aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-12-14 16:15:25 +0000
committerlloyd <[email protected]>2013-12-14 16:15:25 +0000
commit03d02309753b1a6c2e512bff27dca190e8f64e5c (patch)
tree7eb4f4dc1e5b264676f252c2a12446ce551a52af
parent31064f20836265e792a5dc703b84219b5dd774ff (diff)
Add AVX2 compiler flags for GCC and Clang. Tidy compiler option ordering.
-rwxr-xr-xconfigure.py9
-rw-r--r--src/build-data/cc/clang.txt12
-rw-r--r--src/build-data/cc/gcc.txt2
-rw-r--r--src/build-data/makefile/unix.in4
-rw-r--r--src/build-data/makefile/unix_shr.in4
5 files changed, 21 insertions, 10 deletions
diff --git a/configure.py b/configure.py
index f4374bf3f..607471e27 100755
--- a/configure.py
+++ b/configure.py
@@ -1053,6 +1053,9 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
for mod in modules:
if src in mod.sources():
if mod.need_isa != None:
+ if mod.need_isa not in cc.isa_flags:
+ raise Exception('Compiler does not support %s, required by %s' % (
+ mod.need_isa, src))
return cc.isa_flags[mod.need_isa]
return ''
@@ -1061,12 +1064,12 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
"""
def build_commands(sources, obj_dir, flags):
for (obj_file,src) in zip(objectfile_list(sources, obj_dir), sources):
- yield '%s: %s\n\t$(CXX) %s%s $(%s_FLAGS) %s %s$? %s$@\n' % (
+ yield '%s: %s\n\t$(CXX) %s $(%s_FLAGS) %s%s %s$? %s$@\n' % (
obj_file, src,
+ isa_specific_flags(cc, src),
+ flags,
cc.add_include_dir_option,
build_config.include_dir,
- flags,
- isa_specific_flags(cc, src),
cc.compile_option,
cc.output_to_option)
diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt
index 0af44768b..163e64272 100644
--- a/src/build-data/cc/clang.txt
+++ b/src/build-data/cc/clang.txt
@@ -30,9 +30,14 @@ darwin -> "$(CXX) -dynamiclib -fPIC -install_name $(LIBDIR)/$(SONAME)"
</so_link_flags>
<isa_flags>
+"sse2" -> "-msse2"
+"ssse3" -> "-mssse3"
+"sse4.1" -> "-msse4.1"
+"sse4.2" -> "-msse4.2"
+"avx" -> "-mavx"
"aes-ni" -> "-maes"
-"ssse3" -> "-mssse3"
-"sse2" -> "-msse2"
+"avx2" -> "-mavx2"
+"bmi2" -> "-mbmi2"
</isa_flags>
<mach_opt>
@@ -43,7 +48,8 @@ ivybridge -> "-march=core-avx-i"
</mach_opt>
<mach_abi_linking>
-all -> "-stdlib=libc++ -pthread"
+#all -> "-stdlib=libc++ -pthread"
+all -> "-stdlib=libstdc++ -pthread"
x86_64 -> "-m64"
ppc64 -> "-m64"
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt
index b8b9b15b3..52d5020e2 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -44,6 +44,8 @@ solaris -> "$(CXX) -shared -fPIC -Wl,-h,$(SONAME)"
"sse4.2" -> "-msse4.2"
"avx" -> "-mavx"
"aes-ni" -> "-maes"
+"avx2" -> "-mavx2"
+"bmi2" -> "-mbmi2"
</isa_flags>
<mach_opt>
diff --git a/src/build-data/makefile/unix.in b/src/build-data/makefile/unix.in
index 0b6afe0c3..fbc45a681 100644
--- a/src/build-data/makefile/unix.in
+++ b/src/build-data/makefile/unix.in
@@ -6,8 +6,8 @@ LANG_FLAGS = %{lang_flags}
WARN_FLAGS = %{warn_flags}
LINK_TO = %{link_to}
-LIB_FLAGS = $(LIB_OPT) $(LANG_FLAGS) $(WARN_FLAGS)
-CHECK_FLAGS = $(CHECK_OPT) $(LANG_FLAGS) $(WARN_FLAGS)
+LIB_FLAGS = $(LANG_FLAGS) $(LIB_OPT) $(WARN_FLAGS)
+CHECK_FLAGS = $(LANG_FLAGS) $(CHECK_OPT) $(WARN_FLAGS)
# Version Numbers
VERSION = %{version}
diff --git a/src/build-data/makefile/unix_shr.in b/src/build-data/makefile/unix_shr.in
index 806969a00..c412a94fd 100644
--- a/src/build-data/makefile/unix_shr.in
+++ b/src/build-data/makefile/unix_shr.in
@@ -8,8 +8,8 @@ SO_OBJ_FLAGS = %{shared_flags}
SO_LINK_CMD = %{so_link}
LINK_TO = %{link_to}
-LIB_FLAGS = $(LIB_OPT) $(LANG_FLAGS) $(WARN_FLAGS) $(SO_OBJ_FLAGS)
-CHECK_FLAGS = $(CHECK_OPT) $(LANG_FLAGS) $(WARN_FLAGS)
+LIB_FLAGS = $(SO_OBJ_FLAGS) $(LANG_FLAGS) $(LIB_OPT) $(WARN_FLAGS)
+CHECK_FLAGS = $(LANG_FLAGS) $(CHECK_OPT) $(WARN_FLAGS)
# Version Numbers
VERSION = %{version}