Skip to content
Snippets Groups Projects
  1. Mar 26, 2025
    • Cheng Shao's avatar
      configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails · 184114cf
      Cheng Shao authored
      When configure fails to find LLC/OPT/LLVMAS within supported version
      range, it used to set "llc"/"opt"/"clang" as fallback values. This
      behavior is particularly troublesome when the user has llc/opt/clang
      with other versions in their PATH and run the testsuite, since hadrian
      will incorrectly assume have_llvm=True and pass that to the testsuite
      driver, resulting in annoying optllvm test failures (#23186). If
      configure determines llc/opt/clang wouldn't work, then we shouldn't
      pretend it'll work at all, and the bindist configure will invoke
      FIND_LLVM_PROG check again at install time anyway.
      
      (cherry picked from commit 4eb5ad09)
      184114cf
    • Cheng Shao's avatar
      autoconf: remove unused context diff check · d342299e
      Cheng Shao authored
      This patch removes redundant autoconf check for the context diff
      program given it isn't actually been used anywhere, especially since
      make removal.
      
      (cherry picked from commit b7bcf729)
      d342299e
  2. Mar 11, 2025
  3. Feb 05, 2025
  4. Dec 18, 2024
    • Arsen Arsenović's avatar
      Split out the C-- preprocessor, and make it pass -g0 · 5a8790db
      Arsen Arsenović authored and Andreas Klebinger's avatar Andreas Klebinger committed
      Previously, C-- was processed with the C preprocessor program.  This
      means that it inherited flags passed via -optc.  A flag that is somewhat
      often passed through -optc is -g.  At certain -g levels (>=2), GCC
      starts emitting defines *after* preprocessing, for the purposes of
      debug info generation.  This is not useful for the C-- compiler, and, in
      fact, causes lexer errors.  We can suppress this effect (safely, if
      supported) via -g0.
      
      As a workaround, in older versions of GCC (<=10), GCC only emitted
      defines if a certain set of -g*3 flags was passed.  Newer versions check
      the debug level.  For the former, we filter out those -g*3 flags and,
      for the latter, we specify -g0 on top of that.
      
      As a compatible and effective solution, this change adds a C--
      preprocessor distinct from the C compiler and preprocessor, but that
      keeps its flags.  The command line produced for C-- preprocessing now
      looks like:
      
        $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP
      
      Closes: #24474
      (cherry picked from commit 25b0b404)
      5a8790db
    • Serge S. Gulin's avatar
      JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) · 68da8237
      Serge S. Gulin authored and Andreas Klebinger's avatar Andreas Klebinger committed
      Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators.
      But now there are following compiler options: `-C` and `-CC`.
      You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC).
      It seems that `-CC` works better for javascript jsdoc than `-traditional`.
      At least it leaves `/* ... */` comments w/o changes.
      
      (cherry picked from commit 83eb10da)
      68da8237
  5. Mar 27, 2024
    • Rodrigo Mesquita's avatar
      configure: Use LDFLAGS when trying linkers · 10829530
      Rodrigo Mesquita authored and Ben Gamari's avatar Ben Gamari committed
      A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we
      will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to
      check for a working linker. If either of these fail, we try the next in
      line.
      
      However, we were not considering the `$LDFLAGS` when checking if these
      linkers worked. So we would pick a linker that does not support the
      current $LDFLAGS and fail further down the line when we used that linker
      with those flags.
      
      Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not
      supported by `ld.gold` but that was being picked still.
      
      (cherry picked from commit 32a8103f)
      10829530
  6. Mar 25, 2024
    • Zubin's avatar
      Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" · b09cbad8
      Zubin authored
      This reverts commit c82770f5.
      
      The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a
      no-op. `set` sets positional arguments for bash, but we want to set the variable
      given as the first autoconf argument.
      
      Fixes #24542
      
      Metric decreases because the paths in the settings file are now shorter,
      so we allocate less when we read the settings file.
      
      -------------------------
      Metric Decrease:
          T12425
          T13035
          T9198
      -------------------------
      
      (cherry picked from commit 576f8b7e)
      b09cbad8
  7. Feb 26, 2024
    • Felix Yan's avatar
      m4: Correctly detect GCC version · 61a78231
      Felix Yan authored and Marge Bot's avatar Marge Bot committed
      When calling as `cc`, GCC does not outputs lowercased "gcc" at least in 13.2.1 version here.
      
      ```
      $ cc --version
      cc (GCC) 13.2.1 20230801
      ...
      ```
      
      This fails the check and outputs the confusing message: `configure: $CC is not gcc; assuming it's a reasonably new C compiler`
      
      This patch makes it check for upper-cased "GCC" too so that it works correctly:
      
      ```
      checking version of gcc... 13.2.1
      ```
      61a78231
  8. Feb 21, 2024
  9. Feb 19, 2024
    • Ben Gamari's avatar
      Drop dependence on `touch` · 7a0293cc
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This drops GHC's dependence on the `touch` program, instead implementing
      it within GHC. This eliminates an external dependency and means that we
      have one fewer program to keep track of in the `configure` script
      7a0293cc
  10. Feb 08, 2024
    • Matthew Pickering's avatar
      Use specific clang assembler when compiling with -fllvm · ab533e71
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There are situations where LLVM will produce assembly which older gcc
      toolchains can't handle. For example on Deb10, it seems that LLVM >= 13
      produces assembly which the default gcc doesn't support.
      
      A more robust solution in the long term is to require a specific LLVM
      compatible assembler when using -fllvm.
      
      Fixes #16354
      ab533e71
  11. Feb 03, 2024
    • Rodrigo Mesquita's avatar
      Work around autotools setting C11 standard in CC/CXX · cdddeb0f
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      In autoconf >=2.70, C11 is set by default for $CC and $CXX via the
      -std=...11 flag. In this patch, we split the "-std" flag out of the $CC
      and $CXX variables, which we traditionally assume to be just the
      executable name/path, and move it to $CFLAGS/$CXXFLAGS instead.
      
      Fixes #24324
      cdddeb0f
  12. Jan 20, 2024
  13. Jan 04, 2024
  14. Dec 21, 2023
    • Matthew Pickering's avatar
      hadrian: Build all executables in bin/ folder · f7e21fab
      Matthew Pickering authored
      In the end the bindist creation logic copies them all into the bin
      folder. There is no benefit to building a specific few binaries in the
      lib/bin folder anymore.
      
      This also removes the ad-hoc logic to copy the touchy and unlit
      executables from stage0 into stage1. It takes <1s to build so we might
      as well just build it.
      f7e21fab
  15. Dec 13, 2023
    • Moritz Angermann's avatar
      Drop hard Xcode dependency · a3ee3b99
      Moritz Angermann authored and Marge Bot's avatar Marge Bot committed
      XCODE_VERSION calls out to `xcodebuild`, which is only available
      when having `Xcode` installed. The CommandLineTools are not
      sufficient. To install Xcode, you must have an apple id to download
      the Xcode.xip from apple.
      
      We do not use xcodebuild anywhere in our build explicilty. At best
      it appears to be a proxy for checking the linker or the compiler.
      These should rather be done with
      ```
      xcrun ld -version
      ```
      or similar, and not by proxy through Xcode. The CLR should be
      sufficient for building software on macOS.
      a3ee3b99
  16. Nov 15, 2023
    • Rodrigo Mesquita's avatar
      configure: check target (not build) understands -no_compact_unwind · af261ccd
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      Previously, we were branching on whether the build system was darwin to
      shortcut this check, but we really want to branch on whether the target
      system (which is what we are configuring ld_prog for) is darwin.
      af261ccd
    • Rodrigo Mesquita's avatar
      darwin: Fix single_module is obsolete warning · e6c803f7
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      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
      e6c803f7
    • Rodrigo Mesquita's avatar
      Suppress duplicate librares linker warning of new macOS linker · e98051a5
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      Fixes #24167
      
      XCode 15 introduced a new linker which warns on duplicate libraries being
      linked. To disable this warning, we pass -Wl,-no_warn_duplicate_libraries as
      suggested by Brad King in CMake issue #25297.
      
      This flag isn't necessarily available to other linkers on darwin, so we must
      only configure it into the CC linker arguments if valid.
      e98051a5
  17. Oct 31, 2023
  18. Oct 22, 2023
  19. Oct 12, 2023
    • John Ericson's avatar
      Split BFD support to RTS configure · f399812c
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      The flag is still in the top-level configure, but the other checks
      (which define various macros --- important) are in the RTS configure.
      f399812c
    • John Ericson's avatar
      Adjust `FP_FIND_LIBFFI` · ea7a1447
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      Just set vars, and `AC_SUBST` in top-level configure.
      
      Don't define `HAVE_SYSTEM_LIBFFI` because nothing is using it. It hasn't
      be in used since 36093407 (part of the
      make build system).
      ea7a1447
  20. Oct 11, 2023
  21. Oct 10, 2023
    • Ben Gamari's avatar
      configure: Probe stage0 link flags · c00a4bd6
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      For consistency with later stages and CC.
      c00a4bd6
    • Ben Gamari's avatar
      toolchain: Don't pass --target to emscripten toolchain · 0720fde7
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      As noted in `Note [Don't pass --target to emscripten toolchain]`,
      emscripten's `emcc` is rather inconsistent with respect to its treatment
      of the `--target` flag. Avoid this by special-casing this toolchain
      in the `configure` script and `ghc-toolchain`.
      
      Fixes on aspect of #23744.
      0720fde7
    • Matthew Pickering's avatar
      configure: Check whether -no-pie works when the C compiler is used as a linker · 1f0de49a
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      `-no-pie` is a flag we pass when using the C compiler as a linker (see
      pieCCLDOpts in GHC.Driver.Session) so we should test whether the C
      compiler used as a linker supports the flag, rather than just the C
      compiler.
      1f0de49a
    • Matthew Pickering's avatar
      configure: Error when ghc-toolchain fails to compile · 9b2dfd21
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This is a small QOL change as if you are working on ghc-toolchain and it
      fails to compile then configure will continue and can give you outdated
      results.
      9b2dfd21
    • Matthew Pickering's avatar
      Check for --target linker flag separately to C compiler · 89a0918d
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There are situations where the C compiler doesn't accept `--target` but
      when used as a linker it does (but doesn't do anything most likely)
      
      In particular with old gcc toolchains, the C compiler doesn't support
      --target but when used as a linker it does.
      89a0918d
    • Matthew Pickering's avatar
      configure: AC_PATH_TARGET_TOOL for LD · d8da73cd
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      We want to make sure that LD is set to an absolute path in order to be
      consistent with the `LD=$(command -v ld)` call. The AC_PATH_TARGET_TOOL
      macro uses the absolute path rather than AC_CHECK_TARGET_TOOL which
      might use a relative path.
      d8da73cd
    • Matthew Pickering's avatar
      Add same LD hack to ghc-toolchain · 1a5bc0b5
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      In the ./configure script, if you pass the `LD` variable then this has
      the effect of stopping use searching for a linker and hence passing
      `-fuse-ld=...`.
      
      We want to emulate this logic in ghc-toolchain, if a use explicilty
      specifies `LD` variable then don't add `-fuse-ld=..` with the goal of
      making ./configure and ghc-toolchain agree on which flags to use when
      using the C compiler as a linker.
      
      This is quite unsavoury as we don't bake the choice of LD into the
      configuration anywhere but what's important for now is making
      ghc-toolchain and ./configure agree as much as possible.
      
      See #23857 for more discussion
      1a5bc0b5
  22. Oct 04, 2023
    • Ben Gamari's avatar
      configure: Fix #21712 again · f6b2751f
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This is a bit of a shot in the dark to fix #24033, which appears to be
      another instance of #21712. For some reason the ld-override logic
      *still* appears to be active on Darwin targets (or at least one).
      Consequently, on misconfigured systems we may choose a non-`ld64`
      linker.
      
      It's a bit unclear exactly what happened in #24033 but ultimately the
      check added for #21712 was not quite right, checking for the
      `ghc_host_os` (the value of which depends upon the bootstrap compiler)
      instead of the target platform. Fix this.
      
      Fixes #24033.
      f6b2751f
  23. Sep 30, 2023
  24. Sep 23, 2023
  25. Sep 19, 2023
Loading