summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMura Li <mura_li@castech.com.tw>2017-11-28 11:37:01 +0800
committerOri Bernstein <ori@eigenstate.org>2017-11-27 21:11:09 -0800
commit78da203b42b5084a7664e8773f418a4730184d53 (patch)
tree705467bdd48e9eadeeff1572f318adadf444185d
parent422ae1fdf693890b14d9e0c40298065c1342a0ec (diff)
downloadmc-78da203b42b5084a7664e8773f418a4730184d53.tar.gz
Allow MYR_LDFLAGS to work properly
-rwxr-xr-xconfigure10
-rw-r--r--mbld/config+plan9-x64.myr2
-rw-r--r--mbld/deps.myr2
3 files changed, 8 insertions, 6 deletions
diff --git a/configure b/configure
index 534ba9a..088e8c2 100755
--- a/configure
+++ b/configure
@@ -48,7 +48,7 @@ case $OS in
echo 'export SYS=linux' >> config.mk
echo export INST_MAN=$prefix/share/man/man >> config.mk
echo 'const Sys = "Linux"' >> mbld/config.myr
- echo 'const Linkcmd = ["ld", "-o"]' >> mbld/config.myr
+ echo 'const Linkcmd = ["ld"]' >> mbld/config.myr
echo "const Manpath = \"share/man/man\"" >> mbld/config.myr
;;
*Darwin*)
@@ -62,7 +62,7 @@ case $OS in
echo 'const Linkcmd = ["ld", ' \
'"-pagezero_size", "0x100000000",' \
'"-macosx_version_min", "10.6",'\
- '"-o"]' >> mbld/config.myr
+ ']' >> mbld/config.myr
echo "const Manpath = \"share/man/man\"" >> mbld/config.myr
env='[("MACOSX_DEPLOYMENT_TARGET", "10.6")][:]'
;;
@@ -70,21 +70,21 @@ case $OS in
echo 'export SYS=freebsd' >> config.mk
echo export INST_MAN=$prefix/man/man >> config.mk
echo 'const Sys = "FreeBSD"' >> mbld/config.myr
- echo 'const Linkcmd = ["ld", "-o"]' >> mbld/config.myr
+ echo 'const Linkcmd = ["ld"]' >> mbld/config.myr
echo "const Manpath = \"man/man\"" >> mbld/config.myr
;;
*NetBSD*)
echo 'export SYS=netbsd' >> config.mk
echo export INST_MAN=$prefix/man/man >> config.mk
echo 'const Sys = "NetBSD"' >> mbld/config.myr
- echo 'const Linkcmd = ["ld", "-o"]' >> mbld/config.myr
+ echo 'const Linkcmd = ["ld"]' >> mbld/config.myr
echo "const Manpath = \"man/man\"" >> mbld/config.myr
;;
*OpenBSD*)
echo 'export SYS=openbsd' >> config.mk
echo export INST_MAN=$prefix/man/man >> config.mk
echo 'const Sys = "OpenBSD"' >> mbld/config.myr
- echo 'const Linkcmd = ["ld", "-static", "-nopie", "-o"]' >> mbld/config.myr
+ echo 'const Linkcmd = ["ld", "-static", "-nopie"]' >> mbld/config.myr
echo "const Manpath = \"man/man\"" >> mbld/config.myr
;;
*)
diff --git a/mbld/config+plan9-x64.myr b/mbld/config+plan9-x64.myr
index a25a3af..b13fedc 100644
--- a/mbld/config+plan9-x64.myr
+++ b/mbld/config+plan9-x64.myr
@@ -3,7 +3,7 @@ pkg config =
const Instroot = "/"
const Sys = "Plan9"
const Objsuffix = ".6"
- const Linkcmd = ["6l", "-lo"]
+ const Linkcmd = ["6l", "-l"]
const Arcmd = ["ar", "u"]
const Ascmd = ["6a"]
const Directlib = true
diff --git a/mbld/deps.myr b/mbld/deps.myr
index 7c54e34..79f90c4 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -431,6 +431,8 @@ const linkcmd = {b, n, mt, bin, libs, dynlibs, istest
for o : opt_ldflags
std.slpush(&n.cmd, o)
;;
+
+ std.slpush(&n.cmd, "-o")
std.slpush(&n.cmd, std.sldup(bin))
if mt.ldscript.len > 0
std.slpush(&n.cmd, std.sldup("-T"))