Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,249
    • Issues 4,249
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 391
    • Merge Requests 391
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #3780

Closed
Open
Opened Dec 22, 2009 by duncan@trac-duncan

unix-2.4.0.0 fails with base 4.1

The unix package states:

build-depends: base >=4.1 && <4.3

And while it does compile with base 4.1, using ghc-6.10, nothing can successfully link against it.

The symptoms are:

/usr/lib64/ghc-6.10.4/base-4.1.0.0/libHSbase-4.1.0.0.a(PrelIOUtils.o): In function `__hscore_d_name':
(.text+0x1c0): multiple definition of `__hscore_d_name'
/home/duncan/.cabal/lib/unix-2.4.0.0/ghc-6.10.4/libHSunix-2.4.0.0.a(dirUtils.o):dirUtils.c:(.text+0x0): first defined here
/usr/lib64/ghc-6.10.4/base-4.1.0.0/libHSbase-4.1.0.0.a(PrelIOUtils.o): In function `__hscore_free_dirent':
(.text+0x4f0): multiple definition of `__hscore_free_dirent'
/home/duncan/.cabal/lib/unix-2.4.0.0/ghc-6.10.4/libHSunix-2.4.0.0.a(dirUtils.o):dirUtils.c:(.text+0x10): first defined here
/home/duncan/.cabal/lib/unix-2.4.0.0/ghc-6.10.4/libHSunix-2.4.0.0.a(IO.o): In function `sk63_info':
(.text+0x30c4): undefined reference to `fcntl_read'
/home/duncan/.cabal/lib/unix-2.4.0.0/ghc-6.10.4/libHSunix-2.4.0.0.a(IO.o): In function `sk6A_info':
(.text+0x31f0): undefined reference to `fcntl_write'
/home/duncan/.cabal/lib/unix-2.4.0.0/ghc-6.10.4/libHSunix-2.4.0.0.a(IO.o): In function `sk8h_info':
(.text+0x36cc): undefined reference to `fcntl_read'
/home/duncan/.cabal/lib/unix-2.4.0.0/ghc-6.10.4/libHSunix-2.4.0.0.a(IO.o): In function `sl4O_info':
(.text+0x3a52): undefined reference to `fcntl_lock'
/home/duncan/.cabal/lib/unix-2.4.0.0/ghc-6.10.4/libHSunix-2.4.0.0.a(IO.o): In function `sl6S_info':
(.text+0x3cc2): undefined reference to `fcntl_lock'
/home/duncan/.cabal/lib/unix-2.4.0.0/ghc-6.10.4/libHSunix-2.4.0.0.a(IO.o): In function `sl9I_info':
(.text+0x402a): undefined reference to `fcntl_lock'

There are two problems here, the duplicate __hscore_* symbols and and the missing fcntl_* symbols.

The __hscore_d_name C function really is duplicated. There is one copy in base/include/HsBase.h in ghc-6.10, there is another copy in cbits/dirUtils.c in unix-2.4.0.0. Clearly what has happened is that the function from base has been moved into the unix package. However that means when building the unix package with the older base then we get both. The solution is to rename the one in the unix package. Ideally we could limit the visibility of symbols somehow.

The fcntl_read are not defined in the unix package. They are defined in HsBase.h in ghc-6.12 but not in 6.10. Hence they are also missing when unix-2.4.0.0 is built against the older base. The solution is to define them locally.

Originally filed as Cabal ticket: http://hackage.haskell.org/trac/hackage/ticket/620

Trac metadata
Trac field Value
Version 6.12.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/unix
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
6.12.2
Milestone
6.12.2
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#3780