RFR: 8345744: Use C++ LINK_TYPE with SetupBuildLauncher in StaticLibs.gmk
Magnus Ihse Bursie
ihse at openjdk.org
Mon Dec 9 14:03:39 UTC 2024
On Sat, 7 Dec 2024 01:55:07 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:
> Please review following fix for linking static JDK launcher, thanks.
>
> - Set LINK_TYPE to C++ when building the static launcher to make sure LDCXX instead of LD is used for linking.
>
> - Remove -l:libstdc++. For linux, -static-libstdc++ is already set in STATIC_STDCXX_FLAGS. See https://github.com/openjdk/jdk/blob/e0d639878346946d0627a57b0eeb0cac8ca533fc/make/autoconf/lib-std.m4#L50.
>
> See more details in https://bugs.openjdk.org/browse/JDK-8345744.
Thanks @jianglizhou, this was a much better solution. I don't know why I didn't realize that this was the proper solution when I wrote the code.
You can remove `STANDARD_LIBS += -lstdc++` from macOS as well. This in turn means that `STANDARD_LIBS` is not used at all, and can be fully removed.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22624#issuecomment-2528045689
More information about the build-dev
mailing list