static linking of libgcc on linux ?
Martin Buchholz
martinrb at google.com
Tue Sep 21 06:33:24 UTC 2010
This appears to be another case where the hotspot and jdk repo makefiles differ.
hotspot does:
# statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
ifneq ("${CC_VER_MAJOR}", "2")
STATIC_LIBGCC += -static-libgcc
endif
making it look like the jdk repo makefile is in error.
I continue to be surprised that with all the strange fiddling with
linker flags (use of -static-libgcc is not encouraged), that jdk
binaries have such a high degree of binary compatibility.
Martin
On Sun, Sep 19, 2010 at 23:02, David Holmes <David.Holmes at oracle.com> wrote:
> In the j2se/jdk repo make/common/Defs-linux.gmk contains this old code:
>
> #
> # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
> # statically link libgcc but will print a warning with the flag. We don't
> # want the warning, so check gcc version first.
> #
> CC_VER_MAJOR := $(shell $(CC) -dumpversion | $(SED) 's/egcs-//' | $(CUT)
> -d'.' -f1)
> ifeq ("$(CC_VER_MAJOR)", "3")
> OTHER_LDFLAGS += -static-libgcc
> endif
>
> Now we build with gcc 4 we actually don't set -static-libgcc. Can someone
> comment on the correctness of this - should we instead be checking for
> "ifneq ("$(CC_VER_MAJOR)", "2") ?
>
> Thanks,
> David Holmes
>
More information about the build-dev
mailing list