From: Tony Ambardar <tony.ambardar@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Mykola Lysenko <mykolal@fb.com>,
Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips
Date: Mon, 22 Jul 2024 17:04:18 -0700 [thread overview]
Message-ID: <Zp7zgvhrt2/5LpbI@kodidev-ubuntu> (raw)
In-Reply-To: <CAEf4BzY0rt56Zu2J2FOkzB1WuXtjDMgLuApqsKWnxnzbBQ1eKA@mail.gmail.com>
On Mon, Jul 22, 2024 at 02:22:53PM -0700, Andrii Nakryiko wrote:
> On Sun, Jul 21, 2024 at 12:51 AM Tony Ambardar <tony.ambardar@gmail.com> wrote:
[...]
> > --- a/tools/testing/selftests/bpf/Makefile
> > +++ b/tools/testing/selftests/bpf/Makefile
> > @@ -784,9 +784,12 @@ $(OUTPUT)/veristat: $(OUTPUT)/veristat.o
> > $(call msg,BINARY,,$@)
> > $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
> >
> > +# Linking uprobe_multi can fail due to relocation overflows on mips.
> > +uprobe_multi.c-CFLAGS := $(if $(filter mips, $(ARCH)),-mxgot)
> > +
> > $(OUTPUT)/uprobe_multi: uprobe_multi.c
> > $(call msg,BINARY,,$@)
> > - $(Q)$(CC) $(CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@
> > + $(Q)$(CC) $(CFLAGS) $($<-CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@
>
> this $($<-CFLAGS) approach is fragile, non-obvious and will break. But
> there is also no need for this, see:
>
> $(OUTPUT)/bench: LDLIBS += -lm
>
> make allows to override envvars on a per-target basis, so all you
> should need is:
>
>
> $(OUTPUT)/uprobe_multi: CFLAGS += $(if $(filter mips, $(ARCH)),-mxgot)
> $(OUTPUT)/uprobe_multi: uprobe_multi.c
> ... the rest is the same with no change whatsoever ...
>
Great suggestion, thanks for pointing that out! I'll update and send v2.
> >
> > EXTRA_CLEAN := $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
> > prog_tests/tests.h map_tests/tests.h verifier/tests.h \
> > --
> > 2.34.1
> >
next prev parent reply other threads:[~2024-07-23 0:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-21 7:50 [PATCH bpf-next v1 0/2] selftests/bpf: Add support for MIPS systems Tony Ambardar
2024-07-21 7:50 ` [PATCH bpf-next v1 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
2024-07-21 7:50 ` [PATCH bpf-next v1 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
2024-07-22 21:22 ` Andrii Nakryiko
2024-07-23 0:04 ` Tony Ambardar [this message]
2024-07-23 0:13 ` [PATCH bpf-next v2 0/2] selftests/bpf: Add support for MIPS systems Tony Ambardar
2024-07-23 0:13 ` [PATCH bpf-next v2 1/2] selftests/bpf: Add missing system defines for mips Tony Ambardar
2024-07-23 20:20 ` patchwork-bot+netdevbpf
2024-07-23 0:13 ` [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Tony Ambardar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zp7zgvhrt2/5LpbI@kodidev-ubuntu \
--to=tony.ambardar@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox