Skip to content

Undefined references to 'pthread_barrier_{init,destroy,wait}' on Android #9632

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

Closed
luqmana opened this issue Sep 30, 2013 · 3 comments
Closed
Labels
O-android Operating system: Android

Comments

@luqmana
Copy link
Member

luqmana commented Sep 30, 2013

With hello.rs:

fn main() {
    println!("Hello World!");
}

I get:

-> % rustc --target=arm-linux-androideabi --android-cross-path=/scratch/laden/android-dev/standalone hello.rs
error: linking with `/scratch/laden/android-dev/standalone/bin/arm-linux-androideabi-gcc` failed with code 1
note: /scratch/laden/android-dev/standalone/bin/arm-linux-androideabi-gcc arguments: -L/export/scratch/laden/local/lib/rustc/arm-linux-androideabi/lib -marm -o hello hello.o -L/export/scratch/laden/local/lib/rustc/arm-linux-androideabi/lib -lstd-6c65cf4b443341b1-0.9-pre -L/export/scratch/laden/run/.rust -L/export/scratch/laden/run -ldl -llog -lsupc++ -lgnustl_shared -lm -lmorestack -lrustrt -Wl,-rpath,$ORIGIN/../local/lib/rustc/arm-linux-androideabi/lib -Wl,-rpath,/export/scratch/laden/local/lib/rustc/arm-linux-androideabi/lib -Wl,-rpath,/scratch/laden/local/lib/rustc/arm-linux-androideabi/lib
note: /export/scratch/laden/android-dev/standalone/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /export/scratch/laden/local/lib/rustc/arm-linux-androideabi/lib/librustrt.so: error: undefined reference to 'pthread_barrier_init'
/export/scratch/laden/android-dev/standalone/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /export/scratch/laden/local/lib/rustc/arm-linux-androideabi/lib/librustrt.so: error: undefined reference to 'pthread_barrier_destroy'
/export/scratch/laden/android-dev/standalone/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /export/scratch/laden/local/lib/rustc/arm-linux-androideabi/lib/librustrt.so: error: undefined reference to 'pthread_barrier_wait'
collect2: ld returned 1 exit status

No combination of passing -lpthreads or -pthread with --link-args seems to help.

Just stubbing them out makes it compile successfully and at least for that simple program run fine but obviously that's not a solution.

@sanxiyn
Copy link
Member

sanxiyn commented Sep 30, 2013

Does this happen with clean Rust build? I used to get this when libuv is built without options for Android, and this temporarily regressed when we switched to gyp for building libuv, and if you built Rust while it regressed and used incremental build without clean it continued to happen.

@luqmana
Copy link
Member Author

luqmana commented Sep 30, 2013

I think I tried a make clean but I'll just try wiping the build dir to make sure.

@luqmana
Copy link
Member Author

luqmana commented Sep 30, 2013

Yep, wiping out the build dir fixed this.

@luqmana luqmana closed this as completed Sep 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android Operating system: Android
Projects
None yet
Development

No branches or pull requests

2 participants