Repository navigation
meson: link libm into wallpaper-collections/gallery/rotator tests (fixes aarch64 build) - #36
Open
mateoalfaro wants to merge 1 commit into
Open
mateoalfaro wants to merge 1 commit into
mateoalfaro wants to merge 1 commit into
Conversation
dynamic_wallpaper.vala's sun-elevation math gets sin(x)+cos(x) pairs folded
into sincos() by GCC at -O2. sincos/sin/cos/acos/fmod are in libm, which
these targets didn't link. On x86_64 some dependency's DT_NEEDED chain
resolves them transitively, but on aarch64-linux the closure provides no
libm and the three links fail with "undefined reference to `sincos'".
Add cc.find_library('m'), matching the other math-using targets in this
file (recorder-plan-test, the main shell binary).
Assisted-by: opencode:GLM-5.3-Flash
AI-Scope: Applied the validated arm-libm.patch from the upstream fix report (adds cc.find_library('m') to the three wallpaper test executables in meson.build); patch and suggested commit message provided by the report at the user's request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generative AI assistance
AI assistance: disclosed
The commit on this branch carries the required
Assisted-by/AI-Scopetrailers per AGENTS.md; the patch and report text were validated by the submitter.Root cause
At commit
aef0f372529fb69cbf38f64a427aabdfc0b4a555(pinned bysingularity-desktopmaster0ba791f512908c69a03396ae0e05965439187d91), buildingsingularity-desktopon aarch64-linuxfails at the end of the build (all ~2000 targets compile fine) linking exactly three test
executables that share
src/core/dynamic_wallpaper.vala:Mechanism:
sin(x)/cos(x)calls intosincos()at-O2.sincos,sin,cos,acos,fmodlive in libm, which POSIX requires linking explicitly — they are not in libc.meson.buildthat don't declarecc.find_library('m'). The file already uses this exact pattern elsewhere, e.g.the main shell target (line ~660) and
recorder_plan_test(line ~748).libmin itsDT_NEEDEDchain and the linker resolves the undefined symbols transitively. On aarch64 (observed on
NixOS aarch64-linux, glibc, GCC 15) no library in the link closure provides libm, so the
three links fail.
Fix: add
cc.find_library('m')to the three targets' dependency lists, consistent with therest of the file.
Reference file view: https://github.com/singularityos-lab/singularity-shell/blob/aef0f372529fb69cbf38f64a427aabdfc0b4a555/meson.build (lines 905–928)
The patch