Repository navigation
Skip a missing sflib.h in rz-gg with a warning - #6840
Open
TharunBabu-05 wants to merge 1 commit into
Open
TharunBabu-05 wants to merge 1 commit into
TharunBabu-05 wants to merge 1 commit into
Conversation
* `rz-gg` always passed `-include <incdir>/sflib/<os>-<arch>-<bits>/sflib.h` to the compiler, so compiling C for a target without a sflib.h (for example `ios-arm-32` and `ios-arm-64`) failed on the missing file. * Print a warning and compile without it instead, as agreed in rizinorg#5519. * Add tests for a target with and without a sflib.h. Co-authored-by agent: Claude Code/claude-opus-5-5
TharunBabu-05
requested review from
Rot127,
b1llow,
kazarmy,
notxvilka,
ret2libc,
thestr4ng3r and
wargio
as code owners
October 4, 2026 17:20
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.
checklist for this pull request
RZ_APIfunction and struct this PR changes. (NoRZ_APIis changed — the edited functionegg_get_cflagsisstatic.)Detailed description
rz-ggalways passes-include <incdir>/sflib/<os>-<arch>-<bits>/sflib.hto thecompiler (
egg_get_cflags()inlibrz/egg/egg_c_compile.c). Asflib.honlyexists for some targets, so compiling C for a target that has none — e.g.
ios-arm-32/ios-arm-64— fails on the missing include file before thecompiler even starts.
This matches the behaviour reported in #5519 (there,
windows-x86-32). Asdiscussed in that thread, the agreed fix is not to add shellforge support
for those targets, but to skip the missing header: when
sflib.hdoes notexist for the target, print a warning and compile without it. Code that uses no
syscalls still builds; code that needs
sflib.hfails later at compile time asbefore.
Change:
egg_get_cflags()now checksrz_file_exists()on the resolvedsflib.hpath. If it exists, the
-includeflag is added as before; otherwise it logsegg: sflib.h is not available for '<triplet>', compiling without itandomits the flag.
No
RZ_APIis affected.AI disclosure: Claude Code (Anthropic Claude) was used to analyse the issue and
draft the change and the tests. I reviewed the change, verified it compiles and
behaves as described, and confirmed the tests pass. The corresponding commit
carries the
Co-authored-by agent:trailer perAGENTS.md.Test plan
Two cases added to
test/db/tools/rz_gg:rz-gg -k ios -a arm -b 32 …must emit theWARNING: egg: sflib.h is not available for 'ios-arm-32', compiling without itline (checked via
REGEXP_FILTER_ERR).rz-gg -k linux -a x86 -b 64 …must emit nosuch warning.
Verified on CI (Ubuntu,
meson/ninja):rz-test db/tools/rz_gg→68 OK, 0 XX; andrz-gg -k ios -a arm -b 32 bins/other/rz-gg/hi.cprints the warning first(then fails at the
xcrunstep, since the iOS toolchain isn't present on therunner — unrelated to this change).
1 XX), confirmingthe test catches the regression.
Closing issues
closes #5519