-
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
Building Main/StackSetupShim triggers un-silenceable -nopie warnings with clang #4009
Comments
I encounter the same warning when building this branch of my project with recent stack nightly distributions + clang. |
Me too.
|
A follow-up: I've upgraded to stack |
I'm getting
macOS 10.13.4 |
@ncaq thanks for the reference! |
@oluckyman setting:
in |
This is probably an upstream issue https://ghc.haskell.org/trac/ghc/ticket/15112 which unfortunately doesn't look near being closed. According to that, there's an incompatibility with XCode's clang. Specifying the c compiler to use may help (although The workaround looks like the best approach, for now, though there should probably be some documentation fixes for os x. It may be possible to edit the default settings, though. |
Replacing gcc(clang) in "C compiler command" field with brew installed gcc works for me. |
Document -nopie on macOS, resolves #4009
Closing as #4392 adds documentation. |
General summary/comments
In attempting to upgrade a library (haskell-tree-sitter) to a newer Stackage nightly (
nightly-2018-05-04
, for GHC 8.4, butnightly-2018-04-25
exhibits this problem too), the build process (with a custom Setup.hs) always generates the following errors from clang:These errors also appear when compiling dependent C code in the project itself; I was able to fix them with the following stanza in my stack.yaml:
However, I'm unable to figure out how to silence these warnings when building the
setup
executable. Adding aGHC_OPTIONS
stanza to mySetup.hs
did not work, nor did addingccOptions = "-Wno-unused-command-line-argument"
to my Setup.hs'slibBuildInfo
. Short of editing~/.stack/programs/x86_64-osx/ghc-8.4.1/lib/ghc-8.4.1/settings
on every machine we use, is there a way to silence these warnings? This makes upgrading to 8.4 a tricky proposition.I am running macOS 10.13.4 with stack 1.7.1. The output of
clang --version
isRunning with
--verbose
seems to indicate that the command producing these warnings is2018-05-04 12:46:29.295442: [debug] Run process: /Users/patrickt/.stack/programs/x86_64-osx/ghc-8.4.2/bin/ghc-8.4.2 --make -odir /Users/patrickt/src/haskell-tree-sitter/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/setup -hidir /Users/patrickt/src/haskell-tree-sitter/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/setup -i -i. -clear-package-db -global-package-db -package-db=/Users/patrickt/.stack/snapshots/x86_64-osx/nightly-2018-04-25/8.4.2/pkgdb -package-db=/Users/patrickt/src/haskell-tree-sitter/.stack-work/install/x86_64-osx/nightly-2018-04-25/8.4.2/pkgdb -hide-all-packages -package-id=Cabal-2.2.0.1 -package-id=base-4.11.1.0 -package-id=directory-1.3.1.5 -package-id=process-1.6.3.0 -optP-include -optP/Users/patrickt/src/haskell-tree-sitter/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/setup/setup_macros.h /Users/patrickt/src/haskell-tree-sitter/Setup.hs /Users/patrickt/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /Users/patrickt/src/haskell-tree-sitter/.stack-work/dist/x86_64-osx/Cabal-2.2.0.1/setup/setup -threaded
Steps to reproduce
[email protected]:tree-sitter/haskell-tree-sitter.git
tentative-8.4-upgrade
branchscript/bootstrap
to fetch submodulesstack build
Expected
A clean build free of C errors.
Actual
Seemingly-unsilenceable errors from
clang
.Stack version
Method of installation
stack upgrade
since.EDIT: fixed repository link
The text was updated successfully, but these errors were encountered: