Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FIXED at Glasgow Haskell Compiler / GHC
Commits:
-
a1992c60
by Sven Tennie at 2025-11-02T15:16:40+01:00
3 changed files:
Changes:
| ... | ... | @@ -599,6 +599,20 @@ function install_bindist() { |
| 599 | 599 | *)
|
| 600 | 600 | read -r -a args <<< "${INSTALL_CONFIGURE_ARGS:-}"
|
| 601 | 601 | |
| 602 | + if [[ "${CROSS_TARGET:-no_cross_target}" =~ "mingw" ]]; then
|
|
| 603 | + # We suppose that host target = build target.
|
|
| 604 | + # By the fact above it is clearly turning out which host value is
|
|
| 605 | + # for currently built compiler.
|
|
| 606 | + # The fix for #21970 will probably remove this if-branch.
|
|
| 607 | + local -r CROSS_HOST_GUESS=$($SHELL ./config.guess)
|
|
| 608 | + args+=( "--target=$CROSS_TARGET" "--host=$CROSS_HOST_GUESS" )
|
|
| 609 | + |
|
| 610 | + # FIXME: The bindist configure script shouldn't need to be reminded of
|
|
| 611 | + # the target platform. See #21970.
|
|
| 612 | + elif [ -n "${CROSS_TARGET:-}" ]; then
|
|
| 613 | + args+=( "--target=$CROSS_TARGET" "--host=$CROSS_TARGET" )
|
|
| 614 | + fi
|
|
| 615 | + |
|
| 602 | 616 | run ${CONFIGURE_WRAPPER:-} ./configure \
|
| 603 | 617 | --prefix="$instdir" \
|
| 604 | 618 | "${args[@]+"${args[@]}"}" || fail "bindist configure failed"
|
| ... | ... | @@ -636,8 +650,28 @@ function test_hadrian() { |
| 636 | 650 | if [[ "${CROSS_EMULATOR:-}" == "NOT_SET" ]]; then
|
| 637 | 651 | info "Cannot test cross-compiled build without CROSS_EMULATOR being set."
|
| 638 | 652 | return
|
| 639 | - # If we have set CROSS_EMULATOR, then can't test using normal testsuite.
|
|
| 640 | - elif [ -n "${CROSS_EMULATOR:-}" ] && [[ "${CROSS_TARGET:-}" != *"wasm"* ]]; then
|
|
| 653 | + # special case for JS backend
|
|
| 654 | + elif [ -n "${CROSS_TARGET:-}" ] && [ "${CROSS_EMULATOR:-}" == "js-emulator" ]; then
|
|
| 655 | + # The JS backend doesn't support CROSS_EMULATOR logic yet
|
|
| 656 | + unset CROSS_EMULATOR
|
|
| 657 | + # run "hadrian test" directly, not using the bindist, even though it did get installed.
|
|
| 658 | + # This is a temporary solution, See !9515 for the status of hadrian support.
|
|
| 659 | + run_hadrian \
|
|
| 660 | + test \
|
|
| 661 | + --summary-junit=./junit.xml \
|
|
| 662 | + --test-have-intree-files \
|
|
| 663 | + --docs=none \
|
|
| 664 | + "runtest.opts+=${RUNTEST_ARGS:-}" \
|
|
| 665 | + "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
|
|
| 666 | + || fail "cross-compiled hadrian main testsuite"
|
|
| 667 | + elif [[ -n "${CROSS_TARGET:-}" ]] && [[ "${CROSS_TARGET:-}" == *"wasm"* ]]; then
|
|
| 668 | + run_hadrian \
|
|
| 669 | + test \
|
|
| 670 | + --summary-junit=./junit.xml \
|
|
| 671 | + "runtest.opts+=${RUNTEST_ARGS:-}" \
|
|
| 672 | + "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
|
|
| 673 | + || fail "hadrian main testsuite targetting $CROSS_TARGET"
|
|
| 674 | + elif [ -n "${CROSS_TARGET:-}" ]; then
|
|
| 641 | 675 | local instdir="$TOP/_build/install"
|
| 642 | 676 | local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
|
| 643 | 677 | install_bindist _build/bindist/ghc-*/ "$instdir"
|
| ... | ... | @@ -702,18 +736,11 @@ function test_hadrian() { |
| 702 | 736 | rm proftest.hs
|
| 703 | 737 | fi
|
| 704 | 738 | |
| 705 | - # The check-exact check-ppr programs etc can not be built when testing a cross compiler.
|
|
| 706 | - if [ -z "${CROSS_TARGET:-}" ]; then
|
|
| 707 | - TEST_HAVE_INTREE="--test-have-intree-files"
|
|
| 708 | - else
|
|
| 709 | - TEST_HAVE_INTREE=""
|
|
| 710 | - fi
|
|
| 711 | - |
|
| 712 | 739 | run_hadrian \
|
| 713 | 740 | test \
|
| 714 | 741 | --summary-junit=./junit.xml \
|
| 742 | + --test-have-intree-files \
|
|
| 715 | 743 | --test-compiler="${test_compiler}" \
|
| 716 | - $TEST_HAVE_INTREE \
|
|
| 717 | 744 | "runtest.opts+=${RUNTEST_ARGS:-}" \
|
| 718 | 745 | "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
|
| 719 | 746 | || fail "hadrian main testsuite"
|
| ... | ... | @@ -173,7 +173,7 @@ configureArgsStr :: BuildConfig -> String |
| 173 | 173 | configureArgsStr bc = unwords $
|
| 174 | 174 | ["--enable-unregisterised"| unregisterised bc ]
|
| 175 | 175 | ++ ["--disable-tables-next-to-code" | not (tablesNextToCode bc) ]
|
| 176 | - ++ ["--with-intree-gmp" | Just _ <- [crossTarget bc] ]
|
|
| 176 | + ++ ["--with-intree-gmp" | Just _ <- pure (crossTarget bc) ]
|
|
| 177 | 177 | ++ ["--with-system-libffi" | crossTarget bc == Just "wasm32-wasi" ]
|
| 178 | 178 | ++ ["--enable-ipe-data-compression" | withZstd bc ]
|
| 179 | 179 | ++ ["--enable-strict-ghc-toolchain-check"]
|
| ... | ... | @@ -1155,6 +1155,7 @@ debian_x86 = |
| 1155 | 1155 | ]
|
| 1156 | 1156 | where
|
| 1157 | 1157 | validate_debian = Debian12
|
| 1158 | + |
|
| 1158 | 1159 | perfProfilingJob arch sys buildConfig =
|
| 1159 | 1160 | -- Rename the job to avoid conflicts
|
| 1160 | 1161 | rename (<> "-perf")
|
| ... | ... | @@ -1278,7 +1279,7 @@ cross_jobs = [ |
| 1278 | 1279 | (validateBuilds AArch64 (Linux Debian12Wine) (winAarch64Config {llvmBootstrap = True}))
|
| 1279 | 1280 | ]
|
| 1280 | 1281 | where
|
| 1281 | - javascriptConfig = (crossConfig "javascript-unknown-ghcjs" NoEmulatorNeeded (Just "emconfigure"))
|
|
| 1282 | + javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure"))
|
|
| 1282 | 1283 | { bignumBackend = Native }
|
| 1283 | 1284 | |
| 1284 | 1285 | makeWinArmJobs = modifyJobs
|
| ... | ... | @@ -1317,6 +1318,7 @@ cross_jobs = [ |
| 1317 | 1318 | modifyJobs
|
| 1318 | 1319 | ( -- See Note [Testing wasm ghci browser mode]
|
| 1319 | 1320 | setVariable "FIREFOX_LAUNCH_OPTS" "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}"
|
| 1321 | + . setVariable "HADRIAN_ARGS" "--docs=no-sphinx-pdfs --docs=no-sphinx-man"
|
|
| 1320 | 1322 | . delVariable "INSTALL_CONFIGURE_ARGS"
|
| 1321 | 1323 | )
|
| 1322 | 1324 | $ addValidateRule WasmBackend $ validateBuilds Amd64 (Linux AlpineWasm) cfg
|
| ... | ... | @@ -1730,6 +1730,7 @@ |
| 1730 | 1730 | "CROSS_STAGE": "2",
|
| 1731 | 1731 | "CROSS_TARGET": "wasm32-wasi",
|
| 1732 | 1732 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 1733 | + "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
|
| 1733 | 1734 | "RUNTEST_ARGS": "",
|
| 1734 | 1735 | "TEST_ENV": "x86_64-linux-alpine3_22-wasm-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 1735 | 1736 | "XZ_OPT": "-9"
|
| ... | ... | @@ -1795,6 +1796,7 @@ |
| 1795 | 1796 | "CROSS_STAGE": "2",
|
| 1796 | 1797 | "CROSS_TARGET": "wasm32-wasi",
|
| 1797 | 1798 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 1799 | + "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
|
| 1798 | 1800 | "RUNTEST_ARGS": "",
|
| 1799 | 1801 | "TEST_ENV": "x86_64-linux-alpine3_22-wasm-int_native-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 1800 | 1802 | "XZ_OPT": "-9"
|
| ... | ... | @@ -1860,6 +1862,7 @@ |
| 1860 | 1862 | "CROSS_STAGE": "2",
|
| 1861 | 1863 | "CROSS_TARGET": "wasm32-wasi",
|
| 1862 | 1864 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 1865 | + "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
|
| 1863 | 1866 | "RUNTEST_ARGS": "",
|
| 1864 | 1867 | "TEST_ENV": "x86_64-linux-alpine3_22-wasm-unreg-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 1865 | 1868 | "XZ_OPT": "-9"
|
| ... | ... | @@ -2115,6 +2118,7 @@ |
| 2115 | 2118 | "BUILD_FLAVOUR": "validate",
|
| 2116 | 2119 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 2117 | 2120 | "CONFIGURE_WRAPPER": "emconfigure",
|
| 2121 | + "CROSS_EMULATOR": "js-emulator",
|
|
| 2118 | 2122 | "CROSS_STAGE": "2",
|
| 2119 | 2123 | "CROSS_TARGET": "javascript-unknown-ghcjs",
|
| 2120 | 2124 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| ... | ... | @@ -5839,6 +5843,7 @@ |
| 5839 | 5843 | "CROSS_STAGE": "2",
|
| 5840 | 5844 | "CROSS_TARGET": "wasm32-wasi",
|
| 5841 | 5845 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 5846 | + "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
|
| 5842 | 5847 | "RUNTEST_ARGS": "",
|
| 5843 | 5848 | "TEST_ENV": "x86_64-linux-alpine3_22-wasm-cross_wasm32-wasi-release+host_fully_static+text_simdutf"
|
| 5844 | 5849 | }
|
| ... | ... | @@ -5904,6 +5909,7 @@ |
| 5904 | 5909 | "CROSS_STAGE": "2",
|
| 5905 | 5910 | "CROSS_TARGET": "wasm32-wasi",
|
| 5906 | 5911 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 5912 | + "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
|
| 5907 | 5913 | "RUNTEST_ARGS": "",
|
| 5908 | 5914 | "TEST_ENV": "x86_64-linux-alpine3_22-wasm-int_native-cross_wasm32-wasi-release+host_fully_static+text_simdutf"
|
| 5909 | 5915 | }
|
| ... | ... | @@ -5969,6 +5975,7 @@ |
| 5969 | 5975 | "CROSS_STAGE": "2",
|
| 5970 | 5976 | "CROSS_TARGET": "wasm32-wasi",
|
| 5971 | 5977 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 5978 | + "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
|
| 5972 | 5979 | "RUNTEST_ARGS": "",
|
| 5973 | 5980 | "TEST_ENV": "x86_64-linux-alpine3_22-wasm-unreg-cross_wasm32-wasi-release+host_fully_static+text_simdutf"
|
| 5974 | 5981 | }
|
| ... | ... | @@ -6220,6 +6227,7 @@ |
| 6220 | 6227 | "BUILD_FLAVOUR": "validate",
|
| 6221 | 6228 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 6222 | 6229 | "CONFIGURE_WRAPPER": "emconfigure",
|
| 6230 | + "CROSS_EMULATOR": "js-emulator",
|
|
| 6223 | 6231 | "CROSS_STAGE": "2",
|
| 6224 | 6232 | "CROSS_TARGET": "javascript-unknown-ghcjs",
|
| 6225 | 6233 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|