[Hackage] #318: Library cannnot be used when registered in-place on OS X

Hackage trac at galois.com
Fri Jun 5 19:52:13 EDT 2009

#318: Library cannnot be used when registered in-place on OS X
  Reporter:  guest          |        Owner:                 
      Type:  defect         |       Status:  closed         
  Priority:  normal         |    Milestone:  Cabal-1.8      
 Component:  Cabal library  |      Version:        
  Severity:  normal         |   Resolution:  fixed          
  Keywords:                 |   Difficulty:  easy (<4 hours)
Ghcversion:  6.8.3          |     Platform:  Mac OS         
Comment (by guest):

 With this change, if multiple {{{ar}}} invocations add object files with
 identical names, only one of these object files is kept in the archive.

 This can happen if a package has two modules with the same basename and
 {{{--enable-split-objs}}} is used.

 Here is a toy script that demonstrates the problem:
 # AR="/usr/bin/ar -q -c"
 AR="/usr/bin/ar -r -s -c"
 echo 'void f() { }' > a.c
 gcc -c a.c
 rm a.a
 $AR a.a a.o
 $AR a.a a.o
 ar -s a.a
 ar -t a.a
 To solve this problem, we can go back to using 'ar -q' and then doing a
 'ranlib' or 'ar -s' in the end. However, I'd propose that we rename the
 {{{.o}}} files to have unique names, because that has a better chance of
 being portable. (For linking, the name of the object file in the archive
 is immaterial)

 The problem manifests itself in the form of link errors when using the
 affected package, like this one:
 In function `sbwI_info':
 (.text+0xbe): undefined reference to

 I'm using GNU ar of binutils 2.18. I'm not sure whether this is a bug in
 {{{ar}}} or not.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/318#comment:12>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list