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: Use -tags 'netgo' in bulding process to avoid SIGSEGV because of the different version of glibc in dfferent Linux distros #616

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

Zheaoli
Copy link
Contributor

@Zheaoli Zheaoli commented Sep 2, 2024

Fix #604

Signed-off-by: Manjusaka me@manjusaka.me

…e of the different version of glibc in dfferent Linux distros

Signed-off-by: Manjusaka <me@manjusaka.me>
functions.mk Outdated
@@ -49,7 +49,7 @@ define gobuild
CGO_CFLAGS='-O2 -g -gdwarf-4 -I$(CURDIR)/lib/libpcap/' \
CGO_LDFLAGS='-O2 -g -L$(CURDIR)/lib/libpcap/ -lpcap -static' \
GOOS=linux GOARCH=$(GOARCH) CC=$(CMD_CC_PREFIX)$(CMD_CC) \
$(CMD_GO) build -tags $(TARGET_TAG) -ldflags "-w -s -X 'github.com/gojue/ecapture/cli/cmd.GitVersion=$(TARGET_TAG)_$(GOARCH):$(VERSION_NUM):$(VERSION_FLAG)' -linkmode=external -extldflags -static " -o $(OUT_BIN)
$(CMD_GO) build -tags '$(TARGET_TAG) netgo' -ldflags "-w -s -X 'github.com/gojue/ecapture/cli/cmd.GitVersion=$(TARGET_TAG)_$(GOARCH):$(VERSION_NUM):$(VERSION_FLAG)' -linkmode=external -extldflags -static " -o $(OUT_BIN)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the new version of Golang, should multiple tags be separated by commas?

go help build

-tags tag,list
		a comma-separated list of additional build tags to consider satisfied
		during the build. For more information about build tags, see
		'go help buildconstraint'. (Earlier versions of Go used a
		space-separated list, and that form is deprecated but still recognized.)

@cfc4n cfc4n self-requested a review September 2, 2024 14:23
Copy link
Member

@cfc4n cfc4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tags is a comma-separated list.

Signed-off-by: Manjusaka <me@manjusaka.me>
@Zheaoli
Copy link
Contributor Author

Zheaoli commented Sep 2, 2024

Fixed, comma should be better

@Zheaoli Zheaoli requested a review from cfc4n September 2, 2024 14:35
Copy link
Member

@cfc4n cfc4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@cfc4n cfc4n added the fix bug fix PR label Sep 2, 2024
@cfc4n cfc4n merged commit 256abbc into gojue:master Sep 2, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix bug fix PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

based arch linux dist running ecapture crashed: segmentation violation
2 participants