]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
glibc: Configure glibc independently from rest of the system.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Feb 2011 23:30:28 +0000 (00:30 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Feb 2011 23:30:28 +0000 (00:30 +0100)
This fixes a build error that we have been experiencing. Yeah.

pkgs/core/glibc/glibc.nm
pkgs/core/glibc/patches/glibc-2.10.1-undefine-__i686.patch [deleted file]

index 271260d9c20d9eb2b75fbe76a1b9530597c1ecc4..cd51bc355bee1da724760c52ac4daf028d073eac 100644 (file)
@@ -49,11 +49,21 @@ define PKG_DESCRIPTION
        Linux system will not function.
 endef
 
-GLIBC_FLAGS += -fno-strict-aliasing -mno-tls-direct-seg-refs -DNDEBUG
+# Build glibc with custom cflags
+GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -DPIC
 
-CFLAGS   += $(GLIBC_FLAGS)
-CXXFLAGS += $(GLIBC_FLAGS)
+ifeq "$(DISTRO_ARCH)" "i686"
+       GLIBC_FLAGS += -march=i686 -mtune=generic
+endif
 
+ifeq "$(DISTRO_ARCH)" "x86_64"
+       GLIBC_FLAGS += -mtune=generic
+endif
+
+export CFLAGS    = $(GLIBC_FLAGS)
+export CXXFLAGS  = $(GLIBC_FLAGS)
+
+GLIBC_TARGET_PLATFORM = $(subst -gnu,,$(DISTRO_MACHINE))
 OPTIMIZED_KERNEL = 2.6.32
 
 PKG_OBJECTS   += $(THISAPP).tar.xz
@@ -209,21 +219,17 @@ define STAGE_PREPARE
 
        cd $(DIR_APP) && sed -i signal/Makefile \
                -e "s/tst-sigset2//g"
+
+       #cd $(DIR_APP) && sed -i configure \
+       #       -e "s/-Werror -fstack-protector/-fstack-protector/"
 endef
 
 define STAGE_BUILD
-       # --enable-stackguard-randomization could be added here, but this is primarily
-       # for attacks by local users, and we shouldn't have those in the rebooted
-       # system. Adding this will empty the /dev/random entropy pool (via
-       # /dev/urandom), unless the system is running a Random Number Gathering Daemon
-       # (rngd). This version of Glibc uses high precision timing with SSP, so the
-       # canary value changes at run-time. This is not as good as /dev/urandom, but
-       # it's better than nothing and has very good performance.
-
        cd $(DIR_SRC)/glibc-build && \
-               CFLAGS= \
-               CXXFLAGS= \
+               CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \
                ../$(THISAPP)/configure \
+                       --build=$(GLIBC_TARGET_PLATFORM) \
+                       --host=$(GLIBC_TARGET_PLATFORM) \
                        --prefix=/usr \
                        --libexecdir=/usr/lib/glibc \
                        --disable-profile \
@@ -232,8 +238,6 @@ define STAGE_BUILD
                        --with-selinux \
                        --disable-werror \
                        --enable-bind-now \
-                       --enable-stackguard-randomization \
-                       --with-stack-protector=all \
                        --enable-__thread \
                        --enable-tls \
                        --enable-experimental-malloc \
diff --git a/pkgs/core/glibc/patches/glibc-2.10.1-undefine-__i686.patch b/pkgs/core/glibc/patches/glibc-2.10.1-undefine-__i686.patch
deleted file mode 100644 (file)
index ce0ebd4..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-If gcc is configured to generate i686 code or better by default (like 
-when using the --with-arch=pentium3 configure option), then the __i686
-macro will always be defined automatically and thus screw up the
-compilation of some .S files.
-http://bugs.gentoo.org/131108
-
-2006-04-25  Mike Frysinger  <vapier@gentoo.org>
-
-       * sysdeps/i386/sysdep.h (__i686): Undefine.
-
---- glibc-2.10.1/sysdeps/i386/sysdep.h
-+++ glibc-2.10.1/sysdeps/i386/sysdep.h
-@@ -17,6 +17,14 @@
-    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-    02111-1307 USA.  */
-+/*
-+ * When building for i686 targets or better, gcc automatically defines
-+ * '__i686' to '1' for us which causes trouble when using section names
-+ * like '__i686.get_pc_thunk.reg'.  Since we check for __i686__ in the
-+ * code, killing '__i686' shouldn't be a problem.
-+ */
-+#undef __i686
-+
- #include <sysdeps/generic/sysdep.h>
- #ifdef        __ASSEMBLER__
-
-2006-04-25  Mike Frysinger  <vapier@gentoo.org>
-
-       * sysdeps/pthread/pt-initfini.c: Include sysdep.h.
-
---- glibc-2.10.1/nptl/sysdeps/pthread/pt-initfini.c
-+++ glibc-2.10.1/nptl/sysdeps/pthread/pt-initfini.c
-@@ -45,6 +45,9 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
-+/* Embed an #include to pull in asm settings. */
-+asm ("\n#include <sysdep.h>");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");