diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-08-08 14:58:08 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2014-08-26 01:10:23 +0200 |
commit | 31c1ceaf50f911b5ea22a1f7770b961343483230 (patch) | |
tree | 87dcac6a8e47225b7ffaa8c769496883961a1e8b | |
parent | 2d32d70f646e04c28d44fabd9e77d56a812d2aec (diff) |
fdo#82430: configure: MSVC build: avoid using SSE2 instructions
MSVC 2012 for x86 defaults to -arch:SSE2; binaries do not run on any AMD
32-bit CPU, neither on Intel Pentium III.
http://msdn.microsoft.com/en-us/library/vstudio/7t5yh4fd%28v=vs.110%29.aspx
(cherry picked from commit 8bd6bf93b7711a7ac7c5cbd7c3bb980481570ebd)
fdo#82430: MSVC 2010 refuses both -clr and -arch in the same command
(cherry picked from commit 36ce22f41a754fa405804434899a08a23081e721)
fdo#82430: gcc-wrappers: don't stop if REAL_CXX_FLAGS is empty
Hopefully should fix MSVC 2010 build...
(cherry picked from commit a18ff3d5c75c2b468c48bd19439dee0689d24d67)
Change-Id: Ie8253137db2699f2a7fa69c4ac4e7ded90931e3e
Reviewed-on: https://gerrit.libreoffice.org/10925
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
(cherry picked from commit f83c7358964cf9f265f21e7dfa72e82a26923b3e)
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | external/liblangtag/ExternalProject_langtag.mk | 4 | ||||
-rw-r--r-- | external/openssl/ExternalProject_openssl.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 6 | ||||
-rw-r--r-- | solenv/gcc-wrappers/g++.cxx | 4 | ||||
-rw-r--r-- | solenv/gcc-wrappers/gcc.cxx | 4 | ||||
-rw-r--r-- | solenv/gcc-wrappers/wrapper.cxx | 5 | ||||
-rw-r--r-- | solenv/gcc-wrappers/wrapper.hxx | 2 |
8 files changed, 22 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index bbf4775fbdbf..ed16fa4d6652 100644 --- a/configure.ac +++ b/configure.ac @@ -3775,6 +3775,9 @@ if test "$_os" = "WINNT"; then COMPATH=`echo $VC_PRODUCT_DIR` fi fi + if test "$BITNESS_OVERRIDE" = "" -a "$vcnum" != "100"; then + CC="$CC -arch:SSE" # MSVC 2012 default for x86 is -arch:SSE2 + fi export INCLUDE=`cygpath -d "$COMPATH/Include"` PathFormat "$COMPATH" diff --git a/external/liblangtag/ExternalProject_langtag.mk b/external/liblangtag/ExternalProject_langtag.mk index c3d411509cc3..8835bdf001b2 100644 --- a/external/liblangtag/ExternalProject_langtag.mk +++ b/external/liblangtag/ExternalProject_langtag.mk @@ -31,7 +31,9 @@ $(call gb_ExternalProject_get_state_target,langtag,build): $(if $(filter-out LINUX FREEBSD,$(OS)),,LDFLAGS="-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath,\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib) \ $(if $(filter-out SOLARIS,$(OS)),,LDFLAGS="-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-R$(COMMA)\\"\$$\$$ORIGIN:'\'\$$\$$ORIGIN/../ure-link/lib) \ $(if $(filter-out WNTGCC,$(OS)$(COM)),,LDFLAGS="-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2") \ - && $(if $(filter WNTMSC,$(OS)$(COM)),REAL_CC="$(shell cygpath -w $(lastword $(CC)))") \ + && $(if $(filter WNTMSC,$(OS)$(COM)),\ + REAL_CC="$(shell cygpath -w $(lastword $(filter-out -%,$(CC))))" \ + REAL_CC_FLAGS="$(filter -%,$(CC))") \ $(if $(VERBOSE)$(verbose),V=1) \ $(gb_Helper_set_ld_path) \ $(MAKE) \ diff --git a/external/openssl/ExternalProject_openssl.mk b/external/openssl/ExternalProject_openssl.mk index 12c757610ca5..ea5f8b22b1c8 100644 --- a/external/openssl/ExternalProject_openssl.mk +++ b/external/openssl/ExternalProject_openssl.mk @@ -61,7 +61,7 @@ OPENSSL_PLATFORM := \ ifeq ($(COM),MSC) $(call gb_ExternalProject_get_state_target,openssl,build): $(call gb_ExternalProject_run,build,\ - export CC="$(shell cygpath -w $(CC))" \ + export CC="$(shell cygpath -w $(filter-out -%,$(CC))) $(filter -%,$(CC))" \ && export PERL="$(shell cygpath -w $(PERL))" \ && export LIB="$(ILIB)" \ && $(PERL) Configure $(OPENSSL_PLATFORM) no-idea \ diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index fb617ac9e85b..dec9e81f91d5 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -503,9 +503,11 @@ endef # /opt/lo/bin/ccache /cygdrive/c/PROGRA~2/MICROS~2.0/VC/bin/cl.exe gb_AUTOCONF_WRAPPERS = \ - REAL_CC="$(shell cygpath -w $(CC))" \ + REAL_CC="$(shell cygpath -w $(filter-out -%,$(CC)))" \ + REAL_CC_FLAGS="$(filter -%,$(CC))" \ CC="$(call gb_Executable_get_target,gcc-wrapper)" \ - REAL_CXX="$(shell cygpath -w $(CXX))" \ + REAL_CXX="$(shell cygpath -w $(filter-out -%,$(CXX)))" \ + REAL_CXX_FLAGS="$(filter -%,$(CXX))" \ CXX="$(call gb_Executable_get_target,g++-wrapper)" \ LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo" diff --git a/solenv/gcc-wrappers/g++.cxx b/solenv/gcc-wrappers/g++.cxx index d2ee3d555e0a..626b1643590c 100644 --- a/solenv/gcc-wrappers/g++.cxx +++ b/solenv/gcc-wrappers/g++.cxx @@ -13,8 +13,10 @@ int main(int argc, char *argv[]) { vector<string> rawargs(argv + 1, argv + argc); string command=getexe("REAL_CXX"); + string flags=getexe("REAL_CXX_FLAGS", true); - string args=processccargs(rawargs); + string args=flags.empty() ? string() : flags + " "; + args += processccargs(rawargs); setupccenv(); diff --git a/solenv/gcc-wrappers/gcc.cxx b/solenv/gcc-wrappers/gcc.cxx index b8983cf6e5e6..f34c2dba8c99 100644 --- a/solenv/gcc-wrappers/gcc.cxx +++ b/solenv/gcc-wrappers/gcc.cxx @@ -13,8 +13,10 @@ int main(int argc, char *argv[]) { vector<string> rawargs(argv + 1, argv + argc); string command=getexe("REAL_CC"); + string flags=getexe("REAL_CC_FLAGS", true); - string args=processccargs(rawargs); + string args=flags.empty() ? string() : flags + " "; + args += processccargs(rawargs); setupccenv(); diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx index ba22e1642630..585a7df4c95c 100644 --- a/solenv/gcc-wrappers/wrapper.cxx +++ b/solenv/gcc-wrappers/wrapper.cxx @@ -15,11 +15,14 @@ #define BUFLEN 2048 -string getexe(string exename) { +string getexe(string exename, bool maybeempty) { char* cmdbuf; size_t cmdlen; _dupenv_s(&cmdbuf,&cmdlen,exename.c_str()); if(!cmdbuf) { + if (maybeempty) { + return string(); + } cout << "Error " << exename << " not defined. Did you forget to source the environment?" << endl; exit(1); } diff --git a/solenv/gcc-wrappers/wrapper.hxx b/solenv/gcc-wrappers/wrapper.hxx index 985074196c75..36baa0899032 100644 --- a/solenv/gcc-wrappers/wrapper.hxx +++ b/solenv/gcc-wrappers/wrapper.hxx @@ -13,7 +13,7 @@ using namespace std; -string getexe(string exename); +string getexe(string exename, bool maybeempty = false); void setupccenv(); |