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

Issue 4596 - Build with clang/lld fails when LTO enabled #4929

Closed
wants to merge 2 commits into from
Closed

Issue 4596 - Build with clang/lld fails when LTO enabled #4929

wants to merge 2 commits into from

Conversation

vashirov
Copy link
Member

Issue 4596 - Build with clang/lld fails when LTO enabled

Bug Description:
Build with clang/lld fails with undefined reference error.

ld.lld: error: ./.libs/libslapd.so: undefined reference to __rust_probestack [--no-allow-shlib-undefined]
ld.lld: error: ./.libs/libslapd.so: undefined reference to __muloti4 [--no-allow-shlib-undefined]

Fix Description:

  • Disabled GCC security flags when building with clang.
  • lld by default uses xxhash for build ids, which is too small for rpm
    (it requires it between 16 and 64 bytes in size), use sha1 instead.
  • Switch debug CFLAGS and LDFLAGS to use DWARF4 instead of DWARF5.
  • Disable LTO for clang rpm build.

Fixes: #4596

Reviewed by: ???

Firstyear and others added 2 commits September 15, 2021 12:14
Bug Description: Fedora is introducing lto by default which
may affect our build especially with rust and asan

Fix Description: Adapt how we use lto and how we link in
our builds so that lto works for gcc.

fixes: #4596

Author: William Brown <[email protected]>

Review by: ???
Bug Description:
Build with clang/lld fails with undefined reference error.
```
ld.lld: error: ./.libs/libslapd.so: undefined reference to __rust_probestack [--no-allow-shlib-undefined]
ld.lld: error: ./.libs/libslapd.so: undefined reference to __muloti4 [--no-allow-shlib-undefined]
```

Fix Description:
* Disabled GCC security flags when building with clang.
* lld by default uses xxhash for build ids, which is too small for rpm
(it requires it between 16 and 64 bytes in size), use sha1 instead.
* Switch debug CFLAGS and LDFLAGS to use DWARF4 instead of DWARF5.
* Disable LTO for clang rpm build.

Fixes: #4596

Reviewed by: ???
Copy link
Contributor

@Firstyear Firstyear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@vashirov
Copy link
Member Author

Hmm, it breaks compilation with GCC, I need to revise it.

Copy link
Contributor

@Firstyear Firstyear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unmarked from approved

@vashirov vashirov closed this by deleting the head repository Jan 24, 2024
@vashirov
Copy link
Member Author

vashirov commented Nov 1, 2024

I recreated my fork, and it deleted this PR. I can't reopen it, so I resubmitted it as #6392

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

Successfully merging this pull request may close these issues.

Build with clang/lld fails with undefined reference error when LTO is enabled
2 participants