From 677ae754e12d570bdc48efaacae83c0fb8b72e8b Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 5 May 2021 22:09:26 -0700 Subject: Specify -buildmode=c-shared after GO_FLAGS rather than before When building pam_fscrypt.so, specify -buildmode=c-shared after $(GO_FLAGS) so that it overrides any user-specified buildmode. This is needed to allow -buildmode=pie to be specified in GO_FLAGS if the packager wants to build fscrypt as a position-independent executable (e.g. following https://wiki.archlinux.org/title/Go_package_guidelines). Previously, trying to do this caused pam_fscrypt.so to be incorrectly built as an executable rather than as a shared library. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 44ada50..21323cc 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,7 @@ $(BIN)/$(NAME): $(GO_FILES) $(C_FILES) go build $(GO_FLAGS) -o $@ ./cmd/$(NAME) $(PAM_MODULE): $(GO_FILES) $(C_FILES) - go build -buildmode=c-shared $(GO_FLAGS) -o $@ ./$(PAM_NAME) + go build $(GO_FLAGS) -buildmode=c-shared -o $@ ./$(PAM_NAME) rm -f $(BIN)/$(PAM_NAME).h gen: $(BIN)/protoc $(BIN)/protoc-gen-go $(PROTO_FILES) -- cgit v1.2.3