Public bug reported:
$ dpkg-query -W ghc
ghc 7.10.3-7ubuntu1
$ cabal unpack old-time
Unpacking to old-time-1.1.0.3/
$ cd old-time-1.1.0.3
$ cabal configure
Resolving dependencies...
Configuring old-time-1.1.0.3...
configure: WARNING: unrecognized options: --with-compiler
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in
`/tmp/o/old-time-1.1.0.3':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
The relevant config.log snippet is:
configure:2692: checking whether we are cross compiling
configure:2700: /usr/bin/gcc -o conftest -fno-PIE -fno-stack-protector
conftest.c >&5
/usr/bin/ld.bfd.real: /tmp/cczWA9t4.o: relocation R_X86_64_32 against `.rodata'
can not be used when making a shared object; recompile with -fPIC
/tmp/cczWA9t4.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
configure:2704: $? = 1
configure:2711: ./conftest
./configure: line 2713: ./conftest: No such file or directory
configure:2715: $? = 127
configure:2722: error: in `/tmp/o/old-time-1.1.0.3':
configure:2724: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
Indeed, those gcc flags don’t work:
$ printf '#include <stdio.h>\nint main(){puts("Hello, world!");return 0;}' >
hello.c
$ gcc -fno-PIE -fno-stack-protector hello.c
/usr/bin/ld.bfd.real: /tmp/ccB13xCt.o: relocation R_X86_64_32 against `.rodata'
can not be used when making a shared object; recompile with -fPIC
/tmp/ccB13xCt.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
I see that ghc was already patched to pass -fno-PIE to gcc. I suspect
things would work if it also passed -no-pie:
$ gcc -fno-PIE -no-pie -fno-stack-protector hello.c
$ ./a.out
Hello, world!
** Affects: ghc (Ubuntu)
Importance: Undecided
Status: New
** Tags: regression-release
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1583385
Title:
ghc cannot compile old-time package on yakkety amd64 (needs -no-pie in
addition to -fno-PIE?)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ghc/+bug/1583385/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs