c2hs icon indicating copy to clipboard operation
c2hs copied to clipboard

Fails on Darwin with "clang: error: no input files"

Open avdv opened this issue 3 years ago • 0 comments

$ c2hs external/c2hs_repo/Baz.chs -o out//Baz.hs --cpp /usr/bin/cpp -C-includeghcplatform.h -C-includeghcversion.h -C-iquote 
clang: error: no input files

Seems Darwin's cpp is behaving similar to the "openbsd" variant regarding the -xc vs. -x c flags:

bash-3.2$ which cpp
/usr/bin/cpp

bash-3.2$ cpp --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

bash-3.2$ cpp -x c foo.c
clang: error: no input files

I guess the cppopts function could use a little update?

https://github.com/haskell/c2hs/blob/e05db30aaec217f2b158cb1678625512c51f5c5d/src/C2HS/Config.hs#L53-L67

avdv avatar Jul 12 '22 13:07 avdv