aboutsummaryrefslogtreecommitdiffstats
path: root/driver/Linker.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2017-08-23 09:48:04 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2017-08-23 09:48:04 +0200
commit0e2c72a69b2d36652ad5d41d923d70f6f200940b (patch)
treea3562eedba33a918dea13209fe33f7457caabe89 /driver/Linker.ml
parent696bd9d2906e79bdfa11bc18e4b2de0521f6e996 (diff)
downloadcompcert-kvx-0e2c72a69b2d36652ad5d41d923d70f6f200940b.tar.gz
compcert-kvx-0e2c72a69b2d36652ad5d41d923d70f6f200940b.zip
Extended support for the nostartfiles option.
For dcc one needs to pass -Ws to tell the linker that it should not link the default startfiles.
Diffstat (limited to 'driver/Linker.ml')
-rw-r--r--driver/Linker.ml17
1 files changed, 11 insertions, 6 deletions
diff --git a/driver/Linker.ml b/driver/Linker.ml
index 54566efb..37a5cde0 100644
--- a/driver/Linker.ml
+++ b/driver/Linker.ml
@@ -35,9 +35,7 @@ let linker exe_name files =
let gnu_linker_help =
-{| -nostartfiles Do not use the standard system startup files when
- linking
- -nodefaultlibs Do not use the standard system libraries when
+{| -nodefaultlibs Do not use the standard system libraries when
linking
-nostdlib Do not use the standard system startup files or
libraries when linking
@@ -47,6 +45,8 @@ let linker_help =
{|Linking options:
-l<lib> Link library <lib>
-L<dir> Add <dir> to search path for libraries
+ -nostartfiles Do not use the standard system startup files when
+ linking
|} ^
(if Configuration.gnu_toolchain then gnu_linker_help else "") ^
{| -s Remove all symbol table and relocation information from the
@@ -62,10 +62,15 @@ let linker_help =
let linker_actions =
[ Prefix "-l", Self push_linker_arg;
- Prefix "-L", Self push_linker_arg; ] @
+ Prefix "-L", Self push_linker_arg;
+ Exact "-nostartfiles", Self (fun s ->
+ if Configuration.gnu_toolchain then
+ push_linker_arg s
+ else
+ push_linker_arg "-Ws")
+ ] @
(if Configuration.gnu_toolchain then
- [ Exact "-nostartfiles", Self push_linker_arg;
- Exact "-nodefaultlibs", Self push_linker_arg;
+ [ Exact "-nodefaultlibs", Self push_linker_arg;
Exact "-nostdlib", Self push_linker_arg;]
else []) @
[ Exact "-s", Self push_linker_arg;