Skip to content

V5 be#2943

Open
trufae wants to merge 8 commits into
capstone-engine:v5from
trufae:v5-be
Open

V5 be#2943
trufae wants to merge 8 commits into
capstone-engine:v5from
trufae:v5-be

Conversation

@trufae
Copy link
Copy Markdown
Contributor

@trufae trufae commented May 29, 2026

i backported the crossbuilds ci jobs from the next branch to the v5 one.

that confirmed the bugs i found that are already fixed in v6, so i just fixed them here and added more tests:

  • mos65xx UB with format strings on 32bit (causing segfault on arm thumb runner)
  • m68k UB in printf missing cast (causing invalid output in the disassembler)
  • big endian bug in the x86 sib calculation causing some x86 instructions to disassemble incorrectly

@github-actions github-actions Bot added X86 Arch M68K Arch MOS65XX Arch Github-files Github related files labels May 29, 2026
Copy link
Copy Markdown
Collaborator

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

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

Would you mind also applying the other changes from https://github.com/capstone-engine/capstone/pull/2796/changes#diff-8ab50bbaa9a6956702fed253c6b8d13be8f3c4b062faf4398af2053c731e9e82

There are not that many. Mostly formatting changes for the three archs here. Simply copy and paste should do the job.

Comment thread tests/test_arm64.c
Comment thread .github/workflows/CrossBuilds.yml Outdated
- name: C tests
if: ${{ matrix.config.skip_tests != true }}
run: |
ctest --test-dir build --output-on-failure -R '^capstone_'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In v5 this won't run all the tests which matter (MC and issues.cs). You need to run cstest additionally (see CITest.yml)

echo "set(CMAKE_SYSROOT ${sysroot}/usr)"
echo "set(CMAKE_CROSSCOMPILING_EMULATOR ${qemu};-L;${sysroot})"
fi
} > build/toolchain.cmake
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you commit the toolchain files as well? Not generating them here I mean.
It is a nice feature for people to quickly build it or at least have a decent reference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure

Comment thread .github/workflows/CrossBuilds.yml Outdated
trufae and others added 2 commits May 29, 2026 23:30
Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>
Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Github-files Github related files M68K Arch MOS65XX Arch X86 Arch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants