Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build AIX binary since I have seen AIX supported 3 weeks ago #3162

Open
PaulYuanJ opened this issue Oct 21, 2024 · 6 comments
Open

How to build AIX binary since I have seen AIX supported 3 weeks ago #3162

PaulYuanJ opened this issue Oct 21, 2024 · 6 comments

Comments

@PaulYuanJ
Copy link

Host operating system: output of uname -a

Linux ip-172-31-8-215 6.8.0-1016-aws #17-Ubuntu SMP Mon Sep 2 13:48:07 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

I want make a new version for node_exporter on ubuntu system for AIX 6.1.0.0

GOOS=aix GOARCH=ppc64 CGO_ENABLED=0 make build
fatal: not a git repository (or any of the parent directories): .git
>> building binaries
/home/ubuntu/go/bin/promu --config .promu-cgo.yml build --prefix /home/ubuntu/node_exporter/sources-Td0pXGgt7K 
 >   node_exporter
# runtime/cgo
gcc: error: unrecognized command-line option ‘-maix64’
!! command failed: build -o /home/ubuntu/node_exporter/sources-Td0pXGgt7K/node_exporter -ldflags -X github.com/prometheus/common/version.Version=1.8.1 -X github.com/prometheus/common/version.Revision=non-git -X github.com/prometheus/common/version.Branch=non-git -X github.com/prometheus/common/version.BuildUser=ubuntu@ip-172-31-8-215 -X github.com/prometheus/common/version.BuildDate=20241021-15:04:07  -extldflags '-static' github.com/prometheus/node_exporter: exit status 1
make: *** [Makefile.common:204: common-build] Error 1
@bastischubert
Copy link
Member

theres a comment on how to do it here: #3136 (comment)

@PaulYuanJ
Copy link
Author

i modified some source code to m64 instead of maix64, it has been built succeed. i am looking for official command to build.

@discordianfish
Copy link
Member

@PaulYuanJ What exactly did you change? Did a regular go build work for you? AIX is supported but not yet using the Makefile

@PaulYuanJ
Copy link
Author

@PaulYuanJ What exactly did you change? Did a regular go build work for you? AIX is supported but not yet using the Makefile

regular go build result:

image

@PaulYuanJ
Copy link
Author

and I have modified these 2 files:

152 sudo vim /home/ubuntu/go/pkg/mod/golang.org/x/sys@v0.25.0/unix/zerrors_aix_ppc64.go
153 sudo vim /home/ubuntu/go/pkg/mod/golang.org/x/sys@v0.25.0/unix/mkall.sh

change maix64 to m64 in these 2 files, then use make build.

image

@PaulYuanJ
Copy link
Author

But.. when I copy the binary file to AIX to run, encountered error: 0403-006 Execute permission denied
Maybe I used wrong method to build..

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

No branches or pull requests

3 participants