Skip to content

Commit 3fb7502

Browse files
committed
Enable multitarget for all cmake and ninja projects in graalpy to use either default or musl-swcfi toolchains
1 parent 052fb9a commit 3fb7502

File tree

1 file changed

+62
-18
lines changed

1 file changed

+62
-18
lines changed

mx.graalpython/suite.py

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
"--out",
348348
"<output_root:hpy>",
349349
"--cflags",
350-
"-I<output_root:com.oracle.graal.python>/jni_gen -I<output_root:graalpy-pyconfig>/<arch> -I<path:com.oracle.graal.python.cext>/include",
350+
"-I<output_root:com.oracle.graal.python>/jni_gen -I<output_root:graalpy-pyconfig>/<os>-<arch>/<multitarget_libc_selection>/ -I<path:com.oracle.graal.python.cext>/include",
351351
],
352352
"platformDependent": True,
353353
"buildDependencies": [
@@ -540,11 +540,18 @@
540540
"windows": {
541541
"<others>": {
542542
"defaultBuild": False,
543+
"multitarget": {
544+
"libc": ["default"],
545+
},
543546
},
544547
},
545548
"<others>": {
546549
"<others>": {
547550
"defaultBuild": True,
551+
"multitarget": [
552+
{"libc": ["glibc", "default"]},
553+
{"libc": ["musl"], "variant": ["swcfi"]},
554+
],
548555
},
549556
},
550557
},
@@ -577,11 +584,18 @@
577584
"windows": {
578585
"<others>": {
579586
"defaultBuild": False,
587+
"multitarget": {
588+
"libc": ["default"],
589+
},
580590
},
581591
},
582592
"<others>": {
583593
"<others>": {
584594
"defaultBuild": True,
595+
"multitarget": [
596+
{"libc": ["glibc", "default"]},
597+
{"libc": ["musl"], "variant": ["swcfi"]},
598+
],
585599
},
586600
},
587601
},
@@ -606,6 +620,10 @@
606620
"graalpy-pyconfig": {
607621
"subDir": "graalpython",
608622
"class": "CMakeNinjaProject",
623+
"multitarget": [
624+
{"libc": ["glibc", "default"]},
625+
{"libc": ["musl"], "variant": ["swcfi"]},
626+
],
609627
"max_jobs": "1",
610628
"ninja_targets": ["all"],
611629
"cmakeConfig": {
@@ -628,9 +646,12 @@
628646
"os_arch": {
629647
"windows": {
630648
"<others>": {
649+
"multitarget": {
650+
"libc": ["default"],
651+
},
631652
"cmakeConfig": {
632653
"CAPI_INC_DIR": "<output_root:com.oracle.graal.python>/jni_gen",
633-
"PYCONFIG_INCLUDE_DIR": "<output_root:graalpy-pyconfig>/<arch>",
654+
"PYCONFIG_INCLUDE_DIR": "<output_root:graalpy-pyconfig>/<os>-<arch>/<multitarget_libc_selection>",
634655
"TRUFFLE_NFI_H_INC": "<path:com.oracle.truffle.nfi.native>/include",
635656
"GRAALPY_PARENT_DIR": "<suite_parent:graalpython>",
636657
"GRAALPY_EXT": "<graalpy_ext>",
@@ -653,9 +674,13 @@
653674
},
654675
"<others>": {
655676
"<others>": {
677+
"multitarget": [
678+
{"libc": ["glibc", "default"]},
679+
{"libc": ["musl"], "variant": ["swcfi"]},
680+
],
656681
"cmakeConfig": {
657682
"CAPI_INC_DIR": "<output_root:com.oracle.graal.python>/jni_gen",
658-
"PYCONFIG_INCLUDE_DIR": "<output_root:graalpy-pyconfig>/<arch>",
683+
"PYCONFIG_INCLUDE_DIR": "<output_root:graalpy-pyconfig>/<os>-<arch>/<multitarget_libc_selection>/",
659684
"TRUFFLE_NFI_H_INC": "<path:com.oracle.truffle.nfi.native>/include",
660685
"GRAALPY_PARENT_DIR": "<suite_parent:graalpython>",
661686
"GRAALPY_EXT": "<graalpy_ext>",
@@ -695,13 +720,19 @@
695720
"os_arch": {
696721
"windows": {
697722
"<others>": {
698-
# "/O2", "/WX", # cflags to replace -O3 -Werror
699723
"defaultBuild": False,
724+
"multitarget": {
725+
"libc": ["default"],
726+
},
700727
},
701728
},
702729
"<others>": {
703730
"<others>": {
704731
"defaultBuild": True,
732+
"multitarget": [
733+
{"libc": ["glibc", "default"]},
734+
{"libc": ["musl"], "variant": ["swcfi"]},
735+
],
705736
},
706737
},
707738
},
@@ -718,19 +749,28 @@
718749
"os_arch": {
719750
"windows": {
720751
"<others>": {
721-
# "/O2", "/WX", # cflags to replace -O3 -Werror
722752
"defaultBuild": False,
753+
"multitarget": {
754+
"libc": ["default"],
755+
},
723756
},
724757
},
725758
"darwin": {
726759
"<others>": {
727760
"defaultBuild": True,
761+
"multitarget": {
762+
"libc": ["default"],
763+
},
728764
},
729765
},
730766
"<others>": {
731767
"<others>": {
732768
"ldlibs": ["-lutil"],
733769
"defaultBuild": True,
770+
"multitarget": [
771+
{"libc": ["glibc", "default"]},
772+
{"libc": ["musl"], "variant": ["swcfi"]},
773+
],
734774
},
735775
},
736776
},
@@ -787,6 +827,10 @@
787827
"--vm.Xss16777216", # request 16M of stack
788828
'--vm.-enable-native-access=org.graalvm.shadowed.jline',
789829
],
830+
"multitarget": [
831+
{"libc": ["glibc", "default"], "compiler": ["llvm-toolchain", "host", "*"]},
832+
{"libc": ["musl"], "variant": ["swcfi"]},
833+
],
790834
},
791835

792836
"libpythonvm": {
@@ -886,8 +930,8 @@
886930
"<others>": {
887931
"layout": {
888932
"<os>/<arch>/": [
889-
"dependency:com.oracle.graal.python.cext/bin/*",
890-
"dependency:python-libbz2/bin/*",
933+
"dependency:com.oracle.graal.python.cext/<os>-<arch>/<multitarget_libc_selection>/bin/*",
934+
"dependency:python-libbz2/<os>-<arch>/<multitarget_libc_selection>/bin/*",
891935
]
892936
},
893937
},
@@ -896,11 +940,11 @@
896940
"<others>": {
897941
"layout": {
898942
"<os>/<arch>/": [
899-
"dependency:com.oracle.graal.python.cext/bin/*",
900-
"dependency:python-libzsupport/*",
901-
"dependency:python-libposix/*",
902-
"dependency:python-libbz2/bin/*",
903-
"dependency:python-liblzma/bin/*",
943+
"dependency:com.oracle.graal.python.cext/<os>-<arch>/<multitarget_libc_selection>/bin/*",
944+
"dependency:python-libzsupport/<os>-<arch>/<multitarget_libc_selection>/*",
945+
"dependency:python-libposix/<os>-<arch>/<multitarget_libc_selection>/*",
946+
"dependency:python-libbz2/<os>-<arch>/<multitarget_libc_selection>/bin/*",
947+
"dependency:python-liblzma/<os>-<arch>/<multitarget_libc_selection>/bin/*",
904948
]
905949
},
906950
},
@@ -1171,7 +1215,7 @@
11711215
"description": "GraalVM Python header resources",
11721216
"layout": {
11731217
"./META-INF/resources/include/": [
1174-
"dependency:graalpy-pyconfig/pyconfig.h",
1218+
"dependency:graalpy-pyconfig/<os>-<arch>/<multitarget_libc_selection>/pyconfig.h",
11751219
"file:graalpython/com.oracle.graal.python.cext/include/*",
11761220
],
11771221
},
@@ -1354,11 +1398,11 @@
13541398
"extracted-dependency:GRAALPY_VIRTUALENV_SEEDER",
13551399
"dependency:graalpy_licenses/*",
13561400
],
1357-
"bin/<exe:graalpy>": "dependency:graalpy_thin_launcher",
1358-
"bin/<exe:python>": "dependency:graalpy_thin_launcher",
1359-
"bin/<exe:python3>": "dependency:graalpy_thin_launcher",
1360-
"bin/<exe:graalpy-config>": "dependency:graalpy_thin_launcher",
1361-
"libexec/<exe:graalpy-polyglot-get>": "dependency:graalpy_thin_launcher",
1401+
"bin/<exe:graalpy>": "dependency:graalpy_thin_launcher/<os>-<arch>/<multitarget_libc_selection>/graalpy_thin_launcher",
1402+
"bin/<exe:python>": "dependency:graalpy_thin_launcher/<os>-<arch>/<multitarget_libc_selection>/graalpy_thin_launcher",
1403+
"bin/<exe:python3>": "dependency:graalpy_thin_launcher/<os>-<arch>/<multitarget_libc_selection>/graalpy_thin_launcher",
1404+
"bin/<exe:graalpy-config>": "dependency:graalpy_thin_launcher/<os>-<arch>/<multitarget_libc_selection>/graalpy_thin_launcher",
1405+
"libexec/<exe:graalpy-polyglot-get>": "dependency:graalpy_thin_launcher/<os>-<arch>/<multitarget_libc_selection>/graalpy_thin_launcher",
13621406
"release": "dependency:sdk:STANDALONE_JAVA_HOME/release",
13631407
},
13641408
},

0 commit comments

Comments
 (0)