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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250627060723.GC4540@1wt.eu>
Date: Fri, 27 Jun 2025 08:07:23 +0200
From: Willy Tarreau <w@....eu>
To: Arnd Bergmann <arnd@...db.de>
Cc: Thomas Weißschuh <linux@...ssschuh.net>,
        Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
        linux-kernel@...r.kernel.org, Masahiro Yamada <masahiroy@...nel.org>
Subject: Re: [RFC PATCH 3/3] tools/nolibc: add a new "install_all_archs"
 target

On Fri, Jun 27, 2025 at 07:58:58AM +0200, Arnd Bergmann wrote:
> On Fri, Jun 27, 2025, at 05:25, Willy Tarreau wrote:
> > On Thu, Jun 26, 2025 at 11:15:07PM +0200, Arnd Bergmann wrote:
> >> On Thu, Jun 26, 2025, at 22:18, Thomas Weißschuh wrote:
> 
> >> If it's indeed possible to concatenate the path name (I couldn't
> >> figure that out either), that could also be done in place of the
> >> symlink but simpler than the #if/#elif/#elif/... block, like
> >> 
> >> #include <arch.h> // defines ARCH_PREFIX
> >> #include CONCAT(ARCH_PREFIX, ioctl.h)
> >
> > I have never found how it would be possible to do that, let alone in a
> > more or less portable way, because #include doesn't take a C-string in
> > argument but a special syntax which is specific to it ("x" or <x>). It
> > doesn't support concatenating strings for example:
> >
> >   #include "stdio"".h"
> >
> >   $ gcc -E inc.h
> >   inc.h:1:17: warning: extra tokens at end of #include directive
> >       1 | #include "stdio"".h"
> >         |                 ^~~~
> >   inc.h:1:10: fatal error: stdio: No such file or directory
> >       1 | #include "stdio"".h"
> >         |          ^~~~~~~
> 
> This variant does seem to work with gcc and clang:
> 
> #define ARCH i386
> #define __ARCH_HEADER(a, b) <a ## _ ## b>
> #define _ARCH_HEADER(a, b) __ARCH_HEADER(a, b)
> #include _ARCH_HEADER(ARCH, stdio.h)
> 
> Or even simpler
> 
> #define _NOLIBC_ARCH_HEADER(file) <i386_ ## file>
> 
> The ## concatenation is a bit limited here since cpp requires
> both sides to expand to an identifier, meaning you can have
> a '_' next to it, but not a '/' or '-'.

Thanks Arnd, will give it a try this week-end.

Willy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ