From: Paolo Abeni <pabeni@redhat.com>
To: Dmitry Safonov <dima@arista.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Shuah Khan <shuah@kernel.org>
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>,
Dmitry Safonov <0x7f454c46@gmail.com>
Subject: Re: [PATCH] selftests/net/tcp-ao: Use LDLIBS instead of LDFLAGS
Date: Thu, 11 Jan 2024 15:42:02 +0100 [thread overview]
Message-ID: <c68e9299e755b38c38d63d8cb121800639f5e07a.camel@redhat.com> (raw)
In-Reply-To: <20240110-tcp_ao-selftests-makefile-v1-1-aa07d043f052@arista.com>
On Wed, 2024-01-10 at 21:34 +0000, Dmitry Safonov wrote:
> The rules to link selftests are:
>
> > $(OUTPUT)/%_ipv4: %.c
> > $(LINK.c) $^ $(LDLIBS) -o $@
> >
> > $(OUTPUT)/%_ipv6: %.c
> > $(LINK.c) -DIPV6_TEST $^ $(LDLIBS) -o $@
>
> The intel test robot uses only selftest's Makefile, not the top linux
> Makefile:
>
> > make W=1 O=/tmp/kselftest -C tools/testing/selftests
>
> So, $(LINK.c) is determined by environment, rather than by kernel
> Makefiles. On my machine (as well as other people that ran tcp-ao
> selftests) GNU/Make implicit definition does use $(LDFLAGS):
>
> > [dima@Mindolluin ~]$ make -p -f/dev/null | grep '^LINK.c\>'
> > make: *** No targets. Stop.
> > LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
>
> But, according to build robot report, it's not the case for them.
> While I could just avoid using pre-defined $(LINK.c), it's also used by
> selftests/lib.mk by default.
>
> Anyways, according to GNU/Make documentation [1], I should have used
> $(LDLIBS) instead of $(LDFLAGS) in the first place, so let's just do it:
>
> > LDFLAGS
> > Extra flags to give to compilers when they are supposed to invoke
> > the linker, ‘ld’, such as -L. Libraries (-lfoo) should be added
> > to the LDLIBS variable instead.
> > LDLIBS
> > Library flags or names given to compilers when they are supposed
> > to invoke the linker, ‘ld’. LOADLIBES is a deprecated (but still
> > supported) alternative to LDLIBS. Non-library linker flags, such
> > as -L, should go in the LDFLAGS variable.
>
> [1]: https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
>
> Fixes: cfbab37b3da0 ("selftests/net: Add TCP-AO library")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202401011151.veyYTJzq-lkp@intel.com/
> Signed-off-by: Dmitry Safonov <dima@arista.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
next prev parent reply other threads:[~2024-01-11 14:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 21:34 Dmitry Safonov
2024-01-11 14:42 ` Paolo Abeni [this message]
2024-01-12 0:40 ` patchwork-bot+netdevbpf
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=c68e9299e755b38c38d63d8cb121800639f5e07a.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=0x7f454c46@gmail.com \
--cc=davem@davemloft.net \
--cc=dima@arista.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=shuah@kernel.org \
/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
all inboxes | Powered by JetHome®