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]

Re: 3.0 PATCH RFC: Major Solaris 2 configuration cleanup


> From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
> Date: Tue, 29 May 2001 02:31:24 +0200 (MEST)
> 
> The following patch tries to clean up here, moving as much as possible to a
> common config/sol2.h file.

It's nice to see someone clean up this area.  The only comment I have is
about this:

> * Several sparc files define LINKER_DOES_NOT_WORK_WITH_DWARF2.  I have no
>   idea what specific problem is the root of this define, and couldn't find
>   anything in the mail archives.

This is a long and confusing story, but you asked so here goes:

At the end of this message I enclose the original bug report that I
sent to bug-gcc about this.  This is what caused
LINKER_DOES_NOT_WORK_WITH_DWARF2 to be defined for Solaris 2.

I also reported the bug to Sun, and on 1998-05-23 they assigned it bug
ID 4136253.  They said that the bug was actually in the Sun assembler,
not the Sun linker.  (If they are correct, then
LINKER_DOES_NOT_WORK_WITH_DWARF2 is a misnomer.)  The current status
of Sun bug 4136253 is "integrated", which is supposed to mean "we have
a fix but we haven't released a patch yet".  However, it could well
mean that the patch was installed in Solaris 7 but they never got
around to updating their database.

I don't have a Solaris 2.6 host available right now to test with, but
looking through the output of GCC 2.95.3 I suspect that even in 2.95.3
the problem is obsolete: i.e. I suspect that GCC 2.95.3 doesn't
generate .s files that trigger the Sun bug, and I suspect that later
GCCs are similar.

If my theory is right, then I suppose you can remove
LINKER_DOES_NOT_WORK_WITH_DWARF2 from the Solaris configuration files,
as well as from the rest of the source code and documentation.

If you like, I can further investigate this tomorrow by resurrecting
a Solaris 2.6 host and trying to reproduce the bug there.

Here's the old email that I mentioned above:

	From eggert Tue Feb 17 00:58:50 -0800 1998
	From: Paul Eggert <eggert@twinsun.com>
	To: bug-gcc@prep.ai.mit.edu
	Subject: -ggdb, -gdwarf* don't work in Solaris 2.6 sparc (GCC 2.8.1-980214)

	The DWARF and DWARF2 debugging formats don't work on Solaris 2.6 sparc.
	This bug occurs in both GCC 2.8.0 and GCC 2.8.1-980214.
	This breaks -ggdb.  The stabs format still works, so the workaround
	is to use -gstabs+ instead of -ggdb.

	Perhaps -ggdb should imply -gstabs+ instead of -gdwarf-2 on Solaris
	until DWARF2 is made to work?

	Here are the symptoms of the problem:

	$ cat t.c
	main() { return 0; }
	$ gcc -g t.c
	$ gcc -gstabs+ t.c
	$ gcc -gdwarf+ t.c
	ld: fatal: relocation error: R_SPARC_32: file /tmp/ccejGwd_1.o: symbol <unknown>: offset 0xef382387 is non-aligned
	... [ more of the same] 
	$ gcc -gdwarf t.c
	ld: fatal: relocation error: R_SPARC_32: file /tmp/cc9kOY2_1.o: symbol <unknown>: offset 0xef382366 is non-aligned
	... [ more of the same] 
	$ gcc -ggdb t.c
	ld: warning: relocation error: R_SPARC_32: file /tmp/ccBleot_1.o: symbol .text:
		external symbolic relocation against non-allocatable section .debug_line;
		cannot be processed at runtime: relocation ignored
	... [ more of the same] 
	Undefined			first referenced
	 symbol  			    in file
	.debug_info                         /tmp/ccBleot_1.o
	.text                               /tmp/ccBleot_1.o
	.debug_abbrev                       /tmp/ccBleot_1.o
	.debug_line                         /tmp/ccBleot_1.o
	ld: fatal: Symbol referencing errors. No output written to a.out
	$ gcc -gdwarf-2 t.c
	ld: warning: relocation error: R_SPARC_32: file /tmp/ccR3d2__1.o: symbol .text:
		external symbolic relocation against non-allocatable section .debug_line;
		cannot be processed at runtime: relocation ignored
	... [ more of the same] 
	Undefined			first referenced
	 symbol  			    in file
	.debug_info                         /tmp/ccR3d2__1.o
	.text                               /tmp/ccR3d2__1.o
	.debug_abbrev                       /tmp/ccR3d2__1.o
	.debug_line                         /tmp/ccR3d2__1.o
	ld: fatal: Symbol referencing errors. No output written to a.out


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