diff --git a/libclamav/c++/bytecode2llvm.cpp b/libclamav/c++/bytecode2llvm.cpp index fd7fcbfc5..d3e0a65f5 100644 --- a/libclamav/c++/bytecode2llvm.cpp +++ b/libclamav/c++/bytecode2llvm.cpp @@ -2064,7 +2064,11 @@ int bytecode_init(void) // If we have a native target, initialize it to ensure it is linked in and // usable by the JIT. +#ifndef AC_APPLE_UNIVERSAL_BUILD InitializeNativeTarget(); +#else + InitializeAllTargets(); +#endif if (!llvm_is_multithreaded()) { //TODO:cli_dbgmsg diff --git a/libclamav/c++/configure.ac b/libclamav/c++/configure.ac index 932f4710c..c416a949b 100644 --- a/libclamav/c++/configure.ac +++ b/libclamav/c++/configure.ac @@ -25,6 +25,7 @@ AM_SILENT_RULES([yes]) cxxset=${CXXFLAGS+set} AC_PROG_CXX +AC_C_BIGENDIAN if test "$cxxset" != set; then # don't use the default -O2 -g because -g bloats the C++ binaries too much @@ -210,6 +211,10 @@ if test "$enable_alltargets" = "yes"; then build_ppc=yes build_arm=yes fi +if test "$ac_cv_c_bigendian" = "universal"; then + build_x86 = yes + build_ppc = yes +fi AM_CONDITIONAL(BUILD_X86, [test "$build_x86" = "yes"]) AM_CONDITIONAL(BUILD_PPC, [test "$build_ppc" = "yes"]) AM_CONDITIONAL(BUILD_ARM, [test "$build_arm" = "yes"]) diff --git a/libclamav/c++/detect.cpp b/libclamav/c++/detect.cpp index 7994afa8b..c88fdfadc 100644 --- a/libclamav/c++/detect.cpp +++ b/libclamav/c++/detect.cpp @@ -116,8 +116,10 @@ void cli_detect_env_jit(struct cli_environment *env) earch = arch_unknown; break; } +#ifndef AC_APPLE_UNIVERSAL_BUILD if (conflicts) warn_assumptions("CPU architecture", env->arch, earch); +#endif if (earch != arch_unknown) env->arch = earch; diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 index 56af5f1aa..c38714a89 100644 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -605,6 +605,9 @@ fi if ${GREP-grep} elleemme conftest.$ac_objext >/dev/null 2>&1 ; then ac_cv_c_fpu_bigendian=no fi +if test "$ac_cv_c_bigendian" = "universal"; then + ac_cv_c_fpu_bigendian=universal +fi ]) fi @@ -619,6 +622,10 @@ case $ac_cv_c_fpu_bigendian in AC_DEFINE([FPU_WORDS_BIGENDIAN], 0, [FPU byte ordering is little endian]) have_autoitea06="yes" ;; + universal) + AC_DEFINE([FPU_WORDS_BIGENDIAN], [WORDS_BIGENDIAN], [FPU byte ordering matches CPU]) + have_autoitea06="yes" + ;; *) AC_MSG_WARN([Unable to determine FPU endianess, some features may not be available in this build]) esac