Fix bytecode and autoitea06 for Apple-style universal builds (bb #2030)

Bytecode needs to enable both PPC and X86, link in all targets,
and autoit needs fpu_endian == cpu_endian for universal builds.
0.96
Török Edvin 15 years ago
parent 47cee5042d
commit dec93ea86f
  1. 4
      libclamav/c++/bytecode2llvm.cpp
  2. 5
      libclamav/c++/configure.ac
  3. 2
      libclamav/c++/detect.cpp
  4. 7
      m4/acinclude.m4

@ -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

@ -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"])

@ -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;

@ -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

Loading…
Cancel
Save