I'm trying to build glibc 2.6 on ~x86 hardened to test it, but the following patch fails: * Failed Patch: glibc-2.5-hardened-inittls-nosysenter.patch ! * ( /usr/local/portage/sys-libs/glibc/files/2.5/glibc-2.5-hardened-inittls-nosysenter.patch ) Reproducible: Always Steps to Reproduce: 1. unmask glibc 2.6 2. try to install it 3. patch fails Expected Results: it should patch cleanly or at least start compiling
glibc now requires TLS so a lot of #if logic has gone away updated patch in cvs
thanks for that fix :D it still got that error despite the updated files: I needed to change epatch "${FILESDIR}"/2.5/glibc-2.5-hardened-inittls-nosysenter.patch to epatch "${FILESDIR}"/2.6/glibc-2.6-hardened-inittls-nosysenter.patch in the ebuild, now it's compiling ...
looks like i clobbered my changes with too many open windows ... should be fixed now though
I don't know if it's my toolchain but compile fails with binutils [1] i686-pc-linux-gnu-2.17.50.0.15 or [2] i686-pc-linux-gnu-2.17.50.0.17 * cflags & cxxflags: CFLAGS="-Os -march=pentium-m -pipe -mfpmath=sse -falign-functions=64 -fforce-addr" LDFLAGS=" -Wl,--hash-style=both" <== could that be the reason ?? both gcc 3.4.6 and 4.1.2 produce the same output (below):
i686-pc-linux-gnu-gcc vsprintf_chk.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -march=pentium-m -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -fPIC -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -D_IO_MTSAFE_IO -I../include -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os i686-pc-linux-gnu-gcc snprintf_chk.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -march=pentium-m -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -fPIC -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -D_IO_MTSAFE_IO -I../include -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os stack_chk_fail.c:278:1: error: unterminated #ifdef stack_chk_fail.c: In function '__hardened_gentoo_stack_chk_fail': stack_chk_fail.c:276: error: expected declaration or statement at end of input make[2]: *** [/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/stack_chk_fail.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6/debug' make[1]: *** [debug/subdir_lib] Error 2 make[1]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6' make: *** [all] Error 2 !!! ERROR in sys-libs/glibc-2.6: !!! In toolchain-glibc_src_compile at line 4980 !!! make for default failed (gcc 4.1.2-r1 hardened pie)
i686-pc-linux-gnu-gcc vsprintf_chk.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-stack-protector -fno-strict-aliasing -march=pentium-m -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -fPIC -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -D_IO_MTSAFE_IO -I../include -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os i686-pc-linux-gnu-gcc snprintf_chk.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-stack-protector -fno-strict-aliasing -march=pentium-m -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -fPIC -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -D_IO_MTSAFE_IO -I../include -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os stack_chk_fail.c:278:1: unterminated #ifdef stack_chk_fail.c: In function `__hardened_gentoo_stack_chk_fail': stack_chk_fail.c:276: error: syntax error at end of input make[2]: *** [/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/stack_chk_fail.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6/debug' make[1]: *** [debug/subdir_lib] Error 2 make[1]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6' make: *** [all] Error 2 !!! ERROR in sys-libs/glibc-2.6: !!! In toolchain-glibc_src_compile at line 4980 !!! make for default failed (gcc-3.4.6-r2 hardened pie)
i rewrote the stack .c file a bit and broke that ;) please update and try again
ok, now comes up another error message - thanks for your work, btw: work/build-default-i686-pc-linux-gnu-nptl/debug/sprintf_chk.os i686-pc-linux-gnu-gcc vsprintf_chk.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -march=pentium-m -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -fPIC -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -D_IO_MTSAFE_IO -I../include -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsprintf_chk.os i686-pc-linux-gnu-gcc snprintf_chk.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -march=pentium-m -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -fPIC -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -D_IO_MTSAFE_IO -I../include -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os stack_chk_fail.c: In function '__hardened_gentoo_stack_chk_fail': stack_chk_fail.c:205: error: '__NR_socket' undeclared (first use in this function) stack_chk_fail.c:205: error: (Each undeclared identifier is reported only once stack_chk_fail.c:205: error: for each function it appears in.) stack_chk_fail.c:207: error: 'domain' undeclared (first use in this function) stack_chk_fail.c:207: error: 'type' undeclared (first use in this function) stack_chk_fail.c:207: error: 'protocol' undeclared (first use in this function) stack_chk_fail.c:284: error: '_SSP_NSIG' undeclared (first use in this function) make[2]: *** [/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/stack_chk_fail.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6/debug' make[1]: *** [debug/subdir_lib] Error 2 make[1]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6' make: *** [all] Error 2 !!! ERROR in sys-libs/glibc-2.6: !!! In toolchain-glibc_src_compile at line 4980 !!! make for default failed (gcc 4.1.2 hardened)
*** Bug 185381 has been marked as a duplicate of this bug. ***
also happens on gcc-3.4.6-r2 hardened: i686-pc-linux-gnu-gcc snprintf_chk.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-stack-protector -fno-strict-aliasing -march=pentium-m -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -fPIC -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -D_IO_MTSAFE_IO -I../include -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/snprintf_chk.os stack_chk_fail.c: In function `__hardened_gentoo_stack_chk_fail': stack_chk_fail.c:205: error: `__NR_socket' undeclared (first use in this function) stack_chk_fail.c:205: error: (Each undeclared identifier is reported only once stack_chk_fail.c:205: error: for each function it appears in.) stack_chk_fail.c:207: error: `domain' undeclared (first use in this function) stack_chk_fail.c:207: error: `type' undeclared (first use in this function) stack_chk_fail.c:207: error: `protocol' undeclared (first use in this function) i686-pc-linux-gnu-gcc vsnprintf_chk.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-stack-protector -fno-strict-aliasing -march=pentium-m -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -fPIC -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES -D_IO_MTSAFE_IO -I../include -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsnprintf_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsnprintf_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/vsnprintf_chk.os stack_chk_fail.c:284: error: `_SSP_NSIG' undeclared (first use in this function) make[2]: *** [/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/stack_chk_fail.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6/debug' make[1]: *** [debug/subdir_lib] Error 2 make[1]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6' make: *** [all] Error 2 !!! ERROR in sys-libs/glibc-2.6: !!! In toolchain-glibc_src_compile at line 4980 !!! make for default failed
*** Bug 185436 has been marked as a duplicate of this bug. ***
ok, try again please ;) my efforts to move to a C-only approach left out systems where not all the __NR_* were defined
I have the feeling this is getting close to an solution ;) unfortunately it still fails: output for gcc-4.1.2 hardened: /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPIC -o /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-p c-linux-gnu-nptl/debug/backtrace.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc- 2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/backtrace.os.dt -MT /var/tmp /paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/back trace.os stack_chk_fail.c: In function '__hardened_gentoo_stack_chk_fail': stack_chk_fail.c:217: error: 'domain' undeclared (first use in this function) stack_chk_fail.c:217: error: (Each undeclared identifier is reported only once stack_chk_fail.c:217: error: for each function it appears in.) stack_chk_fail.c:217: error: 'type' undeclared (first use in this function) stack_chk_fail.c:217: error: 'protocol' undeclared (first use in this function) stack_chk_fail.c:294: error: '_SSP_NSIG' undeclared (first use in this function) make[2]: *** [/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-lin ux-gnu-nptl/debug/stack_chk_fail.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6/d ebug' make[1]: *** [debug/subdir_lib] Error 2 make[1]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6' make: *** [all] Error 2 !!! ERROR in sys-libs/glibc-2.6: !!! In toolchain-glibc_src_compile at line 4982 !!! make for default failed
Yup, it still does here too.
pretty the same output for gcc-3.4.6-r2 hardened: i686-pc-linux-gnu-gcc ../sysdeps/i386/i686/memmove_chk.S -c -I../include -I/var /tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysd eps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/uni x/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/u nix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/c ommon -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv /i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps /unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i 686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i48 6 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../ sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/gen eric/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdin c -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include -isystem /usr/include -D _LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DP IC -DASSEMBLER -DGAS_SYNTAX -Wa,--noexecstack -o /var/tmp/paludis/sys-libs/gl ibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/memmove_chk.os -MD -MP - MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl /debug/memmove_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-defa ult-i686-pc-linux-gnu-nptl/debug/memmove_chk.os i686-pc-linux-gnu-gcc ../sysdeps/i386/i686/mempcpy_chk.S -c -I../include -I/var /tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug -I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysd eps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/uni x/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/u nix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/c ommon -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv /i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps /unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i 686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i48 6 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../ sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/gen eric/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdin c -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include -isystem /usr/include -D _LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DP IC -DASSEMBLER -DGAS_SYNTAX -Wa,--noexecstack -o /var/tmp/paludis/sys-libs/gl ibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/mempcpy_chk.os -MD -MP - MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl /debug/mempcpy_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-defa ult-i686-pc-linux-gnu-nptl/debug/mempcpy_chk.os stack_chk_fail.c: In function `__hardened_gentoo_stack_chk_fail': stack_chk_fail.c:217: error: `domain' undeclared (first use in this function) stack_chk_fail.c:217: error: (Each undeclared identifier is reported only once stack_chk_fail.c:217: error: for each function it appears in.) stack_chk_fail.c:217: error: `type' undeclared (first use in this function) stack_chk_fail.c:217: error: `protocol' undeclared (first use in this function) stack_chk_fail.c:294: error: `_SSP_NSIG' undeclared (first use in this function) i686-pc-linux-gnu-gcc ../sysdeps/i386/i686/memset_chk.S -c -I../include -I/var/ tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug - I/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl - I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysde ps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix /sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/un ix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/co mmon -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/ i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/ unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix - I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i6 86/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../s ysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/i eee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/gene ric/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include -isystem /usr/include -D_ LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DPIC -DPI C -DASSEMBLER -DGAS_SYNTAX -Wa,--noexecstack -o /var/tmp/paludis/sys-libs/gli bc-2.6/work/build-default-i686-pc-linux-gnu-nptl/debug/memset_chk.os -MD -MP -MF /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-linux-gnu-nptl/d ebug/memset_chk.os.dt -MT /var/tmp/paludis/sys-libs/glibc-2.6/work/build-default -i686-pc-linux-gnu-nptl/debug/memset_chk.os make[2]: *** [/var/tmp/paludis/sys-libs/glibc-2.6/work/build-default-i686-pc-lin ux-gnu-nptl/debug/stack_chk_fail.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6/d ebug' make[1]: *** [debug/subdir_lib] Error 2 make[1]: Leaving directory `/var/tmp/paludis/sys-libs/glibc-2.6/work/glibc-2.6' make: *** [all] Error 2 !!! ERROR in sys-libs/glibc-2.6: !!! In toolchain-glibc_src_compile at line 4980 !!! make for default failed
phreak: i already told you on irc i fixed that ;p
I'm trying out your latest version of the stack .c file *fingers crossed* (still compiling)
finally ! :D It compiled & also installed successfully (tested with gcc-4.1.2 hardened) Thanks a lot, SpanKY !