Bug 40332 - [4.5 Regression] (.eh_frame); no .eh_frame_hdr table will be created.
Summary: [4.5 Regression] (.eh_frame); no .eh_frame_hdr table will be created.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.0
: P1 normal
Target Milestone: 4.5.0
Assignee: Jason Merrill
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2009-06-03 17:04 UTC by Joost VandeVondele
Modified: 2010-02-20 03:50 UTC (History)
4 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work: 4.3.1 4.4.0
Known to fail: 4.5.0
Last reconfirmed: 2010-02-19 15:58:54


Attachments
patch (594 bytes, patch)
2010-02-19 18:00 UTC, Jason Merrill
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2009-06-03 17:04:58 UTC
currently building CP2K with 

> gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /data03/vondele/gcc_trunk/gcc/configure --disable-bootstrap --prefix=/data03/vondele/gcc_trunk/build --enable-languages=c,c++,fortran --disable-multilib --with-ppl=/data03/vondele/gcc_trunk/build/ --with-cloog=/data03/vondele/gcc_trunk/build/
Thread model: posix
gcc version 4.5.0 20090603 (experimental) [trunk revision 148132] (GCC)


leads to these errors at link time:

/usr/bin/ld: error in /data03/vondele/clean/cp2k/src/../lib/Linux-x86-64-gfortran/sdbg/libcp2k_lib.a(force_fields_util.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in /data03/vondele/clean/cp2k/src/../lib/Linux-x86-64-gfortran/sdbg/libcp2k_lib.a(pint_types.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in /data03/vondele/clean/cp2k/src/../lib/Linux-x86-64-gfortran/sdbg/libcp2k_lib.a(qs_force.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in /data03/vondele/clean/cp2k/src/../lib/Linux-x86-64-gfortran/sdbg/libcp2k_lib.a(qs_rho_atom_methods.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in /data03/vondele/clean/cp2k/src/../lib/Linux-x86-64-gfortran/sdbg/libcp2k_lib.a(qs_vxc_atom.o)(.eh_frame); no .eh_frame_hdr table will be created.
[...]

seemingly these are warnings (and not errors), since an executable is generated. These warnings do not happen with older versions of gfortran
Comment 1 Andrew Pinski 2009-06-03 17:09:12 UTC
What binutils version are you using?  do ld --version.  This might be a bug in binutils really.
Comment 2 Joost VandeVondele 2009-06-03 17:14:15 UTC
(In reply to comment #1)
> What binutils version are you using?  do ld --version.  This might be a bug in
> binutils really.

it is recent, I think:
> ld -v
GNU ld (GNU Binutils; openSUSE 11.0) 2.18.50.20080409-11.1


Comment 3 Joost VandeVondele 2009-06-09 08:34:19 UTC
Jakub,

the error message I get below is new with gcc 4.5, and is still present as of revision 148276 (20090608). Is there any info I can provide (e.g. attach the object file?) that could help in getting this resolved as either a gcc or a binutils issue.

Joost 
Comment 4 Jakub Jelinek 2009-06-09 08:38:13 UTC
Start with trying newer binutils.
Comment 5 Joost VandeVondele 2009-06-09 08:54:25 UTC
(In reply to comment #4)
> Start with trying newer binutils.
same error with :

/data03/vondele/binutils-2.19.1/build/bin/ld: error in /data03/vondele/clean/cp2k/src/../lib/Linux-x86-64-gfortran/sdbg/libcp2k_lib.a(ep_methods.o)(.eh_frame); no .eh_frame_hdr table will be created.
make[2]: Leaving directory `/data03/vondele/clean/cp2k/obj/Linux-x86-64-gfortran/sdbg'
make[1]: Leaving directory `/data03/vondele/clean/cp2k/src'
vondele@pcihopt3:/data03/vondele/clean/cp2k/src> ld -v
GNU ld (GNU Binutils) 2.19.1
vondele@pcihopt3:/data03/vondele/clean/cp2k/src> gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /data03/vondele/gcc_trunk/gcc/configure --disable-bootstrap --prefix=/data03/vondele/gcc_trunk/build --enable-languages=c,c++,fortran --disable-multilib --with-ppl=/data03/vondele/gcc_trunk/build/ --with-cloog=/data03/vondele/gcc_trunk/build/
Thread model: posix
gcc version 4.5.0 20090608 (experimental) [trunk revision 148276] (GCC)
Comment 6 Jakub Jelinek 2009-06-09 09:36:56 UTC
Couldn't reproduce (just built cp2k on x86_64-linux with trunk gfortran and
.eh_frame_hdr has been created just fine).  I'm using binutils 2.19.51.0.2.

Anyway, you should probably just tar up the .a library and other things you are linking together and with that report it in binutils bugzilla.
Comment 7 Joost VandeVondele 2009-06-09 10:26:27 UTC
(In reply to comment #6)
> Couldn't reproduce (just built cp2k on x86_64-linux with trunk gfortran and
> .eh_frame_hdr has been created just fine).  I'm using binutils 2.19.51.0.2.
> 
> Anyway, you should probably just tar up the .a library and other things you are
> linking together and with that report it in binutils bugzilla.
> 

It seems to depend on the compilation options as well. The sopt compile (in my case :
FCFLAGS  = -O2 -ffast-math -funroll-loops -ftree-vectorize -march=native -ffree-form $(DFLAGS) -I$(GFORTRAN_INC)
goes fine, while a -O0 compile (sdbg compile with flags:
-O0 -g -ffree-form $(DFLAGS) -I$(GFORTRAN_INC) -fbounds-check
)
produces warnings. In fact, the number of errors depends on the precise options. With -fbounds-check present, there are more errors than without the flag. Any 
chance you could try that ?
make distclean
make ARCH=... VESION=sdbg




Comment 8 Joost VandeVondele 2009-06-09 10:52:14 UTC
(In reply to comment #6)
> Anyway, you should probably just tar up the .a library and other things you are
> linking together and with that report it in binutils bugzilla.
> 

filed this PR for binutiles, 

http://sourceware.org/bugzilla/show_bug.cgi?id=10255

and made the object files/libraries available (with README)

http://www.pci.uzh.ch/vandevondele/tmp/PR40332.tgz
Comment 9 Joost VandeVondele 2009-06-20 17:56:45 UTC
Since the corresponding binutils bug is fixed, should this PR be closed ?
Comment 10 Gary Funck 2010-01-17 18:56:23 UTC
(In reply to comment #9)
> Since the corresponding binutils bug is fixed, should this PR be closed ?

We ran into this bug recently, running tests against a GCC (4.5 precursor)
snapshot.  Discussion here:
http://gcc.gnu.org/ml/gcc/2010-01/msg00332.html

Comment 11 Joost VandeVondele 2010-01-18 14:41:59 UTC
after the previous comment, marking this as a regression, confirm it, and set P1 as suggest by Ian on the list. 
Comment 12 Richard Biener 2010-01-20 18:53:40 UTC
Only RMs may change regression priority.
Comment 13 Mark Mitchell 2010-02-17 17:15:49 UTC
I reluctantly agree with Ian's comment in:

http://gcc.gnu.org/ml/gcc/2010-01/msg00332.html

that:

"I think it would be troubling if a gcc release required a very new
binutils release on a popular platform like x86_64."

I actually think we should be unsympathetic to this kind of mixing of components.  GCC is the only major compiler that does not consider the compiler, assembler, and linker to be a "single unit".  We've made the problem harder for ourselves than it needs to be, for the dubious benefit that users can download a new GCC release without having to get a new assembler and linker.

However, even though I think our policy is counterproductive, it is in fact our policy.  We shouldn't change the policy by accident; we should change it through conscious decision.  Until then, we should indeed to as Ian suggests and:

"modify
the configure test for gcc_cv_as_cfi_directive to avoid the problem
when using an older binutils"
Comment 14 Jason Merrill 2010-02-19 18:00:12 UTC
Created attachment 19923 [details]
patch
Comment 15 Jason Merrill 2010-02-20 03:50:32 UTC
Subject: Bug 40332

Author: jason
Date: Sat Feb 20 03:50:13 2010
New Revision: 156918

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156918
Log:
	PR target/40332
	* configure.ac (gcc_cv_as_cfi_advance_working): Check 32-bit advance.
	* configure: Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/configure
    trunk/gcc/configure.ac

Comment 16 Jason Merrill 2010-02-20 03:50:47 UTC
Fixed.