amazon-ssm-agent icon indicating copy to clipboard operation
amazon-ssm-agent copied to clipboard

Building for Linux OS fails on Mac

Open GarimaBathla opened this issue 6 years ago • 2 comments

I am trying to build SSM Agent from source code (following the instructions) by calling

make build-linux and it fails with error

Build for linux agent GOOS=linux GOARCH=amd64 go build -i -ldflags "-s -w -v" -buildmode=pie -o /Users/gb186037/Projects/go/src/github.com/aws/amazon-ssm-agent/bin/linux_amd64/amazon-ssm-agent -v
/Users/gb186037/Projects/go/src/github.com/aws/amazon-ssm-agent/agent/agent.go /Users/gb186037/Projects/go/src/github.com/aws/amazon-ssm-agent/agent/agent_unix.go /Users/gb186037/Projects/go/src/github.com/aws/amazon-ssm-agent/agent/agent_parser.go

command-line-arguments

loadinternal: cannot find runtime/cgo /usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1 ld: warning: option -s is obsolete and being ignored ld: unknown option: -z clang: error: linker command failed with exit code 1 (use -v to see invocation)

I believe I need a cross compiler on my Mac, but I am not sure how to get it. In your README.MD file for the amazon-sssm-agent Cross Compile SSM Agent is broken link - goes to 404.

I believe that step is what I need to do to make sure I can cross compile SSM Agent (from Mac book for linux distribution). Could that link be fixed, or added instructions on what needs to be installaed on Mac Mojave to ensure ssm agent can be compiled.

GarimaBathla avatar Apr 29 '20 19:04 GarimaBathla

Apologies for the dead link. You can find the instructions for cross compiling the SSM Agent in the following link: https://www.ardanlabs.com/blog/2013/10/cross-compile-your-go-programs.html

ferkhat-aws avatar Apr 30 '20 00:04 ferkhat-aws

Thanks for reaching out, we will fix the deadlink.

I will close the issue, please feel free to reopen if you have more questions

shihuazhang avatar May 02 '20 20:05 shihuazhang