Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 193489

Summary: dev-lang/ocaml doesn't compile w/ --Wl,--as-needed
Product: Gentoo Linux Reporter: Jack Kelly <endgame.dos>
Component: [OLD] DevelopmentAssignee: Gentoo Team for the ML programming language family <ml>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Filter -Wl,--as-needed in the ebuild

Description Jack Kelly 2007-09-23 09:19:20 UTC
I noticed that net-misc/unison will fail to build due to missing symbols if dev-lang/ocaml is built with '-Wl,--as-needed' in LDFLAGS.

Reproducible: Always

Steps to Reproduce:
1. LDFLAGS="-Wl,--as-needed" emerge '=dev-lang/ocaml-3.09.3-r1'
2. emerge unison
3. it breaks
4. emerge ocaml
5. emerge unison
6. it works.

Actual Results:  
emerge unison fails during link:

pty.o: In function `c_openpty':
pty.c:(.text+0x2d): undefined reference to `openpty'
collect2: ld returned 1 exit status
Error during linking
make: *** [unison] Error 2


Expected Results:  
emerge unison succeeds
Comment 1 Jack Kelly 2007-09-23 09:19:43 UTC
Created attachment 131669 [details, diff]
Filter -Wl,--as-needed in the ebuild
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-09-23 09:23:38 UTC
Comment on attachment 131669 [details, diff]
Filter -Wl,--as-needed in the ebuild

Filtering flags doesn't solve anything.
Comment 3 Alexis Ballier gentoo-dev 2007-09-23 09:38:42 UTC
unless I missed something, that's not ocaml which is failing but unison

*** This bug has been marked as a duplicate of bug 189238 ***
Comment 4 Jack Kelly 2007-09-23 10:44:45 UTC
(In reply to comment #3)
> unless I missed something, that's not ocaml which is failing but unison
> 
> *** This bug has been marked as a duplicate of bug 189238 ***
> 

The fault is due to ocaml being built with -Wl,--as-needed. It can be solved by adding more to unison's link step or by filtering --as-needed in ocaml.