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 symbol: fcntl@GLIBC_2.2.5 when compile for armv7 #16002

Open
Dirreke opened this issue Jun 10, 2023 · 6 comments
Open

undefined symbol: fcntl@GLIBC_2.2.5 when compile for armv7 #16002

Dirreke opened this issue Jun 10, 2023 · 6 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@Dirreke
Copy link

Dirreke commented Jun 10, 2023

Zig Version

0.9.1

Steps to Reproduce and Observed Behavior

Sorry, I'm new to zig. If I'm wrong, please let me know.
I'm trying use zig cc to compile rocksdb (actually I compile rust-rocksdb ) for armv7-linux-gnueabihf.
zig 0.10.1 can not compile for armv7 with multiple thread, and according to #6573 , 0.9.1 can do it.
So I use zig 0.9.1, and I get this when linking. It really confused me

  = note: ld.lld: error: undefined symbol: fcntl@GLIBC_2.2.5
          >>> referenced by fs_posix.cc:157 (rocksdb/env/fs_posix.cc:157)
          >>>               fs_posix.o:(rocksdb::(anonymous namespace)::PosixFileSystem::NewSequentialFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rocksdb::FileOptions const&, std::__1::unique_ptr<rocksdb::FSSequentialFile, std::__1::default_delete<rocksdb::FSSequentialFile> >*, rocksdb::IODebugContext*)) in archive .../armv7-unknown-linux-gnueabihf/debug/deps/liblibrocksdb_sys-6aa47adaadf43187.rlib
          >>> referenced by fs_posix.cc:157 (rocksdb/env/fs_posix.cc:157)
          >>>               fs_posix.o:(rocksdb::(anonymous namespace)::PosixFileSystem::NewSequentialFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rocksdb::FileOptions const&, std::__1::unique_ptr<rocksdb::FSSequentialFile, std::__1::default_delete<rocksdb::FSSequentialFile> >*, rocksdb::IODebugContext*)) in archive .../armv7-unknown-linux-gnueabihf/debug/deps/liblibrocksdb_sys-6aa47adaadf43187.rlib
          >>> referenced by fs_posix.cc:157 (rocksdb/env/fs_posix.cc:157)
          >>>               fs_posix.o:(rocksdb::(anonymous namespace)::PosixFileSystem::NewRandomAccessFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rocksdb::FileOptions const&, std::__1::unique_ptr<rocksdb::FSRandomAccessFile, std::__1::default_delete<rocksdb::FSRandomAccessFile> >*, rocksdb::IODebugContext*)) in archive .../armv7-unknown-linux-gnueabihf/debug/deps/liblibrocksdb_sys-6aa47adaadf43187.rlib
          >>> referenced 12 more times
          >>> did you mean: fcntl
          >>> defined in: ~/.cache/zig/o/f9d9fcf846b561cef901d9b46b123fcc/libpthread.so.0

Does it mean that I can't compile it for arm anyway? Or Is there something special flags I need to pass in?

Expected Behavior

//

@Dirreke Dirreke added the bug Observed behavior contradicts documented or intended behavior label Jun 10, 2023
@Dirreke Dirreke changed the title undefined symbol: fcntl@GLIBC_2.2.5 undefined symbol: fcntl@GLIBC_2.2.5 when compile for armv7 Jun 10, 2023
@Kuratius
Copy link

armv7-linux-gnueabihf

Are you sure this is the correct target? Zig uses arm-linux for this I think.

@Dirreke
Copy link
Author

Dirreke commented Jun 10, 2023

yeah, I use cargo-zigbuild to call zig, and it can set target to arm-linux correctly

@squeek502
Copy link
Collaborator

Possibly related: #5882, #9485

@Dirreke
Copy link
Author

Dirreke commented Jun 11, 2023

yeah, I noticed it too. However, even if I set target to arm-linux-gnueabihf.2.24, it's compiled failed either

@Dirreke
Copy link
Author

Dirreke commented Jun 13, 2023

I do some investigating. I found that ~/.cache/zig/o/.../c.o has fcntl@GLIBC_2.4 but not fcntl@GLIBC_2.2.5. I don't know why

@alexrp
Copy link
Member

alexrp commented Oct 12, 2024

Are you still able to reproduce this with 0.13.0 or a master build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

5 participants