[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<BN7PR02MB414887B3CA73281177406A5BD4CCA@BN7PR02MB4148.namprd02.prod.outlook.com>
Date: Wed, 12 Nov 2025 04:32:02 +0000
From: Michael Kelley <mhklinux@...look.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>
CC: "x86@...nel.org" <x86@...nel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, Petr Mladek <pmladek@...e.com>, Miroslav
Benes <mbenes@...e.cz>, Joe Lawrence <joe.lawrence@...hat.com>,
"live-patching@...r.kernel.org" <live-patching@...r.kernel.org>, Song Liu
<song@...nel.org>, laokz <laokz@...mail.com>, Jiri Kosina <jikos@...nel.org>,
Marcos Paulo de Souza <mpdesouza@...e.com>, Weinan Liu <wnliu@...gle.com>,
Fazla Mehrab <a.mehrab@...edance.com>, Chen Zhongjin
<chenzhongjin@...wei.com>, Puranjay Mohan <puranjay@...nel.org>, Dylan Hatch
<dylanbhatch@...gle.com>, Peter Zijlstra <peterz@...radead.org>
Subject: RE: [PATCH v4 49/63] objtool/klp: Add --checksum option to generate
per-function checksums
From: Josh Poimboeuf <jpoimboe@...nel.org> Sent: Tuesday, November 11, 2025 8:04 PM
>
> On Wed, Nov 12, 2025 at 02:26:18AM +0000, Michael Kelley wrote:
> > > I've been able to debug this. Two problems:
> > >
> > > 1) On Ubuntu (both 20.04 and 24.04), /bin/sh and /usr/bin/sh are symlinks
> > > to "dash" (not "bash"). So the "shell" command in "make" invokes dash. The
> > > man page for dash shows that the built-in echo command accepts only -n as
> > > an option. The -e behavior of processing "\n" and similar sequences is always
> > > enabled. So on my Ubuntu systems, the "-e" is ignored by echo and becomes
> > > part of the C source code sent to gcc, and of course it barfs. Dropping the -e
> > > makes it work for me (and the \n is handled correctly), but that might not work
> > > with other shells. Using "/bin/echo" with the -e solves the problem in a more
> > > compatible way across different shells.
>
> Ah. I think we can use "printf" here.
>
> > > 2) With make v4.2.1 on my Ubuntu 20.04 system, the "#" character in the
> > > "#include" added to the echo command is problematic. "make" seems to be
> > > treating it as a comment character, though I'm not 100% sure of that
> > > interpretation. Regardless, the "#" causes a syntax error in the "make" shell
> > > command. Adding a backslash before the "#" solves that problem. On an Ubuntu
> > > 24.04 system with make v4.3, the "#" does not cause any problems. (I tried to put
> > > make 4.3 on my Ubuntu 20.04 system, but ran into library compatibility problems
> > > so I wasn’t able to definitively confirm that it is the make version that changes the
> > > handling of the "#"). Unfortunately, adding the backslash before the # does *not*
> > > work with make v4.3. The backslash becomes part of the C source code sent to
> > > gcc, which barfs. I don't immediately have a suggestion on how to resolve this
> > > in a way that is compatible across make versions.
> >
> > Using "\043" instead of the "#" is a compatible solution that works in make
> > v4.2.1 and v4.3 and presumably all other versions as well.
>
> Hm... I've seen similar portability issues with "," for which we had to
> change it to "$(comma)" which magically worked for some reason that I am
> forgetting.
>
> Does "$(pound)" work? This seems to work here:
>
> HAVE_XXHASH = $(shell printf "$(pound)include <xxhash.h>\nXXH3_state_t *state;int main() {}" | \
>
Yes, the above line works in my Ubuntu 20.04 and 24.04 environments.
It properly detects the presence and absence of xxhash 0.8. Seems like a
good solution to me.
Michael
Powered by blists - more mailing lists