Skip to content

Commit adba76c

Browse files
committed
rts: move cmm sources into common section, and move them into sublibs
1 parent 03f47e8 commit adba76c

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

rts/rts.cabal

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,34 @@ common rts-base-config
331331
rts-fs,
332332
rts
333333

334+
common rts-cmm-sources-base
335+
if !arch(javascript)
336+
-- FIXME: by virtue of being part of the rts main library, these do not get
337+
-- the flags (debug, threaded, ...) as the sub libraries. Thus we are
338+
-- likely missing -DDEBUG, -DTHREADED_RTS, etc.
339+
-- One solution to this would be to turn all of these into `.h` files, and
340+
-- then have the `AutoApply.cmm` in `rts-c-sources-base` include them. This
341+
-- would mean they are included in the sublibraries which will in turn apply
342+
-- the sublibrary specific (c)flags.
343+
autogen-cmm-sources:
344+
AutoApply.cmm
345+
AutoApply_V16.cmm
346+
347+
if arch(x86_64)
348+
cmm-sources:
349+
Jumps_V32.cmm (-mavx2)
350+
Jumps_V64.cmm (-mavx512f)
351+
autogen-cmm-sources:
352+
AutoApply_V32.cmm (-mavx2)
353+
AutoApply_V64.cmm (-mavx512f)
354+
else
355+
cmm-sources:
356+
Jumps_V32.cmm
357+
Jumps_V64.cmm
358+
autogen-cmm-sources:
359+
AutoApply_V32.cmm
360+
AutoApply_V64.cmm
361+
334362
common rts-c-sources-base
335363
if !arch(javascript)
336364
cmm-sources:
@@ -694,33 +722,6 @@ library
694722
rts-headers,
695723
rts-fs
696724

697-
if !arch(javascript)
698-
-- FIXME: by virtue of being part of the rts main library, these do not get
699-
-- the flags (debug, threaded, ...) as the sub libraries. Thus we are
700-
-- likely missing -DDEBUG, -DTHREADED_RTS, etc.
701-
-- One solution to this would be to turn all of these into `.h` files, and
702-
-- then have the `AutoApply.cmm` in `rts-c-sources-base` include them. This
703-
-- would mean they are included in the sublibraries which will in turn apply
704-
-- the sublibrary specific (c)flags.
705-
autogen-cmm-sources:
706-
AutoApply.cmm
707-
AutoApply_V16.cmm
708-
709-
if arch(x86_64)
710-
cmm-sources:
711-
Jumps_V32.cmm (-mavx2)
712-
Jumps_V64.cmm (-mavx512f)
713-
autogen-cmm-sources:
714-
AutoApply_V32.cmm (-mavx2)
715-
AutoApply_V64.cmm (-mavx512f)
716-
else
717-
cmm-sources:
718-
Jumps_V32.cmm
719-
Jumps_V64.cmm
720-
autogen-cmm-sources:
721-
AutoApply_V32.cmm
722-
AutoApply_V64.cmm
723-
724725
common ghcjs
725726
import: rts-base-config
726727

@@ -767,29 +768,29 @@ library nonthreaded-nodebug
767768
if arch(javascript)
768769
import: ghcjs
769770
else
770-
import: rts-base-config, rts-c-sources-base, rts-link-options, rts-global-build-flags
771+
import: rts-base-config, rts-cmm-sources-base, rts-c-sources-base, rts-link-options, rts-global-build-flags
771772

772773
visibility: public
773774

774775
ghc-options: -optc-DRtsWay="v"
775776

776777

777778
library threaded-nodebug
778-
import: rts-base-config, rts-c-sources-base, rts-link-options, rts-global-build-flags, rts-threaded-flags
779+
import: rts-base-config, rts-cmm-sources-base, rts-c-sources-base, rts-link-options, rts-global-build-flags, rts-threaded-flags
779780
visibility: public
780781
build-depends: rts
781782
if arch(javascript)
782783
buildable: False
783784

784785
library nonthreaded-debug
785-
import: rts-base-config, rts-c-sources-base, rts-link-options, rts-global-build-flags, rts-debug-flags
786+
import: rts-base-config, rts-cmm-sources-base, rts-c-sources-base, rts-link-options, rts-global-build-flags, rts-debug-flags
786787
visibility: public
787788
build-depends: rts
788789
if arch(javascript)
789790
buildable: False
790791

791792
library threaded-debug
792-
import: rts-base-config, rts-c-sources-base, rts-link-options, rts-global-build-flags, rts-threaded-flags, rts-debug-flags
793+
import: rts-base-config, rts-cmm-sources-base, rts-c-sources-base, rts-link-options, rts-global-build-flags, rts-threaded-flags, rts-debug-flags
793794
visibility: public
794795
build-depends: rts
795796
if arch(javascript)

0 commit comments

Comments
 (0)