Skip to content

Skip a missing sflib.h in rz-gg with a warning - #6840

Open
TharunBabu-05 wants to merge 1 commit into
rizinorg:devfrom
TharunBabu-05:rz-gg-missing-sflib
Open

TharunBabu-05 wants to merge 1 commit into
rizinorg:devfrom
TharunBabu-05:rz-gg-missing-sflib

Conversation

@TharunBabu-05

@TharunBabu-05 TharunBabu-05 commented Oct 4, 2026 •

Copy link
Copy Markdown

checklist for this pull request

  • I've read the guidelines for contributing to this repository.
  • I made sure to follow the project's coding style.
  • I've documented every RZ_API function and struct this PR changes. (No RZ_API is changed — the edited function egg_get_cflags is static.)
  • I've added tests that prove my changes are effective.
  • I've updated the Rizin book with the relevant information (not needed).
  • I've used AI tools to generate fully or partially these code changes and I'm sure the changes are not copyrighted by somebody else.

Detailed description

rz-gg always passes -include <incdir>/sflib/<os>-<arch>-<bits>/sflib.h to the
compiler (egg_get_cflags() in librz/egg/egg_c_compile.c). A sflib.h only
exists 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 the
compiler even starts.

This matches the behaviour reported in #5519 (there, windows-x86-32). As
discussed in that thread, the agreed fix is not to add shellforge support
for those targets, but to skip the missing header: when sflib.h does not
exist for the target, print a warning and compile without it. Code that uses no
syscalls still builds; code that needs sflib.h fails later at compile time as
before.

Change:

  • egg_get_cflags() now checks rz_file_exists() on the resolved sflib.h
    path. If it exists, the -include flag is added as before; otherwise it logs
    egg: sflib.h is not available for '<triplet>', compiling without it and
    omits the flag.

No RZ_API is 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 per AGENTS.md.

Test plan

Two cases added to test/db/tools/rz_gg:

  • sflib.h missing for the target — rz-gg -k ios -a arm -b 32 … must emit the
    WARNING: egg: sflib.h is not available for 'ios-arm-32', compiling without it
    line (checked via REGEXP_FILTER_ERR).
  • sflib.h found for the target — rz-gg -k linux -a x86 -b 64 … must emit no
    such warning.

Verified on CI (Ubuntu, meson/ninja):

  • With the change: rz-test db/tools/rz_gg → 68 OK, 0 XX; and
    rz-gg -k ios -a arm -b 32 bins/other/rz-gg/hi.c prints the warning first
    (then fails at the xcrun step, since the iOS toolchain isn't present on the
    runner — unrelated to this change).
  • With the change reverted: the sflib.h missing test fails (1 XX), confirming
    the test catches the regression.

Closing issues

closes #5519

* `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
Copilot AI balanced review requested due to automatic review settings October 4, 2026 17:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added rz-test RzEgg AI/LLM Partially or fully AI generated. Critical thinking is advised! labels Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI/LLM Partially or fully AI generated. Critical thinking is advised! rz-test RzEgg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rz-gg: sflib files does not exist for windows-x86-32

2 participants