浏览代码

Disable LTO when checking for fsin/fcos/fldln2/...

LTO might interfere with the instruction detection and produce false positives.
(The conftest.c compiles with `-flto=auto` but fails without it)

The build for riscv64 arch linux fails because of this:
https://archriscv.felixc.at/.status/log.htm?url=logs/libcaca/libcaca-0.99.beta20-2.log

This PR fixes it.
pull/76/head
kxxt 1年前
父节点
当前提交
07cb730bf3
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. +5
    -0
      configure.ac

+ 5
- 0
configure.ac 查看文件

@@ -145,6 +145,9 @@ AC_COMPILE_IFELSE(
AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the ‘Sleep’ function.])],
[AC_MSG_RESULT(no)])

# Disable LTO when checking for the instructions
CFLAGS="${CFLAGS} -fno-lto"

AC_MSG_CHECKING(for fsin/fcos)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
@@ -163,6 +166,8 @@ AC_COMPILE_IFELSE(
AC_DEFINE(HAVE_FLDLN2, 1, [Define to 1 if you have the ‘fldln2’ and other floating point instructions.])],
[AC_MSG_RESULT(no)])

CFLAGS="${CFLAGS%$' -fno-lto'}"

AC_CHECK_HEADERS(zlib.h)
AC_CHECK_LIB(z, gzopen, [ZLIB_LIBS="${ZLIB_LIBS} -lz"])



正在加载...
取消
保存