【问题标题】:Please use compiler that supports __attribute__((constructor))请使用支持 __attribute__((constructor)) 的编译器
【发布时间】:2020-05-13 02:10:10
【问题描述】:

我刚刚使用 gcc/4.8.2 编译了我自己的 gcc/9.2.0 版本。成功编译和安装 gcc/9.2.0 后,我尝试编译 ucx-1.5.1。当我尝试运行 ucx 配置脚本时,我收到以下消息“检查 attribute((constructor))... configure: error: Cannot continue. Please use compiler that supports attribute强>((构造函数))”。 当我使用旧的 gcc/4.8.2 运行脚本时,完全没有错误。

知道出了什么问题吗?

【问题讨论】:

  • gcc/9.2.0 是否可能不支持“__attribute__((constructor))”?

标签: gcc configure ucx


【解决方案1】:

知道出了什么问题吗? 没有。

您可以查看相应的config.log 文件,它通常包含附加信息。一般来说,configue 期间的每个编译错误都不是问题,通常只是功能测试才发现特定功能不可用。

【讨论】:

    【解决方案2】:

    Ucx 使用next code 来确定属性__attribute__((constructor)) 的支持。你可以自己测试一下:

    gcc -x c - <<EOF 
    static int rc = 1;
    static void constructor_test() __attribute__((constructor));
    static void constructor_test() { rc = 0; }
    int main() { return rc; }
    EOF
    

    如果您有错误,请在此处发布。

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题,因为我在 CentOS 8.4 上安装了一个名为“binutils-devel”的软件。

      去掉“binutils-devel”后,ucx编译成功。

      【讨论】:

        猜你喜欢
        • 2019-06-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-12-28
        • 1970-01-01
        • 2020-05-29
        相关资源
        最近更新 更多