This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR86523


Hi Richard,

> The following fixes PR86523, we failed to assing DIE parents to some
> function-local entities with the idea scope vars would pick them up
> but that's not true for some of them.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, LTO bootstrapped
> on the GCC 8 branch (it's said LTO bootstrap is broken on trunk).

the new testcases FAIL on Solaris:

+FAIL: g++.dg/lto/pr86523-1 cp_lto_pr86523-1_0.o-cp_lto_pr86523-1_0.o link, -O2 -flto -g -shared
+FAIL: g++.dg/lto/pr86523-2 cp_lto_pr86523-2_0.o-cp_lto_pr86523-2_0.o link, -O2 -flto -g -shared

32-bit sparc and 64-bit x86 only

On sparc:

ld: warning: unwind table: file /var/tmp//ccRLBN4b.ltrans0.ltrans.o: section .eh_frame: suspicious InitialLoc value 0: binary search table will be incomplete if section requires runtime relocation

On x86:

Text relocation remains                         referenced
    against symbol                  offset      in file
.text (section)                     0x20        cp_lto_pr86523-1_0.o
ld: fatal: relocations remain against allocatable but non-writable sections

The latter happens because the Solaris linker defaults to -z text, and
the tests aren't built as PIC.  The following patch fixes this,
requiring fpic and shared support along the way, too, and also fixes the
Solaris/SPARC failure.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.  Ok for mainline?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2018-07-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* g++.dg/lto/pr86523-1_0.C: Require fpic, shared support.
	(dg-lto-options): Add -fPIC.
	* g++.dg/lto/pr86523-2_0.C: Likewise.

diff --git a/gcc/testsuite/g++.dg/lto/pr86523-1_0.C b/gcc/testsuite/g++.dg/lto/pr86523-1_0.C
--- a/gcc/testsuite/g++.dg/lto/pr86523-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/pr86523-1_0.C
@@ -1,5 +1,7 @@
 // { dg-lto-do link }
-// { dg-lto-options {{-O2 -flto -g -shared}} }
+// { dg-require-effective-target fpic }
+// { dg-require-effective-target shared }
+// { dg-lto-options { { -O2 -fPIC -flto -g -shared } } }
 namespace {
     class a typedef b;
     class a {};
diff --git a/gcc/testsuite/g++.dg/lto/pr86523-2_0.C b/gcc/testsuite/g++.dg/lto/pr86523-2_0.C
--- a/gcc/testsuite/g++.dg/lto/pr86523-2_0.C
+++ b/gcc/testsuite/g++.dg/lto/pr86523-2_0.C
@@ -1,5 +1,7 @@
 // { dg-lto-do link }
-// { dg-lto-options {{-O2 -flto -g -shared}} }
+// { dg-require-effective-target fpic }
+// { dg-require-effective-target shared }
+// { dg-lto-options { { -O2 -fPIC -flto -g -shared } } }
 class a typedef b;
 class a {};
 class c {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]