-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add the needed bits for compiling with link-time optimization. #109
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #109 +/- ##
===========================================
- Coverage 94.48% 94.34% -0.14%
===========================================
Files 32 32
Lines 3750 3764 +14
===========================================
+ Hits 3543 3551 +8
- Misses 207 213 +6
Continue to review full report at Codecov.
|
3af8e8e
to
13bf3f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really enough to make it work? I was under the impression we needed __attribute__ ((symver))
as well (see GCC bug 48200).
Why is it necessary to use -flto-partition=none
?
I was under the impression one ought to set AR, CC, NM, RANLIB, and CFLAGS as arguments to configure, e.g.
./configure CC="gcc" AR="gcc-ar" NM="gcc-nm" RANLIB="gcc-ranlib" CFLAGS="-g -O2 -flto -flto-partition=none" ...
The change to use ${NM-nm}
in test/symbols-*.sh is approved independent of the rest of the patch, please go ahead and push it separately.
13bf3f3
to
a3c3066
Compare
@zackw I've fixed your concerns in the rebased commits.
For LLVM/Clang it simply works that way. For GCC 10.2 one either needs to implement
This is necessary, if one does NOT use |
877603d
to
3055b52
Compare
@zackw Tested and works with GCC 10.2, LTO enabled: https://koji.fedoraproject.org/koji/buildinfo?buildID=1593132 |
@zackw Would you mind to have another look here? |
3055b52
to
2e443c5
Compare
Before merging this, would anyone please comment on the concerns I brought up in #24 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to say I share @solardiz's concerns about exposing latent UB. I would be okay with merging the changes to crypt-port.h
, documenting that an LTO-using build is now possible but experimental and discouraged for production use, and not changing libxcrypt.spec.rpkg yet. [never mind that last bit, I thought it was the spec for what actually goes into Fedora]
If we made the configure script detect LTO and force --disable-obsolete-api
when it did, do you think that would be sufficient to "ensure that build wouldn't be inadvertently usable in production", @solardiz ?
Also, just to verify, the |
Yes, that's correct. |
Can we get a CI build with all hashes enabled, LTO on, and ASan+UBSan also on? That would be a quick way to get some more confidence that the code is UB-sound. |
I will check if that's possible. We LLVM / Clang >= 7 on Travis for this. Or is this possible with GCC as well? We can use Fedora >= 32 to do it, if GCC supports that as well. |
2e443c5
to
78ca901
Compare
I think that would be weird - mixing unrelated things together, and excluding the obsolete APIs from our own LTO stress-testing. If we do use LTO for stress-testing, let's use the opportunity fully. |
78ca901
to
f4c22e8
Compare
GCC 10 and LLVM/Clang 10 offer initial support for building libraries, that are using symbol versioning features, with LTO. To make use of this with GCC 10, the exported versioned symbols need to be declared explicitly with __attribute__((symver (...))). LLVM/Clang 10 supports symbol versioning with LTO out of the box without any changes needed. Fixes #24.
This reverts commit 328563b.
f4c22e8
to
cbf3d3a
Compare
cbf3d3a
to
6a2a314
Compare
Here is an overview of what got changed by this pull request: Issues
======
- Added 1
See the complete overview on Codacy |
Every time you force-push this branch, I get multiple emails from Codacy about the missing syntax-highlighting annotation in the README. It's making it hard for me to tell what actually changed :-( |
@zackw For some funny reason I can even reproduce the errors shown on TravisCI with GCC 10.2 + ASan,UBSan without LTO enabled… :S The other funny thing is: If I replace |
GCC 10.2 and LLVM/Clang 10 offer initial support for building libraries, that are using symbol versioning features, with LTO.
To make use of this with GCC 10.2, the exported versioned symbols need to be declared explicitly with
__attribute__((symver (...)))
.LLVM/Clang 10 supports symbol versioning with LTO out of the box without any changes needed.
Fixes #24.