summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorFlorent Valette <florent.valette@gmail.com>2020-10-05 12:50:42 (GMT)
committerFlorent Valette <florent.valette@gmail.com>2020-10-06 07:32:40 (GMT)
commit1c93176e0521945bac67f58724ba2bb450a74282 (patch)
tree8c77485ef80c94e34bc0e63e8698bfdcec3710f4 /scripts/build
parentb3ed2c40d37cf7d5c2143307286f5d9557ed2df3 (diff)
m4: fix build for mingw32 host
While building a canadian toolchain for windows host (any target), the build failed for m4 host companion_tool with a recent mingw-w64 (at least 7.0.0). m4 needs stack smashing protection which is not part of mingw-w64 c library and an explicit trigger to link w/ libssp is needed. Signed-off-by: Florent Valette <florent.valette@gmail.com>
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/companion_tools/100-m4.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/build/companion_tools/100-m4.sh b/scripts/build/companion_tools/100-m4.sh
index 4bbe8d3..7d9044f 100644
--- a/scripts/build/companion_tools/100-m4.sh
+++ b/scripts/build/companion_tools/100-m4.sh
@@ -42,6 +42,7 @@ do_m4_backend()
local prefix
local cflags
local ldflags
+ local libs
for arg in "$@"; do
eval "${arg// /\\ }"
@@ -54,12 +55,19 @@ do_m4_backend()
# it includes system <spawn.h> but expects a locally-built
# posix_spawn().
ldflags="${ldflags} -lrt"
+ ;;
+ *-mingw32)
+ # m4 is built with stack smashing protection enabled which
+ # is not part of mingw-w64 c library in v7.0.0 and later.
+ libs="${libs} -lssp"
+ ;;
esac
CT_DoLog EXTRA "Configuring m4"
CT_DoExecLog CFG \
CFLAGS="${cflags}" \
LDFLAGS="${ldflags}" \
+ LIBS="${libs}" \
${CONFIG_SHELL} \
"${CT_SRC_DIR}/m4/configure" \
--host="${host}" \