Created attachment 37902 [details] gcc6 --enable-default-pie causes hundreds of errors in test suite When building GCC6 weekly snapshot 20160306 and adding the --enable-default-pie to the configure script, hundreds of errors occur when running the test suite. Platform is X86_64 on Intel Xeon D1540 "Broadwell" Using glibc-2.23 with configure options: --prefix=/usr \ --disable-profile \ --enable-kernel=2.6.32 \ --enable-obsolete-rpc \ --enable-lock-elision=yes \ --enable-stackguard-randomization \ --enable-bind-now Using binutils-2_26-branch with configure options: --prefix=/usr \ --enable-shared \ --disable-werror \ --disable-gdb \ --with-system-zlib Using gcc-6-20160306 with configure options: --prefix=/usr \ --enable-languages=c,c++ \ --disable-multilib \ --disable-bootstrap \ --with-system-zlib \ --disable-libmpx \ --disable-libstdcxx-pch \ --enable-default-pie \ --enable-checking=release Attached is the test suite summary for gcc built with --enable-default-pie. The build without --enable-default-pie but all other configuration options being the same yielded only the 3 errors in PR ld/12365 of binutils 2.26 and these are false positives. There were also 2 libstdc++ errors that are marked "experimental" that occurred in both tests, so I am ignoring them.
When GCC is configured with --enable-default-pie, -fno-pic doesn't turn off PIC: [hjl@gnu-6 gcc]$ ./xgcc -B./ -S x.c -fno-pic x.c:2:3: error: #error foo # error foo ^~~~~ [hjl@gnu-6 gcc]$
(In reply to H.J. Lu from comment #1) > When GCC is configured with --enable-default-pie, -fno-pic doesn't > turn off PIC: > > [hjl@gnu-6 gcc]$ ./xgcc -B./ -S x.c -fno-pic > x.c:2:3: error: #error foo > # error foo > ^~~~~ > [hjl@gnu-6 gcc]$ It isn't a bug since PIC is off by default, but PIE is on by default, which also defines __PIC__, with --enable-default-pie.
But -fno-pic should turn off even the default -fpie or -fPIE (if you force it through configure option) and also make sure neither __PIC__ nor __PIE__ macros are defined.
(In reply to Jakub Jelinek from comment #3) > But -fno-pic should turn off even the default -fpie or -fPIE (if you force > it through configure option) and also make sure neither __PIC__ nor __PIE__ > macros are defined. There is a separate issue and should be tracked with a new bug report.
*** Bug 66400 has been marked as a duplicate of this bug. ***
They should be fixed on hjl/pr70150 branch in GCC git repo.
Created attachment 38007 [details] test suite summary I built hjl/pr70150 branch and while the prior test suite failures are gone, 6 new ones appeared. Full test suite summary is attached. Running target unix FAIL: g++.dg/ext/label13a.C -std=gnu++98 execution test FAIL: g++.dg/ext/label13a.C -std=gnu++98 scan-assembler _ZN1CC4Ev FAIL: g++.dg/ext/label13a.C -std=gnu++11 execution test FAIL: g++.dg/ext/label13a.C -std=gnu++11 scan-assembler _ZN1CC4Ev FAIL: g++.dg/ext/label13a.C -std=gnu++14 execution test FAIL: g++.dg/ext/label13a.C -std=gnu++14 scan-assembler _ZN1CC4Ev XPASS: g++.dg/tls/thread_local-order2.C -std=c++11 execution test XPASS: g++.dg/tls/thread_local-order2.C -std=c++14 execution test === g++ Summary === # of expected passes 103282 # of unexpected failures 6 # of unexpected successes 2 # of expected failures 285 # of unsupported tests 3674 /sources/gcc-build/gcc/testsuite/g++/../../xg++ version 6.0.0 20160317 (experim ental) (GCC)
(In reply to psturm from comment #7) > Created attachment 38007 [details] > test suite summary > > I built hjl/pr70150 branch and while the prior test suite failures are gone, > 6 new ones appeared. Full test suite summary is attached. > > Running target unix > FAIL: g++.dg/ext/label13a.C -std=gnu++98 execution test > FAIL: g++.dg/ext/label13a.C -std=gnu++98 scan-assembler _ZN1CC4Ev > FAIL: g++.dg/ext/label13a.C -std=gnu++11 execution test > FAIL: g++.dg/ext/label13a.C -std=gnu++11 scan-assembler _ZN1CC4Ev > FAIL: g++.dg/ext/label13a.C -std=gnu++14 execution test > FAIL: g++.dg/ext/label13a.C -std=gnu++14 scan-assembler _ZN1CC4Ev Do you get them without --enable-default-pie?
I didn't finish the full system build with --enable default-pie yet. I'll build it without next and let you know.
Yes, exact same errors when built without --enable-default-pie.
*** Bug 66402 has been marked as a duplicate of this bug. ***
Patches are posted at https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00929.html https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00995.html
(In reply to H.J. Lu from comment #12) > Patches are posted at > > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00929.html > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00995.html https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00929.html patch does not apply because it appears it conflicts with another change made for HPPA: In weekly snapshot 6-20160410: gcc/testsuite/gcc.dg/uninit-19.c /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } 13 } */ /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } 22 } */ patch is looking for: -/* { dg-warning "may be used uninitialized" "" { target nonpic } 13 } */ -/* { dg-warning "may be used uninitialized" "" { target { ! nonpic } } 22 } */
(In reply to psturm from comment #13) > (In reply to H.J. Lu from comment #12) > > Patches are posted at > > > > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00929.html > > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00995.html > > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00929.html patch does not > apply because it appears it conflicts with another change made for HPPA: Please try patches on hjl/pr70150 branch.
Tested with hjl/pr70150 branch and no unexpected errors using --enable-default-pie. However, when testing the same branch with both --enable-default-pie and --enable-default-ssp, a couple new failures did show up (in addition to the 11 expected failures): FAIL: gcc.target/i386/cleanup-1.c execution test FAIL: gcc.target/i386/cleanup-2.c execution test I am not sure whether this is relevant or not?
(In reply to psturm from comment #15) > Tested with hjl/pr70150 branch and no unexpected errors using > --enable-default-pie. > > However, when testing the same branch with both --enable-default-pie and > --enable-default-ssp, a couple new failures did show up (in addition to the > 11 expected failures): > > FAIL: gcc.target/i386/cleanup-1.c execution test > FAIL: gcc.target/i386/cleanup-2.c execution test > > I am not sure whether this is relevant or not? Do they fail with only --enable-default-ssp?
Yes, they do appear when only using --enable-default-ssp, so I don't think they are relevant.
(In reply to psturm from comment #17) > Yes, they do appear when only using --enable-default-ssp, so I don't think > they are relevant. I suggest you open a new bug report if you haven't done so.
H.J, Done. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70230 On a separate topic, do you know an Intel colleague named Kirill Shutemov? I am having a problem with a kernel warning about a pmd_set_huge failure and an ACPI warning on my Xeon D-1540 development system when I load the ixgbe driver. The driver guys told me to post on linux-mm and I did, but no reply just yet. It seems Kirill Shumetov is active in the kernel memory management and this is an issue manifesting on an Intel system (both CPU and 10g ethernet). If not him, do you know anyone else I can contact about this? Thanks, Paul ----- Original Message ----- From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: "psturm" <psturm@computervoice.com> Sent: Sunday, April 17, 2016 6:02:45 PM Subject: [Bug testsuite/70150] Additonal test failures with --enable-default-pie https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70150 --- Comment #18 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to psturm from comment #17) > Yes, they do appear when only using --enable-default-ssp, so I don't think > they are relevant. I suggest you open a new bug report if you haven't done so.
GCC 6.1 has been released.
GCC 6.3 is being released, adjusting target milestone.
GCC 6.4 is being released, adjusting target milestone.
Author: hjl Date: Tue Sep 25 12:25:44 2018 New Revision: 264565 URL: https://gcc.gnu.org/viewcvs?rev=264565&root=gcc&view=rev Log: Check pie_enabled target in PIC tests We need to check pie_enabled target in PIC tests to support GCC where PIE is enabled by default when configured with --enable-default-pie. PR testsuite/70150 * gcc.dg/20020312-2.c (dg-additional-options): Set to "-no-pie" for pie_enabled target. * gcc.dg/uninit-19.c: Check pie_enabled for PIC. * gcc.target/i386/pr34256.c: Likewise. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/20020312-2.c trunk/gcc/testsuite/gcc.dg/uninit-19.c trunk/gcc/testsuite/gcc.target/i386/pr34256.c
H.J. : Can you please update Known to work?