diff options
author | Jack Lloyd <[email protected]> | 2015-10-27 17:23:23 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-10-27 17:23:23 -0400 |
commit | 7c417abf6ec0e6d69e5ece865d1293eb8b5b0b7c (patch) | |
tree | 694809e6b1761730a4baf4403b69e27010653870 /src | |
parent | 4f5bc7ccf06c84ae5c1779a7d2c91cd5c937fb33 (diff) | |
parent | 299119f02c09e7d3e657b13e1706cb653eff560c (diff) |
Merge pull request #317 from randombit/cc-flag-sanity
Split up build options
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/buildh.in | 2 | ||||
-rw-r--r-- | src/build-data/cc/clang.txt | 7 | ||||
-rw-r--r-- | src/build-data/cc/ekopath.txt | 7 | ||||
-rw-r--r-- | src/build-data/cc/gcc.txt | 9 | ||||
-rw-r--r-- | src/build-data/cc/hpcc.txt | 11 | ||||
-rw-r--r-- | src/build-data/cc/icc.txt | 7 | ||||
-rw-r--r-- | src/build-data/cc/msvc.txt | 17 | ||||
-rw-r--r-- | src/build-data/cc/pgi.txt | 7 | ||||
-rw-r--r-- | src/build-data/cc/sunstudio.txt | 7 | ||||
-rw-r--r-- | src/build-data/cc/xlc.txt | 7 | ||||
-rw-r--r-- | src/build-data/makefile/header.in | 15 | ||||
-rwxr-xr-x | src/scripts/ci/circle/clang-shared-debug.sh | 2 | ||||
-rwxr-xr-x | src/scripts/ci/circle/clang-static-debug.sh | 2 | ||||
-rwxr-xr-x | src/scripts/ci/circle/gcc-sanitizer.sh | 11 | ||||
-rwxr-xr-x | src/scripts/ci/circle/gcc-shared-debug.sh | 2 | ||||
-rwxr-xr-x | src/scripts/ci/circle/gcc-static-debug.sh | 2 | ||||
-rwxr-xr-x | src/scripts/ci/travis/build.sh | 5 | ||||
-rw-r--r-- | src/tests/test_ffi.cpp | 3 |
18 files changed, 63 insertions, 60 deletions
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in index 3061c9608..31277ff0c 100644 --- a/src/build-data/buildh.in +++ b/src/build-data/buildh.in @@ -6,7 +6,7 @@ * %{user}@%{hostname} running '%{command_line}' * * Target -* - Compiler: %{cxx} %{lib_opt} +* - Compiler: %{cxx} %{cxx_abi_flags} %{cc_compile_flags} * - Arch: %{submodel}/%{arch} * - OS: %{os} */ 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" </binary_link_commands> <mach_abi_linking> -all -> "/MD" -all-debug -> "/MDd" +all -> "/MD /bigobj" +all-debug -> "/MDd /bigobj" </mach_abi_linking> 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 "" diff --git a/src/build-data/makefile/header.in b/src/build-data/makefile/header.in index a83184bb8..eaf4b511d 100644 --- a/src/build-data/makefile/header.in +++ b/src/build-data/makefile/header.in @@ -1,10 +1,9 @@ # Compiler Options -CXX = %{cxx} +CXX = %{cxx} %{cxx_abi_flags} LINKER = %{linker} -LIB_OPT = %{lib_opt} -APP_OPT = %{app_opt} -LANG_FLAGS = %{lang_flags} -WARN_FLAGS = %{warn_flags} + +CXXFLAGS = %{cc_compile_flags} +WARN_FLAGS = %{cc_warning_flags} SO_OBJ_FLAGS = %{shared_flags} LIB_LINK_CMD = %{lib_link_cmd} @@ -15,9 +14,9 @@ LIB_LINKS_TO = %{link_to} APP_LINKS_TO = $(LIB_LINKS_TO) TEST_LINKS_TO = $(LIB_LINKS_TO) -LIB_FLAGS = $(SO_OBJ_FLAGS) $(LANG_FLAGS) $(LIB_OPT) $(WARN_FLAGS) -APP_FLAGS = $(LANG_FLAGS) $(APP_OPT) $(WARN_FLAGS) -TEST_FLAGS = $(LANG_FLAGS) $(APP_OPT) $(WARN_FLAGS) +LIB_FLAGS = $(SO_OBJ_FLAGS) $(CXXFLAGS) $(WARN_FLAGS) +APP_FLAGS = $(CXXFLAGS) $(WARN_FLAGS) +TEST_FLAGS = $(CXXFLAGS) $(WARN_FLAGS) SCRIPTS_DIR = %{scripts_dir} diff --git a/src/scripts/ci/circle/clang-shared-debug.sh b/src/scripts/ci/circle/clang-shared-debug.sh index 2ef4e6dd5..5f38cad7c 100755 --- a/src/scripts/ci/circle/clang-shared-debug.sh +++ b/src/scripts/ci/circle/clang-shared-debug.sh @@ -5,6 +5,6 @@ which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if avai BUILD_NICKNAME=$(basename "$0" .sh) BUILD_DIR="./build-$BUILD_NICKNAME" -./configure.py --with-build-dir="$BUILD_DIR" --build-mode=debug --cc=clang +./configure.py --with-build-dir="$BUILD_DIR" --with-debug-info --cc=clang make -j 2 -f "$BUILD_DIR"/Makefile "$BUILD_DIR"/botan-test diff --git a/src/scripts/ci/circle/clang-static-debug.sh b/src/scripts/ci/circle/clang-static-debug.sh index 6341dd467..56f111190 100755 --- a/src/scripts/ci/circle/clang-static-debug.sh +++ b/src/scripts/ci/circle/clang-static-debug.sh @@ -5,6 +5,6 @@ which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if avai BUILD_NICKNAME=$(basename "$0" .sh) BUILD_DIR="./build-$BUILD_NICKNAME" -./configure.py --with-build-dir="$BUILD_DIR" --build-mode=debug --cc=clang --disable-shared +./configure.py --with-build-dir="$BUILD_DIR" --with-debug-info --cc=clang --disable-shared make -j 2 -f "$BUILD_DIR"/Makefile "$BUILD_DIR"/botan-test diff --git a/src/scripts/ci/circle/gcc-sanitizer.sh b/src/scripts/ci/circle/gcc-sanitizer.sh new file mode 100755 index 000000000..33d474fc6 --- /dev/null +++ b/src/scripts/ci/circle/gcc-sanitizer.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -ev +which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available + +BUILD_NICKNAME=$(basename "$0" .sh) +BUILD_DIR="./build-$BUILD_NICKNAME" + +# Adding Ubsan here, only added in GCC 4.9 +./configure.py --with-build-dir="$BUILD_DIR" --with-debug-info --with-sanitizer --cc-abi-flags='-fsanitize=undefined' +make -j 2 -f "$BUILD_DIR"/Makefile +"$BUILD_DIR"/botan-test diff --git a/src/scripts/ci/circle/gcc-shared-debug.sh b/src/scripts/ci/circle/gcc-shared-debug.sh index 93530b8ac..4f5ed1b6d 100755 --- a/src/scripts/ci/circle/gcc-shared-debug.sh +++ b/src/scripts/ci/circle/gcc-shared-debug.sh @@ -5,6 +5,6 @@ which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if avai BUILD_NICKNAME=$(basename "$0" .sh) BUILD_DIR="./build-$BUILD_NICKNAME" -./configure.py --with-build-dir="$BUILD_DIR" --build-mode=debug +./configure.py --with-build-dir="$BUILD_DIR" --with-debug make -j 2 -f "$BUILD_DIR"/Makefile "$BUILD_DIR"/botan-test diff --git a/src/scripts/ci/circle/gcc-static-debug.sh b/src/scripts/ci/circle/gcc-static-debug.sh index c7d23b9b0..76f4c46b7 100755 --- a/src/scripts/ci/circle/gcc-static-debug.sh +++ b/src/scripts/ci/circle/gcc-static-debug.sh @@ -5,6 +5,6 @@ which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if avai BUILD_NICKNAME=$(basename "$0" .sh) BUILD_DIR="./build-$BUILD_NICKNAME" -./configure.py --with-build-dir="$BUILD_DIR" --build-mode=debug --disable-shared --via-amalgamation +./configure.py --with-build-dir="$BUILD_DIR" --with-debug-info --disable-shared --via-amalgamation make -j 2 -f "$BUILD_DIR"/Makefile "$BUILD_DIR"/botan-test diff --git a/src/scripts/ci/travis/build.sh b/src/scripts/ci/travis/build.sh index bb52f0648..092e9cbe6 100755 --- a/src/scripts/ci/travis/build.sh +++ b/src/scripts/ci/travis/build.sh @@ -7,10 +7,9 @@ if [ "$BUILD_MODE" = "static" ]; then elif [ "$BUILD_MODE" = "shared" ]; then CFG_FLAGS=() elif [ "$BUILD_MODE" = "coverage" ]; then - # lcov gets confused by symlinks - CFG_FLAGS=(--build-mode=coverage --link-method=copy) + CFG_FLAGS=(--with-coverage) elif [ "$BUILD_MODE" = "sanitizer" ]; then - CFG_FLAGS=(--build-mode=sanitizer) + CFG_FLAGS=(--with-sanitizer) fi if [ "$MODULES" = "min" ]; then diff --git a/src/tests/test_ffi.cpp b/src/tests/test_ffi.cpp index 75e81de97..ecaa4a27c 100644 --- a/src/tests/test_ffi.cpp +++ b/src/tests/test_ffi.cpp @@ -155,8 +155,7 @@ TEST_CASE("FFI PBKDF", "[ffi]") CHECK(iters_10ms >= 10000); /* - * Tests deactivated due to consistetly failing in debug mode where -W0 is set - * (./configure.py --build-mode=debug). + * Tests deactivated due to consistently failing when optimizations are disabled * See also: https://github.com/randombit/botan/commit/30b0e3c88e94ba04c1843798f7ac74a008e01d9b */ /* |