Kaydet (Commit) 3bdb7810 authored tarafından Michael Stahl's avatar Michael Stahl

compilerplugins: strip out -m32/-m64 from CXX

These are not part of LO and need to be built with native bitness
of the compiler.

Change-Id: I41fdec130a63e0c0d07f1df228031014cd2351c2
üst 913bf64b
......@@ -9,6 +9,7 @@
# Make sure variables in this Makefile do not conflict with other variables (e.g. from gbuild).
# You may occassionally want to override some of these
CLANGCXX=$(filter-out -m32 -m64,$(CXX))
# Compile flags ('make CLANGCXXFLAGS=-g' if you need to debug the plugin)
CLANGCXXFLAGS=-O2 -Wall -Wextra -g
......@@ -73,7 +74,7 @@ CLANGOBJS=
define clangbuildsrc
$(3): $(2) $(SRCDIR)/compilerplugins/Makefile-clang.mk $(CLANGOUTDIR)/clang-timestamp
@echo [build CXX] $(subst $(SRCDIR)/,,$(2))
$(QUIET)$(CXX) $(CLANGCXXFLAGS) $(CLANGWERROR) $(CLANGDEFS) $(CLANGINCLUDES) -I$(BUILDDIR)/config_host $(2) -fPIC $(CXXFLAGS_CXX11) -c -o $(3) -MMD -MT $(3) -MP -MF $(CLANGOUTDIR)/$(1).d
$(QUIET)$(CLANGCXX) $(CLANGCXXFLAGS) $(CLANGWERROR) $(CLANGDEFS) $(CLANGINCLUDES) -I$(BUILDDIR)/config_host $(2) -fPIC $(CXXFLAGS_CXX11) -c -o $(3) -MMD -MT $(3) -MP -MF $(CLANGOUTDIR)/$(1).d
-include $(CLANGOUTDIR)/$(1).d
......@@ -85,7 +86,7 @@ $(foreach src, $(CLANGSRC), $(eval $(call clangbuildsrc,$(src),$(CLANGINDIR)/$(s
$(CLANGOUTDIR)/plugin.so: $(CLANGOBJS)
@echo [build LNK] $(subst $(BUILDDIR)/,,$@)
$(QUIET)$(CXX) -shared $(CLANGOBJS) -o $@
$(QUIET)$(CLANGCXX) -shared $(CLANGOBJS) -o $@
# Clang most probably doesn't maintain binary compatibility, so rebuild when clang changes.
$(CLANGOUTDIR)/clang-timestamp: $(CLANGBUILD)/bin/clang
......
......@@ -5628,6 +5628,10 @@ if test "$COM_GCC_IS_CLANG" = "TRUE"; then
fi
AC_LANG_PUSH([C++])
save_CPPFLAGS=$CPPFLAGS
save_CXX=$CXX
# compiler plugins must be built with "native" bitness of clang
# because they link against clang libraries
CXX=`echo $CXX | sed -e s/-m64// -e s/-m32//`
CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include -I$CLANGDIR/tools/clang/include -I$CLANGBUILD/include -I$CLANGBUILD/tools/clang/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
[COMPILER_PLUGINS=TRUE],
......@@ -5639,6 +5643,7 @@ if test "$COM_GCC_IS_CLANG" = "TRUE"; then
add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
fi
])
CXX=$save_CXX
CPPFLAGS=$save_CPPFLAGS
AC_LANG_POP([C++])
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment