Skip to content

Commit 29b6a13

Browse files
committed
Disable strict aliasing
Harmonize C++ compiler flags with Node.js (-fno-rtti, -fno-exceptions) and, critically, disable strict aliasing, because V8 is not the least bit strict-aliasing safe. Upstream turned it off in nodejs/node#54339, like it always should have been, and I suspect the mismatch may be the cause of segfaults that show up in production. Remove -fpermissive, it's not needed and something to discourage.
1 parent 3833253 commit 29b6a13

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ext/mini_racer_extension/extconf.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
$CXXFLAGS += " -rdynamic" unless $CXXFLAGS.split.include? "-rdynamic"
1919
$CXXFLAGS += " -fPIC" unless $CXXFLAGS.split.include? "-rdynamic" or IS_DARWIN
2020
$CXXFLAGS += " -std=c++17"
21-
$CXXFLAGS += " -fpermissive"
21+
$CXXFLAGS += " -fno-rtti"
22+
$CXXFLAGS += " -fno-exceptions"
23+
$CXXFLAGS += " -fno-strict-aliasing"
2224
#$CXXFLAGS += " -DV8_COMPRESS_POINTERS"
2325
$CXXFLAGS += " -fvisibility=hidden "
2426

0 commit comments

Comments
 (0)