- Feb 06, 2025
-
-
Cheng Shao authored
This commit fixes an oversight of hadrian wrapper generation logic: when doing cross compilation, `wrapper` is called on executable names with cross prefix, therefore we must use `isSuffixOf` when matching to take the cross prefix into account. Also add missing cross prefix to ghci wrapper content and fix hsc2hs wrapper logic. (cherry picked from commit b57c2174cf8b4804d400c7db774565b2be4ff493)
-
Cheng Shao authored
This commit adds the host_fully_static flavour transformer to hadrian, which ensures stage0 is fully statically linked while still permitting stage1 libdir to contain shared libraries. This is intended to be used by the wasm backend to build portable linux bindists that contain wasm shared libraries. (cherry picked from commit b45080a3) (cherry picked from commit 91c0dbd4) (cherry picked from commit e077d581)
-
Cheng Shao authored
This commit disable the internal-interpreter flag of ghc library when cross compiling, only external interpreter works in such cases. (cherry picked from commit f232c872) (cherry picked from commit 4e7d0cee) (cherry picked from commit 624335b2)
-
Cheng Shao authored
This patch removes the ghciWithDebugger field from flavour config since it's actually not used anywhere. (cherry picked from commit c6e5fd3d) (cherry picked from commit 022d7565) (cherry picked from commit f8c17232)
-
Cheng Shao authored
This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. (cherry picked from commit 06277d56) (cherry picked from commit 0f9a8aaf) (cherry picked from commit 3c4f945a)
-
Cheng Shao authored
This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. (cherry picked from commit 1a32f828) (cherry picked from commit 097ea6e2) (cherry picked from commit 0dac58e1)
-
Cheng Shao authored
This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. (cherry picked from commit f9c1ae12) (cherry picked from commit 5f728fc4) (cherry picked from commit f45b02a8)
-
Cheng Shao authored
hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. (cherry picked from commit 1e5752f6) (cherry picked from commit 78150bfc) (cherry picked from commit 10a74dcd)
-
Cheng Shao authored
When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. (cherry picked from commit 0958937e) (cherry picked from commit 7d5a22c2) (cherry picked from commit 6de1c17d)
-
Cheng Shao authored
This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. (cherry picked from commit 71f28958) (cherry picked from commit 1e77ded1) (cherry picked from commit e5506d09)
-
Cheng Shao authored
This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. (cherry picked from commit 65b4b92f) (cherry picked from commit 92065500) (cherry picked from commit e3d00525)
-
Cheng Shao authored
Ever since the removal of the make build system, the in tree lndir hasn't been actually built, so this patch removes it. (cherry picked from commit d3a050d2) (cherry picked from commit 04860c24)
-
Cheng Shao authored
This commit passes -j to hadrian in the hadrian/hie-bios scripts. When the user starts HLS in a fresh clone that has just been configured, it takes quite a while for hie-bios to pick up the ghc flags and start actual indexing, due to the fact that the hadrian build step defaulted to -j1, so -j speeds things up and improve HLS user experience in GHC. Also add -j flag to .ghcid to speed up ghcid, and sets the Windows build root to .hie-bios which also works and unifies with other platforms, the previous build root _hie-bios was missing from .gitignore anyway. (cherry picked from commit c71bfdff) (cherry picked from commit 57d706ed)
-
Cheng Shao authored
This patch adds the req_ghc_with_threaded_rts predicate to the testsuite to assert the platform has threaded RTS, and mark some tests as req_ghc_with_threaded_rts. Also makes ghc_with_threaded_rts a config field instead of a global variable. (cherry picked from commit aa6afe8a)
-
Cheng Shao authored
(cherry picked from commit a580722e) (cherry picked from commit 4f317bfd) (cherry picked from commit d94d0176)
-
See #22630 and !9552 This commit: - splits req_smp into req_target_smp and req_ghc_smp - changes the testsuite driver to calculate req_ghc_smp - changes a handful of tests to use req_target_smp instead of req_smp - changes a handful of tests to use req_host_smp when needed The problem: - the problem this solves is the ambiguity surrounding req_smp - on master req_smp was used to express the constraint that the program being compiled supports smp _and_ that the host RTS (i.e., the RTS used to compile the program) supported smp. Normally that is fine, but in cross compilation this is not always the case as was discovered in #22630. The solution: - Differentiate the two constraints: - use req_target_smp to say the RTS the compiled program is linked with (and the platform) supports smp - use req_host_smp to say the RTS the host is linked with supports smp WIP: fix req_smp (target vs ghc) add flag to separate bootstrapper split req_smp -> req_target_smp and req_ghc_smp update tests smp flags cleanup and add some docstrings only set ghc_with_smp to bootstrapper on S1 or CC Only set ghc_with_smp to bootstrapperWithSMP of when testing stage 1 and cross compiling test the RTS in config/ghc not hadrian re-add ghc_with_smp fix and align req names fix T11760 to use req_host_smp test the rts directly, avoid python 3.5 limitation test the compiler in a try block align out of tree and in tree withSMP flags mark failing tests as host req smp testsuite: req_host_smp --> req_ghc_smp Fix ghc vs host, fix ghc_with_smp leftover (cherry picked from commit 06036d93)
-
Cheng Shao authored
(cherry picked from commit 1338b7a3)
-
Cheng Shao authored
This patch does a few things: - Always build 64-bit atomic ops in rts/ghc-prim, even on 32-bit platforms - Remove legacy "64bit" cabal flag of rts package - Fix hs_xchg64 function prototype for 32-bit platforms - Fix AtomicFetch test for wasm32 (cherry picked from commit 87095f6a)
-
(cherry picked from commit ee160d06)
-
(cherry picked from commit 8fde4ac8)
-
- Jan 27, 2025
-
-
When we are using ffi adjustors then we rely on `ffi.h` and `ffitarget.h` files during code generation when compiling stubs. Therefore we need to add this dependency to the build system (which this patch does). Reproducer, configure with `--enable-libffi-adjustors` and then build "_build/stage1/libraries/ghc-prim/build/GHC/Types.p_o". Observe that this fails before this patch and works afterwards. Fixes #24864 Co-authored-by:
Sylvain Henry <sylvain@haskus.fr> (cherry picked from commit 0167e472)
-
Luite Stegeman authored
it's not supported
-
This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. (cherry picked from commit 6399d52b)
-
Luite Stegeman authored
Earlier versions of `directory` are racy on Windows due to #24382. Also includes necessary Hadrian bootstrap plan bump. Fixes #24382. based on commit 9ad346ec
-
- Jan 16, 2025
-
-
Luite Stegeman authored
this allows us to update the filepath submodule
-
When constructing the GHC flags for a package Hadrian must take care to set `-this-package-name` in addition to `-this-unit-id`. This hasn't broken until now as we have not had any uses of qualified package imports. However, this will change with `filepath-1.5` and the corresponding `unix` bump, breaking `hadrian/multi-ghci`. (cherry picked from commit d7ee12ea)
-
- Jun 28, 2024
-
-
This patch fixes the no_dynamic_libs flavour transformer and make fully_static reuse it. Previously building with no_dynamic_libs fails since ghc program is still dynamic and transitively brings in dyn ways of rts which are produced by no rules. (cherry picked from commit 1bb24432)
-
- Jun 25, 2024
-
-
More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. (cherry picked from commit 3fff0977)
-
- Apr 15, 2024
-
-
Uses responseFile syntax. The issue arises when GHC is installed on windows into a location that has a space, for example the user name is 'Fake User'. The $topdir will also contain a space, consequentially. When we resolve the top dir in the string `-I$topdir/mingw/include`, then `words` will turn this single argument into `-I/C/Users/Fake` and `User/.../mingw/include` which trips up the flag argument parser of various tools such as gcc or clang. We avoid this by escaping the $topdir before replacing it in `initSettngs`. Additionally, we allow to escape spaces and quotation marks for arguments in `settings` file. Add regression test case to count the number of options after variable expansion and argument escaping took place. Additionally, we check that escaped spaces and double quotation marks are correctly parsed. (cherry picked from commit 31bf85ee)
-
- Apr 02, 2024
-
-
We must generate the hsc2hs wrapper at bindist installation time since it must contain `--lflag` and `--cflag` arguments which depend upon the installation path. The solution here is to substitute these variables in the configure script (see mk/hsc2hs.in). This is then copied over a dummy wrapper in the install rules. Fixes #24050. (cherry picked from commit efcbad2d) (cherry picked from commit 2eca9c7a)
-
This commit fixes incorrectly built genapply when cross compiling (#24347) by nuking all fragile CPP logic in it from the orbit. All target-specific info are now read from DerivedConstants.h at runtime, see added note for details. Also removes a legacy Makefile and adds haskell language server support for genapply. (cherry picked from commit dd4af0e5)
-
primops.txt contains Unicode characters: > LC_ALL=C ./genprimopcode --data-decl < ./primops.txt > genprimopcode: <stdin>: hGetContents: invalid argument (cannot decode byte sequence starting from 226) Hadrian must also avoid using readFile' to read primops.txt because it tries to decode the file with a locale-specific encoding. (cherry picked from commit 52c0fc69)
-
The compiler --info reports that wasm32 compilers have a NCG, so we should agree with that here. (cherry picked from commit 1b90735c)
-
- Dec 18, 2023
-
-
In XCode 15's linker, -single_module is the default and otherwise passing it as a flag results in a warning being raised: ld: warning: -single_module is obsolete This patch fixes this warning by, at configure time, determining whether the linker supports -single_module (which is likely false for all non-darwin linkers, and true for darwin linkers in previous versions of macOS), and using that information at runtime to decide to pass or not the flag in the invocation. Fixes #24168 (cherry picked from commit e6c803f7)
-
- Dec 15, 2023
-
-
Zubin authored
The filepath bump to 1.4.200.1 introduces a deprecation warning. See ghc/ghc#24240 https://github.com/haskell/filepath/pull/206 (cherry picked from commit 86f652dc)
-
- Dec 13, 2023
-
-
Hadrian passes the -DNOSMP flag to GHC when the target doesn't support SMP, but doesn't pass it to CC as well, leading to the following compilation error on mips64el: | Run Cc (FindCDependencies CDep) Stage1: rts/sm/NonMovingScav.c => _build/stage1/rts/build/c/sm/NonMovingScav.o.d Command line: /usr/bin/mips64el-linux-gnuabi64-gcc -E -MM -MG -MF _build/stage1/rts/build/c/hooks/FlagDefaults.thr_debug_p_o.d -MT _build/stage1/rts/build/c/hooks/FlagDefaults.o -Irts/include -I_build/stage1/rts/build -I_build/stage1/rts/build/include -Irts/include -x c rts/hooks/FlagDefaults.c -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Winline -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls -Wundef -fno-strict-aliasing -DTHREADED_RTS -DDEBUG -fomit-frame-pointer -O2 -g -Irts -I_build/stage1/rts/build -DDEBUG -fno-omit-frame-pointer -g3 -O0 ===> Command failed with error code: 1 In file included from rts/include/Stg.h:348, from rts/include/Rts.h:38, from rts/hooks/FlagDefaults.c:8: rts/include/stg/SMP.h:416:2: error: #error memory barriers unimplemented on this architecture 416 | #error memory barriers unimplemented on this architecture | ^~~~~ rts/include/stg/SMP.h:440:2: error: #error memory barriers unimplemented on this architecture 440 | #error memory barriers unimplemented on this architecture | ^~~~~ rts/include/stg/SMP.h:464:2: error: #error memory barriers unimplemented on this architecture 464 | #error memory barriers unimplemented on this architecture | ^~~~~ The old make system correctly passed this flag to both GHC and CC [1]. Fix this error by passing -DNOSMP to CC as well. [1] https://gitlab.haskell.org/ghc/ghc/-/blob/00920f176b0235d5bb52a8e054d89a664f8938fe/rts/ghc.mk#L407 Closes #24082 (cherry picked from commit 257c2807) (cherry picked from commit b2a03315f6336e2708ff54689f2241eb38198dd5)
-
This allows T24066 to fail when the bug is present. Otherwise the out-of-bound access isn't detected as it happens in ghc-bignum which wasn't compiled with the bounds check. (cherry picked from commit 72c7380c)
-
- Sep 19, 2023
- Sep 13, 2023
-
-
Previously the way-specific compilation flags (e.g. `-DDEBUG`, `-DTHREADED_RTS`) would not be passed to the CC invocations. This meant that C dependency files would not correctly reflect dependencies predicated on the way, resulting in the rather painful #23554. Closes #23554. (cherry picked from commit cca74dab)
-