|
From: | Brian Callahan |
Subject: | bug#50972: src/ls.c fails to build when __GNUC_PREREQ is not defined (e.g., OpenBSD) |
Date: | Sat, 02 Oct 2021 14:44:32 +0000 |
Hello -- I am the GNU coreutils package maintainer for OpenBSD.While updating the OpenBSD package to 9.0, the build errored out while compiling src/ls.c with the following error message:
src/ls.c:2276:6: error: function-like macro '__GNUC_PREREQ' is not defined
I noticed that there are some #ifdefs defining and using the macro in the lib/ directory but clearly the definition is not reaching into src/.
OpenBSD has a __GNUC_PREREQ__ macro defined in <sys/cdefs.h> but not the __GNUC_PREREQ macro.
If the preprocessor checks and associated pragmas are removed from src/ls.c then it builds OK. OpenBSD package builders use clang 11.1.0 and clang does not trigger the bogus warnings that these __GNUC_PREREQ-wrapped pragmas are defending against. Obviously that is not a universal fix, just a data point.
Once this fix is done, the rest of coreutils-9.0 builds and works OK. There are no test failures for coreutils-9.0 on x86_64-unknown-openbsd7.0
Thanks. ~Brian
[Prev in Thread] | Current Thread | [Next in Thread] |