diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-08-16 12:31:40 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-08-18 18:37:57 -0400 |
commit | 989b844d7598fd71ffd76e00d8d1f5207d58fd61 (patch) | |
tree | 23883de9c049daf5bc32a95131d291c3309e96c6 | |
parent | 714c936fa31d83cb46b52d1dd920081474793a71 (diff) | |
download | haskell-989b844d7598fd71ffd76e00d8d1f5207d58fd61.tar.gz |
compiler: Drop --build-id=none hack
Since 2011 the object-joining implementation has had a hack to pass
`--build-id=none` to `ld` when supported, seemingly to work around a
linker bug. This hack is now unnecessary and may break downstream users
who expect objects to have valid build-ids. Remove it.
Closes #22060.
-rw-r--r-- | compiler/GHC/Driver/Pipeline/Execute.hs | 9 | ||||
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 1 | ||||
-rw-r--r-- | compiler/GHC/Settings.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Settings/IO.hs | 2 | ||||
-rw-r--r-- | hadrian/bindist/Makefile | 1 | ||||
-rw-r--r-- | hadrian/cfg/system.config.in | 1 | ||||
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 1 | ||||
-rw-r--r-- | m4/fp_prog_ld_build_id.m4 | 20 | ||||
-rw-r--r-- | mk/config.mk.in | 4 | ||||
-rw-r--r-- | rts/include/ghc.mk | 1 |
10 files changed, 1 insertions, 43 deletions
diff --git a/compiler/GHC/Driver/Pipeline/Execute.hs b/compiler/GHC/Driver/Pipeline/Execute.hs index b9da8f374c..08df732873 100644 --- a/compiler/GHC/Driver/Pipeline/Execute.hs +++ b/compiler/GHC/Driver/Pipeline/Execute.hs @@ -1184,17 +1184,10 @@ joinObjectFiles hsc_env o_files output_fn let toolSettings' = toolSettings dflags ldIsGnuLd = toolSettings_ldIsGnuLd toolSettings' ld_r args = GHC.SysTools.runMergeObjects (hsc_logger hsc_env) (hsc_tmpfs hsc_env) (hsc_dflags hsc_env) ( - map GHC.SysTools.Option ld_build_id - ++ [ GHC.SysTools.Option "-o", + [ GHC.SysTools.Option "-o", GHC.SysTools.FileOption "" output_fn ] ++ args) - -- suppress the generation of the .note.gnu.build-id section, - -- which we don't need and sometimes causes ld to emit a - -- warning: - ld_build_id | toolSettings_ldSupportsBuildId toolSettings' = ["--build-id=none"] - | otherwise = [] - if ldIsGnuLd then do script <- newTempName logger tmpfs (tmpDir dflags) TFL_CurrentModule "ldscript" diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 887cfa10f0..c8dd400c23 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -81,7 +81,6 @@ module GHC.Driver.Session ( sTopDir, sGlobalPackageDatabasePath, sLdSupportsCompactUnwind, - sLdSupportsBuildId, sLdSupportsFilelist, sLdIsGnuLd, sGccSupportsNoPie, diff --git a/compiler/GHC/Settings.hs b/compiler/GHC/Settings.hs index 5f1d97b01d..4f6e93b0dc 100644 --- a/compiler/GHC/Settings.hs +++ b/compiler/GHC/Settings.hs @@ -18,7 +18,6 @@ module GHC.Settings , sTopDir , sGlobalPackageDatabasePath , sLdSupportsCompactUnwind - , sLdSupportsBuildId , sLdSupportsFilelist , sLdIsGnuLd , sGccSupportsNoPie @@ -87,7 +86,6 @@ data Settings = Settings -- platform-specific and platform-agnostic. data ToolSettings = ToolSettings { toolSettings_ldSupportsCompactUnwind :: Bool - , toolSettings_ldSupportsBuildId :: Bool , toolSettings_ldSupportsFilelist :: Bool , toolSettings_ldIsGnuLd :: Bool , toolSettings_ccSupportsNoPie :: Bool @@ -189,8 +187,6 @@ sGlobalPackageDatabasePath = fileSettings_globalPackageDatabase . sFileSettings sLdSupportsCompactUnwind :: Settings -> Bool sLdSupportsCompactUnwind = toolSettings_ldSupportsCompactUnwind . sToolSettings -sLdSupportsBuildId :: Settings -> Bool -sLdSupportsBuildId = toolSettings_ldSupportsBuildId . sToolSettings sLdSupportsFilelist :: Settings -> Bool sLdSupportsFilelist = toolSettings_ldSupportsFilelist . sToolSettings sLdIsGnuLd :: Settings -> Bool diff --git a/compiler/GHC/Settings/IO.hs b/compiler/GHC/Settings/IO.hs index 136607df27..074b9a791c 100644 --- a/compiler/GHC/Settings/IO.hs +++ b/compiler/GHC/Settings/IO.hs @@ -94,7 +94,6 @@ initSettings top_dir = do cc_args = words cc_args_str ++ unreg_cc_args cxx_args = words cxx_args_str ldSupportsCompactUnwind <- getBooleanSetting "ld supports compact unwind" - ldSupportsBuildId <- getBooleanSetting "ld supports build-id" ldSupportsFilelist <- getBooleanSetting "ld supports filelist" ldIsGnuLd <- getBooleanSetting "ld is GNU ld" arSupportsDashL <- getBooleanSetting "ar supports -L" @@ -163,7 +162,6 @@ initSettings top_dir = do , sToolSettings = ToolSettings { toolSettings_ldSupportsCompactUnwind = ldSupportsCompactUnwind - , toolSettings_ldSupportsBuildId = ldSupportsBuildId , toolSettings_ldSupportsFilelist = ldSupportsFilelist , toolSettings_ldIsGnuLd = ldIsGnuLd , toolSettings_ccSupportsNoPie = gccSupportsNoPie diff --git a/hadrian/bindist/Makefile b/hadrian/bindist/Makefile index a62cdca797..33ec5ace3f 100644 --- a/hadrian/bindist/Makefile +++ b/hadrian/bindist/Makefile @@ -91,7 +91,6 @@ lib/settings : @echo ',("ld command", "$(SettingsLdCommand)")' >> $@ @echo ',("ld flags", "$(SettingsLdFlags)")' >> $@ @echo ',("ld supports compact unwind", "$(LdHasNoCompactUnwind)")' >> $@ - @echo ',("ld supports build-id", "$(LdHasBuildId)")' >> $@ @echo ',("ld supports filelist", "$(LdHasFilelist)")' >> $@ @echo ',("ld is GNU ld", "$(LdIsGNULd)")' >> $@ @echo ',("Merge objects command", "$(SettingsMergeObjectsCommand)")' >> $@ diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in index 385279a435..f3a4e3f438 100644 --- a/hadrian/cfg/system.config.in +++ b/hadrian/cfg/system.config.in @@ -136,7 +136,6 @@ conf-merge-objects-args-stage3 = @MergeObjsArgs@ gcc-extra-via-c-opts = @GccExtraViaCOpts@ ld-has-no-compact-unwind = @LdHasNoCompactUnwind@ -ld-has-build-id = @LdHasBuildId@ ld-has-filelist = @LdHasFilelist@ ld-is-gnu-ld = @LdIsGNULd@ ar-args = @ArArgs@ diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index 8fcb8e4e00..88fb6d903e 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -311,7 +311,6 @@ generateSettings = do , ("ld command", expr $ settingsFileSetting SettingsFileSetting_LdCommand) , ("ld flags", expr $ settingsFileSetting SettingsFileSetting_LdFlags) , ("ld supports compact unwind", expr $ lookupSystemConfig "ld-has-no-compact-unwind") - , ("ld supports build-id", expr $ lookupSystemConfig "ld-has-build-id") , ("ld supports filelist", expr $ lookupSystemConfig "ld-has-filelist") , ("ld is GNU ld", expr $ lookupSystemConfig "ld-is-gnu-ld") , ("Merge objects command", expr $ settingsFileSetting SettingsFileSetting_MergeObjectsCommand) diff --git a/m4/fp_prog_ld_build_id.m4 b/m4/fp_prog_ld_build_id.m4 deleted file mode 100644 index e0a9ddd7b7..0000000000 --- a/m4/fp_prog_ld_build_id.m4 +++ /dev/null @@ -1,20 +0,0 @@ -# FP_PROG_LD_BUILD_ID -# ------------ -# Sets the output variable LdHasBuildId to YES if ld supports -# --build-id, or NO otherwise. -AC_DEFUN([FP_PROG_LD_BUILD_ID], -[ -AC_CACHE_CHECK([whether ld understands --build-id], [fp_cv_ld_build_id], -[echo 'int foo() { return 0; }' > conftest.c -${CC-cc} -c conftest.c -if ${LdCmd} -r --build-id=none -o conftest2.o conftest.o > /dev/null 2>&1; then - fp_cv_ld_build_id=yes -else - fp_cv_ld_build_id=no -fi -rm -rf conftest*]) -FP_CAPITALIZE_YES_NO(["$fp_cv_ld_build_id"], [LdHasBuildId]) -AC_SUBST([LdHasBuildId]) -])# FP_PROG_LD_BUILD_ID - - diff --git a/mk/config.mk.in b/mk/config.mk.in index fdbaab58b9..6fc80d46ef 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -724,10 +724,6 @@ OPT = @OptCmd@ # overflowing command-line length limits. LdIsGNULd = @LdIsGNULd@ -# Set to YES if ld has the --build-id flag. Sometimes we need to -# disable it with --build-id=none. -LdHasBuildId = @LdHasBuildId@ - # Set to YES if ld has the --no_compact_unwind flag. See #5019 # and GHC.Driver.Pipeline. LdHasNoCompactUnwind = @LdHasNoCompactUnwind@ diff --git a/rts/include/ghc.mk b/rts/include/ghc.mk index 074af66078..d4a765ab8d 100644 --- a/rts/include/ghc.mk +++ b/rts/include/ghc.mk @@ -202,7 +202,6 @@ $(includes_SETTINGS) : rts/include/Makefile | $$(dir $$@)/. @echo ',("ld command", "$(SettingsLdCommand)")' >> $@ @echo ',("ld flags", "$(SettingsLdFlags)")' >> $@ @echo ',("ld supports compact unwind", "$(LdHasNoCompactUnwind)")' >> $@ - @echo ',("ld supports build-id", "$(LdHasBuildId)")' >> $@ @echo ',("ld supports filelist", "$(LdHasFilelist)")' >> $@ @echo ',("ld is GNU ld", "$(LdIsGNULd)")' >> $@ @echo ',("Merge objects command", "$(SettingsMergeObjectsCommand)")' >> $@ |