[Git][ghc/ghc][master] configure: Don't use ld.gold on i386

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat Jul 8 09:09:14 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
c7026962 by Ben Gamari at 2023-07-08T05:08:11-04:00
configure: Don't use ld.gold on i386

ld.gold appears to produce invalid static constructor tables on i386.
While ideally we would add an autoconf check to check for this
brokenness, sadly such a check isn't easy to compose. Instead to
summarily reject such linkers on i386.

Somewhat hackily closes #23579.

- - - - -


1 changed file:

- m4/find_ld.m4


Changes:

=====================================
m4/find_ld.m4
=====================================
@@ -21,10 +21,19 @@ AC_DEFUN([FIND_LD],[
             return
         fi
 
+        case $CPU in
+        i386)
+            # We refuse to use ld.gold on i386 due to #23579, which we don't
+            # have a good autoconf check for.
+            linkers="ld.lld ld" ;;
+        *)
+            linkers="ld.lld ld.gold ld" ;;
+        esac
+
         # Manually iterate over possible names since we want to ensure that, e.g.,
         # if ld.lld is installed but gcc doesn't support -fuse-ld=lld, that we
         # then still try ld.gold and -fuse-ld=gold.
-        for possible_ld in ld.lld ld.gold ld; do
+        for possible_ld in $linkers; do
             TmpLd="" # In case the user set LD
             AC_CHECK_TARGET_TOOL([TmpLd], [$possible_ld])
             if test "x$TmpLd" = "x"; then continue; fi



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c702696258f771d149d5fe5f8ea8b143d45d80e2

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c702696258f771d149d5fe5f8ea8b143d45d80e2
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230708/52191413/attachment-0001.html>


More information about the ghc-commits mailing list