Spurious undefined reference to `openpty'
I'm seeing these since upgrading our build machines from Ubuntu 10.04 to 12.04:
=====> process001(dyn) 3159 of 3394 [0, 96, 0]
cd ../../libraries/process/tests && '/64playpen/simonmar/nightly/HEAD-cam-04-unx/x86_64-unknown-linux/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -o process001 process001.hs -O -dynamic >process001.comp.stderr 2>&1
Compile failed (status 256) errors were:
[1 of 1] Compiling Main ( process001.hs, process001.o )
Linking process001 ...
/64playpen/simonmar/nightly/HEAD-cam-04-unx/x86_64-unknown-linux/libraries/unix/dist-install/build/libHSunix-2.5.1.0-ghc7.5.20120706.so: undefined reference to `openpty'
collect2: ld returned 1 exit status
*** unexpected failure for process001(dyn)
I'm stumped. Here's what I've discovered so far:
- It only happens with
-dynamic
- The
openpty
symbol comes from theutil
library, which we are correctly linking in. Thelibutil.so
library is present, and I've checked that we're getting the right one. - It only happens when using the
process
package, which depends onunix
. Usingunix
by itself is fine. So something about theprocess
package is messing up the linker. - I've tried removing all the
-L
options and linking libraries by full pathname, just in case we're picking up something from the wrong place; that doesn't help.
Trac metadata
Trac field | Value |
---|---|
Version | 7.4.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | high |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |