From: Markus Trippelsdorf Date: Fri, 24 Oct 2014 06:39:24 +0000 (+0000) Subject: Fix bootstrap/PR63632 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fa608e77c23322260187ad098859ea1b2ba3b322;p=gcc.git Fix bootstrap/PR63632 r216566 (r216568 for 4.9 branch) added %{fno-lto} to LINK_COMMAND_SPEC. However the linker doesn't understand -fno-lto and errors out. This causes an LTO/PGO bootstrap failure, because -fno-lto is used during STAGEprofile. Fixed by filtering out -fno-lto in collect2.c. From-SVN: r216613 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cefe8ffab74..857acd07f82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-24 Markus Trippelsdorf + + PR bootstrap/63632 + * collect2.c (main): Filter out -fno-lto. + 2014-10-24 Martin Liska * ipa-icf.c (sem_item_optimizer::parse_nonsingleton_classes): Guard diff --git a/gcc/collect2.c b/gcc/collect2.c index c54e6fb5157..7c067ffcafb 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -1311,6 +1311,12 @@ main (int argc, char **argv) ld1--; ld2--; } + else if (strncmp (arg, "-fno-lto", 8) == 0) + { + /* Do not pass -fno-lto to the linker. */ + ld1--; + ld2--; + } #ifdef TARGET_AIX_VERSION else { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 88e08e0442e..3b7dbdca53a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-10-24 Markus Trippelsdorf + + PR bootstrap/63632 + * g++.dg/torture/pr63632.C: New test. + 2014-10-23 Jonathan Wakely PR c++/63619 diff --git a/gcc/testsuite/g++.dg/torture/pr63632.C b/gcc/testsuite/g++.dg/torture/pr63632.C new file mode 100644 index 00000000000..48cd8692412 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr63632.C @@ -0,0 +1,5 @@ +// PR bootstrap/63632 +// { dg-do link } +// { dg-options "-fno-lto" } + +int main () {}