BII: add -fwrapv compile flag (#197)

This commit is contained in:
kanjitalk755 2024-04-01 18:35:53 +09:00
parent 293ef33a28
commit a07cc8ae56
3 changed files with 8 additions and 2 deletions

View File

@ -1055,7 +1055,7 @@
LIBRARY_SEARCH_PATHS = /usr/local/lib; LIBRARY_SEARCH_PATHS = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.13; MACOSX_DEPLOYMENT_TARGET = 10.13;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = ""; OTHER_CFLAGS = "-fwrapv";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
"OTHER_LDFLAGS[arch=arm64]" = ( "OTHER_LDFLAGS[arch=arm64]" = (
"-luae_cpu_arm64", "-luae_cpu_arm64",
@ -1139,7 +1139,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = /usr/local/lib; LIBRARY_SEARCH_PATHS = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.13; MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CFLAGS = ""; OTHER_CFLAGS = "-fwrapv";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
"OTHER_LDFLAGS[arch=arm64]" = ( "OTHER_LDFLAGS[arch=arm64]" = (
"-luae_cpu_arm64", "-luae_cpu_arm64",

View File

@ -1902,6 +1902,9 @@ if [[ "x$HAVE_IPA" = "xyes" ]]; then
LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
fi fi
CFLAGS="$CFLAGS -fwrapv"
CXXFLAGS="$CXXFLAGS -fwrapv"
dnl Generate Makefile. dnl Generate Makefile.
AC_SUBST(DEFINES) AC_SUBST(DEFINES)
AC_SUBST(SYSSRCS) AC_SUBST(SYSSRCS)

View File

@ -567,6 +567,9 @@ if [[ "x$HAVE_GCC27" = "xyes" ]]; then
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'` CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
fi fi
CFLAGS="$CFLAGS -fwrapv"
CXXFLAGS="$CXXFLAGS -fwrapv"
dnl Generate Makefile. dnl Generate Makefile.
AC_SUBST(DEFINES) AC_SUBST(DEFINES)
AC_SUBST(CPUINCLUDES) AC_SUBST(CPUINCLUDES)