-
Notifications
You must be signed in to change notification settings - Fork 63
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: compile aarch64-linux-android binary on linux when enable lto. #83
Conversation
jemalloc-sys/build.rs
Outdated
@@ -338,6 +338,11 @@ fn main() { | |||
println!("cargo:rustc-link-lib=atomic"); | |||
} | |||
println!("cargo:rerun-if-changed=jemalloc"); | |||
|
|||
cc::Build::new() |
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.
Should only be built for android.
jemalloc-sys/src/pthread_atfork.c
Outdated
// we're building on doesn't have them defined, so just make sure the symbols | ||
// are available. | ||
__attribute__((weak)) int | ||
pthread_atfork(uint8_t *prefork __attribute__((unused)), |
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.
Should use the definition from https://man7.org/linux/man-pages/man3/pthread_atfork.3.html. The original definition is just for convenient.
PTAL @BusyJay |
You need to sign off your commits. |
fad8165
to
a1a0167
Compare
Done. |
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.
Rest LGTM
jemalloc-sys/src/pthread_atfork.c
Outdated
@@ -0,0 +1,13 @@ | |||
#include <pthread.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.
I don't think you need to include this header.
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.
Removed.
Signed-off-by: fys <fengys1996@gmail.com>
Signed-off-by: fys <fengys1996@gmail.com>
732485c
to
bbd97f3
Compare
Thank you! |
This PR changes
pthread_atfork
from a strong symbol to a weak symbol.Related issue
#81