Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
9e5e0234 by mangoiv at 2026-01-17T06:03:03-05:00
add a new issue template for getting verified
To reduce spam created by new users, we will in future not grant
any rights but reporting issues to new users. That is why we will
have to be able to verify them. The added issue template serves that
purpose.
- - - - -
b18b2c42 by Cheng Shao at 2026-01-17T06:03:44-05:00
llvm: fix split sections for llvm backend
This patch fixes split sections for llvm backend:
- Pass missing `--data-sections`/`--function-sections` flags to
llc/opt.
- Use `@llvm.compiler.used` instead of `@llvm.used` to avoid sections
being unnecessarily retained at link-time.
Fixes #26770.
-------------------------
Metric Decrease:
libdir
size_hello_artifact
size_hello_unicode
-------------------------
Co-authored-by: Codex
- - - - -
bbe38277 by Cheng Shao at 2026-01-17T06:36:26-05:00
Update autoconf scripts
Scripts taken from autoconf a2287c3041a3f2a204eb942e09c015eab00dc7dd
- - - - -
04d7d21f by Andreas Klebinger at 2026-01-17T06:36:27-05:00
CString.hs: Update incorrect comment.
Fixes #26322
- - - - -
7 changed files:
- + .gitlab/issue_templates/get-verified.md
- compiler/GHC/CmmToLlvm.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- config.guess
- config.sub
- libraries/ghc-internal/src/GHC/Internal/CString.hs
Changes:
=====================================
.gitlab/issue_templates/get-verified.md
=====================================
@@ -0,0 +1,21 @@
+<!-- To reduce spam, new users have reduced privileges.
+ We would like it if you would contribute to the projects that are here,
+ so please use this template to request more privileges, such as project-creation and forking.
+-->
+
+I cannot create new projects or fork an existing one. I want to contribute to projects here, so please add me to the list of verified users.
+
+<!-- Summarize in one sentence why you are requesting access.
+ For example: "I want to contribute feature A to project B" or "I want to fix issue 1234 in project B" -->
+
+- [ ] I want to …
+
+
+Checklist <!-- Fill the square-brackets with an `x` if you agree with those points -->
+---
+
+- [ ] I understand that this GitLab instance is intended for projects immediately related to the Glasgow Haskell Compiler
+ and that personal / unrelated projects can and will be removed
+
+
+/label ~"Account verification"
=====================================
compiler/GHC/CmmToLlvm.hs
=====================================
@@ -271,15 +271,23 @@ cmmUsedLlvmGens = do
-- used if we didn't provide these hints. This will generate a
-- definition of the form
--
- -- @llvm.used = appending global [42 x i8*] [i8* bitcast <var> to i8*, ...]
+ -- @llvm.compiler.used = appending global [42 x i8*] [i8* bitcast <var> to i8*, ...]
--
-- Which is the LLVM way of protecting them against getting removed.
+ --
+ -- We used to emit @llvm.used, but it's too strong and results in
+ -- SHF_GNU_RETAIN section flag in the object, which prevents linker
+ -- gc-sections from working properly for LLVM backend (#26770).
+ -- @llvm.compiler.used serves a similar purpose that protects the
+ -- variable from being dropped by llc/opt, but it allows linker
+ -- gc-sections to work. See
+ -- https://llvm.org/docs/LangRef.html#the-llvm-compiler-used-global-variable
ivars <- getUsedVars
let cast x = LMBitc (LMStaticPointer (pVarLift x)) i8Ptr
ty = LMArray (length ivars) i8Ptr
usedArray = LMStaticArray (map cast ivars) ty
sectName = Just $ fsLit "llvm.metadata"
- lmUsedVar = LMGlobalVar (fsLit "llvm.used") ty Appending sectName Nothing Constant
+ lmUsedVar = LMGlobalVar (fsLit "llvm.compiler.used") ty Appending sectName Nothing Constant
lmUsed = LMGlobal lmUsedVar (Just usedArray)
if null ivars
then return ()
=====================================
compiler/GHC/CmmToLlvm/Base.hs
=====================================
@@ -286,7 +286,7 @@ data LlvmEnv = LlvmEnv
, envUniqMeta :: UniqFM Unique MetaId -- ^ Global metadata nodes
, envFunMap :: LlvmEnvMap -- ^ Global functions so far, with type
, envAliases :: UniqSet LMString -- ^ Globals that we had to alias, see [Llvm Forward References]
- , envUsedVars :: [LlvmVar] -- ^ Pointers to be added to llvm.used (see @cmmUsedLlvmGens@)
+ , envUsedVars :: [LlvmVar] -- ^ Pointers to be added to llvm.compiler.used (see @cmmUsedLlvmGens@)
-- the following get cleared for every function (see @withClearVars@)
, envVarMap :: LlvmEnvMap -- ^ Local variables so far, with type
=====================================
compiler/GHC/Driver/Pipeline/Execute.hs
=====================================
@@ -934,6 +934,14 @@ llvmOptions llvm_config llvm_version dflags =
[("-relocation-model=" ++ rmodel
,"-relocation-model=" ++ rmodel) | not (null rmodel)]
+ -- Both llc/opt need these flags for split sections
+ ++ [ ("--data-sections", "--data-sections")
+ | gopt Opt_SplitSections dflags
+ ]
+ ++ [ ("--function-sections", "--function-sections")
+ | gopt Opt_SplitSections dflags
+ ]
+
-- Additional llc flags
++ [("", "-mcpu=" ++ mcpu) | not (null mcpu)
, not (any (isInfixOf "-mcpu") (getOpts dflags opt_lc)) ]
=====================================
config.guess
=====================================
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2024 Free Software Foundation, Inc.
+# Copyright 1992-2025 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2024-01-01'
+timestamp='2025-07-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -60,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2024 Free Software Foundation, Inc.
+Copyright 1992-2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,7 +123,7 @@ set_cc_for_build() {
dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c"
- for driver in cc gcc c89 c99 ; do
+ for driver in cc gcc c17 c99 c89 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=$driver
break
@@ -634,7 +634,8 @@ EOF
sed 's/^ //' << EOF > "$dummy.c"
#include
- main()
+ int
+ main ()
{
if (!__power_pc())
exit(1);
@@ -718,7 +719,8 @@ EOF
#include
#include
- int main ()
+ int
+ main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
@@ -1595,8 +1597,11 @@ EOF
*:Unleashed:*:*)
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
;;
- *:Ironclad:*:*)
- GUESS=$UNAME_MACHINE-unknown-ironclad
+ x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*)
+ GUESS=$UNAME_MACHINE-pc-ironclad-mlibc
+ ;;
+ *:[Ii]ronclad:*:*)
+ GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc
;;
esac
@@ -1621,6 +1626,7 @@ cat > "$dummy.c" <."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2024 Free Software Foundation, Inc.
+Copyright 1992-2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -120,7 +120,6 @@ case $# in
esac
# Split fields of configuration type
-# shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <https://oldskool.silicium.org/stations/bull_dpx20.htm
+ # https://www.feb-patrimoine.com/english/bull_dpx2.htm
+ # https://www.feb-patrimoine.com/english/unix_and_bull.htm
+ dpx2 | dpx2[23]00 | dpx2[23]xx)
cpu=m68k
vendor=bull
- basic_os=sysv3
+ ;;
+ dpx2100 | dpx21xx)
+ cpu=i386
+ vendor=bull
+ ;;
+ dpx20)
+ cpu=rs6000
+ vendor=bull
;;
encore | umax | mmax)
cpu=ns32k
@@ -837,18 +901,6 @@ case $basic_machine in
next | m*-next)
cpu=m68k
vendor=next
- case $basic_os in
- openstep*)
- ;;
- nextstep*)
- ;;
- ns2*)
- basic_os=nextstep2
- ;;
- *)
- basic_os=nextstep3
- ;;
- esac
;;
np1)
cpu=np1
@@ -937,7 +989,6 @@ case $basic_machine in
;;
*-*)
- # shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read cpu vendor <&2
exit 1
;;
- kfreebsd*-gnu*- | kopensolaris*-gnu*-)
+ kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-)
;;
vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
;;
@@ -1864,8 +2253,12 @@ case $kernel-$os-$obj in
;;
os2-emx-)
;;
+ rtmk-nova-)
+ ;;
*-eabi*- | *-gnueabi*-)
;;
+ ios*-simulator- | tvos*-simulator- | watchos*-simulator- )
+ ;;
none--*)
# None (no kernel, i.e. freestanding / bare metal),
# can be paired with an machine code file format
@@ -1890,7 +2283,7 @@ case $vendor in
*-riscix*)
vendor=acorn
;;
- *-sunos*)
+ *-sunos* | *-solaris*)
vendor=sun
;;
*-cnk* | *-aix*)
@@ -1964,8 +2357,8 @@ echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
exit
# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-format: "%Y-%02m-%02d"
# time-stamp-end: "'"
# End:
=====================================
libraries/ghc-internal/src/GHC/Internal/CString.hs
=====================================
@@ -79,13 +79,12 @@ summarises the moving parts.
bindings, breaking out usual rule. See GHC.Core
Note [Core top-level string literals]
-* TODO: There is work on a special code-gen path for top-level boxed strings
+* There is a special code-gen path for top-level boxed strings
+
str :: [Char]
str = unpackCString# "foo"#
- so that they can all share a common code pointer
-
- There is a WIP MR on gitlab for this: !3012
+ It's document in Note [unpack_cstring closures].
-}
-----------------------------------------------------------------------------
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d72448bd90f6c646b3ec64a09ba4d63...
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d72448bd90f6c646b3ec64a09ba4d63...
You're receiving this email because of your account on gitlab.haskell.org.