All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: Alexander Lobakin <alexandr.lobakin@intel.com>
Cc: "Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH bpf 1/2] samples: bpf: fix xdp_sample_user.o linking with Clang
Date: Sat, 4 Dec 2021 06:17:21 +0530	[thread overview]
Message-ID: <20211204004721.ubdt2kcshorcmhw4@apollo.legion> (raw)
In-Reply-To: <20211203195004.5803-2-alexandr.lobakin@intel.com>

On Sat, Dec 04, 2021 at 01:20:03AM IST, Alexander Lobakin wrote:
> Clang (13) doesn't get the jokes about specifying libraries to link in
> cclags of individual .o objects:
>
> clang-13: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
> [ ... ]
>   LD  samples/bpf/xdp_redirect_cpu
>   LD  samples/bpf/xdp_redirect_map_multi
>   LD  samples/bpf/xdp_redirect_map
>   LD  samples/bpf/xdp_redirect
>   LD  samples/bpf/xdp_monitor
> /usr/bin/ld: samples/bpf/xdp_sample_user.o: in function `sample_summary_print':
> xdp_sample_user.c:(.text+0x84c): undefined reference to `floor'
> /usr/bin/ld: xdp_sample_user.c:(.text+0x870): undefined reference to `ceil'
> /usr/bin/ld: xdp_sample_user.c:(.text+0x8cf): undefined reference to `floor'
> /usr/bin/ld: xdp_sample_user.c:(.text+0x8f3): undefined reference to `ceil'
> [ more ]
>
> Specify '-lm' as ldflags for all xdp_sample_user.o users in the main
> Makefile and remove it from ccflags of ^ in Makefile.target -- just
> like it's done for all other samples. This works with all compilers.
>
> Fixes: 6e1051a54e31 ("samples: bpf: Convert xdp_monitor to XDP samples helper")
> Fixes: b926c55d856c ("samples: bpf: Convert xdp_redirect to XDP samples helper")
> Fixes: e531a220cc59 ("samples: bpf: Convert xdp_redirect_cpu to XDP samples helper")
> Fixes: bbe65865aa05 ("samples: bpf: Convert xdp_redirect_map to XDP samples helper")
> Fixes: 594a116b2aa1 ("samples: bpf: Convert xdp_redirect_map_multi to XDP samples helper")
> Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> ---

Thanks, something to remember to test for next time.

Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>

--
Kartikeya

  reply	other threads:[~2021-12-04  0:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 19:50 [PATCH bpf 0/2] samples: bpf: fix build issues with Clang/LLVM Alexander Lobakin
2021-12-03 19:50 ` [PATCH bpf 1/2] samples: bpf: fix xdp_sample_user.o linking with Clang Alexander Lobakin
2021-12-04  0:47   ` Kumar Kartikeya Dwivedi [this message]
2021-12-03 19:50 ` [PATCH bpf 2/2] samples: bpf: fix 'unknown warning group' build warning on Clang Alexander Lobakin
2021-12-04  0:47   ` Kumar Kartikeya Dwivedi
2021-12-07  3:35 ` [PATCH bpf 0/2] samples: bpf: fix build issues with Clang/LLVM Andrii Nakryiko

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=20211204004721.ubdt2kcshorcmhw4@apollo.legion \
    --to=memxor@gmail.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.