-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b02
The static launcher (built with 'make static-jdk-image') is statically linked with libstdc++. We need to set LINK_TYPE to C++ with SetupBuildLauncher in StaticLibs.gmk, so LDCXX is used for linking the static launcher executable. Otherwise, LD is used. In some build environments, that causes failure to static linking libstdc++.
I notice both -static-libstdc++ and -l:libstdc++.a are specified in the linking command for the static launcher on linux. Only one needs to be specified to direct the linker to statically link libstdc++. It appears that -static-libstdc++ is more commonly used. As a usage example, I run into 'ld: error: unable to find library -l:libstdc++.a' failure when building the static launcher. Removing -l:libstdc++.a mitigates the linking issue.
I notice both -static-libstdc++ and -l:libstdc++.a are specified in the linking command for the static launcher on linux. Only one needs to be specified to direct the linker to statically link libstdc++. It appears that -static-libstdc++ is more commonly used. As a usage example, I run into 'ld: error: unable to find library -l:libstdc++.a' failure when building the static launcher. Removing -l:libstdc++.a mitigates the linking issue.
- relates to
-
JDK-8303796 Optionally build fully statically linked JDK image
-
- Open
-
- links to
-
Commit(master) openjdk/jdk/a606836a
-
Review(master) openjdk/jdk/22624