Revert "Enable LTO by default."

This reverts commit 44f567c6a3.

Enabling LTO by default causes too many problems, inclusing build
failures for @doofus-01 and link failures with Clang for me.

Players and packagers can still amanually enable LTO in case it
works fine for them.
This commit is contained in:
Jyrki Vesterinen 2018-02-12 08:11:50 +02:00
parent a5a9f6ab19
commit 1d47c23efe
4 changed files with 5 additions and 13 deletions

View file

@ -62,7 +62,7 @@ script:
./utils/travis/check_utf8.sh;
./utils/travis/utf8_bom_dog.sh;
"$CXX" --version;
scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool="$CC" cxxtool="$CXX" --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict=true cxx_std="$CXXSTD" nls="$NLS" jobs=2 enable_lto=false;
scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool="$CC" cxxtool="$CXX" --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict=true cxx_std="$CXXSTD" nls="$NLS" jobs=2;
else
export DISPLAY=:99.0;
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x24;

View file

@ -155,14 +155,10 @@ option(ENABLE_STRICT_COMPILATION "Sets the strict compilation mode" OFF)
option(ENABLE_PEDANTIC_COMPILATION "Sets the pedantic compilation mode" OFF)
option(ENABLE_DEBUG_WINDOW_LAYOUT "Add the debug option to allow the generation of debug layout files in dot format" OFF)
option(ENABLE_DESIGN_DOCUMENTS "Enables the generation of design documents, and has additional dependencies" OFF)
option(ENABLE_LTO "Sets Link Time Optimization for Release builds" ON)
option(ENABLE_LTO "Sets Link Time Optimization for Release builds" OFF)
option(GLIBCXX_DEBUG "Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC" OFF)
option(ENABLE_POT_UPDATE_TARGET "Enables the tools to update the pot files and manuals. This target has extra dependencies." OFF)
if(WIN32)
set(ENABLE_LTO OFF)
endif(WIN32)
if(UNIX AND NOT APPLE AND NOT CYGWIN)
option(ENABLE_NOTIFICATIONS "Enable Window manager notification messages" ON)
endif(UNIX AND NOT APPLE AND NOT CYGWIN)

View file

@ -53,7 +53,7 @@ opts.AddVariables(
('extra_flags_release', 'Extra compiler and linker flags to use for release builds', ""),
('extra_flags_debug', 'Extra compiler and linker flags to use for debug builds', ""),
('extra_flags_profile', 'Extra compiler and linker flags to use for profile builds', ""),
BoolVariable('enable_lto', 'Whether to enable Link Time Optimization for build=release', True),
BoolVariable('enable_lto', 'Whether to enable Link Time Optimization for build=release', False),
('arch', 'What -march option to use for build=release, will default to pentiumpro on Windows', ""),
BoolVariable('glibcxx_debug', 'Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC for build=debug', False),
EnumVariable('profiler', 'profiler to be used for build=profile', "gprof", ["gprof", "gcov", "gperftools", "perf"]),
@ -506,10 +506,6 @@ for env in [test_env, client_env, env]:
# Start setting options for release build
# #
# disable LTO for Windows only - does not work with TDM-GCC
if env["PLATFORM"] == "win32":
env["enable_lto"] = False
# default compiler flags
rel_comp_flags = "-O3"
rel_link_flags = ""

View file

@ -54,14 +54,14 @@ else
ln -s ../build CMakeFiles
cd ..
# run cmake separately so config.h will be seen by the md5 script
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false -DEXTRA_FLAGS_CONFIG="-pipe" -DEXTRA_FLAGS_RELEASE="$EXTRA_FLAGS_RELEASE" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO=false
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false -DEXTRA_FLAGS_CONFIG="-pipe" -DEXTRA_FLAGS_RELEASE="$EXTRA_FLAGS_RELEASE" -DENABLE_STRICT_COMPILATION="$STRICT"
# run manual md5 file tracking/mtime modification script for cmake
python3 cmake_mtime_crc.py
make VERBOSE=1 -j2
else
scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool=$CC cxxtool=$CXX --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict="$STRICT" cxx_std=$CXXSTD nls=false jobs=2 enable_lto=false
scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool=$CC cxxtool=$CXX --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict="$STRICT" cxx_std=$CXXSTD nls=false jobs=2
fi
# check if the build was successful