From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: yocto-patches@lists.yoctoproject.org
Subject: [pseudo][pseudo-1.9]PATCH 04/10] configure: Require GCC 5 or later
Date: Wed, 11 Nov 2026 10:15:06 -0600 [thread overview]
Message-ID: <1794413712-18072-5-git-send-email-mark.hatle@kernel.crashing.org> (raw)
In-Reply-To: <1794413712-18072-1-git-send-email-mark.hatle@kernel.crashing.org>
From: Mark Hatle <mark.hatle@amd.com>
pseudo uses __has_include, which GCC only supports from version 5, so
older compilers such as GCC 4.8 on CentOS 7 failed part way through the
build.
clang reports itself as GCC 4.2.1, so it is only checked for
__has_include.
AI-Generated: Uses GitHub Copilot
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
(cherry picked from commit 7add07ba4f5b5095a66614bb210e5d42cfe33555)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
README | 3 +++
configure | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/README b/README
index c4cb997..039f960 100644
--- a/README
+++ b/README
@@ -11,6 +11,9 @@ environment, allowing ordinary users to run commands which give the illusion
of creating device nodes, changing file ownership, and otherwise doing
things necessary for creating distribution packages or filesystems.
+Building pseudo requires GCC 5 or later (or clang), which the configure
+script checks for.
+
To configure, run the provided configure script. Note that this is
NOT an autoconf script.
diff --git a/configure b/configure
index 68c9962..f561dcb 100755
--- a/configure
+++ b/configure
@@ -232,6 +232,31 @@ if [ -z "$opt_sqlite_lib" ]; then
opt_sqlite_lib=$opt_lib
fi
+# pseudo uses __has_include, which needs GCC 5 or later. clang reports
+# itself as GCC 4.2.1, so only check its support for __has_include.
+if ! cc_version=$(${CC:-cc} -dumpversion 2>/dev/null); then
+ echo >&2 "Error: can't run the C compiler '${CC:-cc}'."
+ exit 1
+fi
+cc_check=$(mktemp -d "${TMPDIR:-/tmp}/pseudo-configure.XXXXXX") || exit 1
+cat > "$cc_check/cc_check.c" <<EOF
+#if defined(__clang__)
+# if !defined(__has_include)
+# error clang without __has_include
+# endif
+#elif !defined(__GNUC__) || __GNUC__ < 5
+# error GCC older than 5
+#endif
+int pseudo_cc_check;
+EOF
+if ! cc_check_out=$(${CC:-cc} -c -o "$cc_check/cc_check.o" "$cc_check/cc_check.c" 2>&1); then
+ echo >&2 "Error: pseudo requires GCC 5 or later (${CC:-cc} reports version $cc_version)."
+ echo >&2 "$cc_check_out"
+ rm -rf "$cc_check"
+ exit 1
+fi
+rm -rf "$cc_check"
+
if [ ! -f "${opt_sqlite}/include/sqlite3.h" ]; then
echo >&2 "SQLite3 headers not found in at ${opt_sqlite}/include/sqlite3.h. Please check that SQLite3 and SQLite3 headers are installed."
exit 1
--
1.8.3.1
next prev parent reply other threads:[~2026-11-11 16:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 16:15 [pseudo][pseudo-1.9]PATCH 00/10] Backports from master to 1.9 branch Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 01/10] test: Skip open_tree tests when the function or syscall is unavailable Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 02/10] makewrappers: Don't generate unused _int paths with noignore_path Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 03/10] ports/linux: Don't require <linux/mount.h> Mark Hatle
2026-11-11 16:15 ` Mark Hatle [this message]
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 05/10] pseudo_client: serialize path changes across clients Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 06/10] ports: hold the path lock in create and metadata wrappers Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 07/10] ports: check created files under the path lock before recording them Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 08/10] test-parallel-ops: Add a parallel create/rename/link/chmod test Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 09/10] README.security: Add information specific to file/process security Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 10/10] AGENTS.md: Add to assist future developers Mark Hatle
2026-11-12 11:46 ` [yocto-patches] [pseudo][pseudo-1.9]PATCH 00/10] Backports from master to 1.9 branch Yoann Congal
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=1794413712-18072-5-git-send-email-mark.hatle@kernel.crashing.org \
--to=mark.hatle@kernel.crashing.org \
--cc=yocto-patches@lists.yoctoproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.