public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: SuHsueyu <anolasc13@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: Support for gcc
Date: Mon, 26 Dec 2022 10:42:34 +0100	[thread overview]
Message-ID: <87pmc6xzzp.fsf@oracle.com> (raw)
In-Reply-To: <CAEc2n-t1W5uit+S9FkttdvbLhZgRdX2-RzUxw71X9FyptsdaSQ@mail.gmail.com> (SuHsueyu's message of "Sun, 25 Dec 2022 23:24:08 +0800")


> Thank you very much. It solved my problem; what bpf-gcc build can now
> be loaded by libbpf.

Glad it helped :)

> BTW, when I tried to use bpf-gcc in godbolt.org, I did not add any
> additional compile options, and it reported an error:
>
> /opt/compiler-explorer/bpf/gcc-trunk-20221225/bpf-unknown-none/lib/gcc/bpf-unknown-none/13.0.0/../../../../bpf-unknown-none/bin/ld:
> -pie not supported
> collect2: error: ld returned 1 exit status
> Compiler returned: 1

Hmm, I just tried and it didn't add -pie to the command line options.  I
think that somehow godbolt.org remembers and re-uses the settings used
by the last user.  At least when it comes to select the cross compiler.
Maybe it is the same with the compilation options...

>
> On Thu, Dec 22, 2022 at 2:26 AM Jose E. Marchesi
> <jose.marchesi@oracle.com> wrote:
>>
>>
>> > So you need a bpf-unknown-none-gcc toolchain.
>> > You can either:
>> >
>> > a) Install a pre-compiled cross available in your distro.
>> >    Debian ships gcc-bpf, for example.  See
>> >    https://gcc.gnu.org/wiki/BPFBackEnd for a list.
>> >
>> > or,
>> >
>> > b) Build crossed versions of binutils and gcc, configuring with
>> >    --target=bpf-unknown-none.
>> >
>> > or,
>> >
>> > c) Use crosstool-ng to build a GCC BPF cross.  We recently added support
>> >    for bpf-unknown-none there.
>>
>> Incidentally, thanks to Marc Poulhiès godbolt.org has now support for
>> nightly builds of GCC BPF.

  reply	other threads:[~2022-12-26  9:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 11:45 Support for gcc SuHsueyu
2022-12-20 17:27 ` sdf
2022-12-21  0:34 ` Andrii Nakryiko
2022-12-21 11:03   ` SuHsueyu
2022-12-21 17:41     ` Alan Maguire
2022-12-21 18:26   ` Jose E. Marchesi
2022-12-21 18:22 ` Jose E. Marchesi
2022-12-21 18:30   ` Jose E. Marchesi
2022-12-25 15:24     ` SuHsueyu
2022-12-26  9:42       ` Jose E. Marchesi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-12-29 18:22 Marc Poulhiès

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=87pmc6xzzp.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=anolasc13@gmail.com \
    --cc=bpf@vger.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