Skip to content

Commit

Permalink
Merge pull request #4392 from BlockScope/doc/nopie-4009
Browse files Browse the repository at this point in the history
Document -nopie on macOS, resolves #4009
  • Loading branch information
dbaynard authored Nov 16, 2018
2 parents a078f1c + f425515 commit 4fef3f7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Other enhancements:

* Support KDE Neon distribution in installer.
[#4371](https://github.com/commercialhaskell/stack/pull/4371)
* Document supression of `'nopie'` warning on macOS in FAQ.
[#4009](https://github.com/commercialhaskell/stack/issues/4009)

Bug fixes:

Expand Down
20 changes: 20 additions & 0 deletions doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,3 +535,23 @@ error "bad relocation (Invalid pointer diff)". The compiler picks up
inconsistent versions of binaries and the mysterious error occurs.
The workaround is to remove LLVM binaries from the `PATH`.
## How do I suppress `'-nopie'` warnings with `stack build` on macOS?
```
clang: warning: argument unused during compilation: '-nopie'
[-Wunused-command-line-argument]
```
This warning is shown when compiler support of `-no-pie` is expected but unavailable.
It's possible to bypass the warning for a specific version of GHC by modifying a global setting:
```
# ~/.stack/programs/x86_64-osx/ghc-8.2.2/lib/ghc-8.2.2/settings
-- ("C compiler supports -no-pie", "YES"),
++ ("C compiler supports -no-pie", "NO"),
```
**Note that we're fixing `ghc-8.2.2` in this case; repeat for other versions as necessary.** You should apply this fix for the version of GHC that matches your resolver.
Issue [#4009](https://github.com/commercialhaskell/stack/issues/4009) on GitHub goes into further detail.

0 comments on commit 4fef3f7

Please sign in to comment.