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,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 381
    • Merge Requests 381
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #17962

Closed
Open
Opened Mar 25, 2020 by Gleb Popov@arrowdReporter

Build fails with LLD 10

Summary

GHC 8.6.5 and 8.8.3 (as well as master, I suspect) fails to build with LLD 10 as linker with following error:

HC [stage 1] utils/iserv/stage2_p/build/Main.p_o

cc: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
ld: error: -r and --export-dynamic may not be used together
cc: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)

The following patch is proposed for the fix:

--- utils/iserv/ghc.mk.orig     2020-03-23 22:25:01 UTC
+++ utils/iserv/ghc.mk
@@ -31,7 +31,7 @@ endif
 # of overhead to startup and increases the binary sizes) but if you
 # need it there's no alternative.
 ifeq "$(TargetElf)" "YES"
-ifneq "$(TargetOS_CPP)" "solaris2"
+ifeq "$(findstring $(TargetOS_CPP), solaris2 freebsd)" ""
 # The Solaris linker does not support --export-dynamic option. It also
 # does not need it since it exports all dynamic symbols by default
 utils/iserv_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic

But I'm not sure if it is a proper fix, or a workaround.

Steps to reproduce

Get a recent FreeBSD 13-CURRENT and just run make -C /usr/ports/lang/ghc.

Assignee
Assign to
8.10.2
Milestone
8.10.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#17962