summaryrefslogtreecommitdiff
path: root/msvcc.sh
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan@mozilla.com>2014-07-31 20:33:33 -0400
committerEhsan Akhgari <ehsan@mozilla.com>2014-07-31 20:35:49 -0400
commit08853e32fb6b750cda664ee6d3290d340429dd4d (patch)
tree858689c00363b6ec18eda7424649b1b18f5a7f81 /msvcc.sh
parentfb25cd08ed5a87640b02f0feeb10a09b37cfddbe (diff)
downloadlibffi-08853e32fb6b750cda664ee6d3290d340429dd4d.tar.gz
Enable forcing the usage of the static CRT in libffi's msvc wrapper
This is required for AddressSanitizer builds with clang-cl.
Diffstat (limited to 'msvcc.sh')
-rwxr-xr-xmsvcc.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/msvcc.sh b/msvcc.sh
index 4a65b0b..65fbfef 100755
--- a/msvcc.sh
+++ b/msvcc.sh
@@ -44,7 +44,8 @@
args_orig=$@
args="-nologo -W3"
-md=-MD
+static_crt=
+debug_crt=
cl="cl"
ml="ml"
safeseh="-safeseh"
@@ -114,9 +115,14 @@ do
defines="$defines $1"
shift 1
;;
+ -DUSE_STATIC_RTL)
+ # Link against static CRT.
+ static_crt=1
+ shift 1
+ ;;
-DUSE_DEBUG_RTL)
# Link against debug CRT.
- md=-MDd
+ debug_crt=1
shift 1
;;
-c)
@@ -211,6 +217,16 @@ if [ -n "$opt" ]; then
args="$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO"
fi
+if [ -n "$static_crt" ]; then
+ md=-MT
+else
+ md=-MD
+fi
+
+if [ -n "$debug_crt" ]; then
+ md="${md}d"
+fi
+
if [ -n "$assembly" ]; then
if [ -z "$outdir" ]; then
outdir="."