Skip to content

novatek: loader: do not link libm, which nothing uses - #55

Merged
dimerr merged 1 commit into
openipc-novatekfrom
novatek/loader-no-libm
Oct 23, 2026
Merged

dimerr merged 1 commit into
openipc-novatekfrom
novatek/loader-no-libm

Conversation

@dimerr

@dimerr dimerr commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Fixes the build legs of run 39899665339: arm-none-eabi-ld: cannot find libm.a.

The vendor loader's link line ends in the toolchain's libm.a, whatever $(CC) -print-file-name=libm.a finds. Ubuntu's gcc-arm-none-eabi, which build-novatek.yml installs for the loader, ships no newlib, so there is none to find. Locally the loader had only been built with arm-linux-gnueabi (which has a libm) and the SDK's Linaro arm-eabi. Nothing in the loader uses libm, so the link line no longer asks for it.

Checked:

  • In ubuntu:24.04 with exactly the workflow's packages, bash build.sh builds both images, with the loader compiled by arm-none-eabi-gcc 13.2.1.
  • Those two images pass the two-boot smoke test on qemu-hisilicon master (nt98562, nt98566).

The vendor link line ends in the toolchain's libm.a, as
$(CC) -print-file-name=libm.a finds it. A bare-metal toolchain without
newlib (Ubuntu's gcc-arm-none-eabi, what build-novatek.yml installs)
has none, and the link failed: "arm-none-eabi-ld: cannot find libm.a".
Nothing in the loader calls into libm: without it the NT98562 and
NT98566 loaders link with arm-linux-gnueabi as before.

Checked: both images build in ubuntu:24.04 with the workflow's packages
(arm-none-eabi-gcc 13.2.1 for the loader).
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix Novatek loader builds without libm

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Remove the unused libm archive from debug and release loader link commands.
• Allow loader builds with Ubuntu’s arm-none-eabi toolchain, which does not provide libm.a.
Diagram

graph TD
  T["ARM toolchain"] --> D["Debug link"] --> I["Loader images"]
  T --> R["Release link"] --> I
Loading
High-Level Assessment

Removing the unused archive from both link commands is the simplest fix. Conditionally linking libm when available would retain an unnecessary dependency.

Files changed (1) +2 / -2

Bug fix (1) +2 / -2
OutputImg.txtDrop libm.a from debug and release loader links +2/-2

Drop libm.a from debug and release loader links

• Removes the explicit libm archive path from both generated linker response files, preventing a missing-libm.a failure with the Ubuntu arm-none-eabi toolchain. The debug command still includes the existing libm search directory.

board/novatek/na51089/loader/MakeCommon/OutputImg.txt

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@dimerr
dimerr merged commit 5fcaed6 into openipc-novatek Oct 23, 2026
14 of 15 checks passed
@dimerr
dimerr deleted the novatek/loader-no-libm branch October 23, 2026 04:47
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

Successfully merging this pull request may close these issues.

1 participant