Browse Source

Some more soft float fixes... for arm in particular (libfloat).
Remove the ADD_LIBGCC_FUNCTIONS option and do things the right way.
Either we have a shared libgcc available, or the libgcc routines
aren't PIC and don't belong in the shared libc anyway.

Manuel Novoa III 21 years ago
parent
commit
f72338a387

+ 6 - 1
Rules.mak

@@ -226,9 +226,14 @@ ifeq ($(HAVE_SHARED),y)
 	BUILD_DYNAMIC_LINKER:=/lib/$(strip $(subst ",, $(notdir $(SYSTEM_LDSO))))
    endif
 endif
-ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
+
+LDADD_LIBFLOAT=
+ifeq ($(strip $(UCLIBC_HAS_SOFT_FLOAT)),y)
     CFLAGS += $(call check_gcc,-msoft-float,)
     #LDFLAGS+= -Wa,-mno-fpu
+ifeq ($(strip $(TARGET_ARCH)),arm)
+    LDADD_LIBFLOAT=-lfloat
+endif
 endif
 
 CFLAGS_NOPIC:=$(CFLAGS)

+ 0 - 2
extra/Configs/Config.arm

@@ -80,11 +80,9 @@ choice
 	  Endian, or Little Endian.
 
 config ARCH_LITTLE_ENDIAN
-	select ADD_LIBGCC_FUNCTIONS
 	bool "Little Endian"
 
 config ARCH_BIG_ENDIAN
-	select ADD_LIBGCC_FUNCTIONS
 	bool "Big Endian"
 
 endchoice

+ 0 - 1
extra/Configs/Config.cris.default

@@ -21,7 +21,6 @@ HAVE_DOT_CONFIG=y
 #
 DOPIC=y
 HAVE_SHARED=y
-ADD_LIBGCC_FUNCTIONS=y
 BUILD_UCLIBC_LDSO=y
 # LDSO_LDD_SUPPORT is not set
 UCLIBC_CTOR_DTOR=y

+ 1 - 18
extra/Configs/Config.in

@@ -27,23 +27,6 @@ config HAVE_SHARED
 	  answer Y here.  If you only want to build uClibc as a static library,
 	  then answer N.
 
-config ADD_LIBGCC_FUNCTIONS
-	bool "Add unresolved libgcc symbols to uClibc"
-	depends on HAVE_SHARED
-	default n
-	help
-	  If you answer Y here, all unresolved functions provided by the libgcc
-	  library that are used by uClibc will be added directly into the
-	  uClibc library.  If your gcc compiler only provides a static libgcc
-	  library, then enabling this option can reduce the size of your
-	  binaries by preventing these functions from being staticly linked
-	  into every binary.  If you have compiled uClibc as PIC code, one
-	  potential size effect of this option is that you may end up adding
-	  non-PIC libgcc code into your shared uClibc library, resulting in a
-	  non sharable text segment (thereby wasting a bunch of ram).  If your
-	  compiler supports a shared libgcc library, you should certainly leave
-	  this option disabled.  Regardless, the safest answer is N.
-
 config BUILD_UCLIBC_LDSO
 	bool "Compile native shared library loader"
 	depends on HAVE_SHARED
@@ -56,7 +39,7 @@ config BUILD_UCLIBC_LDSO
 
 config FORCE_SHAREABLE_TEXT_SEGMENTS
 	bool "Only load shared libraries which can share their text segment"
-	depends on BUILD_UCLIBC_LDSO && UCLIBC_COMPLETELY_PIC && !ADD_LIBGCC_SYMBOLS
+	depends on BUILD_UCLIBC_LDSO && UCLIBC_COMPLETELY_PIC
 	default n
 	help
 	  If you answer Y here, the uClibc native shared library loader will

+ 3 - 3
ldso/util/Makefile

@@ -46,7 +46,7 @@ readelf:	readelf.c
 	strip -x -R .note -R .comment $@
 
 readelf.target: readelf.c
-	$(TARGET_CC) $(CFLAGS) -Wl,-s $^ -o $@
+	$(TARGET_CC) $(CFLAGS) -Wl,-s $^ -o $@ $(LDADD_LIBFLOAT)
 	$(STRIPTOOL) -x -R .note -R .comment $@
 
 readsoname.o:	readsoname.c readsoname2.c
@@ -75,7 +75,7 @@ ldconfig.target:	ldconfig.c readsoname.c
 		-DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
 		-DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
 		-DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" -I. -I../include \
-		$^ -o $@
+		$^ -o $@ $(LDADD_LIBFLOAT)
 	$(STRIPTOOL) -x -R .note -R .comment $@
 
 ldd:	ldd.c
@@ -91,7 +91,7 @@ ldd.target:	ldd.c
 		-DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
 		-DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\" \
 		-DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" \
-		$^ -o $@
+		$^ -o $@ $(LDADD_LIBFLOAT)
 	$(STRIPTOOL) -x -R .note -R .comment $@
 
 clean:

+ 3 - 17
libc/Makefile

@@ -36,12 +36,6 @@ else
 CRTOBJS=../../lib/crt0.o
 endif
 
-ifeq ($(strip $(ADD_LIBGCC_FUNCTIONS)),y)
-LIBGCC_NEED=./tmp/libgcc-need.a
-else
-LIBGCC=
-endif
-
 DIRS = misc pwd_grp stdio string termios inet signal stdlib sysdeps unistd
 
 # Check if the target architecture has a version script for
@@ -60,11 +54,11 @@ ar-target:
 $(LIBNAME): subdirs ar-target
 
 
-shared: $(TOPDIR)lib/$(LIBNAME) $(LIBGCC_NEED)
+shared: $(TOPDIR)lib/$(LIBNAME)
 	$(LD) $(LDFLAGS) $(VERSION_SCRIPT) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \
-		--whole-archive $(LIBGCC_NEED) $(LIBNAME) \
+		--whole-archive $(LIBNAME) \
 		$(TOPDIR)/libc/misc/internals/interp.o --no-whole-archive \
-		-init __uClibc_init $(LIBGCC)
+		-init __uClibc_init
 	@true #$(RM) -r tmp
 	$(INSTALL) -d $(TOPDIR)lib
 	$(RM) $(TOPDIR)lib/$(SHARED_FULLNAME)
@@ -72,14 +66,6 @@ shared: $(TOPDIR)lib/$(LIBNAME) $(LIBGCC_NEED)
 	$(LN) -sf $(SHARED_FULLNAME) $(TOPDIR)lib/libc.so
 	$(LN) -sf $(SHARED_FULLNAME) $(TOPDIR)lib/$(SHARED_MAJORNAME)
 
-$(LIBGCC_NEED): $(TOPDIR)lib/$(LIBNAME)
-	@$(RM) -r tmp
-	@mkdir tmp
-	$(AR) rv $@
-	(cd tmp && CC="$(CC)" LD="$(LD)" LDFLAGS="$(CPU_LDFLAGS-y)" \
-		NM="$(NM)" AR="$(AR)" LIBGCC="$(LIBGCC)" CRTOBJS="$(CRTOBJS)" \
-		/bin/sh $(TOPDIR)../extra/scripts/get-needed-libgcc-objects.sh)
-
 halfclean:
 	@$(RM) $(LIBNAME) uClibc_config.h
 	@$(RM) $(SHARED_FULLNAME) $(SHARED_MAJORNAME) uClibc-0.* libc.so*

+ 1 - 1
libc/misc/wchar/Makefile

@@ -62,7 +62,7 @@ $(MOBJ2): $(MSRC2)
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
 iconv.target: wchar.c
-	$(TARGET_CC) $(CFLAGS) -DL_iconv_main wchar.c -o $@
+	$(TARGET_CC) $(CFLAGS) -DL_iconv_main wchar.c -o $@ $(LDADD_LIBFLOAT)
 	$(STRIPTOOL) -x -R .note -R .comment $@
 
 clean: