Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,323
Issues
4,323
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
372
Merge Requests
372
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
a6f9ebc5
Commit
a6f9ebc5
authored
Oct 19, 2011
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "have subsections via symbols" to the Platform type
parent
7ef5b293
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
55 deletions
+63
-55
aclocal.m4
aclocal.m4
+15
-0
compiler/cmm/CLabel.hs
compiler/cmm/CLabel.hs
+31
-30
compiler/main/SysTools.lhs
compiler/main/SysTools.lhs
+3
-1
compiler/nativeGen/PIC.hs
compiler/nativeGen/PIC.hs
+7
-7
compiler/utils/Platform.hs
compiler/utils/Platform.hs
+5
-3
configure.ac
configure.ac
+0
-13
settings.in
settings.in
+2
-1
No files found.
aclocal.m4
View file @
a6f9ebc5
...
...
@@ -225,6 +225,20 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
esac
}
dnl ** check for Apple-style dead-stripping support
dnl (.subsections-via-symbols assembler directive)
AC_MSG_CHECKING(for .subsections_via_symbols)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [__asm__ (".subsections_via_symbols");])],
[AC_MSG_RESULT(yes)
HaskellHaveSubsectionsViaSymbols=True
AC_DEFINE([HAVE_SUBSECTIONS_VIA_SYMBOLS],[1],
[Define to 1 if Apple-style dead-stripping is supported.])
],
[HaskellHaveSubsectionsViaSymbols=False
AC_MSG_RESULT(no)])
checkArch "$BuildArch" ""
checkVendor "$BuildVendor"
checkOS "$BuildOS" ""
...
...
@@ -239,6 +253,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
AC_SUBST(HaskellTargetArch)
AC_SUBST(HaskellTargetOs)
AC_SUBST(HaskellHaveSubsectionsViaSymbols)
])
...
...
compiler/cmm/CLabel.hs
View file @
a6f9ebc5
...
...
@@ -1103,37 +1103,38 @@ asmTempLabelPrefix platform =
pprDynamicLinkerAsmLabel
::
Platform
->
DynamicLinkerLabelInfo
->
CLabel
->
SDoc
pprDynamicLinkerAsmLabel
platform
dllInfo
lbl
=
if
platform
==
Platform
ArchX86_64
OSDarwin
then
case
dllInfo
of
CodeStub
->
char
'L'
<>
pprCLabel
platform
lbl
<>
text
"$stub"
SymbolPtr
->
char
'L'
<>
pprCLabel
platform
lbl
<>
text
"$non_lazy_ptr"
GotSymbolPtr
->
pprCLabel
platform
lbl
<>
text
"@GOTPCREL"
GotSymbolOffset
->
pprCLabel
platform
lbl
else
if
platformOS
platform
==
OSDarwin
then
case
dllInfo
of
CodeStub
->
char
'L'
<>
pprCLabel
platform
lbl
<>
text
"$stub"
SymbolPtr
->
char
'L'
<>
pprCLabel
platform
lbl
<>
text
"$non_lazy_ptr"
_
->
panic
"pprDynamicLinkerAsmLabel"
else
if
platformArch
platform
==
ArchPPC
&&
osElfTarget
(
platformOS
platform
)
then
case
dllInfo
of
CodeStub
->
pprCLabel
platform
lbl
<>
text
"@plt"
SymbolPtr
->
text
".LC_"
<>
pprCLabel
platform
lbl
_
->
panic
"pprDynamicLinkerAsmLabel"
else
if
platformArch
platform
==
ArchX86_64
&&
osElfTarget
(
platformOS
platform
)
then
case
dllInfo
of
CodeStub
->
pprCLabel
platform
lbl
<>
text
"@plt"
GotSymbolPtr
->
pprCLabel
platform
lbl
<>
text
"@gotpcrel"
GotSymbolOffset
->
pprCLabel
platform
lbl
SymbolPtr
->
text
".LC_"
<>
pprCLabel
platform
lbl
=
if
platformOS
platform
==
OSDarwin
then
if
platformArch
platform
==
ArchX86_64
then
case
dllInfo
of
CodeStub
->
char
'L'
<>
pprCLabel
platform
lbl
<>
text
"$stub"
SymbolPtr
->
char
'L'
<>
pprCLabel
platform
lbl
<>
text
"$non_lazy_ptr"
GotSymbolPtr
->
pprCLabel
platform
lbl
<>
text
"@GOTPCREL"
GotSymbolOffset
->
pprCLabel
platform
lbl
else
case
dllInfo
of
CodeStub
->
char
'L'
<>
pprCLabel
platform
lbl
<>
text
"$stub"
SymbolPtr
->
char
'L'
<>
pprCLabel
platform
lbl
<>
text
"$non_lazy_ptr"
_
->
panic
"pprDynamicLinkerAsmLabel"
else
if
osElfTarget
(
platformOS
platform
)
then
case
dllInfo
of
CodeStub
->
pprCLabel
platform
lbl
<>
text
"@plt"
SymbolPtr
->
text
".LC_"
<>
pprCLabel
platform
lbl
GotSymbolPtr
->
pprCLabel
platform
lbl
<>
text
"@got"
GotSymbolOffset
->
pprCLabel
platform
lbl
<>
text
"@gotoff"
then
if
platformArch
platform
==
ArchPPC
then
case
dllInfo
of
CodeStub
->
pprCLabel
platform
lbl
<>
text
"@plt"
SymbolPtr
->
text
".LC_"
<>
pprCLabel
platform
lbl
_
->
panic
"pprDynamicLinkerAsmLabel"
else
if
platformArch
platform
==
ArchX86_64
then
case
dllInfo
of
CodeStub
->
pprCLabel
platform
lbl
<>
text
"@plt"
GotSymbolPtr
->
pprCLabel
platform
lbl
<>
text
"@gotpcrel"
GotSymbolOffset
->
pprCLabel
platform
lbl
SymbolPtr
->
text
".LC_"
<>
pprCLabel
platform
lbl
else
case
dllInfo
of
CodeStub
->
pprCLabel
platform
lbl
<>
text
"@plt"
SymbolPtr
->
text
".LC_"
<>
pprCLabel
platform
lbl
GotSymbolPtr
->
pprCLabel
platform
lbl
<>
text
"@got"
GotSymbolOffset
->
pprCLabel
platform
lbl
<>
text
"@gotoff"
else
if
platformOS
platform
==
OSMinGW32
then
case
dllInfo
of
SymbolPtr
->
text
"__imp_"
<>
pprCLabel
platform
lbl
_
->
panic
"pprDynamicLinkerAsmLabel"
then
case
dllInfo
of
SymbolPtr
->
text
"__imp_"
<>
pprCLabel
platform
lbl
_
->
panic
"pprDynamicLinkerAsmLabel"
else
panic
"pprDynamicLinkerAsmLabel"
compiler/main/SysTools.lhs
View file @
a6f9ebc5
...
...
@@ -191,6 +191,7 @@ initSysTools mbMinusB
Nothing -> pgmError ("No entry for " ++ show key ++ " in " ++ show settingsFile)
; targetArch <- readSetting "target arch"
; targetOS <- readSetting "target os"
; targetHasSubsectionsViaSymbols <- readSetting "target has subsections via symbols"
; myExtraGccViaCFlags <- getSetting "GCC extra via C opts"
-- On Windows, mingw is distributed with GHC,
-- so we look in TopDir/../mingw/bin
...
...
@@ -252,7 +253,8 @@ initSysTools mbMinusB
; return $ Settings {
sTargetPlatform = Platform {
platformArch = targetArch,
platformOS = targetOS
platformOS = targetOS,
platformHasSubsectionsViaSymbols = targetHasSubsectionsViaSymbols
},
sTmpDir = normalise tmpdir,
sGhcUsagePath = ghc_usage_msg_path,
...
...
compiler/nativeGen/PIC.hs
View file @
a6f9ebc5
...
...
@@ -510,7 +510,7 @@ pprGotDeclaration _ _
-- the splitter in driver/split/ghc-split.lprl recognizes the new output
pprImportedSymbol
::
Platform
->
CLabel
->
Doc
pprImportedSymbol
platform
@
(
Platform
ArchPPC
OSDarwin
)
importedLbl
pprImportedSymbol
platform
@
(
Platform
{
platformArch
=
ArchPPC
,
platformOS
=
OSDarwin
}
)
importedLbl
|
Just
(
CodeStub
,
lbl
)
<-
dynamicLinkerLabelInfo
importedLbl
=
case
opt_PIC
of
False
->
...
...
@@ -564,7 +564,7 @@ pprImportedSymbol platform@(Platform ArchPPC OSDarwin) importedLbl
=
empty
pprImportedSymbol
platform
@
(
Platform
ArchX86
OSDarwin
)
importedLbl
pprImportedSymbol
platform
@
(
Platform
{
platformArch
=
ArchX86
,
platformOS
=
OSDarwin
}
)
importedLbl
|
Just
(
CodeStub
,
lbl
)
<-
dynamicLinkerLabelInfo
importedLbl
=
case
opt_PIC
of
False
->
...
...
@@ -617,7 +617,7 @@ pprImportedSymbol platform@(Platform ArchX86 OSDarwin) importedLbl
=
empty
pprImportedSymbol
(
Platform
_
OSDarwin
)
_
pprImportedSymbol
(
Platform
{
platformOS
=
OSDarwin
}
)
_
=
empty
...
...
@@ -650,12 +650,12 @@ pprImportedSymbol (Platform _ OSDarwin) _
-- the NCG will keep track of all DynamicLinkerLabels it uses
-- and output each of them using pprImportedSymbol.
pprImportedSymbol
(
Platform
ArchPPC_64
os
)
_
|
osElfTarget
os
pprImportedSymbol
platform
@
(
Platform
{
platformArch
=
ArchPPC_64
}
)
_
|
osElfTarget
(
platformOS
platform
)
=
empty
pprImportedSymbol
platform
@
(
Platform
_
os
)
importedLbl
|
osElfTarget
os
pprImportedSymbol
platform
importedLbl
|
osElfTarget
(
platformOS
platform
)
=
case
dynamicLinkerLabelInfo
importedLbl
of
Just
(
SymbolPtr
,
lbl
)
->
let
symbolSize
=
case
wordWidth
of
...
...
compiler/utils/Platform.hs
View file @
a6f9ebc5
...
...
@@ -19,9 +19,11 @@ import Panic
-- | Contains enough information for the native code generator to emit
-- code for this platform.
data
Platform
=
Platform
{
platformArch
::
Arch
,
platformOS
::
OS
}
=
Platform
{
platformArch
::
Arch
,
platformOS
::
OS
,
platformHasSubsectionsViaSymbols
::
Bool
}
deriving
(
Read
,
Show
,
Eq
)
...
...
configure.ac
View file @
a6f9ebc5
...
...
@@ -703,19 +703,6 @@ FP_PROG_LD_X
FP_PROG_LD_IS_GNU
FP_PROG_LD_BUILD_ID
dnl ** check for Apple-style dead-stripping support
dnl (.subsections-via-symbols assembler directive)
AC_MSG_CHECKING(for .subsections_via_symbols)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [__asm__ (".subsections_via_symbols");])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_SUBSECTIONS_VIA_SYMBOLS],[1],
[Define to 1 if Apple-style dead-stripping is supported.])
],
[AC_MSG_RESULT(no)])
dnl *** check for GNU non-executable stack note support (ELF only)
dnl (.section .note.GNU-stack,"",@progbits)
...
...
settings.in
View file @
a6f9ebc5
...
...
@@ -9,6 +9,7 @@
("windres command", "@SettingsWindresCommand@"),
("perl command", "@SettingsPerlCommand@"),
("target os", "@HaskellTargetOs@"),
("target arch", "@HaskellTargetArch@")
("target arch", "@HaskellTargetArch@"),
("target has subsections via symbols", "@HaskellHaveSubsectionsViaSymbols@")
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment