Martchus
f0175878db
Initial motivation of adding the flag was better consistency with compile flags used for regular Arch Linux packages. However, adding -fstack-protector-strong seems to cause segmentation faults even before main() is called. The issue is not reproducible with a simple hello world app and also not reproducible when launching the app under Linux with WINE. But a full-blown Qt 5 app crashes in the way described.
24 lines
882 B
Bash
24 lines
882 B
Bash
#!/bin/sh
|
|
|
|
# check if last arg is a path to configure, else use parent
|
|
for last; do true; done
|
|
if test -x "${last}/configure"; then
|
|
config_path="$last"
|
|
else
|
|
config_path=".."
|
|
fi
|
|
|
|
default_mingw_pp_flags="-D_FORTIFY_SOURCE=2"
|
|
default_mingw_compiler_flags="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4"
|
|
default_mingw_linker_flags="-Wl,-O1,--sort-common,--as-needed"
|
|
|
|
export CPPFLAGS="${MINGW_CPPFLAGS:-$default_mingw_pp_flags $CPPFLAGS}"
|
|
export CFLAGS="${MINGW_CFLAGS:-$default_mingw_compiler_flags $CFLAGS}"
|
|
export CXXFLAGS="${MINGW_CXXFLAGS:-$default_mingw_compiler_flags $CXXFLAGS}"
|
|
export LDFLAGS="${MINGW_LDFLAGS:-$default_mingw_linker_flags $LDFLAGS}"
|
|
|
|
${config_path}/configure \
|
|
--host=@TRIPLE@ --target=@TRIPLE@ --build="$CHOST" \
|
|
--prefix=/usr/@TRIPLE@ --libdir=/usr/@TRIPLE@/lib --includedir=/usr/@TRIPLE@/include \
|
|
--enable-shared --enable-static "$@"
|