Bug 1386126 - binutils-2.27-7.fc26 and later break Haskell dynamic linking on aarch64 and armv7hl
Summary: binutils-2.27-7.fc26 and later break Haskell dynamic linking on aarch64 and a...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: rawhide
Hardware: arm
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1385475 1385477 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-18 08:46 UTC by Jens Petersen
Modified: 2017-04-26 07:46 UTC (History)
3 users (show)

Fixed In Version: binutils-2.27-10.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-25 02:11:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jens Petersen 2016-10-18 08:46:01 UTC
Description of problem:
Recently I noticed that dynamic linking of executables to Haskell library
is failing on aarch64 and armv7hl with recent binutils-2.27 builds in Rawhide.

I suspect this is related somehow to the --sysroot changes in bug 1374889.

Version-Release number of selected component (if applicable):
binutils-2.27-7.fc26
binutils-2.27-9.fc26

How reproducible:
100%

Steps to Reproduce:
$ fedpkg clone -a cpphs
$ cd cpphs
$ sudo dnf builddep ./cpphs.spec
$ fedpkg local


Actual results:
Linking dist/build/cpphs/cpphs ...
/usr/lib/ghc-7.10.3/text_HmqVQnZSpjaC156ABqPhne/libHStext-1.2.2.1-HmqVQnZSpjaC156ABqPhne-ghc7.10.3.so: error: undefined reference to 'logf'
collect2: error: ld returned 1 exit status

Expected results:
No linking error

Additional info:
Does not happen with binutils-2.27-5.fc26 and earlier.

Comment 1 Jens Petersen 2016-10-18 08:51:31 UTC
Ah to reproduce this you shuold use F25 together with F26 binutils
since i added a workaround to F26 ghc-rpm-macros for this.
Alternatively you can use Rawhide together with f25 ghc-rpm-macros
(or just delete the final "%ghc_without_dynamic" line in
"/usr/lib/rpm/macros.d/macros.ghc".)

Comment 2 Nick Clifton 2016-10-18 10:59:36 UTC
Hi Jens,

  Please may I ask a few questions first, before I attempt to reproduce this problem:

  * Does the problem exist with other architectures, eg x86_64, or just ARM
    and AArch64 ?  (I assume the latter, but if this is a sysroot problem
    then it is suspicious that only those two architectures are affected).

  * Is it only the logf symbol that cannot be resolved, or are there (lots
    of) other symbols affected as well ?  If it is just logf then this would
    might indicate a problem with the dynamic library involved (libm.so ?)
    rather than the linker.

Cheers
  Nick

Comment 3 Jens Petersen 2016-10-26 09:25:30 UTC
Hi Nick,

Yes it just happens on armv7hl and aarch64.

From memory I think affects various (all?) symbols starting with "log"
but I would need to check the logs more carefully to be sure.
I am pretty sure it is not just "logf".

Comment 4 Jens Petersen 2016-10-26 09:29:46 UTC
Here are some examples:

http://koji.fedoraproject.org/koji/taskinfo?taskID=16103782
http://koji.fedoraproject.org/koji/taskinfo?taskID=16103673
Linking dist/build/xmobar/xmobar ...
/usr/lib/ghc-7.10.3/scien_3vmCXiZeJinKZBcLawS8i0/libHSscientific-0.3.4.7-3vmCXiZeJinKZBcLawS8i0-ghc7.10.3.so: error: undefined reference to 'log'

http://koji.fedoraproject.org/koji/taskinfo?taskID=16071865
Linking dist/build/darcs/darcs ...
/builddir/build/BUILD/darcs-2.12.2/darcs-2.12.2/dist/build/libHSdarcs-2.12.2-5w02tFeyqS4LTTczMtN7Ff-ghc7.10.3.so: error: undefined reference to 'log'
/usr/lib64/ghc-7.10.3/text_HmqVQnZSpjaC156ABqPhne/libHStext-1.2.2.1-HmqVQnZSpjaC156ABqPhne-ghc7.10.3.so: error: undefined reference to 'logf'

(older logs are gone from koji)

Comment 5 Jens Petersen 2016-10-27 02:47:42 UTC
I agree it is suspicious about libm.so.

However I could reproduce the problem directly on armv7hl F25 by installing
binutils from rawhide there, so I am not sure it is a glibc issue.

Comment 6 Nick Clifton 2016-11-01 11:30:08 UTC
Hi Jens,

  OK - So I can now reproduce the problem in a VM.  (Boy is it slow...)
  
  I have found a workaround - use the BFD linker instead of the GOLD linker - but I have not yet found the source of the problem.  Part of the issue is that it is proving very hard to capture the full linker command line that is being used.  I have a hack that seems to be working for the moment though, so I can proceed.

Cheers
  Nick

Comment 7 Nick Clifton 2016-11-04 17:41:58 UTC
Hi Jens,

  I believe that I have found a fix for this problem.  Please could you try out:

binutils-2.27-10.fc26.rpm

  and let me know how you get on.

Cheers
  Nick

Comment 8 Jens Petersen 2016-11-25 02:11:06 UTC
Sorry I missed your comments - I was traveling at the beginning of the month.

I just did a scratch build of cpphs in Rawhide (binutils-2.27-12.fc26)
without %ghc_without_dynamic and it seemed to succeed:

http://koji.fedoraproject.org/koji/taskinfo?taskID=16607727

so your fix looks good to me.
I will remove the workaround from ghc-rpm-macros. :-)

Thank you very much and sorry for the slow feedback.

Comment 9 Jens Petersen 2017-04-26 07:45:29 UTC
*** Bug 1385475 has been marked as a duplicate of this bug. ***

Comment 10 Jens Petersen 2017-04-26 07:46:22 UTC
*** Bug 1385477 has been marked as a duplicate of this bug. ***


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