-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix symbol visibility issues, add test for it #1359
base: master
Are you sure you want to change the base?
Conversation
ee45fa1
to
f816729
Compare
Rebased on top of the merged #1356. |
f816729
to
d7b1cea
Compare
d7b1cea
to
be7ccb9
Compare
be7ccb9
to
5e37264
Compare
5e37264
to
0203b09
Compare
Is it possible for a Cirrus persistent worker to do not override environment variables set with the |
Maybe |
0203b09
to
542ea42
Compare
542ea42
to
b80241b
Compare
Rebased to resolve conflicts. |
7f53ffc
to
4ec4220
Compare
Agreed. Rebased and ready to move forward :) |
4ec4220
to
b40e4e3
Compare
b40e4e3
to
f2a6941
Compare
f2a6941
to
4f64b9f
Compare
Rebased. |
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.
Code review and approach ACK.
Cool that this caught a real (new) symbol leak.
@fanquake suggested that the test could potentially be simplified for c-i.
src/util_defs.h
Outdated
/* Global variable visibility */ | ||
/* See: https://github.com/bitcoin-core/secp256k1/issues/1181 */ | ||
#if !defined(_WIN32) && defined(__GNUC__) && (__GNUC__ >= 4) | ||
# define SECP256K1_LOCAL_VAR extern __attribute__ ((visibility ("hidden"))) |
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.
The combo of extern + hidden isn't completely intuitive, but the gcc visibility guide confirms that it makes sense.
src/util_defs.h
Outdated
@@ -0,0 +1,12 @@ | |||
#ifndef SECP256K1_UTIL_DEFS_H | |||
#define SECP256K1_UTIL_DEFS_H |
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.
Nit: util_defs.h
is pretty ambiguous. How about util_local_visibility.h
or so?
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.
Thanks! Reworked.
@@ -267,8 +267,6 @@ else() | |||
try_append_c_flags(-Wundef) | |||
endif() | |||
|
|||
set(CMAKE_C_VISIBILITY_PRESET hidden) |
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.
In case it's not obvious to other reviewers, this is no longer needed because every non-static function should be externally visible.
If we ever need to share private symbols between compilation units this won't work. But I agree that it makes sense to take advantage of that if we can.
This change makes the `-fvisibility=hidden` compiler option unnecessary.
4f64b9f
to
44a9392
Compare
To clarify, the fix is in the first commit. The excerpt from the CI log with an error message from the previous iteration of this branch looks as follows:
Thanks! The |
Closes #1181.
Catches the actual symbol visibility issue.
Replaces #1135.