Currently, the new gcc.dg/lto/chkp-privatize test FAILs on Solaris/x86 with gas and ld for 64-bit:
UNRESOLVED: gcc.dg/lto/chkp-privatize c_lto_chkp-privatize_0.o-c_lto_chkp-privatize_1.o execute -fPIC -flto -flto-partition=max -fcheck-pointer-bounds -mmpx FAIL: gcc.dg/lto/chkp-privatize c_lto_chkp-privatize_0.o-c_lto_chkp-privatize_1.o link, -fPIC -flto -flto-partition=max -fcheck-pointer-bounds -mmpx output is: ld: fatal: relocation error: file c_lto_chkp-privatize_0.o: section [4].rela.text: invalid relocation type: 0x28 ld: fatal: symbol referencing errors collect2: error: ld returned 1 exit status This relocation type 0x28 (40) is R_X86_64_PLT32_BND, which Solaris 10 and 11 ld know nothing about. Given that there's no test whatsoever in gcc/configure.ac that the whole toolchain supports the necessary mnemonics and relocs, the logical place seems to be the testsuite. The following patch does just that, turning the mpx effective-target test into a link test, thus checking both assembler and linker used. Tested with the appropriate runtest invocations on i386-pc-solaris2.11 with as/ld (both 32 and 64-bit tests unsupported due to missing assembler support), gas/ld (32-bit tests pass, 64-bit tests unsupported due to missing linker support), and x86_64-unknown-linux-gnu (both 32 and 64-bit tests pass). I wonder what's the point of having mpx-dg.exp at all: I'd rather move the single test to target-supports.exp, avoiding the whole flurry of mpx-dg.exp inclusions all over gcc/testsuite. Ilya? However that may be, it can be done as a followup. Ok for mainline? Rainer 2014-12-18 Rainer Orth <r...@cebitec.uni-bielefeld.de> * lib/mpx-dg.exp (check_effective_target_mpx): Change into link test. Add main.
# HG changeset patch # Parent bf453dbd938f27cf7eced4b5df3c29f5e452a55f Change mpx effective-target test into link test diff --git a/gcc/testsuite/lib/mpx-dg.exp b/gcc/testsuite/lib/mpx-dg.exp --- a/gcc/testsuite/lib/mpx-dg.exp +++ b/gcc/testsuite/lib/mpx-dg.exp @@ -18,7 +18,8 @@ # error-free for trivial code, 0 otherwise. proc check_effective_target_mpx {} { - return [check_no_compiler_messages mpx object { + return [check_no_compiler_messages mpx executable { int *foo (int *arg) { return arg; } + int main (void) { return foo ((void *)0) == 0; } } "-fcheck-pointer-bounds -mmpx"] }
-- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University