Ticket #5337 (closed bug: fixed)

Opened 2 years ago

Last modified 15 months ago

mkRtsOptionsLevelObj should respect -optc standard headers

Reported by: gnezdo Owned by: pcapriotti
Priority: high Milestone: 7.4.2
Component: Compiler Version: 7.0.4
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets: #5528

Description (last modified by igloo) (diff)

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.

Attachments

DriverPipeline-fix-for-5337.patch Download (0.6 KB) - added by gnezdo 2 years ago.
suggested patch

Change History

Changed 2 years ago by gnezdo

suggested patch

Changed 23 months ago by igloo

  • status changed from new to patch

Changed 23 months ago by igloo

  • owner set to igloo
  • description modified (diff)

Thanks, I'll take a look.

Changed 20 months ago by igloo

  • priority changed from normal to high
  • milestone set to 7.4.1

Changed 17 months ago by igloo

  • milestone changed from 7.4.1 to 7.4.2

Changed 15 months ago by igloo

  • owner changed from igloo to pcapriotti
  • difficulty set to Unknown

Changed 15 months ago by pcapriotti

  • status changed from patch to closed
  • resolution set to fixed
  • related set to #5528

Fixed by the same patch as #5528: bcab1273dcb58199001e225eca1708e6648a3bb4.

Note: See TracTickets for help on using tickets.