Browse Source

Cleanup makfile, use ld to avoid chicken-and-egg problems when
building gcc/g++.
-Erik

Eric Andersen 23 years ago
parent
commit
3ad09485cd
1 changed files with 6 additions and 13 deletions
  1. 6 13
      libc/Makefile

+ 6 - 13
libc/Makefile

@@ -43,19 +43,12 @@ $(LIBNAME): subdirs
 shared: $(TOPDIR)lib/$(LIBNAME)
 	@rm -rf tmp
 	@mkdir tmp
-	@(cd tmp && CC=$(CC) LD=$(LD) NM=$(NM) AR=$(AR) /bin/sh ../../extra/scripts/get-needed-libgcc-objects.sh)
-	@if [ -s ./tmp/libgcc-need.a ] ; then \
-		set -e -x; \
-		$(CC) -g $(LDFLAGS) -shared -o $(SHARED_FULLNAME) \
-		    -Wl,-soname,$(SHARED_MAJORNAME) -Wl,--whole-archive \
-		    ./$(LIBNAME) ./tmp/libgcc-need.a \
-		    $(LDSO) -Wl,--dynamic-linker,$(DYNAMIC_LINKER); \
-	else \
-		set -e -x; \
-		$(CC) -g $(LDFLAGS) -shared -o $(SHARED_FULLNAME) \
-		    -Wl,-soname,$(SHARED_MAJORNAME) -Wl,--whole-archive \
-		    ./$(LIBNAME) $(LDSO)  -Wl,-dynamic-linker,$(DYNAMIC_LINKER); \
-	fi
+	$(AR) rv ./tmp/libgcc-need.a
+	@(cd tmp && CC=$(CC) LD=$(LD) NM=$(NM) AR=$(AR) \
+		/bin/sh ../../extra/scripts/get-needed-libgcc-objects.sh)
+	$(LD) $(LDFLAGS) -o $(SHARED_FULLNAME) -soname=$(SHARED_MAJORNAME) \
+		--dynamic-linker $(DYNAMIC_LINKER) --whole-archive $(LIBNAME) \
+		./tmp/libgcc-need.a
 	@/bin/true #rm -rf tmp
 	install -d $(TOPDIR)lib
 	rm -f $(TOPDIR)lib/$(SHARED_FULLNAME)