diff --git a/0ad-mozjs38.patch b/0ad-mozjs38.patch new file mode 100644 index 0000000..7d2e6c4 --- /dev/null +++ b/0ad-mozjs38.patch @@ -0,0 +1,21 @@ +diff -up 0ad-0.0.23b-alpha/libraries/source/spidermonkey/build.sh.orig 0ad-0.0.23b-alpha/libraries/source/spidermonkey/build.sh +--- 0ad-0.0.23b-alpha/libraries/source/spidermonkey/build.sh.orig 2019-09-30 15:33:27.690089303 -0300 ++++ 0ad-0.0.23b-alpha/libraries/source/spidermonkey/build.sh 2019-09-30 15:47:16.201374941 -0300 +@@ -27,7 +27,7 @@ fi + + MAKE_OPTS="${JOBS}" + +-CONF_OPTS="--enable-shared-js --disable-tests --without-intl-api" ++CONF_OPTS="--enable-shared-js --disable-tests --without-intl-api --disable-optimize" + + # Bug 1269319 + # When compiled with GCC 6 (or later), SpiderMonkey 38 (and versions up to 49) is +@@ -37,7 +37,7 @@ if [ "${OS}" != "Windows_NT" ] + then + if [ "`${CXX:=g++} -dumpversion | cut -f1 -d.`" -ge "6" ] + then +- CXXFLAGS="${CXXFLAGS} -fno-schedule-insns2 -fno-delete-null-pointer-checks" ++ CXXFLAGS="${CXXFLAGS} -fpermissive -fno-tree-vrp -fno-strict-aliasing -fno-schedule-insns2 -fno-delete-null-pointer-checks" + fi + fi + diff --git a/0ad.spec b/0ad.spec index cbebc15..c1a6846 100644 --- a/0ad.spec +++ b/0ad.spec @@ -133,6 +133,13 @@ Patch3: %{name}-valgrind.patch # Fix build on ppc64le with patches from https://wiki.raptorcs.com/wiki/Porting/0ad Patch5: %{name}-ppc64.patch +# Due to significant reports matching: +# https://trac.wildfiregames.com/ticket/4053 +# [[PATCH] Building spidermonkey on GCC 6 results in segfaults in the Garbage Collector] +# Basically reinstantiate: +# https://src.fedoraproject.org/rpms/mozjs38/c/761399aba092bcb1299bb4fccfd60f370ab4216e +Patch6: %{name}-mozjs38.patch + %description 0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform real-time strategy (RTS) game of ancient warfare. In short, it is a @@ -154,6 +161,13 @@ hobbyist game developers, since 2001. %endif %patch3 -p1 %patch5 -p1 +%patch6 -p1 +# Related to 0ad-mozjs38.patch +%ifarch %{ix86} +sed -i "s/\(-fno-delete-null-pointer-checks\)/\1 -O0/" \ + libraries/source/spidermonkey/build.sh +%endif +#end Related to 0ad-mozjs38.patch %if %{with system_nvtt} rm -fr libraries/source/nvtt