patch for spec file of gcc 3.4.4, so that libgss library is not
authorWaldemar Brodkorb <mail@waldemar-brodkorb.de>
Wed, 4 Jan 2006 08:37:19 +0000 (08:37 +0000)
committerWaldemar Brodkorb <mail@waldemar-brodkorb.de>
Wed, 4 Jan 2006 08:37:19 +0000 (08:37 +0000)
automatically linked into every binary. explicitely link it into needed
packages (kismet, nmap, samba) and add dependencies.
idea and patch from sven-ola, thx. Saves 16 kb in the default squashfs
images.

SVN-Revision: 2817

openwrt/package/Config.in
openwrt/package/base-files/Makefile
openwrt/package/base-files/ipkg/uclibc.control
openwrt/package/kismet/Makefile
openwrt/package/kismet/ipkg/kismet.control
openwrt/package/nmap/Makefile
openwrt/package/nmap/ipkg/nmap.control
openwrt/package/samba/Makefile
openwrt/package/samba/ipkg/samba.control
openwrt/toolchain/gcc/Makefile

index 53b10b6304ed48cd2852a5040337f3e85122a81d..47bddeb283b27dd48eee028efc08bed298d07f6e 100644 (file)
@@ -183,6 +183,7 @@ source "package/libevent/Config.in"
 source "package/expat/Config.in" # libexpat
 source "package/flac/Config.in"  # libflac
 source "package/freetype/Config.in"  # libfreetype
 source "package/expat/Config.in" # libexpat
 source "package/flac/Config.in"  # libflac
 source "package/freetype/Config.in"  # libfreetype
+source "package/base-files/Config.in" # libgcc
 source "package/libgcrypt/Config.in"
 source "package/libgd/Config.in"
 source "package/libgdbm/Config.in"
 source "package/libgcrypt/Config.in"
 source "package/libgd/Config.in"
 source "package/libgdbm/Config.in"
index 8b74ee0d9ca81e0c07bced0c61040e2fac1f5336..7601de2ad067b553f675e440aab53558e378d699 100644 (file)
@@ -29,7 +29,15 @@ LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version}
 IDIR_LIBGCC:=$(PKG_BUILD_DIR)/libgcc
 IPKG_LIBGCC:=$(PACKAGE_DIR)/libgcc_$(LIBGCC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 
 IDIR_LIBGCC:=$(PKG_BUILD_DIR)/libgcc
 IPKG_LIBGCC:=$(PACKAGE_DIR)/libgcc_$(LIBGCC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
 
-PACKAGES:=$(IPKG_BASE) $(IPKG_UCLIBC) $(IPKG_LIBGCC)
+PACKAGES:=$(IPKG_BASE) $(IPKG_UCLIBC) 
+PACKAGES_INSTALL:=$(IPKG_BASE) $(IPKG_UCLIBC) 
+
+ifeq ($(BR2_PACKAGE_LIBGCC),y)
+PACKAGES_INSTALL+=$(IPKG_LIBGCC)
+endif
+ifeq ($(BR2_PACKAGE_LIBGCC),m)
+PACKAGES+=$(IPKG_LIBGCC)
+endif
 
 $(PKG_BUILD_DIR)/.prepared:
        mkdir -p $(PKG_BUILD_DIR) $(PACKAGE_DIR)
 
 $(PKG_BUILD_DIR)/.prepared:
        mkdir -p $(PKG_BUILD_DIR) $(PACKAGE_DIR)
@@ -88,4 +96,4 @@ prepare:
 compile-targets: $(PACKAGES)
 install-targets: compile
        mkdir -p $(TARGET_DIR)
 compile-targets: $(PACKAGES)
 install-targets: compile
        mkdir -p $(TARGET_DIR)
-       $(IPKG) install $(PACKAGES)
+       $(IPKG) install $(PACKAGES_INSTALL)
index d07ed906814a7d37ec87302898afb35a8613309f..1cdfe157cb4f16fd0038b3c4045bdef267758ccb 100644 (file)
@@ -1,5 +1,5 @@
 Package: uclibc
 Priority: optional
 Section: net
 Package: uclibc
 Priority: optional
 Section: net
-Depends: base-files, libgcc
+Depends: base-files
 Description: Standard C library for embedded Linux systems
 Description: Standard C library for embedded Linux systems
index 366fddddba073d549a903a15695a622103cb27fa..58e3f501ad03c90ff91e42f4a3c003eefa536c3c 100644 (file)
@@ -28,7 +28,7 @@ $(PKG_BUILD_DIR)/.configured:
                CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++"  \
                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(LINUX_DIR)/include" \
                LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
                CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++"  \
                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(LINUX_DIR)/include" \
                LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-               LIBS="-luClibc++ -lc -lm" \
+               LIBS="-luClibc++ -lc -lm -lgcc" \
                ./configure \
                        --target=$(GNU_TARGET_NAME) \
                        --host=$(GNU_TARGET_NAME) \
                ./configure \
                        --target=$(GNU_TARGET_NAME) \
                        --host=$(GNU_TARGET_NAME) \
@@ -58,7 +58,7 @@ $(PKG_BUILD_DIR)/.configured:
 
 $(PKG_BUILD_DIR)/.built:
        $(MAKE) -C $(PKG_BUILD_DIR) \
 
 $(PKG_BUILD_DIR)/.built:
        $(MAKE) -C $(PKG_BUILD_DIR) \
-               LIBS="-luClibc++ -lc -lm" \
+               LIBS="-luClibc++ -lc -lm -lgcc" \
                all
        touch $@
 
                all
        touch $@
 
index ef77d815f5005c86ce654186c74b20ca382b5289..193328563cc22a4056bead96bf7cbaee7da1b058 100644 (file)
@@ -1,7 +1,7 @@
 Package: kismet
 Priority: optional
 Section: net
 Package: kismet
 Priority: optional
 Section: net
-Depends: kismet-client, kismet-server 
+Depends: libgcc, kismet-client, kismet-server 
 Description: kismet
  Kismet is an 802.11 layer2 wireless network detector,
  sniffer, and intrusion detection system. Kismet will work with any
 Description: kismet
  Kismet is an 802.11 layer2 wireless network detector,
  sniffer, and intrusion detection system. Kismet will work with any
index 1aa8bed4c736aadf953d3a969914e2c07d145155..659bff9580764b046e1028cd2c813fe32a057200 100644 (file)
@@ -26,7 +26,7 @@ $(PKG_BUILD_DIR)/.configured:
                CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
                LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
                CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
                LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-               LIBS="-luClibc++ -lc -lm" \
+               LIBS="-luClibc++ -lc -lm -lgcc" \
                ac_cv_prog_CXX="$(TARGET_CXX)" \
                ./configure \
                  --target=$(GNU_TARGET_NAME) \
                ac_cv_prog_CXX="$(TARGET_CXX)" \
                ./configure \
                  --target=$(GNU_TARGET_NAME) \
index ad2a984d123fee57bf8fc2486acf72addd050c29..56253fda0b4a3630b6623c128e9a34e766842eb5 100644 (file)
@@ -1,5 +1,5 @@
 Package: nmap
 Priority: optional
 Section: net
 Package: nmap
 Priority: optional
 Section: net
-Depends: libpcap, libpcre, uclibc++
+Depends: libgcc, libpcap, libpcre, uclibc++
 Description: Nmap is a free open source utility for network exploration or security auditing.
 Description: Nmap is a free open source utility for network exploration or security auditing.
index 566e604a035dc23d81a21d06c393b02d6950ffaf..584ed9a0441e0da9072c05719d82234b8652b853 100644 (file)
@@ -58,7 +58,7 @@ $(PKG_BUILD_DIR)/.built:
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -DNDEBUG -DSHMEM_SIZE=524288 -Dfcntl=fcntl64" \
                CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -DNDEBUG -DSHMEM_SIZE=524288 -Dfcntl=fcntl64" \
                CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
-               LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
+               LDFLAGS="-lgcc_s -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
                ac_cv_lib_cups_httpConnect=no \
                ac_cv_sizeof_int=4 \
                ac_cv_sizeof_long=4 \
                ac_cv_lib_cups_httpConnect=no \
                ac_cv_sizeof_int=4 \
                ac_cv_sizeof_long=4 \
index 503ce7240c40deef375d13b69bd4abf08bb3ab67..c1cf603c4d5e1656940ec3befc0548a405304726 100644 (file)
@@ -1,5 +1,5 @@
 Package: samba
 Priority: optional
 Section: net
 Package: samba
 Priority: optional
 Section: net
-Depends:
+Depends: libgcc
 Description: NetBIOS/SMB file and print server
 Description: NetBIOS/SMB file and print server
index dc7e02c7ae8b80c94338819466dbbdaac2047c8a..f6f4acaab63cc067a5b68ecb4e04703b507a1a91 100644 (file)
@@ -188,6 +188,16 @@ ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.)
        cp ./$(GCC_VERSION)/specs-$(ARCH)-soft-float $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
 endif
 endif
        cp ./$(GCC_VERSION)/specs-$(ARCH)-soft-float $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs
 endif
 endif
+# We do another ugly hack here because the standard behaviour is
+# to include a reference to libgcc.so.1 in all binaries. For flash space
+# saving, we change the specs file to link in a static libgcc here. 
+       if [ ! -f $(STAGING_DIR)/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ] ; then \
+               echo staging dir specs file is missing ; \
+               /bin/false ; \
+       fi;
+       if grep -q as-needed $(STAGING_DIR)/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs; then \
+               patch -d $(STAGING_DIR)/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/ -p0 < ./$(GCC_VERSION)/static-libgcc.patch.conditional ; \
+       fi;
 
 source: $(DL_DIR)/$(GCC_SOURCE)
 prepare: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
 
 source: $(DL_DIR)/$(GCC_SOURCE)
 prepare: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc