Skip to content

Enables multi architecture builds for dns_interceptor#699

Open
Ghost-B0t wants to merge 3 commits intolitmuschaos:masterfrom
Ghost-B0t:master
Open

Enables multi architecture builds for dns_interceptor#699
Ghost-B0t wants to merge 3 commits intolitmuschaos:masterfrom
Ghost-B0t:master

Conversation

@Ghost-B0t
Copy link

What this PR does / why we need it:
Enables multi-architecture builds for "dns_interceptor" binary to support ARM64 based chaos. Earlier it only built for AMD64.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #697

Special notes for your reviewer:

Signed-off-by: Rahul <93730014+Ghost-B0t@users.noreply.github.com>
@xnaveenx
Copy link

Hi @Ghost-B0t, thanks for working on this!

I am not a maintainer, but I wanted to help verify this fix on my local Apple Silicon (M2) setup.

Observation:
The build failed locally for me. I dug a little deeper and noticed that main.go in custom/dns_interceptor seems to have hardcoded CGO flags pointing to x86_64 paths:

#cgo LDFLAGS: -L/usr/lib64/ -L/usr/lib/x86_64-linux-gnu/ -ldl

Result: Because of this, running GOOS=linux GOARCH=arm64 go build seems to trigger a build constraint error on ARM architectures.

Could you please double-check if we need to update those flags to support the multi-arch build? I'd be happy to test again once update!

@Jonsy13
Copy link
Contributor

Jonsy13 commented Dec 24, 2025

Hi @Ghost-B0t, thanks for working on this!

I am not a maintainer, but I wanted to help verify this fix on my local Apple Silicon (M2) setup.

Observation: The build failed locally for me. I dug a little deeper and noticed that main.go in custom/dns_interceptor seems to have hardcoded CGO flags pointing to x86_64 paths:

#cgo LDFLAGS: -L/usr/lib64/ -L/usr/lib/x86_64-linux-gnu/ -ldl

Result: Because of this, running GOOS=linux GOARCH=arm64 go build seems to trigger a build constraint error on ARM architectures.

Could you please double-check if we need to update those flags to support the multi-arch build? I'd be happy to test again once update!

Correct, @Ghost-B0t You may want to try by updating the flag to

#cgo LDFLAGS: -ldl

Signed-off-by: Rahul <93730014+Ghost-B0t@users.noreply.github.com>
@Ghost-B0t
Copy link
Author

Hey @xnaveenx @Jonsy13 Thanks for the reviews. I have updated the flag to remove architecture dependency and CGO was disabled for any builds, I have parameterized it, keeping the default as disabled as dns_interceptor needs CGo.
Please let me know if there are any other suggestions on the same.

@xnaveenx
Copy link

I verified this using a Dockerized Linux environment on Apple Silicon to ensure a clean cross-compile.

Status: Verified
Ran the following build command inside a golang:1.23 container:
CGO_ENABLED=1 GOOS=linux GOARCH=64 go build -v -o dns_interceptor_linux_arm64 .

Result:
The build passed, and the output binary is correct:
ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1

The fix looks solid on my end. Looking forward to seeing this merged! Thanks again @Ghost-B0t

@Ghost-B0t
Copy link
Author

@Jonsy13 Any updates on this?

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.

Missing ARM64 binary for dns_interceptor in release assets

3 participants