Commit 0c2350c2 authored by Alp Mestanogullari's avatar Alp Mestanogullari 🦑 Committed by Moritz Angermann
Browse files

rts.cabal.in: advertise profiling flavours of libraries, behind a flag

The make build system appears to be doing a bit of magic in order to supply
the profiled flavours of libHSrts and libCffi, as they're not advertised in
the 'extra-library-flavours' field of rts.cabal.in. This patch explicitly
advertises _p and _thr_p flavours of the RTS library and libCffi, but only
when the RTS is configured with the (newly introduced) 'profiling' flag.

This is necessary for Hadrian, as a branch (soon to be merged) does away with
ghc-cabal and relies just on Cabal to get package information. Without this
patch, Cabal can never inform us that _p and _thr_p flavours should be
built (and registered in the package db) as well, which obviously prevents us
from building a profiled GHC.

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4409
parent e03ca71f
......@@ -26,6 +26,8 @@ flag leading-underscore
default: @CabalLeadingUnderscore@
flag smp
default: True
flag profiling
default: False
library
-- rts is a wired in package and
......@@ -43,7 +45,16 @@ library
-- libCffi_debug libCffi_ libCffi_l libCffi_p
-- libCffi_thr libCffi_thr_debug libCffi_thr_l libCffi_thr_p
extra-library-flavours: _debug _l _thr _thr_debug _thr_l
-- TODO: _p and _thr_p only if profiling.
-- The make build system seems to be doing something "magic"/special
-- for generating profiled builds of those libraries, but we need to
-- be transparent for hadrian which gets information about the rts
-- "package" through Cabal and this cabal file. We therefore declare
-- two profiling-enabled flavours to be available when passing the
-- 'profiling' flag when configuring the RTS from hadrian, using Cabal.
if flag(profiling)
extra-library-flavours: _p _thr_p
exposed: True
exposed-modules:
if flag(libm)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment