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

chore: fix compilation warnings about malformed LC_DYSYMTAB #5829

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ else
GOBIN=$(shell go env GOBIN)
endif

ifeq (Darwin,$(shell uname -s))
LDFLAGS_COMMON ?= -extldflags=-Wl,-ld_classic
endif

LDFLAGS_METADATA ?= \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Release=$(TAG) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Commit=$(COMMIT) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Repo=$(REPO_INFO) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.ProjectURL=$(REPO_URL)

# ------------------------------------------------------------------------------
# Configuration - Tooling
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -174,21 +184,21 @@ _build.fips:

.PHONY: _build.template
_build.template:
go build -o bin/manager -ldflags "-s -w \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Release=$(TAG) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Commit=$(COMMIT) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Repo=$(REPO_INFO)" ${MAIN}
go build -o bin/manager \
-ldflags "-s -w $(LDFLAGS_METADATA)" \
${MAIN}

.PHONY: _build.debug
_build.debug:
$(MAKE) _build.template.debug MAIN=./internal/cmd/main.go

.PHONY: _build.template.debug
_build.template.debug:
go build -o bin/manager-debug -trimpath -gcflags=all="-N -l" -ldflags " \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Release=$(TAG) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Commit=$(COMMIT) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Repo=$(REPO_INFO)" ${MAIN}
go build -o bin/manager-debug \
-trimpath \
-gcflags=all="-N -l" \
-ldflags "-s -w $(LDFLAGS_METADATA)" \
${MAIN}

.PHONY: fmt
fmt:
Expand Down Expand Up @@ -366,10 +376,7 @@ test.conformance: _check.container.environment go-junit-report
TEST_KONG_HELM_CHART_VERSION="$(TEST_KONG_HELM_CHART_VERSION)" \
GOFLAGS="-tags=conformance_tests" \
go test \
-ldflags " \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.ProjectURL=$(REPO_URL) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Release=$(TAG) \
-X $(REPO_URL)/$(GO_MOD_MAJOR_VERSION)/internal/manager/metadata.Repo=$(REPO_INFO)" \
-ldflags "$(LDFLAGS_METADATA)" \
-v \
-race $(GOTESTFLAGS) \
-timeout $(INTEGRATION_TEST_TIMEOUT) \
Expand All @@ -388,7 +395,9 @@ test.integration.enterprise: test.integration.enterprise.postgres test.integrati
_test.unit: gotestsum
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
$(GOTESTSUM) -- \
-race $(GOTESTFLAGS) \
-race \
-ldflags="$(LDFLAGS_COMMON)" \
$(GOTESTFLAGS) \
-tags envtest \
-covermode=atomic \
-coverpkg=$(PKG_LIST) \
Expand Down Expand Up @@ -423,7 +432,9 @@ _test.envtest: gotestsum setup-envtest use-setup-envtest
$(GOTESTSUM) \
--hide-summary output \
-- \
-race $(GOTESTFLAGS) \
-race \
-ldflags="$(LDFLAGS_COMMON)" \
$(GOTESTFLAGS) \
-tags envtest \
-covermode=atomic \
-timeout $(ENVTEST_TIMEOUT) \
Expand Down
Loading