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

PHP build failure in aflplusplus-lto #99

Open
moratorium08 opened this issue May 1, 2022 · 2 comments
Open

PHP build failure in aflplusplus-lto #99

moratorium08 opened this issue May 1, 2022 · 2 comments

Comments

@moratorium08
Copy link

We cannot build PHP targets by the setting of aflplusplus_lto.

ld.lld: error: undefined symbol: std::__throw_length_error(char const*)
>>> referenced by stl_vector.h:1505 (/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:1505)
>>>               lto.tmp:(std::vector<icu_60::UnicodeString, std::allocator<icu_60::UnicodeString> >::_M_check_len(unsigned long, char const*) const)
>>> referenced by stl_vector.h:1505 (/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:1505)
>>>               lto.tmp:(std::vector<icu_60::Formattable, std::allocator<icu_60::Formattable> >::_M_check_len(unsigned long, char const*) const)

It seems to be related to this issue. And in fact, as indicated in that issue, when we disable `intl', the build succeeds.

Though I'm not sure what is the root cause of this, we confirmed that we can successfully build it without LTO (aflplusplus). Therefore, LTO is doing something bad.

@adrianherrera
Copy link
Member

Hmmm I'm not sure what the relation is with that issue. I have seen a similar C++ error before, and from memory it seemed to relate to a mix of standard libraries (libc++ vs libstdc++).

If I have some time, I'll have a dig and see what I can find.

Thanks for raising the issue!

@acidghost
Copy link

@moratorium08 I think the problem is with older versions of LLD which do not support IFUNC.

PHP compiles fine with LTO and LLVM 16. Just be aware that it's memory hungry and can go OOM with -j$(nproc).

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