diff options
author | lloyd <[email protected]> | 2013-04-17 16:06:56 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-04-17 16:06:56 +0000 |
commit | 77f0c643c0a575842fda1891f68bebc4bb8d2697 (patch) | |
tree | d066a4075efd5450e25780392f6b32e7f85a2c9a /src/build-data/cc | |
parent | f1d38d7a08b3939148b3426d00244bad89d23948 (diff) |
Always include modules requiring ISA extensions as long as the
compiler and target platform might support it. For instance the AES
SSSE3 code is now always in any x86 build, with just that specific
file being compiled with -mssse3. Since we'll only call that code if
cpuid confirms it works at runtime, we don't have portability issues,
and it can be safely included in generic builds (eg for distributions).
Tweak how machine specific compiler flags are generated to be a bit
easier to maintain.
Diffstat (limited to 'src/build-data/cc')
-rw-r--r-- | src/build-data/cc/clang.txt | 21 | ||||
-rw-r--r-- | src/build-data/cc/gcc.txt | 37 | ||||
-rw-r--r-- | src/build-data/cc/xlc.txt | 2 |
3 files changed, 34 insertions, 26 deletions
diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt index 40bdb0a0b..0af44768b 100644 --- a/src/build-data/cc/clang.txt +++ b/src/build-data/cc/clang.txt @@ -1,5 +1,3 @@ -# Largely copied from the gcc config - macro_name CLANG binary_name clang++ @@ -11,15 +9,15 @@ add_lib_dir_option -L add_lib_option -l lang_flags "-D_REENTRANT -std=c++11" -warning_flags "-W -Wall" +warning_flags "-Wextra -Wall" makefile_style unix lib_opt_flags "-O3" check_opt_flags "-O2" shared_flags "-fPIC" -debug_flags -g -no_debug_flags "-finline-functions" +debug_flags "-g -fno-inline-functions" +no_debug_flags "" visibility_build_flags "-fvisibility=hidden" visibility_attribute '__attribute__((visibility("default")))' @@ -31,10 +29,17 @@ default -> "$(CXX) -shared -fPIC -Wl,-soname,$(SONAME)" darwin -> "$(CXX) -dynamiclib -fPIC -install_name $(LIBDIR)/$(SONAME)" </so_link_flags> +<isa_flags> +"aes-ni" -> "-maes" +"ssse3" -> "-mssse3" +"sse2" -> "-msse2" +</isa_flags> + <mach_opt> -x86_64 -> "-march=SUBMODEL" -nehalem -> "-march=corei7" -westmere -> "-march=corei7 -maes" +x86_64 -> "-march=SUBMODEL" +nehalem -> "-march=corei7" +sandybridge -> "-march=corei7-avx" +ivybridge -> "-march=core-avx-i" </mach_opt> <mach_abi_linking> diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index 59e9671f5..cfa223098 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -16,8 +16,7 @@ maintainer_warning_flags "-Werror -Wall -Wextra -Wstrict-aliasing -Wstrict-overf lib_opt_flags "-O3" check_opt_flags "-O2" shared_flags "-fPIC" -debug_flags -g -no_debug_flags "-finline-functions" +debug_flags "-g -fno-inline-functions" visibility_build_flags "-fvisibility=hidden" visibility_attribute '__attribute__((visibility("default")))' @@ -39,22 +38,25 @@ hpux -> "$(CXX) -shared -fPIC -Wl,+h,$(SONAME)" solaris -> "$(CXX) -shared -fPIC -Wl,-h,$(SONAME)" </so_link_flags> +<isa_flags> +"sse2" -> "-msse2" +"ssse3" -> "-mssse3" +"sse4.1" -> "-msse4.1" +"sse4.2" -> "-msse4.2" +"avx" -> "-mavx" +"aes-ni" -> "-maes" +</isa_flags> + <mach_opt> # Avoid using -march=i[345]86, instead tune for generic -i386 -> "-mtune=generic -momit-leaf-frame-pointer" -i486 -> "-mtune=generic -momit-leaf-frame-pointer" -i586 -> "-mtune=generic -momit-leaf-frame-pointer" +i386 -> "-mtune=generic" +i486 -> "-mtune=generic" +i586 -> "-mtune=generic" # Translate to GCC-speak -nehalem -> "-march=corei7 -momit-leaf-frame-pointer" -westmere -> "-march=corei7 -maes -momit-leaf-frame-pointer" - -#nehalem -> "-march=core2 -msse4.1 -msse4.2 -momit-leaf-frame-pointer" -#westmere -> "-march=core2 -msse4.1 -msse4.2 -maes -momit-leaf-frame-pointer" - -sandybridge -> "-march=corei7-avx -momit-leaf-frame-pointer" -ivybridge -> "-march=core-avx-i -momit-leaf-frame-pointer" -atom32 -> "-march=atom -momit-leaf-frame-pointer" +nehalem -> "-march=corei7" +sandybridge -> "-march=corei7-avx" +ivybridge -> "-march=core-avx-i" ppc601 -> "-mpowerpc -mcpu=601" cellppu -> "-mcpu=cell" @@ -83,8 +85,11 @@ ppc32 -> "-mcpu=SUBMODEL" ppc ppc64 -> "-mcpu=SUBMODEL" ppc sparc32 -> "-mcpu=SUBMODEL -Wa,-xarch=v8plus" sparc32- sparc64 -> "-mcpu=v9 -mtune=SUBMODEL" -x86_32 -> "-march=SUBMODEL -momit-leaf-frame-pointer" -x86_64 -> "-march=SUBMODEL -momit-leaf-frame-pointer" +x86_32 -> "-march=SUBMODEL" +x86_64 -> "-march=SUBMODEL" + +all_x86_32 -> "-momit-leaf-frame-pointer" +all_x86_64 -> "-momit-leaf-frame-pointer" </mach_opt> # The 'linking' bit means "use this for both compiling *and* linking" diff --git a/src/build-data/cc/xlc.txt b/src/build-data/cc/xlc.txt index 87b32746b..609439243 100644 --- a/src/build-data/cc/xlc.txt +++ b/src/build-data/cc/xlc.txt @@ -21,8 +21,6 @@ cellppu -> "-qarch=cell" ppc970 -> "-qarch=ppc970" power4 -> "-qarch=pwr4" power5 -> "-qarch=pwr5" - -cellppu -> "-qarch=cell" </mach_opt> <so_link_flags> |