Serge S. Gulin pushed to branch wip/T25974 at Glasgow Haskell Compiler / GHC
Commits:
-
eea552e1
by Serge S. Gulin at 2025-05-07T10:14:07+03:00
-
b4c53dd8
by Serge S. Gulin at 2025-05-08T16:58:40+04:00
-
3ccf3c01
by Serge S. Gulin at 2025-05-09T15:41:07+04:00
-
a21cee90
by Serge S. Gulin at 2025-05-10T00:10:20+04:00
-
b347c867
by Serge S. Gulin at 2025-05-10T01:42:34+04:00
-
0c7c5407
by Serge S. Gulin at 2025-05-10T18:01:43+04:00
-
34b1810d
by Serge S. Gulin at 2025-05-11T22:18:07+04:00
12 changed files:
- .gitignore
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- boot
- configure.ac
- hadrian/src/Builder.hs
- hadrian/src/Rules/BinaryDist.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
- m4/find_merge_objects.m4
- m4/fp_setup_windows_toolchain.m4
Changes:
... | ... | @@ -256,3 +256,6 @@ ghc.nix/ |
256 | 256 | # clangd
|
257 | 257 | .clangd
|
258 | 258 | dist-newstyle/
|
259 | + |
|
260 | +# .gitlab/ci.sh for HERMETIC=1
|
|
261 | +cabal/* |
... | ... | @@ -2,7 +2,7 @@ variables: |
2 | 2 | GIT_SSL_NO_VERIFY: "1"
|
3 | 3 | |
4 | 4 | # Commit of ghc/ci-images repository from which to pull Docker images
|
5 | - DOCKER_REV: 6e9f8f17086e56e83adae4a8a9d63e2fec3cb6c7
|
|
5 | + DOCKER_REV: 719761ba598220b9576f82aab39e442cc1a1cf1f
|
|
6 | 6 | |
7 | 7 | # Sequential version number of all cached things.
|
8 | 8 | # Bump to invalidate GitLab CI cache.
|
... | ... | @@ -75,6 +75,15 @@ Environment variables affecting both build systems: |
75 | 75 | NIX_SYSTEM On Darwin, the target platform of the desired toolchain
|
76 | 76 | (either "x86-64-darwin" or "aarch-darwin")
|
77 | 77 | NO_BOOT Whether to run ./boot or not, used when testing the source dist
|
78 | + TOOLCHAIN_SOURCE Select a source of toolchain. Possible values:
|
|
79 | + - "env": Toolchains are included in the Docker image via environment
|
|
80 | + variables. Default for Linux.
|
|
81 | + - "nix": Toolchains are provided via .gitlab/darwin/toolchain.nix.
|
|
82 | + Default for Darwin.
|
|
83 | + - "extracted":
|
|
84 | + Toolchains will be downloaded and extracted through the
|
|
85 | + CI process. Default for other systems. Windows and FreeBSD
|
|
86 | + are included.
|
|
78 | 87 | |
79 | 88 | Environment variables determining build configuration of Hadrian system:
|
80 | 89 | |
... | ... | @@ -83,14 +92,14 @@ Environment variables determining build configuration of Hadrian system: |
83 | 92 | This tests the "reinstall" configuration
|
84 | 93 | CROSS_EMULATOR The emulator to use for testing of cross-compilers.
|
85 | 94 | |
86 | -Environment variables determining bootstrap toolchain (Linux):
|
|
95 | +Environment variables determining bootstrap toolchain (TOOLCHAIN_SOURCE=env):
|
|
87 | 96 | |
88 | 97 | GHC Path of GHC executable to use for bootstrapping.
|
89 | 98 | CABAL Path of cabal-install executable to use for bootstrapping.
|
90 | 99 | ALEX Path of alex executable to use for bootstrapping.
|
91 | 100 | HAPPY Path of alex executable to use for bootstrapping.
|
92 | 101 | |
93 | -Environment variables determining bootstrap toolchain (non-Linux):
|
|
102 | +Environment variables determining bootstrap toolchain (TOOLCHAIN_SOURCE=extracted):
|
|
94 | 103 | |
95 | 104 | GHC_VERSION Which GHC version to fetch for bootstrapping.
|
96 | 105 | CABAL_INSTALL_VERSION
|
... | ... | @@ -135,7 +144,9 @@ function mingw_init() { |
135 | 144 | case "$MSYSTEM" in
|
136 | 145 | CLANG64)
|
137 | 146 | target_triple="x86_64-unknown-mingw32"
|
138 | - boot_triple="x86_64-unknown-mingw32" # triple of bootstrap GHC
|
|
147 | + ;;
|
|
148 | + CLANGARM64)
|
|
149 | + target_triple="aarch64-unknown-mingw32"
|
|
139 | 150 | ;;
|
140 | 151 | *)
|
141 | 152 | fail "win32-init: Unknown MSYSTEM $MSYSTEM"
|
... | ... | @@ -150,10 +161,19 @@ function mingw_init() { |
150 | 161 | MINGW_MOUNT_POINT="${MINGW_PREFIX}"
|
151 | 162 | PATH="$MINGW_MOUNT_POINT/bin:$PATH"
|
152 | 163 | |
153 | - # We always use mingw64 Python to avoid path length issues like #17483.
|
|
154 | - export PYTHON="/mingw64/bin/python3"
|
|
155 | - # And need to use sphinx-build from the environment
|
|
156 | - export SPHINXBUILD="/mingw64/bin/sphinx-build.exe"
|
|
164 | + case "$MSYSTEM" in
|
|
165 | + CLANGARM64)
|
|
166 | + # At MSYS for ARM64 we force to use their special versions to speedup the compiler step
|
|
167 | + export PYTHON="/clangarm64/bin/python3"
|
|
168 | + export SPHINXBUILD="/clangarm64/bin/sphinx-build.exe"
|
|
169 | + ;;
|
|
170 | + *)
|
|
171 | + # We always use mingw64 Python to avoid path length issues like #17483.
|
|
172 | + export PYTHON="/mingw64/bin/python3"
|
|
173 | + # And need to use sphinx-build from the environment
|
|
174 | + export SPHINXBUILD="/mingw64/bin/sphinx-build.exe"
|
|
175 | + ;;
|
|
176 | + esac
|
|
157 | 177 | }
|
158 | 178 | |
159 | 179 | # This will contain GHC's local native toolchain
|
... | ... | @@ -178,15 +198,21 @@ function show_tool() { |
178 | 198 | }
|
179 | 199 | |
180 | 200 | function set_toolchain_paths() {
|
181 | - case "$(uname -m)-$(uname)" in
|
|
182 | - # Linux toolchains are included in the Docker image
|
|
183 | - *-Linux) toolchain_source="env" ;;
|
|
184 | - # Darwin toolchains are provided via .gitlab/darwin/toolchain.nix
|
|
185 | - *-Darwin) toolchain_source="nix" ;;
|
|
186 | - *) toolchain_source="extracted" ;;
|
|
187 | - esac
|
|
201 | + if [ -z "${TOOLCHAIN_SOURCE:-}" ]
|
|
202 | + then
|
|
203 | + # Fallback to automatic detection which could not work for cases
|
|
204 | + # when cross compiler will be build at Windows environment
|
|
205 | + # and requires a special mingw compiler (not bundled)
|
|
206 | + case "$(uname -m)-$(uname)" in
|
|
207 | + # Linux toolchains are included in the Docker image
|
|
208 | + *-Linux) TOOLCHAIN_SOURCE="env" ;;
|
|
209 | + # Darwin toolchains are provided via .gitlab/darwin/toolchain.nix
|
|
210 | + *-Darwin) TOOLCHAIN_SOURCE="nix" ;;
|
|
211 | + *) TOOLCHAIN_SOURCE="extracted" ;;
|
|
212 | + esac
|
|
213 | + fi
|
|
188 | 214 | |
189 | - case "$toolchain_source" in
|
|
215 | + case "$TOOLCHAIN_SOURCE" in
|
|
190 | 216 | extracted)
|
191 | 217 | # These are populated by setup_toolchain
|
192 | 218 | GHC="$toolchain/bin/ghc$exe"
|
... | ... | @@ -217,7 +243,7 @@ function set_toolchain_paths() { |
217 | 243 | : ${HAPPY:=$(which happy)}
|
218 | 244 | : ${ALEX:=$(which alex)}
|
219 | 245 | ;;
|
220 | - *) fail "bad toolchain_source"
|
|
246 | + *) fail "bad TOOLCHAIN_SOURCE"
|
|
221 | 247 | esac
|
222 | 248 | |
223 | 249 | export GHC
|
... | ... | @@ -247,7 +273,7 @@ function setup() { |
247 | 273 | cp -Rf "$CABAL_CACHE"/* "$CABAL_DIR"
|
248 | 274 | fi
|
249 | 275 | |
250 | - case $toolchain_source in
|
|
276 | + case $TOOLCHAIN_SOURCE in
|
|
251 | 277 | extracted) time_it "setup" setup_toolchain ;;
|
252 | 278 | *) ;;
|
253 | 279 | esac
|
... | ... | @@ -273,14 +299,37 @@ function setup() { |
273 | 299 | }
|
274 | 300 | |
275 | 301 | function fetch_ghc() {
|
276 | - if [ ! -e "$GHC" ]; then
|
|
277 | - local v="$GHC_VERSION"
|
|
302 | + local boot_triple_to_fetch
|
|
303 | + case "$(uname)" in
|
|
304 | + MSYS_*|MINGW*)
|
|
305 | + case "$MSYSTEM" in
|
|
306 | + CLANG64)
|
|
307 | + boot_triple_to_fetch="x86_64-unknown-mingw32" # triple of bootstrap GHC
|
|
308 | + ;;
|
|
309 | + *)
|
|
310 | + fail "win32-init: Unknown MSYSTEM $MSYSTEM"
|
|
311 | + ;;
|
|
312 | + esac
|
|
313 | + ;;
|
|
314 | + Darwin)
|
|
315 | + boot_triple_to_fetch="x86_64-apple-darwin"
|
|
316 | + ;;
|
|
317 | + FreeBSD)
|
|
318 | + boot_triple_to_fetch="x86_64-portbld-freebsd"
|
|
319 | + ;;
|
|
320 | + Linux)
|
|
321 | + ;;
|
|
322 | + *) fail "uname $(uname) is not supported by ghc boot fetch" ;;
|
|
323 | + esac
|
|
324 | + readonly boot_triple_to_fetch
|
|
325 | + |
|
326 | + local -r v="$GHC_VERSION"
|
|
278 | 327 | if [[ -z "$v" ]]; then
|
279 | 328 | fail "neither GHC nor GHC_VERSION are not set"
|
280 | 329 | fi
|
281 | 330 | |
282 | 331 | start_section "fetch GHC"
|
283 | - url="https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-${boot_triple}.tar.xz"
|
|
332 | + url="https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-${boot_triple_to_fetch}.tar.xz"
|
|
284 | 333 | info "Fetching GHC binary distribution from $url..."
|
285 | 334 | curl "$url" > ghc.tar.xz || fail "failed to fetch GHC binary distribution"
|
286 | 335 | $TAR -xJf ghc.tar.xz || fail "failed to extract GHC binary distribution"
|
... | ... | @@ -297,8 +346,6 @@ function fetch_ghc() { |
297 | 346 | esac
|
298 | 347 | rm -Rf "ghc-${GHC_VERSION}" ghc.tar.xz
|
299 | 348 | end_section "fetch GHC"
|
300 | - fi
|
|
301 | - |
|
302 | 349 | }
|
303 | 350 | |
304 | 351 | function fetch_cabal() {
|
... | ... | @@ -349,7 +396,10 @@ function fetch_cabal() { |
349 | 396 | # here. For Docker platforms this is done in the Docker image
|
350 | 397 | # build.
|
351 | 398 | function setup_toolchain() {
|
399 | + if [ ! -e "$GHC" ]; then
|
|
352 | 400 | fetch_ghc
|
401 | + fi
|
|
402 | + |
|
353 | 403 | fetch_cabal
|
354 | 404 | cabal_update
|
355 | 405 | |
... | ... | @@ -405,6 +455,17 @@ function configure() { |
405 | 455 | if [[ -n "${target_triple:-}" ]]; then
|
406 | 456 | args+=("--target=$target_triple")
|
407 | 457 | fi
|
458 | + if [[ "${TOOLCHAIN_SOURCE:-}" =~ "extracted" ]]; then
|
|
459 | + # To extract something need download something first.
|
|
460 | + args+=("--enable-tarballs-autodownload")
|
|
461 | + else
|
|
462 | + # For Windows we should explicitly --enable-distro-toolchain
|
|
463 | + # if i.e. we decided to use TOOLCHAIN_SOURCE = env
|
|
464 | + case "$(uname)" in
|
|
465 | + MSYS_*|MINGW*) args+=("--enable-distro-toolchain") ;;
|
|
466 | + *) ;;
|
|
467 | + esac
|
|
468 | + fi
|
|
408 | 469 | if [[ -n "${ENABLE_NUMA:-}" ]]; then
|
409 | 470 | args+=("--enable-numa")
|
410 | 471 | else
|
... | ... | @@ -421,7 +482,6 @@ function configure() { |
421 | 482 | # See https://stackoverflow.com/questions/7577052 for a rationale for the
|
422 | 483 | # args[@] symbol-soup below.
|
423 | 484 | run ${CONFIGURE_WRAPPER:-} ./configure \
|
424 | - --enable-tarballs-autodownload \
|
|
425 | 485 | "${args[@]+"${args[@]}"}" \
|
426 | 486 | GHC="$GHC" \
|
427 | 487 | || ( cat config.log; fail "configure failed" )
|
... | ... | @@ -562,12 +622,35 @@ function install_bindist() { |
562 | 622 | read -r -a args <<< "${INSTALL_CONFIGURE_ARGS:-}"
|
563 | 623 | |
564 | 624 | if [[ "${CROSS_TARGET:-no_cross_target}" =~ "mingw" ]]; then
|
565 | - # We suppose that host target = build target.
|
|
625 | + # We assume that BUILD=HOST.
|
|
566 | 626 | # By the fact above it is clearly turning out which host value is
|
567 | 627 | # for currently built compiler.
|
568 | 628 | # The fix for #21970 will probably remove this if-branch.
|
569 | - local -r CROSS_HOST_GUESS=$($SHELL ./config.guess)
|
|
570 | - args+=( "--target=$CROSS_TARGET" "--host=$CROSS_HOST_GUESS" )
|
|
629 | + # Modifications are needed due of reasons like See Note [Wide Triple Windows].
|
|
630 | + |
|
631 | + local -r cross_host_triple_guess_origin=$($SHELL ./config.guess)
|
|
632 | + |
|
633 | + # We expect here to have (x86_64|aarch64)
|
|
634 | + local -r cross_host_triple_guess_arch=$(echo "${cross_host_triple_guess_origin}" | cut -d'-' -f1)
|
|
635 | + |
|
636 | + # Expect to have (apple|unknown)
|
|
637 | + local -r cross_host_triple_guess_vendor=$(echo "${cross_host_triple_guess_origin}" \
|
|
638 | + `# "pc" should be converted to unknown for all supported platforms by GHC` \
|
|
639 | + | sed -e "s/-pc-/-unknown-/" | cut -d'-' -f2)
|
|
640 | + |
|
641 | + # 3,4 because it might contain a dash, expect to have (linux-gnu|mingw32|darwin)
|
|
642 | + local -r cross_host_triple_guess_os=$(echo "${cross_host_triple_guess_origin}" | cut -d'-' -f3,4 \
|
|
643 | + `# GHC treats mingw64 as mingw32, so, we need hide this difference` \
|
|
644 | + | sed -e "s/mingw.*/mingw32/" \
|
|
645 | + `# config.guess may return triple with a release number, i.e. for darwin: aarch64-apple-darwin24.4.0` \
|
|
646 | + | sed -e "s/darwin.*/darwin/" \
|
|
647 | + | sed -e "s/freebsd.*/freebsd/" \
|
|
648 | + )
|
|
649 | + |
|
650 | + local -r cross_host_triple_guess="$cross_host_triple_guess_arch-$cross_host_triple_guess_vendor-$cross_host_triple_guess_os"
|
|
651 | + echo "Convert guessed triple ${cross_host_triple_guess_origin} to GHC-compatible: ${cross_host_triple_guess}"
|
|
652 | + |
|
653 | + args+=( "--target=$CROSS_TARGET" "--host=$cross_host_triple_guess" )
|
|
571 | 654 | |
572 | 655 | # FIXME: The bindist configure script shouldn't need to be reminded of
|
573 | 656 | # the target platform. See #21970.
|
... | ... | @@ -587,7 +670,7 @@ function install_bindist() { |
587 | 670 | }
|
588 | 671 | |
589 | 672 | function test_hadrian() {
|
590 | - check_msys2_deps _build/stage1/bin/ghc --version
|
|
673 | + check_msys2_deps "_build/stage1/bin/${cross_prefix}ghc$exe" --version
|
|
591 | 674 | check_release_build
|
592 | 675 | |
593 | 676 | # Ensure that statically-linked builds are actually static
|
... | ... | @@ -946,10 +1029,12 @@ esac |
946 | 1029 | MAKE="make"
|
947 | 1030 | TAR="tar"
|
948 | 1031 | case "$(uname)" in
|
949 | - MSYS_*|MINGW*) mingw_init ;;
|
|
950 | - Darwin) boot_triple="x86_64-apple-darwin" ;;
|
|
1032 | + MSYS_*|MINGW*)
|
|
1033 | + mingw_init
|
|
1034 | + ;;
|
|
1035 | + Darwin)
|
|
1036 | + ;;
|
|
951 | 1037 | FreeBSD)
|
952 | - boot_triple="x86_64-portbld-freebsd"
|
|
953 | 1038 | MAKE="gmake"
|
954 | 1039 | TAR="gtar"
|
955 | 1040 | ;;
|
... | ... | @@ -110,9 +110,19 @@ data Opsys |
110 | 110 | | FreeBSD14
|
111 | 111 | | Windows deriving (Eq)
|
112 | 112 | |
113 | +data WineMode
|
|
114 | + = OnlyTest
|
|
115 | + -- ^ Wine will be used only to test binaries after cross-compile
|
|
116 | + -- which means we do cross-compile from Linux to Windows
|
|
117 | + | FullBuild
|
|
118 | + -- ^ Wine will be used for full process of compilation
|
|
119 | + -- which means compilation itself will be executed under Wine.
|
|
120 | + -- It makes possible to run compilation for Windows environment at Linux machines.
|
|
121 | + deriving (Eq)
|
|
122 | + |
|
113 | 123 | data LinuxDistro
|
114 | 124 | = Debian12
|
115 | - | Debian12Wine
|
|
125 | + | Debian12Wine WineMode
|
|
116 | 126 | | Debian12Riscv
|
117 | 127 | | Debian11
|
118 | 128 | | Debian11Js
|
... | ... | @@ -316,7 +326,7 @@ distroName Debian12 = "deb12" |
316 | 326 | distroName Debian11 = "deb11"
|
317 | 327 | distroName Debian11Js = "deb11-emsdk-closure"
|
318 | 328 | distroName Debian12Riscv = "deb12-riscv"
|
319 | -distroName Debian12Wine = "deb12-wine"
|
|
329 | +distroName (Debian12Wine _) = "deb12-wine"
|
|
320 | 330 | distroName Debian10 = "deb10"
|
321 | 331 | distroName Debian9 = "deb9"
|
322 | 332 | distroName Fedora33 = "fedora33"
|
... | ... | @@ -360,6 +370,7 @@ testEnv arch opsys bc = |
360 | 370 | , ["no_tntc" | not (tablesNextToCode bc) ]
|
361 | 371 | , ["cross_"++triple | Just triple <- pure $ crossTarget bc ]
|
362 | 372 | , [flavourString (mkJobFlavour bc)]
|
373 | + , if opsys == Linux (Debian12Wine FullBuild) then ["_wine_full_build"] else []
|
|
363 | 374 | ]
|
364 | 375 | |
365 | 376 | -- | The hadrian flavour string we are going to use for this build
|
... | ... | @@ -728,6 +739,7 @@ data ValidateRule |
728 | 739 | | I386Backend -- ^ Run this job when the "i386" label is set
|
729 | 740 | | WinArm64 -- ^ Run this job when the "aarch64" and "Windows" labels are set together without "LLVM backend"
|
730 | 741 | | WinArm64LLVM -- ^ Run this job when the "aarch64" and "Windows" labels are set together with "LLVM backend"
|
742 | + | WineArm64 -- ^ Run this job when the "aarch64" and "Wine" labels are set
|
|
731 | 743 | deriving (Show, Ord, Eq)
|
732 | 744 | |
733 | 745 | -- | Convert the state of the rule into a string that gitlab understand.
|
... | ... | @@ -781,6 +793,10 @@ validateRuleString WinArm64LLVM = and_all |
781 | 793 | , labelString "Windows"
|
782 | 794 | , validateRuleString LLVMBackend
|
783 | 795 | ]
|
796 | +validateRuleString WineArm64 = and_all
|
|
797 | + [ labelString "aarch64"
|
|
798 | + , labelString "Wine"
|
|
799 | + ]
|
|
784 | 800 | |
785 | 801 | ---------------------------------------------------------------------
|
786 | 802 | -- The Job type
|
... | ... | @@ -847,6 +863,19 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
847 | 863 | , "bash .gitlab/ci.sh build_hadrian"
|
848 | 864 | , "bash .gitlab/ci.sh test_hadrian"
|
849 | 865 | ]
|
866 | + | Linux (Debian12Wine FullBuild) <- opsys
|
|
867 | + = [ "sudo chown ghc:ghc -R ."
|
|
868 | + , "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh setup"
|
|
869 | + , "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh configure"
|
|
870 | + -- We have to trigger cabal build in an independent way to mitigate Wine hangs at MSYS2/Arm64EC
|
|
871 | + , "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l -c './hadrian/build-cabal clean'"
|
|
872 | + -- We use "--enable-distro-toolchain" due of TOOLCHAIN_SOURCE="env", so we have to manually copy
|
|
873 | + -- bootstrap's compiler mingw into `_build` because binary-dist-dir requires it at Windows.
|
|
874 | + -- After './hadrian/build-cabal clean' we have to recreate the build root directory.
|
|
875 | + , "mkdir ./_build && cp -r ~/.wine/drive_c/msys64/opt/ghc-bootstrap/mingw ./_build/"
|
|
876 | + , "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh build_hadrian"
|
|
877 | + , "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh test_hadrian"
|
|
878 | + ]
|
|
850 | 879 | | otherwise
|
851 | 880 | = [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++
|
852 | 881 | [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++
|
... | ... | @@ -897,6 +926,10 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
897 | 926 | ]
|
898 | 927 | in "RUNTEST_ARGS" =: unwords runtestArgs
|
899 | 928 | , if testsuiteUsePerf buildConfig then "RUNTEST_ARGS" =: "--config perf_path=perf" else mempty
|
929 | + -- TODO: move me to an appropriate way
|
|
930 | + , if crossTarget buildConfig == Just "aarch64-unknown-mingw32" && opsys == Linux (Debian12Wine FullBuild)
|
|
931 | + then "CONFIGURE_ARGS" =: "--build=x86_64-unknown-mingw32 --host=x86_64-unknown-mingw32"
|
|
932 | + else mempty
|
|
900 | 933 | ]
|
901 | 934 | |
902 | 935 | jobArtifacts = Artifacts
|
... | ... | @@ -1277,47 +1310,76 @@ cross_jobs = [ |
1277 | 1310 | -- Linux Aarch64 (Wine + FEX + MSYS64) => Windows Aarch64
|
1278 | 1311 | , makeWinArmJobs
|
1279 | 1312 | $ addValidateRule WinArm64
|
1280 | - (validateBuilds AArch64 (Linux Debian12Wine) winAarch64Config)
|
|
1313 | + (validateBuilds AArch64 (Linux (Debian12Wine OnlyTest)) winAarch64Config)
|
|
1281 | 1314 | , makeWinArmJobs
|
1282 | 1315 | $ addValidateRule WinArm64LLVM
|
1283 | - (validateBuilds AArch64 (Linux Debian12Wine) (winAarch64Config {llvmBootstrap = True}))
|
|
1316 | + (validateBuilds AArch64 (Linux (Debian12Wine OnlyTest)) (winAarch64Config {llvmBootstrap = True}))
|
|
1317 | + , makeWineArmJobs
|
|
1318 | + $ addValidateRule WineArm64
|
|
1319 | + (validateBuilds AArch64 (Linux (Debian12Wine FullBuild)) wineAarch64Config)
|
|
1284 | 1320 | ]
|
1285 | 1321 | where
|
1286 | 1322 | javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure"))
|
1287 | 1323 | { bignumBackend = Native }
|
1288 | 1324 | |
1289 | - makeWinArmJobs = modifyJobs
|
|
1290 | - ( -- Cross compiler validate does not need any docs
|
|
1291 | - setVariable "HADRIAN_ARGS" "--docs=none"
|
|
1292 | - . setVariable "AR" (llvm_prefix ++ "llvm-ar")
|
|
1293 | - . setVariable "CC" (llvm_prefix ++ "clang")
|
|
1294 | - . setVariable "CXX" (llvm_prefix ++ "clang++")
|
|
1295 | - . setVariable "NM" (llvm_prefix ++ "nm")
|
|
1296 | - . setVariable "OBJCOPY" (llvm_prefix ++ "objcopy")
|
|
1297 | - . setVariable "OBJDUMP" (llvm_prefix ++ "objdump")
|
|
1298 | - . setVariable "RANLIB" (llvm_prefix ++ "llvm-ranlib")
|
|
1299 | - . setVariable "SIZE" (llvm_prefix ++ "size")
|
|
1300 | - . setVariable "STRINGS" (llvm_prefix ++ "strings")
|
|
1301 | - . setVariable "STRIP" (llvm_prefix ++ "strip")
|
|
1302 | - . setVariable "WindresCmd" (llvm_prefix ++ "windres")
|
|
1303 | - . setVariable "LLVMAS" (llvm_prefix ++ "clang")
|
|
1304 | - . setVariable "LD" (llvm_prefix ++ "ld")
|
|
1305 | - -- Windows target require to make linker merge feature check disabled.
|
|
1306 | - . setVariable "MergeObjsCmd" ""
|
|
1307 | - -- LLVM MinGW Linux Toolchain expects to recieve "aarch64-w64-mingw32"
|
|
1308 | - -- as a triple but we use more common "aarch64-unknown-mingw32".
|
|
1309 | - -- Due of this we need configure ld manually for clang beacause
|
|
1310 | - -- it will use system's ld otherwise when --target will be specified to
|
|
1311 | - -- unexpected triple.
|
|
1312 | - . setVariable "CFLAGS" cflags
|
|
1313 | - . setVariable "CONF_CC_OPTS_STAGE2" cflags
|
|
1314 | - ) where
|
|
1315 | - llvm_prefix = "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-"
|
|
1316 | - cflags = "-fuse-ld=" ++ llvm_prefix ++ "ld --rtlib=compiler-rt"
|
|
1325 | + addWindowsCrossArmVars llvm_prefix exe_suffix cflags = modifyJobs
|
|
1326 | + ( -- Cross compiler validate does not need any docs
|
|
1327 | + setVariable "HADRIAN_ARGS" "--docs=none"
|
|
1328 | + . setVariable "AR" (llvm_prefix ++ "llvm-ar" ++ exe_suffix)
|
|
1329 | + . setVariable "CC" (llvm_prefix ++ "clang")
|
|
1330 | + . setVariable "CXX" (llvm_prefix ++ "clang++")
|
|
1331 | + . setVariable "NM" (llvm_prefix ++ "nm" ++ exe_suffix)
|
|
1332 | + . setVariable "OBJCOPY" (llvm_prefix ++ "objcopy")
|
|
1333 | + . setVariable "OBJDUMP" (llvm_prefix ++ "objdump")
|
|
1334 | + . setVariable "RANLIB" (llvm_prefix ++ "llvm-ranlib" ++ exe_suffix)
|
|
1335 | + . setVariable "SIZE" (llvm_prefix ++ "size")
|
|
1336 | + . setVariable "STRINGS" (llvm_prefix ++ "strings")
|
|
1337 | + . setVariable "STRIP" (llvm_prefix ++ "strip")
|
|
1338 | + . setVariable "WindresCmd" (llvm_prefix ++ "windres")
|
|
1339 | + . setVariable "LLVMAS" (llvm_prefix ++ "clang")
|
|
1340 | + . setVariable "LD" (llvm_prefix ++ "ld")
|
|
1341 | + -- See Note [Empty MergeObjsCmd]
|
|
1342 | + -- Windows target require to make linker merge feature check disabled.
|
|
1343 | + . setVariable "MergeObjsCmd" ""
|
|
1344 | + -- Note [Wide Triple Windows]
|
|
1345 | + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1346 | + -- LLVM MinGW Linux Toolchain expects to recieve "aarch64-w64-mingw32"
|
|
1347 | + -- as a triple but we use more common "aarch64-unknown-mingw32".
|
|
1348 | + -- Due of this we need configure ld manually for clang because
|
|
1349 | + -- it will use system's ld otherwise when --target will be specified to
|
|
1350 | + -- unexpected triple.
|
|
1351 | + . setVariable "CFLAGS" cflags
|
|
1352 | + . setVariable "CONF_CC_OPTS_STAGE2" cflags
|
|
1353 | + )
|
|
1354 | + |
|
1355 | + makeWinArmJobs =
|
|
1356 | + let
|
|
1357 | + llvm_prefix = "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-"
|
|
1358 | + -- See Note [Windows Toolchain Standard Library Options]
|
|
1359 | + cflags = "-fuse-ld=" ++ llvm_prefix ++ "ld --rtlib=compiler-rt"
|
|
1360 | + in addWindowsCrossArmVars llvm_prefix "" cflags
|
|
1317 | 1361 | |
1318 | 1362 | winAarch64Config = (crossConfig "aarch64-unknown-mingw32" (Emulator "/opt/wine-arm64ec-msys2-deb12/bin/wine") Nothing)
|
1319 | 1363 | { bignumBackend = Native }
|
1320 | 1364 | |
1365 | + wineAarch64Config = (crossConfig "aarch64-unknown-mingw32" NoEmulatorNeeded Nothing)
|
|
1366 | + { bignumBackend = Native }
|
|
1367 | + |
|
1368 | + makeWineArmJobs =
|
|
1369 | + let
|
|
1370 | + llvm_path = "C:/msys64/opt/ghc-bootstrap/mingw/bin"
|
|
1371 | + llvm_prefix = llvm_path ++ "/aarch64-w64-mingw32-"
|
|
1372 | + exe_suffix = ".exe"
|
|
1373 | + -- See Note [Windows Toolchain Standard Library Options]
|
|
1374 | + cflags = "-fuse-ld=" ++ llvm_path ++ "/ld.lld --rtlib=compiler-rt -D_UCRT"
|
|
1375 | + in modifyJobs
|
|
1376 | + ( setVariable "TOOLCHAIN_SOURCE" "env"
|
|
1377 | + . setVariable "DLLTOOL" (llvm_path ++ "/dlltool" ++ exe_suffix)
|
|
1378 | + . setVariable "CC_STAGE0" (llvm_path ++ "/x86_64-w64-mingw32-clang")
|
|
1379 | + . setVariable "CONF_CC_OPTS_STAGE0" ("--target=x86_64-unknown-mingw32 " ++ cflags)
|
|
1380 | + . setVariable "CONF_CC_OPTS_STAGE1" cflags
|
|
1381 | + ) . (addWindowsCrossArmVars llvm_prefix exe_suffix cflags)
|
|
1382 | + |
|
1321 | 1383 | make_wasm_jobs cfg =
|
1322 | 1384 | modifyJobs
|
1323 | 1385 | ( -- See Note [Testing wasm ghci browser mode]
|
... | ... | @@ -1377,6 +1439,7 @@ platform_mapping = Map.map go combined_result |
1377 | 1439 | , "x86_64-windows-validate"
|
1378 | 1440 | , "aarch64-linux-deb12-validate"
|
1379 | 1441 | , "aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate"
|
1442 | + , "aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build"
|
|
1380 | 1443 | , "nightly-x86_64-linux-alpine3_20-wasm-cross_wasm32-wasi-release+host_fully_static+text_simdutf"
|
1381 | 1444 | , "nightly-x86_64-linux-deb11-validate"
|
1382 | 1445 | , "nightly-x86_64-linux-deb12-validate"
|
... | ... | @@ -1385,6 +1448,7 @@ platform_mapping = Map.map go combined_result |
1385 | 1448 | , "nightly-aarch64-linux-deb10-validate"
|
1386 | 1449 | , "nightly-aarch64-linux-deb12-validate"
|
1387 | 1450 | , "nightly-aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate"
|
1451 | + , "nightly-aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build"
|
|
1388 | 1452 | , "nightly-x86_64-linux-alpine3_12-validate"
|
1389 | 1453 | , "nightly-x86_64-linux-deb10-validate"
|
1390 | 1454 | , "nightly-x86_64-linux-fedora33-release"
|
... | ... | @@ -477,6 +477,93 @@ |
477 | 477 | "WindresCmd": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-windres"
|
478 | 478 | }
|
479 | 479 | },
|
480 | + "aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build": {
|
|
481 | + "after_script": [
|
|
482 | + ".gitlab/ci.sh save_cache",
|
|
483 | + ".gitlab/ci.sh save_test_output",
|
|
484 | + ".gitlab/ci.sh clean",
|
|
485 | + "cat ci_timings"
|
|
486 | + ],
|
|
487 | + "allow_failure": false,
|
|
488 | + "artifacts": {
|
|
489 | + "expire_in": "2 weeks",
|
|
490 | + "paths": [
|
|
491 | + "ghc-aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build.tar.xz",
|
|
492 | + "junit.xml",
|
|
493 | + "unexpected-test-output.tar.gz"
|
|
494 | + ],
|
|
495 | + "reports": {
|
|
496 | + "junit": "junit.xml"
|
|
497 | + },
|
|
498 | + "when": "always"
|
|
499 | + },
|
|
500 | + "cache": {
|
|
501 | + "key": "aarch64-linux-deb12-wine-$CACHE_REV",
|
|
502 | + "paths": [
|
|
503 | + "cabal-cache",
|
|
504 | + "toolchain"
|
|
505 | + ]
|
|
506 | + },
|
|
507 | + "dependencies": [],
|
|
508 | + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12-wine:$DOCKER_REV",
|
|
509 | + "needs": [
|
|
510 | + {
|
|
511 | + "artifacts": false,
|
|
512 | + "job": "hadrian-ghc-in-ghci"
|
|
513 | + }
|
|
514 | + ],
|
|
515 | + "rules": [
|
|
516 | + {
|
|
517 | + "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\baarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build(\\s|$).*/)) || (($ONLY_JOBS == null) && ((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || (($CI_MERGE_REQUEST_LABELS =~ /.*aarch64.*/) && ($CI_MERGE_REQUEST_LABELS =~ /.*Wine.*/))))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)",
|
|
518 | + "when": "on_success"
|
|
519 | + }
|
|
520 | + ],
|
|
521 | + "script": [
|
|
522 | + "sudo chown ghc:ghc -R .",
|
|
523 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh setup",
|
|
524 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh configure",
|
|
525 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l -c './hadrian/build-cabal clean'",
|
|
526 | + "mkdir ./_build && cp -r ~/.wine/drive_c/msys64/opt/ghc-bootstrap/mingw ./_build/",
|
|
527 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh build_hadrian",
|
|
528 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh test_hadrian"
|
|
529 | + ],
|
|
530 | + "stage": "full-build",
|
|
531 | + "tags": [
|
|
532 | + "aarch64-linux"
|
|
533 | + ],
|
|
534 | + "variables": {
|
|
535 | + "AR": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-llvm-ar.exe",
|
|
536 | + "BIGNUM_BACKEND": "native",
|
|
537 | + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build",
|
|
538 | + "BUILD_FLAVOUR": "validate",
|
|
539 | + "CC": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-clang",
|
|
540 | + "CC_STAGE0": "C:/msys64/opt/ghc-bootstrap/mingw/bin/x86_64-w64-mingw32-clang",
|
|
541 | + "CFLAGS": "-fuse-ld=C:/msys64/opt/ghc-bootstrap/mingw/bin/ld.lld --rtlib=compiler-rt -D_UCRT",
|
|
542 | + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check --build=x86_64-unknown-mingw32 --host=x86_64-unknown-mingw32",
|
|
543 | + "CONF_CC_OPTS_STAGE0": "--target=x86_64-unknown-mingw32 -fuse-ld=C:/msys64/opt/ghc-bootstrap/mingw/bin/ld.lld --rtlib=compiler-rt -D_UCRT",
|
|
544 | + "CONF_CC_OPTS_STAGE1": "-fuse-ld=C:/msys64/opt/ghc-bootstrap/mingw/bin/ld.lld --rtlib=compiler-rt -D_UCRT",
|
|
545 | + "CONF_CC_OPTS_STAGE2": "-fuse-ld=C:/msys64/opt/ghc-bootstrap/mingw/bin/ld.lld --rtlib=compiler-rt -D_UCRT",
|
|
546 | + "CROSS_TARGET": "aarch64-unknown-mingw32",
|
|
547 | + "CXX": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-clang++",
|
|
548 | + "DLLTOOL": "C:/msys64/opt/ghc-bootstrap/mingw/bin/dlltool.exe",
|
|
549 | + "HADRIAN_ARGS": "--docs=none",
|
|
550 | + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
|
551 | + "LD": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-ld",
|
|
552 | + "LLVMAS": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-clang",
|
|
553 | + "MergeObjsCmd": "",
|
|
554 | + "NM": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-nm.exe",
|
|
555 | + "OBJCOPY": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-objcopy",
|
|
556 | + "OBJDUMP": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-objdump",
|
|
557 | + "RANLIB": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-llvm-ranlib.exe",
|
|
558 | + "RUNTEST_ARGS": "",
|
|
559 | + "SIZE": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-size",
|
|
560 | + "STRINGS": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-strings",
|
|
561 | + "STRIP": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-strip",
|
|
562 | + "TEST_ENV": "aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build",
|
|
563 | + "TOOLCHAIN_SOURCE": "env",
|
|
564 | + "WindresCmd": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-windres"
|
|
565 | + }
|
|
566 | + },
|
|
480 | 567 | "i386-linux-alpine3_20-validate": {
|
481 | 568 | "after_script": [
|
482 | 569 | ".gitlab/ci.sh save_cache",
|
... | ... | @@ -1148,6 +1235,94 @@ |
1148 | 1235 | "XZ_OPT": "-9"
|
1149 | 1236 | }
|
1150 | 1237 | },
|
1238 | + "nightly-aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build": {
|
|
1239 | + "after_script": [
|
|
1240 | + ".gitlab/ci.sh save_cache",
|
|
1241 | + ".gitlab/ci.sh save_test_output",
|
|
1242 | + ".gitlab/ci.sh clean",
|
|
1243 | + "cat ci_timings"
|
|
1244 | + ],
|
|
1245 | + "allow_failure": false,
|
|
1246 | + "artifacts": {
|
|
1247 | + "expire_in": "8 weeks",
|
|
1248 | + "paths": [
|
|
1249 | + "ghc-aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build.tar.xz",
|
|
1250 | + "junit.xml",
|
|
1251 | + "unexpected-test-output.tar.gz"
|
|
1252 | + ],
|
|
1253 | + "reports": {
|
|
1254 | + "junit": "junit.xml"
|
|
1255 | + },
|
|
1256 | + "when": "always"
|
|
1257 | + },
|
|
1258 | + "cache": {
|
|
1259 | + "key": "aarch64-linux-deb12-wine-$CACHE_REV",
|
|
1260 | + "paths": [
|
|
1261 | + "cabal-cache",
|
|
1262 | + "toolchain"
|
|
1263 | + ]
|
|
1264 | + },
|
|
1265 | + "dependencies": [],
|
|
1266 | + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12-wine:$DOCKER_REV",
|
|
1267 | + "needs": [
|
|
1268 | + {
|
|
1269 | + "artifacts": false,
|
|
1270 | + "job": "hadrian-ghc-in-ghci"
|
|
1271 | + }
|
|
1272 | + ],
|
|
1273 | + "rules": [
|
|
1274 | + {
|
|
1275 | + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)",
|
|
1276 | + "when": "on_success"
|
|
1277 | + }
|
|
1278 | + ],
|
|
1279 | + "script": [
|
|
1280 | + "sudo chown ghc:ghc -R .",
|
|
1281 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh setup",
|
|
1282 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh configure",
|
|
1283 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l -c './hadrian/build-cabal clean'",
|
|
1284 | + "mkdir ./_build && cp -r ~/.wine/drive_c/msys64/opt/ghc-bootstrap/mingw ./_build/",
|
|
1285 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh build_hadrian",
|
|
1286 | + "/opt/wine-arm64ec-msys2-deb12/bin/wine c:/msys64/usr/bin/bash.exe -l .gitlab/ci.sh test_hadrian"
|
|
1287 | + ],
|
|
1288 | + "stage": "full-build",
|
|
1289 | + "tags": [
|
|
1290 | + "aarch64-linux"
|
|
1291 | + ],
|
|
1292 | + "variables": {
|
|
1293 | + "AR": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-llvm-ar.exe",
|
|
1294 | + "BIGNUM_BACKEND": "native",
|
|
1295 | + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build",
|
|
1296 | + "BUILD_FLAVOUR": "validate",
|
|
1297 | + "CC": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-clang",
|
|
1298 | + "CC_STAGE0": "C:/msys64/opt/ghc-bootstrap/mingw/bin/x86_64-w64-mingw32-clang",
|
|
1299 | + "CFLAGS": "-fuse-ld=C:/msys64/opt/ghc-bootstrap/mingw/bin/ld.lld --rtlib=compiler-rt -D_UCRT",
|
|
1300 | + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check --build=x86_64-unknown-mingw32 --host=x86_64-unknown-mingw32",
|
|
1301 | + "CONF_CC_OPTS_STAGE0": "--target=x86_64-unknown-mingw32 -fuse-ld=C:/msys64/opt/ghc-bootstrap/mingw/bin/ld.lld --rtlib=compiler-rt -D_UCRT",
|
|
1302 | + "CONF_CC_OPTS_STAGE1": "-fuse-ld=C:/msys64/opt/ghc-bootstrap/mingw/bin/ld.lld --rtlib=compiler-rt -D_UCRT",
|
|
1303 | + "CONF_CC_OPTS_STAGE2": "-fuse-ld=C:/msys64/opt/ghc-bootstrap/mingw/bin/ld.lld --rtlib=compiler-rt -D_UCRT",
|
|
1304 | + "CROSS_TARGET": "aarch64-unknown-mingw32",
|
|
1305 | + "CXX": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-clang++",
|
|
1306 | + "DLLTOOL": "C:/msys64/opt/ghc-bootstrap/mingw/bin/dlltool.exe",
|
|
1307 | + "HADRIAN_ARGS": "--docs=none",
|
|
1308 | + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
|
1309 | + "LD": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-ld",
|
|
1310 | + "LLVMAS": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-clang",
|
|
1311 | + "MergeObjsCmd": "",
|
|
1312 | + "NM": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-nm.exe",
|
|
1313 | + "OBJCOPY": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-objcopy",
|
|
1314 | + "OBJDUMP": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-objdump",
|
|
1315 | + "RANLIB": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-llvm-ranlib.exe",
|
|
1316 | + "RUNTEST_ARGS": "",
|
|
1317 | + "SIZE": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-size",
|
|
1318 | + "STRINGS": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-strings",
|
|
1319 | + "STRIP": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-strip",
|
|
1320 | + "TEST_ENV": "aarch64-linux-deb12-wine-int_native-cross_aarch64-unknown-mingw32-validate-_wine_full_build",
|
|
1321 | + "TOOLCHAIN_SOURCE": "env",
|
|
1322 | + "WindresCmd": "C:/msys64/opt/ghc-bootstrap/mingw/bin/aarch64-w64-mingw32-windres",
|
|
1323 | + "XZ_OPT": "-9"
|
|
1324 | + }
|
|
1325 | + },
|
|
1151 | 1326 | "nightly-i386-linux-alpine3_20-validate": {
|
1152 | 1327 | "after_script": [
|
1153 | 1328 | ".gitlab/ci.sh save_cache",
|
... | ... | @@ -52,6 +52,8 @@ def autoreconf(): |
52 | 52 | # Run autoreconf on everything that needs it.
|
53 | 53 | processes = {}
|
54 | 54 | if os.name == 'nt':
|
55 | + # Note [ACLOCAL_PATH for Windows]
|
|
56 | + # ~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
55 | 57 | # Get the normalized ACLOCAL_PATH for Windows
|
56 | 58 | # This is necessary since on Windows this will be a Windows
|
57 | 59 | # path, which autoreconf doesn't know doesn't know how to handle.
|
... | ... | @@ -658,12 +658,13 @@ GHC_LLVM_TARGET_SET_VAR |
658 | 658 | AC_SUBST(LlvmTarget)
|
659 | 659 | |
660 | 660 | dnl ** See whether cc supports --target=<triple> and set
|
661 | -dnl CONF_CC_OPTS_STAGE[012] accordingly.
|
|
662 | -FP_CC_SUPPORTS_TARGET([$CC_STAGE0], [CONF_CC_OPTS_STAGE0], [CONF_CXX_OPTS_STAGE0])
|
|
661 | +dnl CONF_CC_OPTS_STAGE[12] accordingly.
|
|
663 | 662 | FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE1], [CONF_CXX_OPTS_STAGE1])
|
664 | 663 | FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE2], [CONF_CXX_OPTS_STAGE2])
|
665 | 664 | |
666 | -FP_PROG_CC_LINKER_TARGET([$CC_STAGE0], [CONF_CC_OPTS_STAGE0], [CONF_GCC_LINKER_OPTS_STAGE0])
|
|
665 | +# CONF_CC_OPTS_STAGE0 should be left as is because it is already configured
|
|
666 | +# by bootstrap compiler settings
|
|
667 | + |
|
667 | 668 | FP_PROG_CC_LINKER_TARGET([$CC], [CONF_CC_OPTS_STAGE1], [CONF_GCC_LINKER_OPTS_STAGE1])
|
668 | 669 | FP_PROG_CC_LINKER_TARGET([$CC], [CONF_CC_OPTS_STAGE2], [CONF_GCC_LINKER_OPTS_STAGE2])
|
669 | 670 |
... | ... | @@ -26,7 +26,7 @@ import Hadrian.Builder.Tar |
26 | 26 | import Hadrian.Oracles.Path
|
27 | 27 | import Hadrian.Oracles.TextFile
|
28 | 28 | import Hadrian.Utilities
|
29 | -import Oracles.Setting (bashPath, targetStage)
|
|
29 | +import Oracles.Setting (bashPath, targetStage, isWinHost)
|
|
30 | 30 | import System.Exit
|
31 | 31 | import System.IO (stderr)
|
32 | 32 | |
... | ... | @@ -327,8 +327,14 @@ instance H.Builder Builder where |
327 | 327 | Ar Unpack _ -> cmd' [Cwd output] [path] buildArgs buildOptions
|
328 | 328 | |
329 | 329 | Autoreconf dir -> do
|
330 | + isWin <- isWinHost
|
|
331 | + let aclocal_env =
|
|
332 | + -- It is generally assumed that you would use MinGW's compilers from within an MSYS shell.
|
|
333 | + -- See Note [ACLOCAL_PATH for Windows]
|
|
334 | + if isWin then [AddEnv "ACLOCAL_PATH" "/c/msys64/usr/share/aclocal/"]
|
|
335 | + else []
|
|
330 | 336 | bash <- bashPath
|
331 | - cmd' [Cwd dir] [bash, path] buildArgs buildOptions
|
|
337 | + cmd' (Cwd dir `cons` aclocal_env) [bash, path] buildArgs buildOptions
|
|
332 | 338 | |
333 | 339 | Configure dir -> do
|
334 | 340 | -- Inject /bin/bash into `libtool`, instead of /bin/sh,
|
... | ... | @@ -115,7 +115,12 @@ installTo relocatable prefix = do |
115 | 115 | targetPlatform <- setting TargetPlatformFull
|
116 | 116 | let ghcVersionPretty = "ghc-" ++ version ++ "-" ++ targetPlatform
|
117 | 117 | bindistFilesDir = root -/- "bindist" -/- ghcVersionPretty
|
118 | - runBuilder (Configure bindistFilesDir) ["--prefix="++prefix] [] []
|
|
118 | + win <- isWinTarget
|
|
119 | + -- See Note [Empty MergeObjsCmd]
|
|
120 | + let disabledMerge =
|
|
121 | + if win then ["MergeObjsCmd="]
|
|
122 | + else []
|
|
123 | + runBuilder (Configure bindistFilesDir) (["--prefix="++prefix] ++ disabledMerge) [] []
|
|
119 | 124 | let env = case relocatable of
|
120 | 125 | Relocatable -> [AddEnv "RelocatableBuild" "YES"]
|
121 | 126 | NotRelocatable -> []
|
... | ... | @@ -232,7 +237,7 @@ bindistRules = do |
232 | 237 | -- N.B. the ghc-pkg executable may be prefixed with a target triple
|
233 | 238 | -- (c.f. #20267).
|
234 | 239 | ghcPkgName <- programName (vanillaContext Stage1 ghcPkg)
|
235 | - cmd_ (bindistFilesDir -/- "bin" -/- ghcPkgName) ["recache"]
|
|
240 | + cmd_ (bindistFilesDir -/- "bin" -/- ghcPkgName <.> exe) ["recache"]
|
|
236 | 241 | |
237 | 242 | |
238 | 243 |
... | ... | @@ -861,7 +861,9 @@ expirationTime mgr us = do |
861 | 861 | -- The 'TimeoutCallback' will not be called more than once.
|
862 | 862 | --
|
863 | 863 | -- Be careful not to exceed @maxBound :: Int@, which on 32-bit machines is only
|
864 | --- 2147483647 μs, less than 36 minutes.
|
|
864 | +-- 2147483647 microseconds, less than 36 minutes.
|
|
865 | +-- We can not use here utf/greek symbol due of:
|
|
866 | +-- _build/stage1/libraries/ghc-internal/build/GHC/Internal/Event/Windows.hs: commitBuffer: invalid argument (cannot encode character '\206')
|
|
865 | 867 | --
|
866 | 868 | {-# NOINLINE registerTimeout #-}
|
867 | 869 | registerTimeout :: Manager -> Int -> TimeoutCallback -> IO TimeoutKey
|
... | ... | @@ -878,7 +880,9 @@ registerTimeout mgr@Manager{..} uSrelTime cb = do |
878 | 880 | -- This has no effect if the timeout has already fired.
|
879 | 881 | --
|
880 | 882 | -- Be careful not to exceed @maxBound :: Int@, which on 32-bit machines is only
|
881 | --- 2147483647 μs, less than 36 minutes.
|
|
883 | +-- 2147483647 microseconds, less than 36 minutes.
|
|
884 | +-- We can not use here utf/greek symbol due of:
|
|
885 | +-- _build/stage1/libraries/ghc-internal/build/GHC/Internal/Event/Windows.hs: commitBuffer: invalid argument (cannot encode character '\206')
|
|
882 | 886 | --
|
883 | 887 | updateTimeout :: Manager -> TimeoutKey -> Seconds -> IO ()
|
884 | 888 | updateTimeout mgr (TK key) relTime = do
|
... | ... | @@ -980,7 +984,7 @@ step maxDelay mgr@Manager{..} = do |
980 | 984 | -- There are some unusual edge cases you need to deal with. The
|
981 | 985 | -- GetQueuedCompletionStatus function blocks a thread until there's
|
982 | 986 | -- work for it to do. Based on the return value, the number of bytes
|
983 | - -- and the overlapped structure, there’s a lot of possible "reasons"
|
|
987 | + -- and the overlapped structure, there's a lot of possible "reasons"
|
|
984 | 988 | -- for the function to have returned. Deciphering all the possible
|
985 | 989 | -- cases:
|
986 | 990 | --
|
... | ... | @@ -33,6 +33,8 @@ AC_DEFUN([FIND_MERGE_OBJECTS],[ |
33 | 33 | fi
|
34 | 34 | |
35 | 35 | |
36 | + # Note [Empty MergeObjsCmd]
|
|
37 | + # ~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
36 | 38 | # If MergeObjsCmd="" then we assume that the user is explicitly telling us that
|
37 | 39 | # they do not want to configure the MergeObjsCmd, this is particularly important for
|
38 | 40 | # the bundled windows toolchain.
|
... | ... | @@ -85,6 +85,8 @@ AC_DEFUN([FP_SETUP_WINDOWS_TOOLCHAIN],[ |
85 | 85 | mingw_prefix="$1"
|
86 | 86 | mingw_install_prefix="$2"
|
87 | 87 | |
88 | + # Note [Windows Toolchain Standard Library Options]
|
|
89 | + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
88 | 90 | # Our Windows toolchain is based around Clang and LLD. We use compiler-rt
|
89 | 91 | # for the runtime, libc++ and libc++abi for the C++ standard library
|
90 | 92 | # implementation, and libunwind for C++ unwinding.
|