File tree Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,16 @@ fn main() {
338
338
println ! ( "cargo:rustc-link-lib=atomic" ) ;
339
339
}
340
340
println ! ( "cargo:rerun-if-changed=jemalloc" ) ;
341
+
342
+ if target. contains ( "android" ) {
343
+ // These symbols are used by jemalloc on android but the really old android
344
+ // we're building on doesn't have them defined, so just make sure the symbols
345
+ // are available.
346
+ cc:: Build :: new ( )
347
+ . file ( "src/pthread_atfork.c" )
348
+ . compile ( "pthread_atfork" ) ;
349
+ println ! ( "cargo:rerun-if-changed=src/pthread_atfork.c" ) ;
350
+ }
341
351
}
342
352
343
353
fn run_and_log ( cmd : & mut Command , log_file : & Path ) {
Original file line number Diff line number Diff line change @@ -890,20 +890,6 @@ pub type extent_merge_t = unsafe extern "C" fn(
890
890
arena_ind : c_uint ,
891
891
) -> c_bool ;
892
892
893
- // These symbols are used by jemalloc on android but the really old android
894
- // we're building on doesn't have them defined, so just make sure the symbols
895
- // are available.
896
- #[ no_mangle]
897
- #[ cfg( target_os = "android" ) ]
898
- #[ doc( hidden) ]
899
- pub extern "C" fn pthread_atfork (
900
- _prefork : * mut u8 ,
901
- _postfork_parent : * mut u8 ,
902
- _postfork_child : * mut u8 ,
903
- ) -> i32 {
904
- 0
905
- }
906
-
907
893
#[ allow( missing_docs) ]
908
894
mod env;
909
895
Original file line number Diff line number Diff line change
1
+ /*
2
+ * These symbols are used by jemalloc on android but the really old android
3
+ * we're building on doesn't have them defined, so just make sure the symbols
4
+ * are available.
5
+ */
6
+ __attribute__((weak )) int
7
+ pthread_atfork (void (* prepare )(void ) __attribute__((unused )),
8
+ void (* parent )(void ) __attribute__((unused )),
9
+ void (* child )(void ) __attribute__((unused ))) {
10
+ return 0 ;
11
+ }
You can’t perform that action at this time.
0 commit comments