Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Compile bug: Errors on glibc < 2.34

Open Beginner friendly
#31,280 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cmake, cpp, linux

Research direction

Read tests/CMakeLists.txt near the llama_build(test-backend-ops.cpp LINK ggml) entry and check how other tests link Threads::Threads. The report identifies std::thread and std::async as the cause and gives the proposed one line link change. Build test-backend-ops on Linux with glibc older than 2.34 to confirm it links without the workaround.

Written by the indexing model from the issue text.

Description

bug-unconfirmed
Git commit

https://github.com/ggml-org/llama.cpp/pull/30299

Operating systems

Linux

GGML backends

CUDA

Problem description & steps to reproduce

Per suggestion logging this as a bug:

During build i get following error:

[llama.cpp 45%] Linking CXX executable ../bin/test-backend-ops /usr/bin/ld: CMakeFiles/test-backend-ops.dir/test-backend-ops.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.17' /usr/bin/ld: /lib/aarch64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: *** [tests/CMakeFiles/test-backend-ops.dir/build.make:106: bin/test-backend-ops] Error 1 make[1]: *** [CMakeFiles/Makefile2:4076: tests/CMakeFiles/test-backend-ops.dir/all] Error 2

My work around: add 2 flags -DCMAKE_EXE_LINKER_FLAGS="-pthread" and -DCMAKE_SHARED_LINKER_FLAGS="-pthread"

Notes from the discussion i added to clarify the issue for actual fix instead of a work around:

test-backend-ops uses std::thread and std::async. Since #30299 (commit ccdbe29, Oct 12, "tests : link each test against only the libraries it uses"), tests/CMakeLists.txt builds it with

llama_build(test-backend-ops.cpp LINK ggml)

The proper fix in the repo is one line after that llama_build:

target_link_libraries(test-backend-ops PRIVATE Threads::Threads)

First Bad Commit

No response

Compile command
~/Bin/cmake-4.2.3-linux-aarch64//bin/cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DLLAMA_CURL=OFF -DCMAKE_CUDA_ARCHITECTURES=72 -DGGML_RPC=ON

( note the hardcoded cmake, had to manually download due to older OS version )
Relevant log output
Posted error above.
Dominant language
C++
Stars
133k
Forks
24.9k
Avg merge
2d 1h
Merged PRs (30d)
500

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ggml-org/llama.cpp

All issues in ggml-org/llama.cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.