From 262549f5f2cada8394a09b2e33990fc3a600688c Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Fri, 9 Nov 2018 09:24:30 -0500 Subject: [PATCH 1/3] Add supress nopie instructions to FAQ, #4009. --- doc/faq.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/faq.md b/doc/faq.md index 9c16e9cb70..a0045bad42 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -535,3 +535,24 @@ 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. +For `ghc-8.2.2`, the warning suppressing setting change +would be; + +``` +# ~/.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"), +``` + +Make the change of expectation in stack's settings for the version of GHC that +matches the resolver in use in the build. From 852604f9c4cf7c915dc005b58998cb40fceba361 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Fri, 9 Nov 2018 09:31:27 -0500 Subject: [PATCH 2/3] Link to related issue and add to changelog, #4009. --- ChangeLog.md | 2 ++ doc/faq.md | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 18c77bfa85..da07b76038 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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: diff --git a/doc/faq.md b/doc/faq.md index a0045bad42..7b4811d5ca 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -555,4 +555,5 @@ would be; ``` Make the change of expectation in stack's settings for the version of GHC that -matches the resolver in use in the build. +matches the resolver in use in the build. The related issue is +[#4009](https://github.com/commercialhaskell/stack/issues/4009). From f4255153ab11f71e6a433476f5cabbb23d8da26b Mon Sep 17 00:00:00 2001 From: dbaynard Date: Fri, 16 Nov 2018 15:51:31 +0100 Subject: [PATCH 3/3] Apply Matt's edits --- doc/faq.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/doc/faq.md b/doc/faq.md index 7b4811d5ca..480f32e2aa 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -543,17 +543,15 @@ clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument] ``` -This warning is shown when compiler support of `-no-pie` is expected. -For `ghc-8.2.2`, the warning suppressing setting change -would be; +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"), ``` -Make the change of expectation in stack's settings for the version of GHC that -matches the resolver in use in the build. The related issue is -[#4009](https://github.com/commercialhaskell/stack/issues/4009). +**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.