Bug 542004 - GCL fails to properly read the linker map of at least binutils >= 2.19's ld
Summary: GCL fails to properly read the linker map of at least binutils >= 2.19's ld
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcl
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-27 21:53 UTC by Paulo Cesar Pereira de Andrade
Modified: 2009-12-10 04:28 UTC (History)
2 users (show)

Fixed In Version: 2.6.8-0.7.20090701cvs.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-10 04:12:58 UTC
Type: ---


Attachments (Terms of Use)
gcl-2.6.8-iplt.patch (1.55 KB, patch)
2009-11-27 21:56 UTC, Paulo Cesar Pereira de Andrade
no flags Details | Diff

Description Paulo Cesar Pereira de Andrade 2009-11-27 21:53:53 UTC
The gcl-2.6.8-plt.patch patch is incorrect, and will generate
a gcl binary that fails to build at least maxima and axiom,
when using the newer binutil's ld.

  There is a blank line before the " .iplt" section in the linker
map, and there are annotations, i.e. if the second character is
not a blank, it is an annotation.

Comment 1 Paulo Cesar Pereira de Andrade 2009-11-27 21:56:14 UTC
Created attachment 374311 [details]
gcl-2.6.8-iplt.patch

  This patch should correct the issue.
  To check the mandriva gcl package, please check:
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/gcl/current/

Comment 2 Jerry James 2009-11-30 17:15:05 UTC
Thank you very much for the patch.  I will make new builds today for F-11+.

Comment 3 Fedora Update System 2009-11-30 20:31:27 UTC
gcl-2.6.8-0.7.20090701cvs.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/gcl-2.6.8-0.7.20090701cvs.fc12

Comment 4 Fedora Update System 2009-11-30 20:31:37 UTC
gcl-2.6.8-0.5.20090701cvs.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/gcl-2.6.8-0.5.20090701cvs.fc11

Comment 5 Paulo Cesar Pereira de Andrade 2009-12-01 18:33:44 UTC
  Thanks. Feel free to close the bug when appropriate.

  I suggest using "--enable-statsysbfd --disable-dynsysbfd" instead of
"--disable-statsysbfd --enable-dynsysbfd", otherwise, gcl needs to be
recompiled everytime binutils is updated (or risk have the package
broken until someone notices it).

  Also, when linking with a dynamic libbfd, but not using the suggested
patch, it was hiding the problem, as si:save-system was generating
broken axiom binaries, that would crash when loading some .o modules.
And, when using static or local libbfd it would fail to load modules
due to missing libc symbols, but probably statically linking libc
could have been another solution (more of a hack).

Comment 6 Jerry James 2009-12-01 18:49:15 UTC
Land mines everywhere, huh? :-)  It seems to me that the problem is that the libbfd dependency is not visible to rpm, so we don't get a versioned dependency on it.  If I manually add such a versioned dependency to the spec file, then I'll get a broken dep message whenever there is a binutils update.

I'll have to ponder all the ways this can break and choose the least dangerous path.  Thanks for your input.

Comment 7 Fedora Update System 2009-12-02 04:28:43 UTC
gcl-2.6.8-0.7.20090701cvs.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gcl'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12489

Comment 8 Fedora Update System 2009-12-02 04:43:27 UTC
gcl-2.6.8-0.5.20090701cvs.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gcl'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-12507

Comment 9 Jerry James 2009-12-02 18:37:54 UTC
I'm talking nonsense in comment 6.  This is the contents of /usr/lib64/libbfd.so:

------------------------------------------------------------------------------
/* GNU ld script */

/* Ensure this .so library will not be used by a link for a different format
   on a multi-architecture system.  */
OUTPUT_FORMAT(elf64-x86-64)

/* The libz dependency is unexpected by legacy build scripts.  */
INPUT ( /usr/lib64/libbfd.a -liberty -lz )
------------------------------------------------------------------------------

All I'm doing by configuring gcl for dynamic libbfd is avoiding the necessity of hacking up the makefiles to add -lz.  RPM doesn't detect the libbfd dependency because gcl isn't linked to it statically.  Use of ldd confirms this.  So the suggestion in comment 5 accomplishes nothing, and the recent breakage was NOT due to dynamic linking of libbfd.

I figured this all out about a year ago and then promptly forgot about it. :-)

Comment 10 Paulo Cesar Pereira de Andrade 2009-12-02 19:25:46 UTC
  I was talking somewhat based on Mandriva file system :-)

  libbfd.so used to be a symlink to the "versioned" libbfd-version-date-tag.so,
then, for a few days there was no more libbfd.so, and then after some talk
with the binutils maintainer a linker script was added, like the one in
Fedora.

  The breakage was just due to linker map format change, what caused the
previous parser to not find symbols under " .iplt".

  The gcl configure script appears to automatically add libz, but maybe
I am missing something, or problem in another place gcl is used.

Comment 11 Jerry James 2009-12-03 19:31:47 UTC
You're right.  That part of the configure script didn't exist last year when I took over maintenance of the gcl package.  It was added upstream early in 2009 sometime, if my memory isn't entirely faulty.  (It may be.)  So at this point, there should be no difference at all between configuring for static or dynamic libbfd.  And thanks to the patch you supplied, our PLT woes should be at an end too, I hope.  Thanks again for your help.

Comment 12 Fedora Update System 2009-12-10 04:12:49 UTC
gcl-2.6.8-0.5.20090701cvs.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2009-12-10 04:28:10 UTC
gcl-2.6.8-0.7.20090701cvs.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.