Elfutils在Mac上构建错误:配置:错误:__ thread支持需要

发布于 2025-01-31 23:13:25 字数 609 浏览 3 评论 0原文

repro的说明:

$ 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

Instructions to repro:

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

Error log:

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

What is missing here?

Machine details:
MacOS 12.3.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

恰似旧人归 2025-02-07 23:13:25

我评论说,

# 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

,最后解决这个问题

I commented out

# 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]))
#

Then re-generate the configure with

autoconf

Finally, workaround this problem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文