On 21 September 2010 07:33, Martin Buchholz <marti...@google.com> wrote:
> 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.
>

I would imagine this static linking is to aid binary compatibility,
allowing Oracle to ship
binaries which work with different versions of gcc and glibc (which I
believe is also statically linked)
than that it is built against.

I wonder if it's worth disabling such linking on distributions.  Would
it lead to a significant reduction in footprint?

> Martin
>
> On Sun, Sep 19, 2010 at 23:02, David Holmes <david.hol...@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
>>
>



-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8

Reply via email to