From 54540244c1d89faa5b359c75a9c38b6fed0a08c9 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 26 Oct 2015 14:12:23 -0400 Subject: Remove the strange conjoining of debug and optimization flags. Previously a build had optimizations disabled completely when debug info was emitted. But there are many reasons to use optimized builds with debug symbols (running under valgrind, against afl, with Asan/Ubsan, in prod, etc). And personally I find even debugging at -O2 or -O3 is fine most of the time and worth it for the speed. Use the (now documented!) --no-optimizations flag if no optimization is desired while debugging. This also removes the distinction between library and application compile flags; there is a single optimization level that is probably good enough for everything. On Win32 it removes definding _CONSOLE for the application. This seems to be some mythical value that may have been required at some point, but is not documented anywhere I can find. Who knows what VC thinks, hoping I don't have to add this back. It also drops defining `EBUG` which is what happens when you tell cl.exe to '/DEBUG'. LOL. --- src/build-data/cc/clang.txt | 7 +++---- src/build-data/cc/ekopath.txt | 7 +++---- src/build-data/cc/gcc.txt | 9 +++------ src/build-data/cc/hpcc.txt | 11 +++++------ src/build-data/cc/icc.txt | 7 +++---- src/build-data/cc/msvc.txt | 17 +++++++++++------ src/build-data/cc/pgi.txt | 7 +++---- src/build-data/cc/sunstudio.txt | 7 +++---- src/build-data/cc/xlc.txt | 7 +++---- 9 files changed, 37 insertions(+), 42 deletions(-) (limited to 'src/build-data/cc') diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt index 129218dcd..fd11e59ec 100644 --- a/src/build-data/cc/clang.txt +++ b/src/build-data/cc/clang.txt @@ -13,10 +13,9 @@ lang_flags "-std=c++11 -D_REENTRANT -fstack-protector" warning_flags "-Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code" maintainer_warning_flags "-Qunused-arguments -Werror -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=unreachable-code" -compile_flags_release "-c" -compile_flags_debug "-c -g" -lib_opt_flags_release "-O3" -app_opt_flags_release "-O2" +compile_flags "-c" +debug_info_flags "-g" +optimization_flags "-O3" shared_flags "-fPIC" coverage_flags "--coverage" diff --git a/src/build-data/cc/ekopath.txt b/src/build-data/cc/ekopath.txt index a41abc7c4..549c21a23 100644 --- a/src/build-data/cc/ekopath.txt +++ b/src/build-data/cc/ekopath.txt @@ -7,10 +7,9 @@ add_include_dir_option -I add_lib_dir_option -L add_lib_option -l -compile_flags_release "-c" -compile_flags_debug "-c -g" -lib_opt_flags_release "-O3 -OPT:Ofast:alias=disjoint" -app_opt_flags_release "-O2" +compile_flags "-c" +debug_info_flags "-g" +optimization_flags "-O3" lang_flags "-D_REENTRANT -ansi -Wno-long-long" warning_flags "-W -Wall" diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index 4eacacef2..3531e9355 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -11,12 +11,9 @@ lang_flags "-std=c++11 -D_REENTRANT" maintainer_warning_flags "-Wold-style-cast -Werror -Wno-error=old-style-cast -Wno-error=zero-as-null-pointer-constant -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=strict-overflow" warning_flags "-Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant" -compile_flags_release "-c" -compile_flags_debug "-c -g" -lib_opt_flags_release "-O2" -lib_opt_flags_debug "-O0" -app_opt_flags_release "-O2" -app_opt_flags_debug "-O0" +compile_flags "-c" +debug_info_flags "-g" +optimization_flags "-O2" shared_flags "-fPIC" coverage_flags "--coverage" diff --git a/src/build-data/cc/hpcc.txt b/src/build-data/cc/hpcc.txt index 2e30995f6..2f2686d10 100644 --- a/src/build-data/cc/hpcc.txt +++ b/src/build-data/cc/hpcc.txt @@ -7,13 +7,12 @@ add_include_dir_option -I add_lib_dir_option -L add_lib_option -l -compile_flags_release "-c" -compile_flags_debug "-c -g" -lib_opt_flags_release "+O2" -app_opt_flags_release "+O2" - lang_flags "-AA -ext +eh -z" -warning_flags "" # +w + +compile_flags "-c" +debug_info_flags "-g" +optimization_flags "+O2" +warning_flags "+w" shared_flags "+Z" makefile_style gmake diff --git a/src/build-data/cc/icc.txt b/src/build-data/cc/icc.txt index f7fdf72be..084d2a4f2 100644 --- a/src/build-data/cc/icc.txt +++ b/src/build-data/cc/icc.txt @@ -7,10 +7,9 @@ add_include_dir_option -I add_lib_dir_option -L add_lib_option -l -compile_flags_release "-c -fomit-frame-pointer" -compile_flags_debug "-c -g" -lib_opt_flags_release "-O2 -ip -unroll" -app_opt_flags_release "-O2" +compile_flags "-c" +debug_info_flags "-g" +optimization_flags "-O2" lang_flags "-std=c++0x" warning_flags "-w1" diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt index 7a35f9648..67e5023aa 100644 --- a/src/build-data/cc/msvc.txt +++ b/src/build-data/cc/msvc.txt @@ -8,10 +8,15 @@ add_include_dir_option "/I" add_lib_dir_option -L add_lib_option "" -compile_flags_release "/nologo /c /bigobj /O2" -compile_flags_debug "/nologo /c /bigobj /Od /Zi /FS /DEBUG" -app_opt_flags_release "/D_CONSOLE" -app_opt_flags_debug "/D_CONSOLE" +compile_flags "/nologo /c" + +optimization_flags "/O2" + +# for debug info in the object file: +#debug_info_flags "/Z7" + +# for using a PDB file: +debug_info_flags "/Zi /FS" lang_flags "/EHs /GR" warning_flags "/W3 /wd4275 /wd4267" @@ -46,6 +51,6 @@ default-debug -> "$(LINKER) /DEBUG" -all -> "/MD" -all-debug -> "/MDd" +all -> "/MD /bigobj" +all-debug -> "/MDd /bigobj" diff --git a/src/build-data/cc/pgi.txt b/src/build-data/cc/pgi.txt index ca4b49cd9..06b2f8400 100644 --- a/src/build-data/cc/pgi.txt +++ b/src/build-data/cc/pgi.txt @@ -7,10 +7,9 @@ add_include_dir_option -I add_lib_dir_option -L add_lib_option -l -compile_flags_release "-c" -compile_flags_debug "-c" -lib_opt_flags_release "-fast -Minline" -app_opt_flags_release "-fast" +compile_flags "-c" +debug_info_flags "-g" +optimization_flags "-fast -Minline" shared_flags "-fPIC" makefile_style gmake diff --git a/src/build-data/cc/sunstudio.txt b/src/build-data/cc/sunstudio.txt index 964c878ff..9ace5107c 100644 --- a/src/build-data/cc/sunstudio.txt +++ b/src/build-data/cc/sunstudio.txt @@ -7,10 +7,9 @@ add_include_dir_option -I add_lib_dir_option -L add_lib_option -l -compile_flags_release "-c" -compile_flags_debug "-c -g" -lib_opt_flags_release "-xO5" -app_opt_flags_release "-xO2" +compile_flags "-c" +debug_info_flags "-g" +optimization_flags "-xO2" shared_flags "-KPIC" warning_flags "+w -erroff=truncwarn,wnoretvalue" diff --git a/src/build-data/cc/xlc.txt b/src/build-data/cc/xlc.txt index 68dc62582..55b9e7092 100644 --- a/src/build-data/cc/xlc.txt +++ b/src/build-data/cc/xlc.txt @@ -7,10 +7,9 @@ add_include_dir_option -I add_lib_dir_option -L add_lib_option -l -compile_flags_release "-c" -compile_flags_debug "-c -g" -lib_opt_flags_release "-O2" -app_opt_flags_release "-O2" +compile_flags "-c" +debug_info_flags "-g" +optimization_flags "-O2" lang_flags "" -- cgit v1.2.3