Ticket #4053: GCC6.4.patch

File GCC6.4.patch, 2.0 KB (added by Itms, 8 years ago)
  • libraries/source/spidermonkey/build.sh

     
    2929
    3030CONF_OPTS="--enable-shared-js --disable-tests --without-intl-api"
    3131
     32# If the compiler is GCC 6 (or later), we need to disable some optimizations.
     33# Indeed, SpiderMonkey 38, when compiled with GCC6 or later, can segfault during GC.
     34if [ "${OS}" != "Windows_NT" ]
     35then
     36  if echo "${CXX:-g++}" | grep -q "g++";
     37  then
     38    if [ "`g++ -dumpversion | cut -f1 -d.`" -ge "6" ]
     39    then
     40      CXXFLAGS="${CXXFLAGS} -fno-schedule-insns2 -fno-delete-null-pointer-checks"
     41    fi
     42  fi
     43fi
     44
    3245# Change the default location where the tracelogger should store its output.
    3346# The default location is . on Windows and /tmp/ on *nix.
    3447TLCXXFLAGS='-DTRACE_LOG_DIR="\"../../source/tools/tracelogger/\""'
     
    91104perl -i.bak -pe 's/(SHARED_LIBRARY_NAME\s+=).*/$1 '\''mozjs38-ps-debug'\''/' moz.build
    92105mkdir -p build-debug
    93106cd build-debug
    94 CXXFLAGS="${TLCXXFLAGS}" ../configure ${CONF_OPTS} --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal
     107CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal
    95108${MAKE} ${MAKE_OPTS}
    96109cd ..
    97110
     
    98111perl -i.bak -pe 's/(SHARED_LIBRARY_NAME\s+=).*/$1 '\''mozjs38-ps-release'\''/' moz.build
    99112mkdir -p build-release
    100113cd build-release
    101 CXXFLAGS="${TLCXXFLAGS}" ../configure ${CONF_OPTS} --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" --enable-optimize  # --enable-gczeal --enable-debug-symbols
     114CXXFLAGS="${CXXFLAGS} ${TLCXXFLAGS}" ../configure ${CONF_OPTS} --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" --enable-optimize  # --enable-gczeal --enable-debug-symbols
    102115${MAKE} ${MAKE_OPTS}
    103116cd ..
    104117