Add a darwin/arm64 Go language-detector fixture - #224
Conversation
build_go_cross.sh covers linux and windows but no darwin, so there is no Mach-O Go binary here that cle can load: the only one, tests/x86_64/terramate.macho, is darwin/amd64, where the Go linker emits LC_UNIXTHREAD and cle raises CLECompatibilityError. Built with go1.27.1, the script's current toolchain, from the same langdetect_go.go every other target uses. Unlike its siblings this one was not built at /workspace, so it is built with -trimpath and carries no build paths at all; the command reproduces it byte for byte from any directory.
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head The file. Reproducibility. Both paths are absolute, so the command runs from anywhere. Run from the No build paths. What reads it. cle's Go pclntab parser recovers 1,888 function entries from Script. session: sharpen |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS What a Mach-O loader test has to work with, before and after this fixture. Before — the only Mach-O Go binary in the repository is darwin/amd64, where angr/binaries masterAfter — the new file loads, and the cle branch that reads the Go pclntab on with this fixture |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS cle master is red, and this branch holds one of the two fixtures it is waiting angr/cle#808 merged at 2026-09-03T17:44:30Z as Read from cle CI run 33786713158, job Merging this branch clears those two. It does not make cle master green by Head here is |
cle's tests on master now load tests/aarch64/langdetect_go.macho and tests/aarch64/relocatable_object.macho, which #193 and #224 added after this branch was cut. angr/cle#807 names this pull request in its sync: line, so CI checks this branch out instead of master and those two files were missing: 3 failed, 264 passed on the macOS job. Merging master in supplies them and leaves this branch's own five objects and build script untouched.
cle's tests on master now load tests/aarch64/langdetect_go.macho and tests/aarch64/relocatable_object.macho, which #193 and #224 added after this branch was cut. angr/cle#764 and angr/cle#804 name this pull request in their sync: lines, so CI checks this branch out instead of master; once either is rebased onto current cle master those two files would be missing and the macOS job would fail. Merging master in supplies them and leaves this branch's own three objects and build script untouched.
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
There is no Mach-O Go binary here that cle can load, so a loader test for Go on
Mach-O has nothing to run against.
tests_src/language_detector/build_go_cross.shcross-compiles
langdetect_go.gofor linux/386, linux/arm, linux/arm64,windows/386, windows/arm64 and windows/amd64, and for no darwin target.
The one Mach-O Go binary the repository does have is
tests/x86_64/terramate.macho,and it is darwin/amd64:
(cle
2f7657fd.) The Go linker emitsLC_UNIXTHREADfor darwin/amd64.Root cause
The script was written for the architectures a CFG test needed at the time, and
darwin was not one of them.
Fix
Add a darwin/arm64 target and the binary it produces,
tests/aarch64/langdetect_go.macho. darwin/amd64 is left out until cle can loadone, and the script says so beside the line.
Built with go1.27.1, the script's
GO_CURRENT, from the sametests_src/language_detector/langdetect_go.goevery other target uses. Unlikeits siblings this one was not built at
/workspace, so it is built with-trimpath. Without that the binary carries the builder's home directorythrough its DWARF; with it the file contains no build path at all and the
recorded command reproduces it byte for byte from any working directory.
Testing
The file is a 2,430,258-byte
MH_EXECUTEforCPU_TYPE_ARM64carrying a__TEXT,__gopclntabsection. cle's Go pclntab parser reads 1,888 functionentries out of it, and every one of those addresses lands inside
__text.Rebuilding with the command in the script reproduces the committed bytes
exactly, from two different working directories.
Needed by the cle change that reads the Go pclntab on Mach-O and PE, which adds
a Mach-O regression test against this file.
Validation: #224 (comment)
session: sharpen