File tree 2 files changed +18
-11
lines changed 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -339,10 +339,15 @@ fn main() {
339
339
}
340
340
println ! ( "cargo:rerun-if-changed=jemalloc" ) ;
341
341
342
- cc:: Build :: new ( )
343
- . file ( "src/pthread_atfork.c" )
344
- . compile ( "pthread_atfork" ) ;
345
- println ! ( "cargo:rerun-if-changed=src/pthread_atfork.c" ) ;
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
+ }
346
351
}
347
352
348
353
fn run_and_log ( cmd : & mut Command , log_file : & Path ) {
Original file line number Diff line number Diff line change 1
- #include <stdint .h>
1
+ #include <pthread .h>
2
2
3
- // These symbols are used by jemalloc on android but the really old android
4
- // we're building on doesn't have them defined, so just make sure the symbols
5
- // are available.
3
+ /*
4
+ * These symbols are used by jemalloc on android but the really old android
5
+ * we're building on doesn't have them defined, so just make sure the symbols
6
+ * are available.
7
+ */
6
8
__attribute__((weak )) int
7
- pthread_atfork (uint8_t * prefork __attribute__((unused )),
8
- uint8_t * postfork_parent __attribute__((unused )),
9
- uint8_t * postfork_child __attribute__((unused ))) {
9
+ pthread_atfork (void ( * prepare )( void ) __attribute__((unused )),
10
+ void ( * parent )( void ) __attribute__((unused )),
11
+ void ( * child )( void ) __attribute__((unused ))) {
10
12
return 0 ;
11
13
}
You can’t perform that action at this time.
0 commit comments