Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centos编译报错 #342

Open
fishfly123 opened this issue Apr 29, 2022 · 3 comments
Open

Centos编译报错 #342

fishfly123 opened this issue Apr 29, 2022 · 3 comments

Comments

@fishfly123
Copy link

lwan-request.c:(.text+0xe79): undefined reference to __builtin_expect_with_probability' lwan-request.c:(.text+0x12ad): undefined reference to __builtin_expect_with_probability'
lwan-request.c:(.text+0x1485): undefined reference to __builtin_expect_with_probability' lwan-request.c:(.text+0x19b8): undefined reference to __builtin_expect_with_probability'
lwan-request.c:(.text+0x1b7a): undefined reference to __builtin_expect_with_probability' ../../lib/liblwan.a(lwan-request.c.o):lwan-request.c:(.text+0x1d79): more undefined references to __builtin_expect_with_probability' follow
collect2: error: ld returned 1 exit status
make[2]: *** [src/bin/lwan/lwan] Error 1
make[1]: *** [src/bin/lwan/CMakeFiles/lwan.dir/all] Error 2
make: *** [all] Error 2

@lpereira
Copy link
Owner

lpereira commented Apr 29, 2022 via email

@fishfly123
Copy link
Author

你好。旧的编译器没有得到很好的支持。应该可以在没有这个内置的情况下进行构建,但可能在其他地方代码依赖于旧编译器不支持的东西。不过,请随意发送补丁!我没有时间在平台上支持 Lwan,或者使用我不使用的编译器,但如果有人修复了这个问题,那么我会合并他们的补丁就好了。

On Thu, Apr 28, 2022, at 9:25 PM, fishfly123 wrote: lwan-request.c:(.text+0xe79): undefined reference to __builtin_expect_with_probability' lwan-request.c:(.text+0x12ad): undefined reference to __builtin_expect_with_probability' lwan-request.c:(.text+0x1485): undefined reference to __builtin_expect_with_probability' lwan-request.c:(.text+0x19b8): undefined reference to __builtin_expect_with_probability' lwan-request.c:(.text+0x1b7a): undefined reference to __builtin_expect_with_probability' ../../lib/liblwan.a(lwan-request.c.o):lwan-request.c:(.text+0x1d79): more undefined references to __builtin_expect_with_probability' follow collect2: error: ld returned 1 exit status make[2]: *** [src/bin/lwan/lwan] Error 1 make[1]: *** [src/bin/lwan/CMakeFiles/lwan.dir/all] Error 2 make: *** [all] Error 2 — Reply to this email directly, view it on GitHub <#342>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADVGKX5PQAGRLA3ZALEY3VHNJDZANCNFSM5UUOX6AA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

非常感谢您的回复,我可以使用哪个版本的GCC进行正确编译呢?

@kiwionly
Copy link

kiwionly commented Apr 29, 2022

@fishfly123

You could try as below:

  1. Install a package with repository for your system:
    On CentOS, install package centos-release-scl available in CentOS repository:
    $ sudo yum install centos-release-scl

  2. Install this collection, it come with GCC 9
    $ sudo yum install devtoolset-9

  3. Start using software collections:
    $ scl enable devtoolset-9 bash

I was able to build with steps above in centos 7.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants