svn commit: trunk/uClibc

Denys Vlasenko vda.linux at googlemail.com
Wed Apr 30 01:33:39 UTC 2008


On Tuesday 29 April 2008 17:01, Bernhard Fischer wrote:
> > ifeq ($(TARGET_ARCH),i386)
> >+	OPTIMIZATION+=$(call check_gcc,-fomit-frame-pointer,)
> >+
> >+	# NB: this may make SSE insns segfault!
> >+	# -O1 -march=pentium3, -Os -msse etc are known to be affected.
> >+	# TODO: conditionally bump to 4
> >+	# (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13685)
> > 	OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,)
> 
> I believe that this is fixed on 4.3.0 and 4.2.3; ISTR that the stack
> branch will be more clever in this respect (not yet merged AFAIK).

Good.

Wait. I do hope gcc people did not "fix" it by just enforcing
-mpreferred-stack-boundary=4 regardless of what one puts
on command line?

> >+	CPU_CFLAGS-y  += $(call check_gcc,-ffunction-sections -fdata-sections,)
> >+	CPU_LDFLAGS-y += -Wl,--sort-common -Wl,--sort-section -Wl,alignment
> 
> Is this really correct? I would have thought that this should read
> -Wl,--sort-section,alignment

It works both ways. But -Wl,--sort-section,alignment looks nicer, indeed.
Will fix.

> Also, why don't you check if the linker really supports them?

Fixing:

diff -d -urpN uClibc.5/Rules.mak uClibc.6/Rules.mak
--- uClibc.5/Rules.mak  2008-04-30 02:54:08.000000000 +0200
+++ uClibc.6/Rules.mak  2008-04-30 03:30:47.000000000 +0200
@@ -213,7 +213,12 @@ endif
        # Idx Name          Size      VMA       LMA       File off  Algn
        #   0 .text         xxxxxxxx  00000000  00000000  xxxxxxxx  2**2 <===!
        CPU_CFLAGS-y  += $(call check_gcc,-ffunction-sections -fdata-sections,)
-       CPU_LDFLAGS-y += -Wl,--sort-common -Wl,--sort-section -Wl,alignment
+ifneq ($(call check_ld,--sort-common,),)
+       CPU_LDFLAGS-y += -Wl,--sort-common
+endif
+ifneq ($(call check_ld,--sort-section alignment),)
+       CPU_LDFLAGS-y += -Wl,--sort-section,alignment
+endif

        CPU_LDFLAGS-y+=-m32
        CPU_CFLAGS-y+=-m32

--
vda



More information about the uClibc mailing list