]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Prevent Clang UB 'optimization' which breaks integerness checks.
authorMike Pall <mike>
Thu, 10 Apr 2025 20:53:50 +0000 (22:53 +0200)
committerMike Pall <mike>
Thu, 10 Apr 2025 20:53:50 +0000 (22:53 +0200)
Thanks to Kacper Michajłow. #1351 #1355

src/Makefile

index 4a56d1e8e50202145713015e00ac3b9140a63e25..c83abfa0b6218039d7189d0fe9d9099389c2a91b 100644 (file)
@@ -302,6 +302,9 @@ endif
 ifneq (,$(INSTALL_LJLIBD))
   TARGET_XCFLAGS+= -DLUA_LJDIR=\"$(INSTALL_LJLIBD)\"
 endif
+ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-strict-float-cast-overflow 2>/dev/null || echo 1))
+  TARGET_XCFLAGS+= -fno-strict-float-cast-overflow
+endif
 
 ##############################################################################
 # Target system detection.