On Thu, Mar 12, 2026 at 7:11 AM Warner Losh <[email protected]> wrote:
> thunk.c is the same between linux-user and bsd-user (out of tree), > so share it between the two. > > Signed-off-by: Warner Losh <[email protected]> > --- > As part of upstream blitz bsd-user, I've discovered that bsd-user and > linux-user have the same thunk.c file. Rather than copy it, put it into > the common-user directory and share it. It has to be compiled > per-target, unlike the rest of common-user, so modify linux-user and > bsd-user to grab it from there. > I can also do the #include "../common-user/thunk.c" hack. But this seemed more straightforward. I'm also open to other ways to share. I can't just put it into the common-user/meson.build list since it needs to be per-target, not for the host. There doesn't seem to be a generic '*_user_ss' I can use. the user_ss that common-user/meson.build users is in addition to bsd_user_ss or linux_user_ss. Warner > --- > bsd-user/meson.build | 1 + > {linux-user => common-user}/thunk.c | 0 > linux-user/meson.build | 2 +- > 3 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/bsd-user/meson.build b/bsd-user/meson.build > index 00428fc2f8..c19b1f37a7 100644 > --- a/bsd-user/meson.build > +++ b/bsd-user/meson.build > @@ -17,6 +17,7 @@ bsd_user_ss.add(files( > 'plugin-api.c', > 'signal.c', > 'strace.c', > + '../common-user/thunk.c', > 'uaccess.c', > )) > > diff --git a/linux-user/thunk.c b/common-user/thunk.c > similarity index 100% > rename from linux-user/thunk.c > rename to common-user/thunk.c > diff --git a/linux-user/meson.build b/linux-user/meson.build > index 332847a621..f98b4a62cc 100644 > --- a/linux-user/meson.build > +++ b/linux-user/meson.build > @@ -17,7 +17,7 @@ linux_user_ss.add(files( > 'signal.c', > 'strace.c', > 'syscall.c', > - 'thunk.c', > + '../common-user/thunk.c', > 'uaccess.c', > 'uname.c', > )) > > --- > base-commit: 769a37d8bd0c81c39128fc292352f01bad0769f4 > change-id: 20260312-share-thunk-ab1585477999 > > Best regards, > -- > Warner Losh <[email protected]> > >
