#5337: mkRtsOptionsLevelObj should respect -optc standard headers
-------------------------------+--------------------------------------------
    Reporter:  gnezdo          |        Owner:  igloo       
        Type:  bug             |       Status:  patch       
    Priority:  normal          |    Milestone:              
   Component:  Compiler        |      Version:  7.0.4       
    Keywords:                  |     Testcase:              
   Blockedby:                  |   Difficulty:              
          Os:  Linux           |     Blocking:              
Architecture:  x86_64 (amd64)  |      Failure:  None/Unknown
-------------------------------+--------------------------------------------
Changes (by igloo):

  * owner:  => igloo


Old description:

> Our fancy compilation environment does not keep the standard C headers
> always in the same place. We always invoke gcc with --sysroot. Then we
> pass the same flag to ghc with -optc--sysroot=blah.
>
> This works most of the time until I also do ghc -rtsopts. In that case
> GHC will try to build a small generated object file with a limited
> command line that fails to include -optc flags. That leads to failure:
>
> *** C Compiler:
> gcc -c /tmp/ghc15472_0/ghc15472_0.c -o /tmp/ghc15472_0/ghc15472_0.o
> -Ilib/ghc-7.0.4/include -fno-stack-protector
>
> In file included from /tmp/ghc15472_0/ghc15472_0.c:1:0:
>
> In file included from lib/ghc-7.0.4/include/Rts.h:23:0:
>

> lib/ghc-7.0.4/include/Stg.h:62:10:
>      fatal error: 'math.h' file not found
> #include <math.h>
>          ^
> 1 error generated.
>
> This seems trivially easy to fix with the attached patch.

New description:

 Our fancy compilation environment does not keep the standard C headers
 always in the same place. We always invoke gcc with --sysroot. Then we
 pass the same flag to ghc with -optc--sysroot=blah.

 This works most of the time until I also do ghc -rtsopts. In that case GHC
 will try to build a small generated object file with a limited command
 line that fails to include -optc flags. That leads to failure:
 {{{
 *** C Compiler:
 gcc -c /tmp/ghc15472_0/ghc15472_0.c -o /tmp/ghc15472_0/ghc15472_0.o
 -Ilib/ghc-7.0.4/include -fno-stack-protector

 In file included from /tmp/ghc15472_0/ghc15472_0.c:1:0:

 In file included from lib/ghc-7.0.4/include/Rts.h:23:0:


 lib/ghc-7.0.4/include/Stg.h:62:10:
      fatal error: 'math.h' file not found
 #include <math.h>
          ^
 1 error generated.
 }}}
 This seems trivially easy to fix with the attached patch.

--

Comment:

 Thanks, I'll take a look.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5337#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to