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

For s390x arch the auto generated go object's name needs to have s390x prefix #1308

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion cmd/bpf2go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,12 @@ func (b2g *bpf2go) convert(tgt target, goarches []goarch) (err error) {
}
stem := fmt.Sprintf("%s_%s", outputStem, tgt.clang)
if tgt.linux != "" {
stem = fmt.Sprintf("%s_%s_%s", outputStem, tgt.clang, tgt.linux)
// for s390 target GOARCH has to be s390x
if tgt.linux == "390" {
stem = fmt.Sprintf("%s_%s_%s", outputStem, tgt.clang, "s390x")
} else {
stem = fmt.Sprintf("%s_%s_%s", outputStem, tgt.clang, tgt.linux)
}
}

objFileName := filepath.Join(b2g.outputDir, stem+".o")
Expand Down
6 changes: 6 additions & 0 deletions cmd/bpf2go/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ func TestCollectTargets(t *testing.T) {
{"bpfel", "x86"}: linuxArchesLE["x86"],
},
},
{
[]string{"s390x"},
map[target][]goarch{
{"bpfeb", "s390"}: linuxArchesBE["s390"],
},
},
{
[]string{"native"},
nativeTarget,
Expand Down