diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 9295c949f..0b1dd47a2 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -638,7 +638,19 @@ def is_compiler(given, expected): def is_CXX_gpp(): return is_compiler(CXX, 'g++') +def is_clang_in_gpp_form(cc): + outf = open('clang_version', 'rw') + subprocess.call([cc, '--version'], stdout=outf, stderr=outf) + outf.seek(0) + version_string = outf.read() + contains_clang = version_string.find('clang') != -1 + outf.close() + os.remove('clang_version') + return contains_clang + def is_CXX_clangpp(): + if is_compiler(CXX, 'g++'): + return is_clang_in_gpp_form(CXX) return is_compiler(CXX, 'clang++') def get_cpp_files(path): diff --git a/src/util/hwf.cpp b/src/util/hwf.cpp index 8585e7eda..40d20b644 100644 --- a/src/util/hwf.cpp +++ b/src/util/hwf.cpp @@ -49,8 +49,11 @@ Revision History: // clear to the compiler what instructions should be used. E.g., for sqrt(), the Windows compiler selects // the x87 FPU, even when /arch:SSE2 is on. // Luckily, these are kind of standardized, at least for Windows/Linux/OSX. +#ifdef __clang__ +#undef USE_INTRINSICS +#else #include - +#endif hwf_manager::hwf_manager() : m_mpz_manager(m_mpq_manager)