-
Notifications
You must be signed in to change notification settings - Fork 674
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
Conversation
3ccbedf
to
51568f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try simply passing -target s390x
instead of -target s390
? I think that will do the right thing. Ignore the file name, the important bit is the build constraint contained within.
cmd/bpf2go/main.go
Outdated
@@ -66,7 +66,7 @@ var targetByGoArch = map[string]target{ | |||
"mips64p32": {"bpfeb", ""}, | |||
"ppc64": {"bpfeb", "powerpc"}, | |||
"s390": {"bpfeb", "s390"}, | |||
"s390x": {"bpfeb", "s390"}, | |||
"s390x": {"bpfeb", "s390x"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct since the second entry in target
is used to define __TARGET_ARCH_s390
, etc. There is no __TARGET_ARCH_s390x
from what I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u mean the define in bpf_tracing.h right I think the same target _s390
seems to be used for both arch 32bits and 64bits at least that is what I saw in iovisor/bcc@7d7b6e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u are right reworked the diffs PTAL
using |
51568f8
to
d9ffaf6
Compare
d9ffaf6
to
e011219
Compare
Can you copy and paste the error you get when using |
the auto generated go file not getting embedded when build so GOARCH=s390x because the generated file is _s390.go instead of _s390x.go GOARCH=s390x make compile
### Compiling project
# github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf
pkg/ebpf/tracer.go:55:22: undefined: BpfObjects
pkg/ebpf/tracer.go:84:15: undefined: LoadBpf
pkg/ebpf/tracer.go:401:48: undefined: BpfFlowId
pkg/ebpf/tracer.go:401:60: undefined: BpfFlowMetrics
pkg/ebpf/tracer.go:405:23: undefined: BpfFlowId
pkg/ebpf/tracer.go:405:35: undefined: BpfFlowMetrics
pkg/ebpf/tracer.go:406:9: undefined: BpfFlowId
pkg/ebpf/tracer.go:407:16: undefined: BpfFlowMetrics
pkg/ebpf/tracer.go:452:78: undefined: BpfObjects
pkg/ebpf/tracer.go:512:18: undefined: BpfObjects
pkg/ebpf/tracer.go:407:16: too many errors
make: *** [Makefile:131: compile] Error 1 I shared the build logs in issue #1307 |
Okay, in that case the issue is that |
Yes GO doesn't consider |
Just my thought looking into this a bit more: Line 310 in bfbacc1
Here the element At the moment, I think, it is not possible to determine GOARCH from the value combinations of |
b384e80
to
26e3445
Compare
Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
26e3445
to
eb4c598
Compare
@florianl take a look at 00aa2c3 which hopefully clarifies goarch vs clang target vs linux target. The way files are generated are as follows:
The problem is that the clang target I think the fix is to change the way we name files, which unfortunately is a breaking change. I'll try to prep a PR. |
Thanks @lmb pls cc me in your new PR |
this PR no longer needed a new PR by @lmb will be generated to fix this issue |
s390
is not a validGOARCH
changing yje auto generated go file to uses390x
arch instead.fix #1307