mlc-ai / mlc-ai/tokenizers-cpp

linker error when using aarch64 tokenizer_c.a

Open
#91 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
512
Forks
132
PR merge metrics
No merged PRs in 30d

Description

Getting following linker errors when using cross compiled tokenizer_c.a in a project.

The problem is some object files in tokenizer_c.a archive are not compiling for aarch64 and still getting compiled to x86 instead.

aarch64-unknown-linux-gnu/bin/ld.bfd: tokenizers-cpp-build/aarch64-unknown-linux-gnu/release/libtokenizers_c.a(a445302c6d3dcb51-regexec.o): Relocations in generic ELF (EM: 62)
aarch64-unknown-linux-gnu/bin/ld.bfd: tokenizers-cpp-build/aarch64-unknown-linux-gnu/release/libtokenizers_c.a(a445302c6d3dcb51-regexec.o): Relocations in generic ELF (EM: 62)
aarch64-unknown-linux-gnu/bin/ld.bfd: tokenizers-cpp-build/aarch64-unknown-linux-gnu/release/libtokenizers_c.a(a445302c6d3dcb51-regexec.o): Relocations in generic ELF (EM: 62)
aarch64-unknown-linux-gnu/bin/ld.bfd: tokenizers-cpp-build/aarch64-unknown-linux-gnu/release/libtokenizers_c.a: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by inspecting how tokenizer_c.a is cross-compiled and verify the architecture of the archive objects, especially regexec.o named in the linker output. The issue is resolved when every object in tokenizer_c.a targets aarch64 and the reported linker command succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.