[syslinux] [PATCH 18/19] mk: Don't link against compiler's version of libgcc

Matt Fleming matt at console-pimps.org
Fri Mar 23 11:02:52 PDT 2012


From: Matt Fleming <matt.fleming at intel.com>

Syslinux provides its own copy of libgcc functions in
com32/lib/libgcc, so we don't need to link against the version
provided by the compiler. What's worse, the behaviour is different
between the two versions.

This caused problems, for example, when parsing the TOTALTIMEOUT
config directive in com32/menu because of the following calculation,

	totaltimeout = (atoll(skipspace(p + 13)) * CLK_TCK + 9) / 10;

which invokes __divdi3() as provided by libgcc. The results returned
by the Syslinux and compiler's copy of libgcc differ, leading to
differences in behaviour.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>
---
 mk/elf.mk |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mk/elf.mk b/mk/elf.mk
index 5a2ce2d..ca06115 100644
--- a/mk/elf.mk
+++ b/mk/elf.mk
@@ -47,14 +47,13 @@ CFLAGS     = $(GCCOPT) -W -Wall -march=i386 \
 	     -I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE)
 SFLAGS     = $(GCCOPT) -D__COM32__ -march=i386
 LDFLAGS    = -m elf_i386 -shared --hash-style=gnu -T $(com32)/lib/elf32.ld
-LIBGCC    := $(shell $(CC) $(GCCOPT) --print-libgcc)
 
 LNXCFLAGS  = -I$(com32)/libutil/include -W -Wall -O -g -D_GNU_SOURCE
 LNXSFLAGS  = -g
 LNXLDFLAGS = -g
 
 C_LIBS	   = $(com32)/libutil/libutil_com.c32 $(GPLLIB) \
-	     $(com32)/lib/libcom32.c32 $(LIBGCC)
+	     $(com32)/lib/libcom32.c32
 C_LNXLIBS  = $(com32)/libutil/libutil_lnx.a \
 	     $(com32)/elflink/ldlinux/ldlinux_lnx.a
 
-- 
1.7.4.4




More information about the Syslinux mailing list