Skip to content

Commit 3d76f99

Browse files
authored
section flags only for splitSections (#2085)
ghc/ghc@3ece985 added section flags unconditional for splitSections. This breaks for .text without suffix and has the assmebler complaining. ``` ghc_1.s:7849:0: error: Warning: Ignoring changed section attributes for .text | 7849 | .section .text,"xr" | ^ ```
1 parent 618341c commit 3d76f99

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

overlays/bootstrap.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ in {
249249
++ final.lib.optional (versionAtLeast "8.10" && versionLessThan "9.0" && final.stdenv.targetPlatform.isAarch64) ./patches/ghc/ghc-8.10-aarch64-handle-none-rela.patch
250250
++ final.lib.optional (versionAtLeast "9.0" && final.stdenv.targetPlatform.isAarch64) ./patches/ghc/ghc-9.0-better-symbol-addr-debug.patch
251251
++ final.lib.optional (versionAtLeast "9.0" && final.stdenv.targetPlatform.isAarch64) ./patches/ghc/ghc-9.0-aarch64-handle-none-rela.patch
252+
++ final.lib.optional (versionAtLeast "9.6.3" && final.stdenv.targetPlatform.isWindows) ./patches/ghc/ghc-9.6-hadrian-splitsections.patch
252253
;
253254
in ({
254255
ghc865 = final.callPackage ../compiler/ghc (traceWarnOld "8.6" {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/compiler/GHC/CmmToAsm/Ppr.hs b/compiler/GHC/CmmToAsm/Ppr.hs
2+
index 45b0545..967391d 100644
3+
--- a/compiler/GHC/CmmToAsm/Ppr.hs
4+
+++ b/compiler/GHC/CmmToAsm/Ppr.hs
5+
@@ -246,9 +246,10 @@ pprGNUSectionHeader config t suffix =
6+
panic "PprBase.pprGNUSectionHeader: unknown section type"
7+
flags = case t of
8+
Text
9+
- | OSMinGW32 <- platformOS platform
10+
+ | OSMinGW32 <- platformOS platform, splitSections
11+
-> text ",\"xr\""
12+
- | otherwise -> text ",\"ax\"," <> sectionType platform "progbits"
13+
+ | splitSections
14+
+ -> text ",\"ax\"," <> sectionType platform "progbits"
15+
CString
16+
| OSMinGW32 <- platformOS platform
17+
-> empty

0 commit comments

Comments
 (0)