From 01a4decf0681e239e6c3f66220d8f2cc88502cbe Mon Sep 17 00:00:00 2001 From: Tim Yamin Date: Thu, 6 Apr 2006 22:03:52 +0000 Subject: [PATCH] Add hardened fix for bug #128806. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@371 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_compile.sh | 6 ++++++ pkg/klibc-1.2.1-nostdinc-flags.patch | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 pkg/klibc-1.2.1-nostdinc-flags.patch diff --git a/gen_compile.sh b/gen_compile.sh index 1146700..82701af 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -785,6 +785,12 @@ compile_klibc() { ${GK_SHARE}/pkg/klibc-1.1.16-sparc2.patch \ || gen_die "Failed patching klibc" fi + if [ -f "${GK_SHARE}/pkg/klibc-1.2.1-nostdinc-flags.patch" ] + then + patch -p1 -i \ + ${GK_SHARE}/pkg/klibc-1.2.1-nostdinc-flags.patch \ + || gen_die "Failed patching klibc" + fi # Don't install to "//lib" fix sed -e 's:SHLIBDIR = /lib:SHLIBDIR = $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)lib:' -i scripts/Kbuild.install diff --git a/pkg/klibc-1.2.1-nostdinc-flags.patch b/pkg/klibc-1.2.1-nostdinc-flags.patch new file mode 100644 index 0000000..acdbcb6 --- /dev/null +++ b/pkg/klibc-1.2.1-nostdinc-flags.patch @@ -0,0 +1,22 @@ +--- klibc-1.2.1/Makefile 2006-02-07 10:14:05.000000000 +0200 ++++ klibc-1.2.1.az/Makefile 2006-02-07 10:14:11.000000000 +0200 +@@ -12,7 +12,7 @@ + include scripts/Kbuild.include + + export CC := gcc +-NOSTDINC_FLAGS := -nostdlib -nostdinc -isystem $(shell $(CC) -print-file-name=include) ++export NOSTDINC_FLAGS := -nostdlib -nostdinc -isystem $(shell $(CC) -print-file-name=include) + + export ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/parisc64/parisc/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) + +--- klibc-1.2.1/klcc/Kbuild 2006-02-07 10:26:11.000000000 +0200 ++++ klibc-1.2.1.az/klcc/Kbuild 2006-02-07 10:28:16.000000000 +0200 +@@ -14,7 +14,7 @@ + $(Q)echo 'KCROSS=$(KCROSS)' >> $@ + $(Q)echo 'CC=$(KLIBCCC)' >> $@ + $(Q)echo 'LD=$(KLIBCLD)' >> $@ +- $(Q)echo 'REQFLAGS=$(filter-out -I%,$(KLIBCDEFS) $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS))' >> $@ ++ $(Q)echo 'REQFLAGS=$(NOSTDINC_FLAGS) $(filter-out -I%,$(KLIBCDEFS) $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS))' >> $@ + $(Q)echo 'OPTFLAGS=$(KLIBCOPTFLAGS)' >> $@ + $(Q)echo 'LDFLAGS=$(KLIBCLDFLAGS)' >> $@ + $(Q)echo 'STRIP=$(KLIBCSTRIP)' >> $@