elftutils 在 Mac 上构建错误:配置:错误:需要 __thread 支持

问题描述 投票:0回答:1

重现说明:

$ git clone --depth=1  git://sourceware.org/git/elfutils.git
$ cd elfutils
$ autoreconf -i -f
$ ./configure

错误日志:

...
checking whether the compiler generates build-ids... ./configure: line 6951: -n: command not found
no
configure: WARNING: compiler doesn't generate build-id by default
checking whether gcc supports -Wl,-z,relro... no
checking for __thread support... no
configure: error: __thread support required

这里缺少什么?

机器详情: MacOS 12.3.1

macos elf binutils dwarf
1个回答
0
投票

我评论掉了

# AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
# # Use the same flags that we use for our DSOs, so the test is representative.
# # Some old compiler/linker/libc combinations fail some ways and not others.
# save_CFLAGS="$CFLAGS"
# save_LDFLAGS="$LDFLAGS"
# CFLAGS="-fpic $CFLAGS"
# LDFLAGS="-shared -Wl,-z,defs,-z,relro $LDFLAGS"
# AC_LINK_IFELSE([dnl
# AC_LANG_PROGRAM([[#undef __thread
# static __thread int a; int foo (int b) { return a + b; }]],
#               [[exit (foo (0));]])],
#              ac_cv_tls=yes, ac_cv_tls=no)
# CFLAGS="$save_CFLAGS"
# LDFLAGS="$save_LDFLAGS"])
# AS_IF([test "x$ac_cv_tls" != xyes],
#       AC_MSG_ERROR([__thread support required]))
#

然后重新生成配置

autoconf

最后解决这个问题

© www.soinside.com 2019 - 2024. All rights reserved.