From b1021ca76bb3c47b1b520421ccece38d772e5907 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Thu, 3 Nov 2016 11:52:32 -0400 Subject: Add new configure argument --optimize-for-size Uses -Os for GCC/Clang/ICC, /O1 for MSVC. Might be used in the future to control compile time features also (eg using a large precomputed table, vs not). Does not have any influence on module selection, just informs the build that a smaller binary is preferable. [ci skip] --- src/build-data/cc/clang.txt | 1 + src/build-data/cc/gcc.txt | 1 + src/build-data/cc/icc.txt | 1 + src/build-data/cc/msvc.txt | 1 + 4 files changed, 4 insertions(+) (limited to 'src/build-data/cc') diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt index 8c5baf7ca..c4a85658f 100644 --- a/src/build-data/cc/clang.txt +++ b/src/build-data/cc/clang.txt @@ -16,6 +16,7 @@ maintainer_warning_flags "-Qunused-arguments -Werror -Wno-error=unused-parameter compile_flags "-c" debug_info_flags "-g" optimization_flags "-O3" +size_optimization_flags "-Os" #sanitizer_flags "-fsanitize=address,undefined -fsanitize-coverage=edge,indirect-calls,8bit-counters -fno-sanitize-recover=undefined" sanitizer_flags "-fsanitize=address,undefined" diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index b086583ff..b88454ce6 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -17,6 +17,7 @@ maintainer_warning_flags "-Wold-style-cast -Wsuggest-override -Wshadow -Werror - compile_flags "-c" debug_info_flags "-g" optimization_flags "-O3" +size_optimization_flags "-Os" shared_flags "-fPIC" coverage_flags "--coverage" diff --git a/src/build-data/cc/icc.txt b/src/build-data/cc/icc.txt index 084d2a4f2..f1b7e5a15 100644 --- a/src/build-data/cc/icc.txt +++ b/src/build-data/cc/icc.txt @@ -10,6 +10,7 @@ add_lib_option -l compile_flags "-c" debug_info_flags "-g" optimization_flags "-O2" +size_optimization_flags "-Os" 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 8231c0429..c1b820b91 100644 --- a/src/build-data/cc/msvc.txt +++ b/src/build-data/cc/msvc.txt @@ -11,6 +11,7 @@ add_lib_option "" compile_flags "/nologo /c" optimization_flags "/O2" +size_optimization_flags "/O1" # for debug info in the object file: #debug_info_flags "/Z7" -- cgit v1.2.3