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,319
    • Issues 4,319
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 355
    • Merge Requests 355
  • 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
  • #4523

Closed
Open
Opened Nov 23, 2010 by bos@trac-bos

unix package does not check properly for sem_close

On modern Linux systems (in my case, Fedora 13 and 14), the sem_close and other functions are in the rt and pthread libraries. This combination is not checked for properly by the unix package's autoconf script. As a result attempting to build the unix package will succeed, but linking applications against the misconfigured unix will result in undefined symbol errors for e.g. sem_close.

I believe that the C compiler needs to be invoked with -pthread for the right thing to happen, as unix.buildinfo contains a reference to rt that is nevertheless not enough:

buildable: True
cc-options: 
ld-options: 
extra-libraries:  rt util dl 

Here's my current workaround hack:

--- old-unix/configure.ac	2010-11-23 15:25:33.741849630 -0800
+++ new-unix/configure.ac	2010-11-23 15:25:33.760849987 -0800
@@ -215,6 +215,9 @@
 	PTHREAD_CFLAGS=-pthread
 	PTHREAD_LDFLAGS=-pthread
 	;;
+linux*)
+	PTHREAD_LIBS=pthread
+	;;
 esac
 AC_SUBST(PTHREAD_CFLAGS)
 AC_SUBST(PTHREAD_LDFLAGS)
Trac metadata
Trac field Value
Version 7.0.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
7.0.2
Milestone
7.0.2
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#4523