Skip to content

build: default to a 64-bit only build for the Capstone decoder - #42

Merged
lvaroqui merged 2 commits into
masterfrom
cod-3590-valgrind-codspeed-fails-to-build-on-multilib-hosts-no
Oct 2, 2026
Merged

lvaroqui merged 2 commits into
masterfrom
cod-3590-valgrind-codspeed-fails-to-build-on-multilib-hosts-no

Conversation

@lvaroqui

@lvaroqui lvaroqui commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Default to a 64-bit only build, and fail at configure time if a secondary platform is still requested.

On a multilib host (Arch with lib32-glibc, Ubuntu with gcc-multilib), a plain ./configure also enables the x86 secondary platform. Capstone is only compiled for the primary platform, and callgrind/Makefile.am passes the Capstone flags only to the primary targets, so callgrind_x86_linux failed in make on the #error in cycledecode.c:350. CI and the Debian packaging never hit this: they pass --enable-only64bit, and the Ubuntu runners have no 32-bit toolchain.

CODSPEED_ONLY64BIT_DEFAULT sets --enable-only64bit unless --enable-only64bit or --enable-only32bit was given either way. CODSPEED_CAPSTONE now errors out when a secondary platform remains (e.g. --disable-only64bit), instead of failing later in make.

Alternatives considered:

  • Building a second, -m32 Capstone and wiring it into the secondary targets: nothing runs a 32-bit Callgrind with cycle estimation, so it isn't worth the extra build.
  • Stubbing cycledecode.c when Capstone is absent: this would silently ship a Callgrind whose --cycle-estimation does nothing.

Verified on a multilib Manjaro host: plain ./configure gives amd64 only and make succeeds; --disable-only64bit stops at configure with the new message; --enable-only32bit configures an x86-only build.

Closes COD-3590

@codspeed

codspeed Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 84 untouched benchmarks
⏩ 60 skipped benchmarks1


Comparing cod-3590-valgrind-codspeed-fails-to-build-on-multilib-hosts-no (5429ea2) with master (18b901a)

Open in CodSpeed

Footnotes

  1. 60 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@lvaroqui
lvaroqui force-pushed the cod-3590-valgrind-codspeed-fails-to-build-on-multilib-hosts-no branch from b55afbd to 5a64947 Compare October 1, 2026 12:29
Capstone is compiled for the primary platform only, and cycledecode.c does
not build without it. On a bi-arch host with 32-bit multilib, a plain
./configure also enabled the secondary x86 Callgrind, which then failed in
make with a missing capstone/capstone.h and the CLG_WITH_CAPSTONE #error.

Default to --enable-only64bit unless --enable-only64bit or
--enable-only32bit was given either way, and fail at configure time with a
clear message if a secondary platform is still requested.

Closes COD-3590
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lvaroqui
lvaroqui force-pushed the cod-3590-valgrind-codspeed-fails-to-build-on-multilib-hosts-no branch from 5a64947 to faab01a Compare October 2, 2026 09:07
@lvaroqui
lvaroqui marked this pull request as ready for review October 2, 2026 09:08
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Changes build configuration defaults and constraints.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR defaults configuration to a 64-bit-only build and rejects secondary-platform builds before Capstone-dependent Callgrind compilation begins. The latest change sets the 64-bit cache value directly so a cached bi-architecture choice does not defeat that default.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Configure options and cache] --> B[Choose primary and secondary platforms]
  B --> C{Secondary platform selected?}
  C -->|Yes| D[Stop at Capstone configuration check]
  C -->|No| E[Build primary-platform Callgrind]
Loading

Reviews (2) · Last reviewed commit: "build: apply the 64-bit only default ove..."

Comment thread m4/codspeed_capstone.m4 Outdated
With ./configure -C, a config.cache from an earlier bi-arch run still holds
vg_cv_only64bit=no. AC_CACHE_CHECK then skips the AC_ARG_ENABLE handler, so
setting enable_only64bit=yes had no effect: the secondary platform stayed
selected and the Capstone check aborted configure.

Set vg_cv_only64bit=yes directly instead. A cached 32-bit only choice is kept,
as it has no secondary platform either and forcing 64-bit on top of it would
trip the "both --enable-only64bit and --enable-only32bit" error.

Refs COD-3590
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lvaroqui
lvaroqui requested a review from not-matthias October 2, 2026 09:38
@lvaroqui
lvaroqui merged commit 57010df into master Oct 2, 2026
10 checks passed
@lvaroqui
lvaroqui deleted the cod-3590-valgrind-codspeed-fails-to-build-on-multilib-hosts-no branch October 2, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants