Skip to content

Commit fbec784

Browse files
committed
add -no-pie to linking
1 parent 6bd87a8 commit fbec784

6 files changed

Lines changed: 4 additions & 161 deletions

File tree

Cabal/src/Distribution/Simple/GHC/Build/Link.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ linkOrLoadComponent
126126
++ [ "-static"
127127
| withFullyStaticExe lbi
128128
]
129+
++ ["no-pie"]
129130
-- Pass extra `ld-options` given
130131
-- through to GHC's linker.
131132
++ maybe

Cabal/src/Distribution/Simple/GHC/Internal.hs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -514,18 +514,6 @@ componentJsGhcOptions verbosity lbi bi clbi odir filename =
514514
, ghcOptExtra = hcOptions GHC bi
515515
}
516516

517-
-- Since the GHС is sensitive to what is given to it, we sometimes need to
518-
-- be able to pass options only to new versions
519-
-- We want to be able to support C++ and C separately in older ghc
520-
-- See example in buildExtraSources "C++ Sources" or "C Sources"
521-
separateGhcOptions :: Monoid a => Version -> Compiler -> a -> a
522-
separateGhcOptions ver comp defaultOptions =
523-
case compilerCompatVersion GHC comp of
524-
Just v
525-
| v >= ver -> defaultOptions
526-
| otherwise -> mempty
527-
Nothing -> mempty
528-
529517
componentGhcOptions
530518
:: VerbosityLevel
531519
-> LocalBuildInfo
@@ -599,11 +587,7 @@ componentGhcOptions verbosity lbi bi clbi odir =
599587
, -- Unsupported extensions have already been checked by configure
600588
ghcOptExtensions = toNubListR $ usedExtensions bi
601589
, ghcOptExtensionMap = Map.fromList . compilerExtensions $ (compiler lbi)
602-
, ghcOptCcProgram =
603-
separateGhcOptions
604-
(mkVersion [9, 4])
605-
(compiler lbi)
606-
(maybeToFlag $ programPath <$> lookupProgram gccProgram (withPrograms lbi))
590+
, ghcOptCcProgram = maybeToFlag $ programPath <$> lookupProgram gccProgram (withPrograms lbi)
607591
}
608592
where
609593
exe_paths =

cabal-testsuite/PackageTests/FFI/ForeignOptsPgmc/cabal.test.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Test.Cabal.Prelude
33
main = do
44
skipIfWindows "requires a POSIX shell script as the C compiler wrapper"
55
cabalTest $ do
6-
skipUnlessGhcVersion ">= 9.4"
6+
-- skipUnlessGhcVersion ">= 9.4"
77
cwd <- fmap testCurrentDir getTestEnv
88
let wrapper = cwd </> "scripts/cc-wrapper.sh"
99
cabal "v2-build" ["foreign-opts-pgmc-exe"]

cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single-2.out

Lines changed: 0 additions & 67 deletions
This file was deleted.

cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single-2.test.hs

Lines changed: 0 additions & 75 deletions
This file was deleted.

cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.test.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Test.Cabal.Prelude
66
main = cabalTest $ do
77
-- the With GHC-9.2+ output contains -this-unit-id
88
-- the With GHC-9.4+ output contains -pgmc by default
9-
skipUnlessGhcVersion ">= 9.4"
9+
skipUnlessGhcVersion ">= 9.2"
1010
withRepo "repo" $ do
1111
runShowBuildInfo ["exe:Complex"]
1212
>> withPlan

0 commit comments

Comments
 (0)