From: Christian Brauner Date: Fri, 29 Jan 2021 12:04:58 +0000 (+0100) Subject: configure: fix static builds with clang-12 and LTO X-Git-Tag: lxc-5.0.0~313^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d6bfd4f6ca7469f764a0568ad545c2515ef6124;p=thirdparty%2Flxc.git configure: fix static builds with clang-12 and LTO Signed-off-by: Christian Brauner --- diff --git a/configure.ac b/configure.ac index bc1aec88e..4f31d94ac 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,18 @@ if test "x$valid_compiler" = "xno"; then AC_MSG_ERROR([Sorry, your compiler is too old - please upgrade it]) fi +AC_PROG_GCC_TRADITIONAL +AC_ENABLE_SHARED +AC_ENABLE_STATIC +# Check binaries +AC_PROG_SED +case $CC in clang*) + AC_CHECK_TOOL([AR], llvm-ar) + AC_CHECK_TOOL([NM], llvm-nm) + AC_CHECK_TOOL([OBJCOPY], llvm-objcopy) + AC_CHECK_TOOL([RANLIB], llvm-ranlib) +esac + # libtool LT_INIT AC_SUBST([LIBTOOL_DEPS]) @@ -731,10 +743,6 @@ AC_CHECK_TYPES([struct rtnl_link_stats64], [], [], [[#include ] AX_PTHREAD AC_SEARCH_LIBS(clock_gettime, [rt]) -# Check for some standard binaries -AC_PROG_GCC_TRADITIONAL -AC_PROG_SED - # See if we support thread-local storage. LXC_CHECK_TLS