Skip to content
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

undefined reference to `pthread_create' #1596

Open
5 of 11 tasks
thewh1teagle opened this issue Dec 16, 2024 · 0 comments
Open
5 of 11 tasks

undefined reference to `pthread_create' #1596

thewh1teagle opened this issue Dec 16, 2024 · 0 comments

Comments

@thewh1teagle
Copy link

thewh1teagle commented Dec 16, 2024

Checklist

Describe your issue

I'm trying to compile the crate espeak-rs-sys with cross for linux arm64 but it failed with this error:

  [ 95%] Linking CXX executable espeak-ng

  --- stderr
  Failed to run rustfmt: cannot find binary path (non-fatal, continuing)
  make: warning: -j8 forced in submake: resetting jobserver mode.
  /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: libespeak-ng/libespeak-ng.a(event.c.o): in function `event_init':
  event.c:(.text.event_init+0xd0): undefined reference to `pthread_create'
  /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: libespeak-ng/libespeak-ng.a(event.c.o): in function `event_terminate':
  event.c:(.text.event_terminate+0x60): undefined reference to `pthread_join'
  /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: libespeak-ng/libespeak-ng.a(fifo.c.o): in function `fifo_init':
  fifo.c:(.text.fifo_init+0x1d0): undefined reference to `pthread_create'
  /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: libespeak-ng/libespeak-ng.a(fifo.c.o): in function `fifo_terminate':
  fifo.c:(.text.fifo_terminate+0x70): undefined reference to `pthread_join'
  collect2: error: ld returned 1 exit status
  make[2]: *** [src/CMakeFiles/espeak-ng-bin.dir/build.make:100: src/espeak-ng] Error 1
  make[1]: *** [CMakeFiles/Makefile2:940: src/CMakeFiles/espeak-ng-bin.dir/all] Error 2
  make: *** [Makefile:166: all] Error 2
  thread 'main' panicked at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.51/src/lib.rs:1100:5:

  command did not execute successfully, got: exit status: 2

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

cross config:
https://github.com/thewh1teagle/piper-rs/blob/5191355716a2818913381e01d8a8ac8e7d3b6525/Cargo.toml#L34-L39

What target(s) are you cross-compiling for?

aarch64-unknown-linux-gnu

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5 (4090bec 2024-10-15)

Example

git clone --recursive --branch feat/linux-arm64 https://github.com/thewh1teagle/piper-rs
cd piper-rs
cross build --no-default-features -p espeak-rs-sys --target aarch64-unknown-linux-gnu

Additional information / notes

it builds in thewh1teagle/piper-rs#5 manually on ubuntu 22.04 x64
Also in Dockerfile.linux.arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant