validate failure on Mac OSX for ghc head (validate fails with clang)

hey All, the current settings for warnings etc for ghc validate do not work on mac, this is because some gcc flag isn't in clang, or vice versa, or some version of gcc related matter the relevant error is: error: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-const-variable'? [-Werror,-Wunknown-warning-option] the culprit seems to be apple clang, at least if my reading of the config output by validate is correct Configure completed successfully. Building GHC version : 8.5.20171223 Git commit id : d7d0aa316f9d23d73ae617e0cc1b147907667ef4 Build platform : x86_64-apple-darwin Host platform : x86_64-apple-darwin Target platform : x86_64-apple-darwin Bootstrapping using : /Users/carter/.install-ghc/ghc-8.2.2-hq/bin/ghc which is version : 8.2.2 Using (for bootstrapping) : /usr/bin/clang Using gcc : /usr/local/bin/gcc-7 which is version : 7.2.0 Building a cross compiler : NO Unregisterised : NO hs-cpp : /usr/local/bin/gcc-7 hs-cpp-flags : -E -undef -traditional there seem to be several take aways: 1) clang doesn't support unused-but-set-variable 1.5) no one has run validate on OSX in the past few months with a vanilla checkout / env? 2) how do i change the compiler selected for boot strapping, whether via env variables or other twiddles thanks! -Carter

digging around in configure.ac it looks like i need to set CC_STAGE0 env variable to my desired CC :) hope this helps other folks... but it definiely seems like the current logic for CC_STAGE0 is more brittle than for CC On Sun, Dec 24, 2017 at 5:02 PM, Carter Schonwald < carter.schonwald@gmail.com> wrote:
hey All, the current settings for warnings etc for ghc validate do not work on mac,
this is because some gcc flag isn't in clang, or vice versa, or some version of gcc related matter
the relevant error is:
error: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-const-variable'? [-Werror,-Wunknown-warning-option]
the culprit seems to be apple clang, at least if my reading of the config output by validate is correct
Configure completed successfully.
Building GHC version : 8.5.20171223 Git commit id : d7d0aa316f9d23d73ae617e0cc1b147907667ef4
Build platform : x86_64-apple-darwin Host platform : x86_64-apple-darwin Target platform : x86_64-apple-darwin
Bootstrapping using : /Users/carter/.install-ghc/ghc-8.2.2-hq/bin/ghc which is version : 8.2.2
Using (for bootstrapping) : /usr/bin/clang Using gcc : /usr/local/bin/gcc-7 which is version : 7.2.0 Building a cross compiler : NO Unregisterised : NO hs-cpp : /usr/local/bin/gcc-7 hs-cpp-flags : -E -undef -traditional
there seem to be several take aways:
1) clang doesn't support unused-but-set-variable 1.5) no one has run validate on OSX in the past few months with a vanilla checkout / env? 2) how do i change the compiler selected for boot strapping, whether via env variables or other twiddles
thanks!
-Carter

Carter Schonwald
digging around in configure.ac it looks like i need to set CC_STAGE0 env variable to my desired CC :)
hope this helps other folks... but it definiely seems like the current logic for CC_STAGE0 is more brittle than for CC
Indeed, I've realized over the last few weeks in attempts to cross-compile GHC that our configure script is a bit... let's say peculiar in several respects. Do record your findings on the Wiki. They will be much easier to find there than buried on ghc-devs. Cheers, - Ben

I put some notes on trac. I’ll see about updating build notes later.
I did find some stuff in the Mach linker that needs to be handled
differently on gcc vs clang on Mac. And likely needs a patch so it also
builds clean with gcc
On Thu, Dec 28, 2017 at 10:26 AM Ben Gamari
Carter Schonwald
writes: digging around in configure.ac it looks like i need to set CC_STAGE0 env variable to my desired CC :)
hope this helps other folks... but it definiely seems like the current logic for CC_STAGE0 is more brittle than for CC
Indeed, I've realized over the last few weeks in attempts to cross-compile GHC that our configure script is a bit... let's say peculiar in several respects.
Do record your findings on the Wiki. They will be much easier to find there than buried on ghc-devs.
Cheers,
- Ben
participants (2)
-
Ben Gamari
-
Carter Schonwald