]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - lfs/glibc
captive: Refactor the access page
[people/pmueller/ipfire-2.x.git] / lfs / glibc
index d850a503c598006293f1bced6ae4c0a4257d4762..122aca58fdd6b6927770d3473be865a7ceb65260 100644 (file)
--- a/lfs/glibc
+++ b/lfs/glibc
@@ -38,7 +38,8 @@ ifeq "$(ROOT)" ""
   EXTRA_CONFIG = \
        --build=$(BUILDTARGET) \
        --prefix=/usr \
-       --libexecdir=/usr/lib/glibc
+       --libexecdir=/usr/lib/glibc \
+       --enable-stack-protector=strong
 else
   TARGET = $(DIR_INFO)/$(THISAPP)-tools
   EXTRA_CONFIG = \
@@ -53,25 +54,29 @@ endif
 # Enable some extra optimization for the glibc code
 CFLAGS = -O3 -DNDEBUG -fasynchronous-unwind-tables -fPIC -DPIC
 
-ifeq "$(MACHINE)" "i586"
+ifeq "$(BUILD_ARCH)" "armv7hl"
+       CFLAGS += -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
+endif
+
+ifeq "$(BUILD_ARCH)" "i586"
        CFLAGS += -march=i586 -mtune=generic -mno-tls-direct-seg-refs
 endif
 
 # Disable hardware FP for armv5tel
-ifeq "$(MACHINE)" "armv5tel"
+ifeq "$(BUILD_ARCH)" "armv5tel"
        EXTRA_CONFIG += \
                --without-fp
 endif
 
 # Add some general configuration flags
 EXTRA_CONFIG += \
+       --enable-obsolete-rpc \
        --disable-profile \
        --enable-kernel=3.2 \
        --enable-add-ons \
        --without-selinux \
        --enable-experimental-malloc \
-       --enable-bind-now \
-       --enable-stack-protector=strong
+       --enable-bind-now
 
 ###############################################################################
 # Top-level Rules
@@ -113,19 +118,23 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
        @mkdir $(DIR_SRC)/glibc-build
 
-ifeq "$(ROOT)" ""
-ifeq "$(MACHINE_TYPE)" "arm"
-       cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
-               scripts/test-installation.pl
-else
-ifeq "$(MACHINE)" "x86_64"
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
+
+ifneq "$(TOOLCHAIN)" "1"
+ ifeq "$(BUILD_ARCH)" "x86_64"
        cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \
                scripts/test-installation.pl
-else
+ endif
+
+ ifeq "$(BUILD_ARCH)" "i586"
        cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
                scripts/test-installation.pl
-endif
-endif
+ endif
+
+ ifeq "$(BUILD_ARCH)" "armv5tel"
+       cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
+               scripts/test-installation.pl
+ endif
 endif
 
        cd $(DIR_SRC)/glibc-build && \
@@ -137,15 +146,24 @@ endif
 
        cd $(DIR_SRC)/glibc-build && make install
 
-ifeq "$(ROOT)" ""
+ifneq "$(TOOLCHAIN)" "1"
        # Creating the locales
        mkdir -p /usr/lib/locale
        cd $(DIR_SRC)/glibc-build && make localedata/install-locales
 
        # Timezone data will be shipped by tzdata.
        rm -rfv /usr/share/zoneinfo
-else
-       ln -svf lib /tools/lib64
 endif
+
+ifeq "$(TOOLCHAIN)" "1"
+       # Test the linker in toolchain
+       cd $(DIR_APP) && echo "int main() { return 0; }" > dummy.c
+       cd $(DIR_APP) && $(CROSSTARGET)-gcc dummy.c -o dummy
+
+       # Must be using a runtime linker from /tools
+       cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: /tools"
+       cd $(DIR_APP) && rm -vf dummy dummy.c
+endif
+
        @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
        @$(POSTBUILD)