Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help packages to avoid linker symbol clashes #693

Open
bos opened this issue May 24, 2012 · 0 comments
Open

Help packages to avoid linker symbol clashes #693

bos opened this issue May 24, 2012 · 0 comments
Labels
Cabal: other old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 type: enhancement
Milestone

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(Imported from Trac #701, reported by @dcoutts on 2010-06-14)

Currently it is all too easy to end up with silently clashing linker symbols.

The prime example is C code linked into a Haskell package. Multiple versions of the same package will define the same linker symbols. The system linker is happy to just pick the first occurrence of a symbol (though the ghci linker is stricter). This can cause havoc if the behaviour of the C code changes from one version of the package to another (see for example the problem with mmap and darcs, ticket #700).

There are a number of things we could do to improve the situation.

  • We could make it easier to make versioned C symbols in the C code used in a Haskell package by providing cpp macros.
  • We could explicitly check for unversioned C symbols in Haskell libs
  • We could try linking Haskell libs in such a way that the C symbols are not visible and thus cannot clash, but it would also mean they are not exported for other libs to use.
@ttuegel ttuegel added this to the _|_ milestone Apr 23, 2015
@andreabedini andreabedini added the old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cabal: other old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 type: enhancement
Projects
None yet
Development

No branches or pull requests

3 participants