Summary: | dev-libs/gmp-4.2.2-r2: text relocations in tests which fails on hardened | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Joshua Pettett <bugs.gentoo.devel> |
Component: | New packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | beech, hardened, kanelxake |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=487812 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Build log
add -nopie to the tests GMP PIC x86 tests patch |
Description
Joshua Pettett
2008-08-28 18:57:56 UTC
Created attachment 164017 [details]
Build log
Please do not attach compressed logs, but attach the relevant parts as plain text in future. Assuming dupe. If you don't think so, feel free to reopen. *** This bug has been marked as a duplicate of bug 186710 *** (In reply to comment #2) > *** This bug has been marked as a duplicate of bug 186710 *** Bug 186710 is about a warning about a binary with text relocations that was being merged. In my case, only the tests had relocations, which causes the emerge to fail hardened system, but after getting past the tests, the actually merged files do not have any text relocations. This suggests to me that either bug could be solved without necessarily affecting the other. So these are two separate, albeit related, issues, correct? (In reply to comment #3) > So these are two separate, albeit related, issues, correct? If you so. ;) Honestly, I can't look at all bugs in depth, especially when there's compressed data attached, so my approach to bug wrangling is somewhat fuzzy. It's just a matter of time. Thanks four your feedback. Sorry about the compressed log; I got into that habit when I was having a problem with OpenOffice and the build log was too large to upload uncompressed. The most relevant part of the log, as far as I can tell, is the snippet I included in the original report. The same ld warning is also returned for each one: "creating a DT_TEXTREL in object." The emerge process dies after these test failures. However, when changing PaX restrictions to allow these tests to pass, many of the subsequent tests have the same problem. Thanks. There are two .asm files in the tests folder, starting with x86. I tried the Gentoo hardened TEXTREL removal guide to no avail. 7 out of 9 tests fail due to (AFAIK) two assembler files. They reference what I can only assume to be an external reference (named callable_arguments) which is translated into a fixed memory address. Bug is reproducible on dev-libs/gmp-4.2.4 for x86. Hardened team: some help please :) Is this still a problem with gmp-4.3.0? >>> Test phase [check]: dev-libs/gmp-4.3.1 make -j5 -j1 check make check-recursive make[1]: Entering directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1' Making check in tests make[2]: Entering directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests' Making check in . make[3]: Entering directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests' make libtests.la t-bswap t-constants t-count_zeros t-gmpmax t-hightomask t-modlinv t-popc t-parity t-sub make[4]: Entering directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests' /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o memory.lo memory.c mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c memory.c -fPIC -DPIC -o .libs/memory.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c memory.c -o memory.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o misc.lo misc.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c misc.c -fPIC -DPIC -o .libs/misc.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c misc.c -o misc.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o refmpf.lo refmpf.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c refmpf.c -fPIC -DPIC -o .libs/refmpf.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c refmpf.c -o refmpf.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o refmpn.lo refmpn.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c refmpn.c -fPIC -DPIC -o .libs/refmpn.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c refmpn.c -o refmpn.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o refmpq.lo refmpq.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c refmpq.c -fPIC -DPIC -o .libs/refmpq.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c refmpq.c -o refmpq.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o refmpz.lo refmpz.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c refmpz.c -fPIC -DPIC -o .libs/refmpz.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c refmpz.c -o refmpz.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o spinner.lo spinner.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c spinner.c -fPIC -DPIC -o .libs/spinner.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c spinner.c -o spinner.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o trace.lo trace.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c trace.c -fPIC -DPIC -o .libs/trace.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c trace.c -o trace.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -Wa,--noexecstack `test -f 'x86call.asm' || echo './'`x86call.asm ../mpn/m4-ccas --m4=m4 gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -Wa,--noexecstack x86call.asm -fPIC -DPIC -o .libs/x86call.o m4 -DHAVE_CONFIG_H -DPIC x86call.asm >tmp-x86call.s gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -Wa,--noexecstack tmp-x86call.s -fPIC -DPIC -o .libs/x86call.o ../mpn/m4-ccas --m4=m4 gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -Wa,--noexecstack x86call.asm -o x86call.o >/dev/null 2>&1 /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c -o x86check.lo x86check.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c x86check.c -fPIC -DPIC -o .libs/x86check.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c x86check.c -o x86check.o >/dev/null 2>&1 /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o libtests.la memory.lo misc.lo refmpf.lo refmpn.lo refmpq.lo refmpz.lo spinner.lo trace.lo x86call.lo x86check.lo ../libgmp.la i686-pc-linux-gnu-ar cq .libs/libtests.a .libs/memory.o .libs/misc.o .libs/refmpf.o .libs/refmpn.o .libs/refmpq.o .libs/refmpz.o .libs/spinner.o .libs/trace.o .libs/x86call.o .libs/x86check.o i686-pc-linux-gnu-ranlib .libs/libtests.a creating libtests.la (cd .libs && rm -f libtests.la && ln -s ../libtests.la libtests.la) gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-bswap.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-bswap t-bswap.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-bswap t-bswap.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object. creating t-bswap gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-constants.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-constants t-constants.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-constants t-constants.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object. creating t-constants gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-count_zeros.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-count_zeros t-count_zeros.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-count_zeros t-count_zeros.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object. creating t-count_zeros gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-gmpmax.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-gmpmax t-gmpmax.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-gmpmax t-gmpmax.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so creating t-gmpmax gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-hightomask.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-hightomask t-hightomask.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-hightomask t-hightomask.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so creating t-hightomask gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-modlinv.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-modlinv t-modlinv.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-modlinv t-modlinv.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object. creating t-modlinv gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-popc.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-popc t-popc.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-popc t-popc.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object. creating t-popc gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-parity.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-parity t-parity.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-parity t-parity.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object. creating t-parity gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O3 -march=pentium4 -mtune=pentium4 -pipe -c t-sub.c /bin/sh ../libtool --mode=link gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu -Wl,--as-needed -o t-sub t-sub.o libtests.la ../libgmp.la gcc -O3 -march=pentium4 -mtune=pentium4 -pipe -Wl,-O1 -Wl,--sort-common -Wl,--warn-once -Wl,--hash-style=gnu -o .libs/t-sub t-sub.o -Wl,--as-needed ./.libs/libtests.a /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/.libs/libgmp.so ../.libs/libgmp.so /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object. creating t-sub make[4]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests' make check-TESTS make[4]: Entering directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests' /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests/.libs/lt-t-bswap: error while loading shared libraries: cannot make segment writable for relocation: Permission denied FAIL: t-bswap /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests/.libs/lt-t-constants: error while loading shared libraries: cannot make segment writable for relocation: Permission denied FAIL: t-constants /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests/.libs/lt-t-count_zeros: error while loading shared libraries: cannot make segment writable for relocation: Permission denied FAIL: t-count_zeros PASS: t-gmpmax PASS: t-hightomask /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests/.libs/lt-t-modlinv: error while loading shared libraries: cannot make segment writable for relocation: Permission denied FAIL: t-modlinv /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests/.libs/lt-t-popc: error while loading shared libraries: cannot make segment writable for relocation: Permission denied FAIL: t-popc /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests/.libs/lt-t-parity: error while loading shared libraries: cannot make segment writable for relocation: Permission denied FAIL: t-parity /var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests/.libs/lt-t-sub: error while loading shared libraries: cannot make segment writable for relocation: Permission denied FAIL: t-sub ==================================== 7 of 9 tests failed Please report to gmp-bugs@gmplib.org ==================================== make[4]: *** [check-TESTS] Error 1 make[4]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests' make[3]: *** [check-am] Error 2 make[3]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1/tests' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/dev-libs/gmp-4.3.1/work/gmp-4.3.1' make: *** [check] Error 2 * * ERROR: dev-libs/gmp-4.3.1 failed. * Call stack: * ebuild.sh, line 49: Called src_test * environment, line 3368: Called _eapi0_src_test * ebuild.sh, line 607: Called die * The specific snippet of code: * hasq test $FEATURES && die "Make check failed. See above for details." * The die message: * Make check failed. See above for details. Crazy work-around kludge that actually works (assumes standard paths; set NEW_GMP_VERSION to version being installed): until (ebuild /usr/portage/dev-libs/gmp/gmp-$NEW_GMP_VERSION.ebuild merge); do scanelf -RqtxXz 'm' /var/tmp/portage/dev-libs/gmp-$NEW_GMP_VERSION/work/gmp-$NEW_GMP_VERSION/tests/ done Created attachment 240257 [details, diff]
add -nopie to the tests
This patch add -nopie to the CFLAGS in the Makefiles in /tests
And it should only be for x86 and hardened
Fixed in 5.0.1 rev 1.5 I tried this patch from GMP unstable: http://gmplib.org:8000/gmp/raw-rev/f6ad7c54bb00 and it works for me. Test suite compiles and works with -fPIC -pie on i686. I suggest replacing the nopie patch with it. Patch is attached. Created attachment 263955 [details, diff]
GMP PIC x86 tests patch
|