diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-01-09 10:18:11 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-01-09 10:18:11 +0000 |
commit | f605da2fb6ec413fbd86e45a78f53cb2e721ab74 (patch) | |
tree | ed3cbb4371c74d24530885a902c34317419358b7 | |
parent | 066a8e2f6f4637d7239a141bd57e73c82991b690 (diff) |
Be more carefull about erroring out of shell fragments. Try to
enable -falign-functions if avilable.
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | Rules.mak | 4 | ||||
-rw-r--r-- | libc/Makefile | 4 | ||||
-rw-r--r-- | libc/unistd/Makefile | 10 | ||||
-rw-r--r-- | libm/Makefile | 2 |
5 files changed, 24 insertions, 10 deletions
@@ -76,6 +76,7 @@ headers: dummy fi; \ fi; @if [ ! -f include/asm/unistd.h ] ; then \ + set -e; \ echo " "; \ echo "The path '$(KERNEL_SOURCE)/include/asm' doesn't exist."; \ echo "I bet you didn't set KERNEL_SOURCE, TARGET_ARCH or HAS_MMU in \`Config'"; \ @@ -84,6 +85,7 @@ headers: dummy /bin/false; \ fi; @if [ $(HAS_MMU) != "true" ] && [ $(TARGET_ARCH) = "i386" ] ; then \ + set -e; \ echo "WARNING: I bet your x86 system really has an MMU, right?"; \ echo " malloc and friends won't work unless you fix \`Config'"; \ echo " "; \ @@ -199,13 +201,15 @@ ifeq ($(strip $(HAVE_SHARED)),true) install -d $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin ln -fs $(DEVEL_PREFIX)/bin/ldd $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd ln -fs $(DEVEL_PREFIX)/bin/readelf $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-readelf - if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so ] ; then \ + @if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so ] ; then \ + set -x -e; \ install -m 755 lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so $(PREFIX)$(DEVEL_PREFIX)/lib; \ mkdir -p $(PREFIX)$(SHARED_LIB_LOADER_PATH); \ ln -s $(DEVEL_PREFIX)/lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so \ $(PREFIX)$(SHARED_LIB_LOADER_PATH)/$(UCLIBC_LDSO) || true; \ fi; - if [ -x ldso/util/ldconfig ] ; then \ + @if [ -x ldso/util/ldconfig ] ; then \ + set -x -e; \ install -d $(PREFIX)$(DEVEL_PREFIX)/etc; \ install -m 755 ldso/util/ldconfig $(PREFIX)$(DEVEL_PREFIX)/bin; \ ln -fs $(DEVEL_PREFIX)/sbin/ldconfig $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldconfig; \ @@ -229,13 +233,15 @@ ifeq ($(strip $(HAVE_SHARED)),true) cp -a lib/*.so.* $(PREFIX)$(TARGET_PREFIX)/lib install -m 755 ldso/util/ldd $(PREFIX)$(TARGET_PREFIX)/usr/bin install -m 755 ldso/util/readelf $(PREFIX)$(TARGET_PREFIX)/usr/bin - if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so ] ; then \ + @if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so ] ; then \ + set -x -e; \ install -m 755 lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so $(PREFIX)$(TARGET_PREFIX)/lib; \ mkdir -p $(PREFIX)$(SHARED_LIB_LOADER_PATH); \ ln -s $(TARGET_PREFIX)/lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so \ $(PREFIX)$(SHARED_LIB_LOADER_PATH)/$(UCLIBC_LDSO) || true; \ fi; - if [ -x ldso/util/ldconfig ] ; then \ + @if [ -x ldso/util/ldconfig ] ; then \ + set -x -e; \ install -d $(PREFIX)$(TARGET_PREFIX)/etc; \ install -m 755 ldso/util/ldconfig $(PREFIX)$(TARGET_PREFIX)/sbin; \ fi; @@ -44,8 +44,10 @@ TARGET_ARCH=${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e ' # Some nice architecture specific optimizations ifndef OPTIMIZATION # use '-Os' optimization if available, else use -O2, allow Config to override -OPTIMIZATION = ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ +OPTIMIZATION += ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ then echo "-Os"; else echo "-O2" ; fi} +OPTIMIZATION += ${shell if $(CC) -falign-functions=1 -S -o /dev/null -xc \ + /dev/null >/dev/null 2>&1; then echo "-falign-functions=1"; fi} ifeq ($(strip $(TARGET_ARCH)),arm) OPTIMIZATION+=-fstrict-aliasing endif diff --git a/libc/Makefile b/libc/Makefile index 295386c2b..c8587b58d 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -44,12 +44,14 @@ 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 \ + @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); \ diff --git a/libc/unistd/Makefile b/libc/unistd/Makefile index be002c64c..c325eae3a 100644 --- a/libc/unistd/Makefile +++ b/libc/unistd/Makefile @@ -71,13 +71,15 @@ sysconf_tester.o: sysconf.c gen_sysconf_tester.o: sysconf_tester.o getpagesize_tester.o @ld -r -o gen_sysconf_tester.o sysconf_tester.o getpagesize_tester.o - @if nm -s gen_sysconf_tester.o | grep -v "U errno" | grep " U " ;\ - then \ + @if [ nm -s gen_sysconf_tester.o | grep -v "U errno" | grep " U " ] ; then \ + set -e -x; \ echo warning: missing symbols in gen_sysconf_tester.o so using generic sysconf.c ;\ cp -f sysconf.c sysconf_src.c ;\ else \ - if ../extra/gcc-uClibc/gcc-uClibc-$(NATIVE_ARCH) -static -D_UCLIBC_GENERATE_SYSCONF_MAIN sysconf.c sysconf_tester.o -o gen_sysconf && \ - ./gen_sysconf > sysconf_$(NATIVE_ARCH).c ;\ + set -e -x; \ + if ../extra/gcc-uClibc/gcc-uClibc-$(NATIVE_ARCH) -static \ + -D_UCLIBC_GENERATE_SYSCONF_MAIN sysconf.c sysconf_tester.o \ + -o gen_sysconf && ./gen_sysconf > sysconf_$(NATIVE_ARCH).c ;\ then \ echo successfully built sysconf_$(NATIVE_ARCH).c ;\ else \ diff --git a/libm/Makefile b/libm/Makefile index 4eef46bd3..17f0d6f9a 100644 --- a/libm/Makefile +++ b/libm/Makefile @@ -85,6 +85,7 @@ endif $(LIBM): ar-target @if [ -f $(LIBM) ] ; then \ + set -x -e; \ install -d $(TOPDIR)lib; \ rm -f $(TOPDIR)lib/$(LIBM); \ install -m 644 $(LIBM) $(TOPDIR)lib; \ @@ -92,6 +93,7 @@ $(LIBM): ar-target shared: all if [ -f $(LIBM) ] ; then \ + set -x -e; \ $(TARGET_CC) $(TARGET_LDFLAGS) -nostdlib -shared -o $(LIBM_SHARED_FULLNAME) \ -Wl,-soname,$(LIBM_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBM) -lc; \ install -d $(TOPDIR)lib; \ |