diff --git a/makefile b/makefile index ae3da55383..9108ecc6b5 100755 --- a/makefile +++ b/makefile @@ -261,7 +261,7 @@ endif input = List ifeq ($(use-clang),true) - build-cxx = clang -std=c++11 + build-cxx = clang++ -std=c++11 build-cc = clang else build-cxx = g++ @@ -302,7 +302,7 @@ cflags_debug_fast = -O0 -g3 cflags_stress = -O0 -g3 cflags_stress_major = -O0 -g3 ifeq ($(use-clang),true) - cflags_fast = -O4 -g3 + cflags_fast = -O3 -flto -g3 cflags_small = -Oz -g3 else cflags_fast = -O3 -g3 @@ -346,6 +346,18 @@ cflags = $(build-cflags) common-lflags = -lm -lz +ifeq ($(use-clang),true) + ifeq ($(build-platform),darwin) + common-lflags += -Wl,-export_dynamic + else + ifneq ($(platform),windows) + common-lflags += -Wl,-E + else + common-lflags += -Wl,--export-all-symbols + endif + endif +endif + build-lflags = -lz -lpthread -ldl lflags = $(common-lflags) -lpthread -ldl @@ -1657,7 +1669,7 @@ endif $(build)/%.o: $(lzma)/C/%.c @echo "compiling $(@)" @mkdir -p $(dir $(@)) - $(cxx) $(cflags) $(no-error) -c $$($(windows-path) $(<)) $(call output,$(@)) + $(cc) $(cflags) $(no-error) -c $$($(windows-path) $(<)) $(call output,$(@)) $(vm-asm-objects): $(build)/%-asm.o: $(src)/%.$(asm-format) $(compile-asm-object) @@ -1771,7 +1783,7 @@ executable-objects = $(vm-objects) $(classpath-objects) $(driver-object) \ $(javahome-object) $(boot-javahome-object) $(lzma-decode-objects) unittest-executable-objects = $(unittest-objects) $(vm-objects) \ - $(build)/util/arg-parser.o $(stub-objects) + $(build)/util/arg-parser.o $(stub-objects) $(lzma-decode-objects) ifeq ($(process),interpret) unittest-executable-objects += $(all-codegen-target-objects) diff --git a/src/avian/x86.h b/src/avian/x86.h index e428e1dd04..cbccf8f592 100644 --- a/src/avian/x86.h +++ b/src/avian/x86.h @@ -30,8 +30,8 @@ #ifdef __APPLE__ # include "mach/mach_types.h" -# include "mach/i386/thread_act.h" -# include "mach/i386/thread_status.h" +# include "mach/thread_act.h" +# include "mach/thread_status.h" # if __DARWIN_UNIX03 && defined(_STRUCT_X86_EXCEPTION_STATE32) # define FIELD(x) __##x diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 0cf5e3b465..0232c30b44 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -284,7 +284,9 @@ struct JmmInterface { const unsigned InterfaceVersion = 4; const unsigned PageSize = 4 * 1024; +#ifdef AVIAN_OPENJDK_SRC const int VirtualFileBase = 1000000000; +#endif Machine* globalMachine; diff --git a/src/compile.cpp b/src/compile.cpp index 8bce364b55..75fee5a7d4 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -50,7 +50,9 @@ const bool DebugNatives = false; const bool DebugCallTable = false; const bool DebugMethodTree = false; const bool DebugFrameMaps = false; +#ifndef NDEBUG const bool DebugIntrinsics = false; +#endif const bool CheckArrayBounds = true; diff --git a/src/tools/type-generator/main.cpp b/src/tools/type-generator/main.cpp index cdcb6c9874..8461d9f3e5 100644 --- a/src/tools/type-generator/main.cpp +++ b/src/tools/type-generator/main.cpp @@ -27,7 +27,7 @@ #define UNUSED __attribute__((unused)) -inline void operator delete(void*) { abort(); } +void operator delete(void*) { abort(); } extern "C" void __cxa_pure_virtual(void) { abort(); }