aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2021-05-05 22:09:26 -0700
committerEric Biggers <ebiggers3@gmail.com>2021-05-05 22:22:20 -0700
commit677ae754e12d570bdc48efaacae83c0fb8b72e8b (patch)
tree2ebeeb5087936b370e0a40226b7b02d72cb82060 /Makefile
parent79795229bba45f6f58b8e0496a9a9e098f1c22aa (diff)
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
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)