-
Notifications
You must be signed in to change notification settings - Fork 841
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
GHC 8.4.3 on macos will generate linker error #4373
Comments
I have encountered the same problem. Plus, with |
And yes, the error disappeared after I copied [("GCC extra via C opts", " -fwrapv -fno-builtin"),
- ("C compiler command", "gcc"),
+ ("C compiler command", "clang"),
("C compiler flags", " -fno-stack-protector"),
- ("C compiler link flags", " -fuse-ld=lld"),
- ("C compiler supports -no-pie", "NO"),
- ("Haskell CPP command","gcc"),
+ ("C compiler link flags", " "),
+ ("C compiler supports -no-pie", "YES"),
+ ("Haskell CPP command","clang"),
("Haskell CPP flags","-E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs"),
- ("ld command", "ld.lld"),
+ ("ld command", "ld"),
("ld flags", ""),
- ("ld supports compact unwind", "NO"),
+ ("ld supports compact unwind", "YES"),
("ld supports build-id", "NO"),
- ("ld supports filelist", "NO"),
- ("ld is GNU ld", "YES"),
+ ("ld supports filelist", "YES"),
+ ("ld is GNU ld", "NO"),
("ar command", "ar"),
("ar flags", "qcls"),
("ar supports at file", "NO"),
- ("ranlib command", ""),
+ ("ranlib command", "ranlib"),
("touch command", "touch"),
("dllwrap command", "/bin/false"),
("windres command", "/bin/false"), |
I believe #4366 addresses this. Would you try the workaround there? |
facing the same issue, uninstalling llvm (and excluding it's binaries from the PATH) doesn't help:
(macOS) looks like it needs a different gcc version (not ( it complains about UPD: resolved by removing |
Closing as it seems original issue was addressed with FAQ entry |
I am encountering same issue on macOS 10.14.1 . I did already remove What is actually meant by the OK for other haskell newbies: the "settings" referred to from #4373 (comment) above is here: For convenience here is the entire updated
There is one followup: given my co-worker on
|
Thanks @javadba! I'm also a newbie (albeit months later than you!) and your comments helped me! |
And thanks @bonotake for that diff! |
where is this file?
|
@geofflangenderfer , based on #4373 (comment), the 'settings' being discussed are part of GHC (not Stack, as such) in its subdirectory |
When I use "stack ghc something.hs" on macos,ghc will generate the following linker error:
ld64.lld: warning: ignoring unknown argument: --gc-sections
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -u
ld64.lld: warning: ignoring unknown argument: -search_paths_first
ld64.lld: warning: -sdk_version is required when emitting min version load command. Setting sdk version to match provided min version
Cannot open text.o: bad relocation (Invalid pointer diff) in section __TEXT/__text (r1_address=160, r1_type=5, r1_extern=1, r1_length=3, r1_pcrel=0, r1_symbolnum=19), (r2_address=160, r2_type=0, r2_extern=1, r2_length=3, r2_pcrel=0, r2_symbolnum=13)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gcc' failed in phase
Linker'. (Exit code: 1)I found that the problem may be caused by the settings.After copy the settings from homebrew ghc installations,the problem disappear.
[("GCC extra via C opts", " -fwrapv -fno-builtin"),
("C compiler command", "clang"),
("C compiler flags", " -fno-stack-protector"),
("C compiler link flags", " "),
("C compiler supports -no-pie", "YES"),
("Haskell CPP command","clang"),
("Haskell CPP flags","-E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs"),
("ld command", "ld"),
("ld flags", ""),
("ld supports compact unwind", "YES"),
("ld supports build-id", "NO"),
("ld supports filelist", "YES"),
("ld is GNU ld", "NO"),
("ar command", "ar"),
("ar flags", "qcls"),
("ar supports at file", "NO"),
("ranlib command", "ranlib"),
("touch command", "touch"),
("dllwrap command", "/bin/false"),
("windres command", "/bin/false"),
("libtool command", "libtool"),
("perl command", "/usr/local/bin/perl"),
("cross compiling", "NO"),
("target os", "OSDarwin"),
("target arch", "ArchX86_64"),
("target word size", "8"),
("target has GNU nonexec stack", "False"),
("target has .ident directive", "True"),
("target has subsections via symbols", "True"),
("target has RTS linker", "YES"),
("Unregisterised", "NO"),
("LLVM llc command", "llc"),
("LLVM opt command", "opt"),
("LLVM clang command", "clang")
]
The text was updated successfully, but these errors were encountered: