lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKmqyKPs_nZh4dq6VWty=1WXuPHLCzBs78CBqi7szs+tr37S8g@mail.gmail.com>
Date: Wed, 13 Nov 2024 09:18:17 +1000
From: Alistair Francis <alistair23@...il.com>
To: Andreas Hindborg <a.hindborg@...nel.org>
Cc: Alistair Francis <alistair@...stair23.me>, linux-kernel@...r.kernel.org, 
	boqun.feng@...il.com, me@...enk.dev, benno.lossin@...ton.me, 
	tmgross@...ch.edu, aliceryhl@...gle.com, gary@...yguo.net, ojeda@...nel.org, 
	rust-for-linux@...r.kernel.org, alex.gaynor@...il.com, 
	alistair.francis@....com, bjorn3_gh@...tonmail.com
Subject: Re: [PATCH v3 01/11] rust: bindings: Support some inline static functions

On Tue, Nov 12, 2024 at 7:58 PM Andreas Hindborg <a.hindborg@...nel.org> wrote:
>
> "Alistair Francis" <alistair23@...il.com> writes:
>
> > On Mon, Nov 11, 2024 at 10:07 PM Andreas Hindborg <a.hindborg@...nel.org> wrote:
> >>
> >> "Alistair Francis" <alistair@...stair23.me> writes:
> >>
> >> <cut>
> >>
> >> > diff --git a/rust/exports.c b/rust/exports.c
> >> > index 587f0e776aba..288958d2ebea 100644
> >> > --- a/rust/exports.c
> >> > +++ b/rust/exports.c
> >> > @@ -18,6 +18,7 @@
> >> >  #include "exports_core_generated.h"
> >> >  #include "exports_helpers_generated.h"
> >> >  #include "exports_bindings_generated.h"
> >> > +#include "exports_bindings_static_generated.h"
> >>
> >> Generating `exports_bindings_static_generated.h` depends on `exports.o`,
> >> which depends on `exports.c`. Does this not create chicken-egg kind of
> >> problem?
> >
> > It is a bit confusing as there are a few levels of autogeneration, but
> > Make happily handles it.
> >
> > `exports.c` depends on `exports_bindings_static_generated.h`
> >
> > But `exports_bindings_static_generated.h` depends on `extern.o`
> > (extern not exports).
> >
> > `extern.o` then depends on `extern.c`
> >
> > `extern.c` then depends on `bindings_generated_static.rs`, which is
> > generated by bindgen.
> >
> > So there isn't a chick-egg problem and this happily builds from a clean tree.
>
> Right, I think I mixed up exports/extern.
>
> Anyway, it does not build for me. I applied it on top of `rust-next` and
> I get:
>
> ..
> │  CC      rust/extern.o                                                                                                                                                                                                                                                                                                              │
> │/home/aeh/src/linux-rust/helpers/rust/extern.c:1:10: fatal error: '/home/aeh/src/linux-rust/helpers/bindings/bindings_helper.h' file not found                                                                                                                                                                                       │
> │    1 | #include "/home/aeh/src/linux-rust/helpers/bindings/bindings_helper.h"                                                                                                                                                                                                                                                       │
> │      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                       │
> │1 error generated.                                                                                                                                                                                                                                                                                                                   │

Thanks for testing this

The #include in `extern.c` is auto-generated by bindgen based on your
current directory. So for an out of tree build I guess it's just
wrong. I'll fixup the sed operation to ensure we correct the path to
be a relative path instead.

Alistair

>
>
> I am doing out of tree build - maybe that is the culprit?
>
>
> Best regards,
> Andreas Hindborg
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ