ref: 78da203b42b5084a7664e8773f418a4730184d53
parent: 422ae1fdf693890b14d9e0c40298065c1342a0ec
author: Mura Li <mura_li@castech.com.tw>
date: Tue Nov 28 06:37:01 EST 2017
Allow MYR_LDFLAGS to work properly
--- a/configure
+++ b/configure
@@ -48,7 +48,7 @@
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 @@
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,7 +70,7 @@
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*)
@@ -77,7 +77,7 @@
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*)
@@ -84,7 +84,7 @@
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
;;
*)
--- a/mbld/config+plan9-x64.myr
+++ b/mbld/config+plan9-x64.myr
@@ -3,7 +3,7 @@
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
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -431,6 +431,8 @@
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"))