[aarch64] compilation error : gamebuild fails: fp_op_s and FOP_SUB undeclared in generated main_553.c

Closed
#517 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
44/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c, zig
Domain
build-system

Research direction

Start by inspecting the swgen code-generation path and the generated extracted/.gamebuild/main/main_553.c around line 14756; the issue does not name the generator source files or tests. Check how this path emits declarations for fp_op_s and FOP_SUB, then reproduce the aarch64 gamebuild with zig cc if the project setup allows it. Done means the generated code compiles on the reported aarch64 environment.

Written by the indexing model from the issue text.

Description

bug
Before you start
Savage Wind version

0.4.1-alpha.4 (latest)

Game version

1.9.0

Your PC

konkr pocket fit snapdragon g3 gen 3

Where in the game

compilation

What happened, and how to make it happen again

Hi,

I'm reporting a build failure on aarch64 (KONKR Pocket G3, running through DroidDeck). The documentation says aarch64 is experimental and that community reports decide whether it works, so here is my report.

Environment

· Device: KONKR Pocket G3
· OS / frontend: DroidDeck (Linux environment)
· Architecture: aarch64 (ARM64)
· Savage Wind version: 0.4.0-alpha.4 (commit cb981817, tree 1b542ba2)
· GPU: Turnip Adreno (TM) 750
· Driver: Mesa 27.0.0-devel (git-b1a8996cb3), Vulkan API 1.4.366
· Generator/compiler used by gamebuild: swgen + zig cc, 8 jobs

What happened

After setting up my own game files, the game entered the gamebuild phase. It compiled for about 449 seconds, then failed while compiling the generated file extracted/.gamebuild/main/main_553.c with zig cc.

The two errors are:

extracted/.gamebuild/main/main_553.c:14756:126: error: call to undeclared function 'fp_op_s'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 14756 |     { extern int rt_surf_takeoff_pending(uint64_t); if (rt_surf_takeoff_pending(c->x[21])) c->v[0] = (uint32_t)c->v[1]; else fp_op_s(c, FOP_SUB, 0, 1, 0); }
       |                                                                                                                              ^
extracted/.gamebuild/main/main_553.c:14756:137: error: use of undeclared identifier 'FOP_SUB'
 14756 |     { extern int rt_surf_takeoff_pending(uint64_t); if (rt_surf_takeoff_pending(c->x[21])) c->v[0] = (uint32_t)c->v[1]; else fp_op_s(c, FOP_SUB, 0, 1, 0); }
       |                                                                                                                                         ^~~~~~~
2 errors generated.
[gamebuild] failed in 449s
[launcher] game code: the game code didn't compile

Reproduction steps

  1. Run Savage Wind 0.4.0-alpha.4 (aarch64) on KONKR Pocket G3 / DroidDeck.
  2. Point it at my own game files and let it set them up.
  3. Wait for the automatic gamebuild step (recompile game code from my files).
  4. After ~449 s, compilation fails with the errors above.

My analysis

This looks like a code-generator (swgen) issue rather than a compiler or runtime problem. The generated snippet emits a call to fp_op_s(...) with the constant FOP_SUB on the else branch, but the generated file does not declare fp_op_s or define FOP_SUB anywhere before that point. The other runtime helper in the same line (rt_surf_takeoff_pending) is declared locally via extern int rt_surf_takeoff_pending(uint64_t);, so it seems the generator emits a local declaration for one helper but not for fp_op_s, and never emits the FOP_SUB enum/constant. This may be specific to the aarch64 target's codegen path or runtime header inclusion.

savage.log

Settings

No response

savagewind.log

savage.log

Before sending
  • This report contains no game files, keys, firmware, generated game code, save files or links to copies of the game.
Dominant language
C
Stars
811
Forks
37
Avg merge
17m
Merged PRs (30d)
13

Getting set up

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.

More from Revivedx/SavageWindRecomp

All issues in Revivedx/SavageWindRecomp

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.