From: Willy Tarreau <w@1wt.eu>
To: Zhangjin Wu <falcon@tinylab.org>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, thomas@t-8ch.de
Subject: Re: [PATCH v4 00/18] tools/nolibc: shrink arch support
Date: Sun, 16 Jul 2023 00:26:58 +0200 [thread overview]
Message-ID: <20230715222658.GA27708@1wt.eu> (raw)
In-Reply-To: <cover.1689444638.git.falcon@tinylab.org>
Hi Zhangjin,
On Sun, Jul 16, 2023 at 02:16:36AM +0800, Zhangjin Wu wrote:
> Hi, Willy, Thomas
>
> Thanks very much for your careful review and great suggestions, now, we
> get v4 revision of the arch shrink series [1], it mainly include a new
> fixup for -O0 under gcc < 11.1.0, the stackprotector support for
> _start_c(), new testcases for startup code and two new test targets.
>
> All of the tests passed or skipped (tinyconfig + few options +
> qemu-system) for both -Os and -O0:
(...)
First, good news, it looks OK from the nolibc-test perspective and
by looking at the code, so I merged all this into branch
20230715-nolibc-next-1
Second, bad news, my preinit code doesn't build anymore due to missing
definitions for statx. It's built using the default method which involves
just including nolibc.h (and getting linux includes from the default path).
I could simplify it to this one-liner:
$ printf "int test_stat(const char *p, struct stat *b) { return stat(p,b); }\n" |
gcc -c -o test.o -xc - -nostdlib -include ./sysroot/x86/include/nolibc.h
In file included from ././sysroot/x86/include/nolibc.h:98:0,
from <command-line>:32:
././sysroot/x86/include/sys.h:952:78: warning: 'struct statx' declared inside parameter list will not be visible outside of this definition or declaration
int sys_statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf)
^~~~~
././sysroot/x86/include/sys.h:962:74: warning: 'struct statx' declared inside parameter list will not be visible outside of this definition or declaration
int statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf)
^~~~~
././sysroot/x86/include/sys.h: In function 'statx':
././sysroot/x86/include/sys.h:964:51: warning: passing argument 5 of 'sys_statx' from incompatible pointer type [-Wincompatible-pointer-types]
return __sysret(sys_statx(fd, path, flags, mask, buf));
^~~
././sysroot/x86/include/sys.h:952:5: note: expected 'struct statx *' but argument is of type 'struct statx *'
int sys_statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf)
^~~~~~~~~
././sysroot/x86/include/sys.h: In function 'stat':
././sysroot/x86/include/sys.h:971:15: error: storage size of 'statx' isn't known
struct statx statx;
^~~~~
././sysroot/x86/include/sys.h:974:60: error: 'STATX_BASIC_STATS' undeclared (first use in this function)
ret = __sysret(sys_statx(AT_FDCWD, path, AT_NO_AUTOMOUNT, STATX_BASIC_STATS, &statx));
^~~~~~~~~~~~~~~~~
././sysroot/x86/include/sys.h:974:60: note: each undeclared identifier is reported only once for each function it appears in
I finally found that it's due to the lack of -Isysroot/x86/include, so
it used to get linux includes from those provided by glibc and these ones
were missing statx since packaged for an older kernel.
I knew that sooner or later I'd have to reinstall this machine but I
can't get out of my head that to date I have yet not been convinced by
the absolute necessity of this modification which is progressively adding
more burden :-/ Time will tell...
Cheers,
Willy
next prev parent reply other threads:[~2023-07-15 22:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-15 18:16 [PATCH v4 00/18] tools/nolibc: shrink arch support Zhangjin Wu
2023-07-15 18:17 ` [PATCH v4 01/18] tools/nolibc: arch-*.h: add missing space after ',' Zhangjin Wu
2023-07-15 18:18 ` [PATCH v4 02/18] tools/nolibc: fix up startup failures for -O0 under gcc < 11.1.0 Zhangjin Wu
2023-07-15 18:20 ` [PATCH v4 03/18] tools/nolibc: remove the old sys_stat support Zhangjin Wu
2023-07-15 18:21 ` [PATCH v4 04/18] tools/nolibc: add new crt.h with _start_c Zhangjin Wu
2023-07-15 18:22 ` [PATCH v4 05/18] tools/nolibc: stackprotector.h: add empty __stack_chk_init for !_NOLIBC_STACKPROTECTOR Zhangjin Wu
2023-07-15 18:23 ` [PATCH v4 06/18] tools/nolibc: crt.h: initialize stack protector Zhangjin Wu
2023-07-15 18:24 ` [PATCH v4 07/18] tools/nolibc: arm: shrink _start with _start_c Zhangjin Wu
2023-07-15 18:25 ` [PATCH v4 08/18] tools/nolibc: aarch64: " Zhangjin Wu
2023-07-15 18:26 ` [PATCH v4 09/18] tools/nolibc: i386: " Zhangjin Wu
2023-07-15 18:27 ` [PATCH v4 10/18] tools/nolibc: x86_64: " Zhangjin Wu
2023-07-15 18:28 ` [PATCH v4 11/18] tools/nolibc: mips: " Zhangjin Wu
2023-07-15 18:30 ` [PATCH v4 12/18] tools/nolibc: loongarch: " Zhangjin Wu
2023-07-15 18:31 ` [PATCH v4 13/18] tools/nolibc: riscv: " Zhangjin Wu
2023-07-15 18:32 ` [PATCH v4 14/18] tools/nolibc: s390: " Zhangjin Wu
2023-07-15 18:33 ` [PATCH v4 15/18] selftests/nolibc: add EXPECT_PTRGE, EXPECT_PTRGT, EXPECT_PTRLE, EXPECT_PTRLT Zhangjin Wu
2023-07-15 18:34 ` [PATCH v4 16/18] selftests/nolibc: add testcases for startup code Zhangjin Wu
2023-07-15 18:35 ` [PATCH v4 17/18] selftests/nolibc: allow run nolibc-test locally Zhangjin Wu
2023-07-15 18:36 ` [PATCH v4 18/18] selftests/nolibc: allow test -include /path/to/nolibc.h Zhangjin Wu
2023-07-15 22:26 ` Willy Tarreau [this message]
2023-07-16 1:17 ` [PATCH v4 00/18] tools/nolibc: shrink arch support Zhangjin Wu
2023-07-16 4:50 ` Willy Tarreau
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=20230715222658.GA27708@1wt.eu \
--to=w@1wt.eu \
--cc=arnd@arndb.de \
--cc=falcon@tinylab.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=thomas@t-8ch.de \
/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