https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66022

Norm Jacobs <norm.jacobs at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |norm.jacobs at oracle dot com

--- Comment #2 from Norm Jacobs <norm.jacobs at oracle dot com> ---
I have run into something similar building GCC 4.8.2 on a Solaris 12
development build.

silence-ld04% uname -a
SunOS silence-ld04 5.12 s12_87 sun4v sparc sun4v

I have a Sparc Solaris 12 system with Binutils 2.25.1.  When I try to build GCC
4.8.2 (yes, I know it's old) I get failures in the stage2/stage3 comparison.

[snip]
libiberty/strsignal.o differs
libiberty/dwarfnames.o differs
libiberty/physmem.o differs
libiberty/obstack.o differs
libiberty/choose-temp.o differs
libiberty/strerror.o differs
libiberty/safe-ctype.o differs
zlib/libz_a-uncompr.o differs
zlib/libz_a-gzwrite.o differs
zlib/libz_a-inffast.o differs
zlib/libz_a-compress.o differs
zlib/libz_a-zutil.o differs
make[3]: *** [compare] Error 1

It seems to build fine with Binutils 2.23.1 installed and seems to build fine
on x86.  A little digging and I found that configure is deciding set
BUILD_CONFIG to bootstrap-debug with Binutils 2.25.1 installed on SPARC, but
not otherwise.  Doing this adds "-gtoggle" to the compilation line in stage2,
which wouldn't be a problem since the comparison should have switched to
contrib/compare-debug which strips out unwanted ELF sections prior to
comparison.  In my case, the problem seems to be that the ELF sections are
re-ordered as a result of adding '-gtoggle' to the compilation.  Since the
sections are re-ordered, the comparison fails even after being stripped.

silence-ld04% /usr/gnu/bin/objdump --headers libz_a-zutil.o*

libz_a-zutil.o:     file format elf32-sparc-sol2

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000114  00000000  00000000  00000120  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .rodata       000000c6  00000000  00000000  00000238  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  2 .debug_frame  0000009c  00000000  00000000  00000300  2**2
                  CONTENTS, RELOC, READONLY, DEBUGGING
  3 .debug_info   000002aa  00000000  00000000  0000039c  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
  4 .debug_abbrev 000000fd  00000000  00000000  00000646  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_loc    000000a0  00000000  00000000  00000743  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_aranges 00000020  00000000  00000000  000007e3  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
  7 .debug_line   00000122  00000000  00000000  00000803  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING
  8 .debug_str    00000000  00000000  00000000  00000925  2**0
                  CONTENTS, READONLY, DEBUGGING
  9 .comment      0000004e  00000000  00000000  00000e00  2**0
                  CONTENTS, READONLY

libz_a-zutil.o.gtoggle:     file format elf32-sparc-sol2

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .rodata       000000c6  00000000  00000000  00000080  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  1 .text         00000114  00000000  00000000  00000148  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  2 .comment      0000004e  00000000  00000000  00000430  2**0
                  CONTENTS, READONLY
silence-ld04%

Note that the ordering of .rodata and .text differ.  I can workaround this for
now using "--with-build-config=no" when I configure, but it seems odd that my
ELF sections are getting re-ordered.  I haven't yet tried to build the trunk on
this system.

Reply via email to