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
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 \
--with-selinux \
--disable-werror \
--enable-bind-now \
- --enable-stackguard-randomization \
- --with-stack-protector=all \
--enable-__thread \
--enable-tls \
--enable-experimental-malloc \
+++ /dev/null
-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*/");
-