Skip to content

Commit

Permalink
Add linker flags for text section creation conditionally, based on th…
Browse files Browse the repository at this point in the history
…e OS
  • Loading branch information
13ajay authored and Lychee030 committed Aug 22, 2024
1 parent 81b7817 commit d625eb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ VERSION=1.2.0
release: build/bin/aws_signing_helper

curdir=$(shell pwd)
uname=$(shell uname -s)
ifeq ($(uname),Darwin)
extra_ld_flags=-extldflags '-sectcreate __TEXT __info_plist $(curdir)/Info.plist'
else
extra_ld_flags=
endif

build/bin/aws_signing_helper:
go build -buildmode=pie -ldflags "-X 'github.com/aws/rolesanywhere-credential-helper/cmd.Version=${VERSION}' -extldflags '-sectcreate __TEXT __info_plist $(curdir)/Info.plist' -linkmode=external -w -s" -trimpath -o build/bin/aws_signing_helper main.go
go build -buildmode=pie -ldflags "-X 'github.com/aws/rolesanywhere-credential-helper/cmd.Version=${VERSION}' $(extra_ld_flags) -linkmode=external -w -s" -trimpath -o build/bin/aws_signing_helper main.go

.PHONY: clean
clean:
Expand Down

0 comments on commit d625eb9

Please sign in to comment.