[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] [PATCH] Fix EGLIBC build with -Os



EGLIBC (and GLIBC) currently fails to build with -Os, because some
functions like fstatat64() are not inlined. This results in a failure
are link time, as those functions are only available statically in 
libc_nonshared.a.

When linking against libc.so, the /usr/lib/libc.so helper scripts takes
care of linking with this static library. In order to build libc.so with
-Os, it is also needed to link with libc_nonshared.a. That's the purpose
of the patch below.

Tested successfully on amd64, the testsuite shows no regressions when
building with -Os instead of -O2. I am sending this patch to the
EGLIBC mailing list as I am not sure such a patch would be accepted in
GLIBC, while it is surely something wanted in EGLIBC. Reducing the 
memory footprint is one of the goal of EGLIBC.


2008-09-07  Aurelien Jarno  <aurelien@xxxxxxxxxxx>

        * Makerules ($(common-objpfx)libc.so): link with
	$(common-objpfx)libc_nonshared.a.

Index: libc/Makerules
===================================================================
--- libc/Makerules	(révision 6892)
+++ libc/Makerules	(copie de travail)
@@ -620,7 +620,8 @@
 			 $(common-objpfx)libc_pic.os \
 			 $(elfobjdir)/sofini.os \
 			 $(elfobjdir)/interp.os $(elfobjdir)/ld.so \
-			 $(common-objpfx)shlib.lds
+			 $(common-objpfx)shlib.lds \
+			 $(common-objpfx)libc_nonshared.a
 	$(build-shlib)
 ifeq ($(versioning),yes)
 $(common-objpfx)libc.so: $(common-objpfx)libc.map

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@xxxxxxxxxx         | aurelien@xxxxxxxxxxx
   `-    people.debian.org/~aurel32 | www.aurel32.net