[cxx] Compile mini-llvm.c as C++ if configure -enable-cxx. (mono/mono#17558)
authorJay Krell <jaykrell@microsoft.com>
Fri, 25 Oct 2019 15:46:01 +0000 (08:46 -0700)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Fri, 25 Oct 2019 15:46:01 +0000 (17:46 +0200)
[cxx] Compile mini-llvm.c as C++ if configure -enable-cxx.

This is presently catastrophic, because of `MonoJitICallId` varying between C and C++, and therefore the layout of `MonoCallInst`.

Related to:
https://github.com/mono/mono/pull/17557

https://github.com/mono/mono/pull/17445#issuecomment-546175352

Commit migrated from https://github.com/mono/mono/commit/893486638cae8efc46323d6c2209fc99febcd05d

src/mono/mono/mini/Makefile.am.in

index 5f53066..0c66de7 100755 (executable)
@@ -214,6 +214,7 @@ if LOADED_LLVM
 lib_LTLIBRARIES += libmono-llvm.la
 libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp
 libmono_llvm_la_LIBADD = $(glib_libs) $(LLVM_LIBS) $(LLVM_LDFLAGS)
+libmono_llvm_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@
 
 if HOST_DARWIN
 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace