aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemcc3
-rw-r--r--src/runtime.js2
-rw-r--r--src/settings.js3
3 files changed, 8 insertions, 0 deletions
diff --git a/emcc b/emcc
index 079f6edc..ed6e916f 100755
--- a/emcc
+++ b/emcc
@@ -1032,6 +1032,9 @@ try:
if minify_whitespace is None:
minify_whitespace = opt_level >= 2 and not keep_js_debug
+ if shared.Settings.TARGET_X86: assert 'i386-pc-linux-gnu' in shared.COMPILER_OPTS
+ if shared.Settings.TARGET_LE32: assert 'le32-unknown-nacl' in shared.COMPILER_OPTS
+
## Compile source code to bitcode
if DEBUG: print >> sys.stderr, 'emcc: compiling to bitcode'
diff --git a/src/runtime.js b/src/runtime.js
index ec39636f..b184b275 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -178,7 +178,9 @@ var Runtime = {
// type can be a native type or a struct (or null, for structs we only look at size here)
getAlignSize: function(type, size) {
// we align i64s and doubles on 64-bit boundaries, unlike x86
+#if TARGET_LE32
if (type == 'i64' || type == 'double') return 8;
+#endif
return Math.min(size, Runtime.QUANTUM_SIZE);
},
diff --git a/src/settings.js b/src/settings.js
index 48b0347e..82cb411b 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -17,6 +17,9 @@ var QUANTUM_SIZE = 4; // This is the size of an individual field in a structure.
//
// Changing this from the default of 4 is deprecated.
+var TARGET_X86 = 0; // For le32-unknown-nacl
+var TARGET_LE32 = 1; // For i386-pc-linux-gnu
+
var CORRECT_SIGNS = 1; // Whether we make sure to convert unsigned values to signed values.
// Decreases performance with additional runtime checks. Might not be
// needed in some kinds of code.