Skip to content
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

need to set -pgma clang -pgmc clang on mac #8

Closed
cartazio opened this issue Feb 26, 2014 · 8 comments
Closed

need to set -pgma clang -pgmc clang on mac #8

cartazio opened this issue Feb 26, 2014 · 8 comments

Comments

@cartazio
Copy link

Building hfsevents-0.1.5... Preprocessing library hfsevents-0.1.5... [1 of 1] Compiling System.OSX.FSEvents ( System/OSX/FSEvents.hs, dist/build/System/OSX/FSEvents.o ) gcc-4.8: error: language objective-c not recognized gcc-4.8: error: language objective-c not recognized
if i pass -pgmc clang -pgma clang things work out fine

@luite
Copy link
Owner

luite commented Feb 27, 2014

is that really something that should be done in the .cabal file? shouldn't GHC know what compiler to run (and the options that it accepts) when it encounters a .m file?

(that said, i'm ok with a workaround, but doesn't this break things for users with no clang?)

@cartazio
Copy link
Author

No Mac user with lion and newer will ever lack clang if they have dev tools
installed, and it's currently broken for me unless I do pgma clang pgmc
clang, because my ghc uses real GCC by default.

Likewise, mixing clang vs GCC actually is slightly broken because cabal /
ghc invokes the assembler separate from the c compiler, and that seems to
break things if you mix both. I'll test more to sanity check this claim
of mine later this afternoon

On Thursday, February 27, 2014, Luite Stegeman [email protected]
wrote:

is that really something that should be done in the .cabal file?
shouldn't GHC know what compiler to run (and the options that it accepts)
when it encounters a .m file?

(that said, i'm ok with a workaround, but doesn't this break things for
users with no clang?)


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-36247234
.

@ocramz
Copy link

ocramz commented Dec 3, 2015

I just ran into this problem as well, when compiling the latest stack : stack upgrade --git . Where should one supply those flags in this case?
I'm on OSX 10.9.5, using stack version 0.1.4.0

@cartazio
Copy link
Author

cartazio commented Dec 3, 2015

I'm not sure if stack lets you specify per package configuration flags. So
you may be shit out of luck. Also why isn't your GHC using clang for both
cpp and c code and asm?
On Dec 3, 2015 5:51 AM, "Marco Zocca" [email protected] wrote:

I just ran into this problem as well, when compiling the latest stack : stack
upgrade --git . Where should one supply those flags in this case


Reply to this email directly or view it on GitHub
#8 (comment).

@ocramz
Copy link

ocramz commented Dec 4, 2015

I'd rather find my answers elsewhere than thinking of being "shit out of luck". Thank you

@luite
Copy link
Owner

luite commented Dec 4, 2015

I've been hesitant to patch this package, since the problem points to a GHC installation issue rather than a problem with the package itself. Instead of hardcoding a compiler program name in all packages that need to compile Objective C it's best to fix the the problem at its source.

GHC gets the underlying compiler commands to use from its settings file (you can find the location with ghc --print-libdir and dump the config with ghc --info. How did you install your GHC?

@cartazio
Copy link
Author

cartazio commented Dec 5, 2015

Agreed. Your error indicates a misconfigured Mac install of ghc. Could you
provide more information about your config?

On Friday, December 4, 2015, Luite Stegeman [email protected]
wrote:

I've been hesitant to patch this package, since the problem points to a
GHC installation issue rather than a problem with the package itself.
Instead of hardcoding a compiler program name in all packages that need to
compile Objective C it's best to fix the the problem at its source.

GHC gets the underlying compiler commands to use from its settings file
(you can find the location with ghc --print-libdir and dump the config
with ghc --info. How did you install your GHC?


Reply to this email directly or view it on GitHub
#8 (comment).

@luite
Copy link
Owner

luite commented Aug 23, 2024

I think this has been fixed by GHC and/or cabal by now

(welcome to open a new issue if new workarounds are needed of course)

@luite luite closed this as completed Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants