Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

macOS build from source fails in linker #1135

Open
@xsebek

Description

@xsebek

I am getting the following error when installing from source on macOS Mojave:

ondrejsebek haskell-ide-engine$ stack build
Downloaded nightly-2019-03-07 build plan.    
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.6.4.                                      
Installed GHC.                                                                      
Didn't see MonadRandom-0.5.1.1@sha256:935d79b8a589f4b0f847cb787f8efaa6f5d67ec1e8f0e023775b3b5f85643f92,1414 in your package indices.
Updating and trying again.
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/                                 
Downloading timestamp                                                                            
Downloading snapshot                                                                             
Updating index                                                                                   
Updated package index downloaded                                                                 
Update complete                                                                                  
Populated index cache.    
[1 of 2] Compiling Main             ( /Users/ondrejsebek/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/ondrejsebek/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim   ( /Users/ondrejsebek/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Users/ondrejsebek/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /Users/ondrejsebek/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4 ...
ld64.lld: warning: ignoring unknown argument: --gc-sections
ld64.lld: warning: ignoring unknown argument: -u

# ... this goes on for quite some time ...

ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -search_paths_first
ld64.lld: warning: ignoring unknown argument: -dead_strip_dylibs
ld64.lld: warning: -sdk_version is required when emitting min version load command.  Setting sdk version to match provided min version
Cannot open /Users/ondrejsebek/.stack/setup-exe-src/setup-mPHDZzAJ.o: bad relocation (Invalid pointer diff) in section __TEXT/__text (r1_address=21c, r1_type=5, r1_extern=1, r1_length=2, r1_pcrel=0, r1_symbolnum=37), (r2_address=21c, r2_type=0, r2_extern=1, r2_length=2, r2_pcrel=0, r2_symbolnum=30)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)

--  While building simple Setup.hs using:
      /Users/ondrejsebek/.stack/programs/x86_64-osx/ghc-8.6.4/bin/ghc -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-2.4.0.1 /Users/ondrejsebek/.stack/setup-exe-src/setup-mPHDZzAJ.hs /Users/ondrejsebek/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -o /Users/ondrejsebek/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4
    Process exited with code: ExitFailure 1

As I am only starting to use stack & friends I have no clue what to do.
Any tips would be greatly appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildContinuous integration and buildingos: macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions