linking fails with binutils 2.20.51.20101009-0ubuntu1: cannot use --sysroot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ghc6 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: ghc6
I am using the ghc6 package version 6.12.1-13ubuntu1 on Natty Narwhal:
% lsb_release -rd
Description: Ubuntu natty (development branch)
Release: 11.04
% apt-cache policy ghc6
ghc6:
Installed: 6.12.1-13ubuntu1
Candidate: 6.12.1-13ubuntu1
Version table:
6.12.3-1 0
500 http://
*** 6.12.1-13ubuntu1 0
900 http://
900 http://
100 /var/lib/
6.12.1-13 0
500 http://
After updating to binutils 2.20.51.
% sudo dpkg -i /var/cache/
(Reading database ... 291421 files and directories currently installed.)
Preparing to replace binutils 2.20.51.
Unpacking replacement binutils ...
Preparing to replace binutils-static 2.20.51.
Unpacking replacement binutils-static ...
Setting up binutils (2.20.51.
Setting up binutils-static (2.20.51.
Processing triggers for man-db ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
sudo dpkg -i 1.08s user 0.58s system 23% cpu 6.973 total
% printf 'main = do\n putStrLn "Hello, world!"\n' > helloworld.hs
% runhugs helloworld.hs
Hello, world!
% ghc helloworld.hs -o helloworld
/usr/bin/ld: this linker was not configured to use sysroots
collect2: ld returned 1 exit status
zsh: exit 1 ghc helloworld.hs -o helloworld
% ls helloworld*
helloworld.hi helloworld.hs helloworld.o
It works when I downgrade to an older binutils package:
% sudo dpkg -i /var/cache/
dpkg: warning: downgrading binutils from 2.20.51.
(Reading database ... 291421 files and directories currently installed.)
Preparing to replace binutils 2.20.51.
Unpacking replacement binutils ...
dpkg: warning: downgrading binutils-static from 2.20.51.
Preparing to replace binutils-static 2.20.51.
Unpacking replacement binutils-static ...
Setting up binutils (2.20.51.
Setting up binutils-static (2.20.51.
Processing triggers for man-db ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
sudo dpkg -i 1.15s user 0.57s system 23% cpu 7.283 total
% ghc helloworld.hs -o helloworld
compilation IS NOT required
% ls helloworld*
helloworld helloworld.hi helloworld.hs helloworld.o
% ./helloworld
Hello, world!
%
Apparently, --sysroot is disabled in the newer binutils: https:/
I don't know whether this is a problem that should be resolved in GHC or in binutils.
Let me know if I should provide more information.
Thanks!
Fixed in newer binutils, thanks for reporting!