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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Carter Schonwald
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

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

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

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

On Sun, Dec 24, 2017 at 5:02 PM, Carter Schonwald <[hidden email]> 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


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

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

Ben Gamari-2
Carter Schonwald <[hidden email]> 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

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

signature.asc (497 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Carter Schonwald
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 <[hidden email]> wrote:
Carter Schonwald <[hidden email]> 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

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs