diff options
author | Sam James <sam@gentoo.org> | 2023-02-15 03:40:29 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-02-15 03:40:44 +0000 |
commit | 6f0d46367c6c163fa0d560ef0aed8cb093c3f3f9 (patch) | |
tree | 1fa5b040b44a9cd97f99db877ce9ea3a59a12dc2 /app-admin | |
parent | sys-kernel/rt-sources: add 5.4.230_p80, drop 5.4.221_p79 (diff) | |
download | gentoo-6f0d46367c6c163fa0d560ef0aed8cb093c3f3f9.tar.gz gentoo-6f0d46367c6c163fa0d560ef0aed8cb093c3f3f9.tar.bz2 gentoo-6f0d46367c6c163fa0d560ef0aed8cb093c3f3f9.zip |
app-admin/sudo: fix build w/ gcc 13
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-admin')
-rw-r--r-- | app-admin/sudo/files/sudo-1.9.13-gcc-13.patch | 53 | ||||
-rw-r--r-- | app-admin/sudo/files/sudo-1.9.13-missing-bracket-as-if.patch | 40 | ||||
-rw-r--r-- | app-admin/sudo/sudo-1.9.13.ebuild | 5 |
3 files changed, 98 insertions, 0 deletions
diff --git a/app-admin/sudo/files/sudo-1.9.13-gcc-13.patch b/app-admin/sudo/files/sudo-1.9.13-gcc-13.patch new file mode 100644 index 000000000000..4ebdce7e9f67 --- /dev/null +++ b/app-admin/sudo/files/sudo-1.9.13-gcc-13.patch @@ -0,0 +1,53 @@ +https://github.com/sudo-project/sudo/issues/239 +https://github.com/sudo-project/sudo/pull/240 + +From 20d1348354ddbfb1b1f95522f81d73ec00988358 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Wed, 15 Feb 2023 03:20:36 +0000 +Subject: [PATCH] sudo_fatal: Fix build where compiler recognises [[noreturn]] + attribute (C23) + +If the compiler supports [[noreturn]] as a attribute as in C23, +then we define sudo_noreturn to be it. When that's the case, we must place +it at the beginning of the declaration, before any other *extension* +attributes (__attribute(...)). + +sudo_dso_public is always an extension attribute, while sudo_noreturn only +might be, so put it first. + +This only shows up with GCC 13 so far (see the linked GCC bug (notabug) +for a bit more exploration). Clang 16 does support the attribute but doesn't let +you sue it for earlier language versions (need to pass explicit -std=c2x, +unlike with GCC here). + +This is essentially a followup to e707ffe58b3ccfe5c72f54c38eac1d7069d5021e. + +Tested with GCC 13.0.1 20230212 (unreleased), GCC 12.2.1 20230211, +Clang 16.0.0_rc2, and Clang 15.0.7. + +Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796 +Closes: https://github.com/sudo-project/sudo/issues/239 +Fixes: e707ffe58b3ccfe5c72f54c38eac1d7069d5021e +Fixes: 16ae61dcd7d3cd8bf6eb10a22fa742d4505da4e9 +--- a/include/sudo_fatal.h ++++ b/include/sudo_fatal.h +@@ -171,12 +171,12 @@ sudo_dso_public int sudo_fatal_callback_deregister_v1(sudo_fatal_callback_t fun + sudo_dso_public int sudo_fatal_callback_register_v1(sudo_fatal_callback_t func); + sudo_dso_public char *sudo_warn_gettext_v1(const char *domainname, const char *msgid) sudo_attr_fmt_arg(2); + sudo_dso_public void sudo_warn_set_locale_func_v1(sudo_warn_setlocale_t func); +-sudo_dso_public sudo_noreturn void sudo_fatal_nodebug_v1(const char *fmt, ...) sudo_printf0like(1, 2); +-sudo_dso_public sudo_noreturn void sudo_fatalx_nodebug_v1(const char *fmt, ...) sudo_printflike(1, 2); +-sudo_dso_public sudo_noreturn void sudo_gai_fatal_nodebug_v1(int errnum, const char *fmt, ...) sudo_printflike(2, 3); +-sudo_dso_public sudo_noreturn void sudo_vfatal_nodebug_v1(const char *fmt, va_list ap) sudo_printf0like(1, 0); +-sudo_dso_public sudo_noreturn void sudo_vfatalx_nodebug_v1(const char *fmt, va_list ap) sudo_printflike(1, 0); +-sudo_dso_public sudo_noreturn void sudo_gai_vfatal_nodebug_v1(int errnum, const char *fmt, va_list ap) sudo_printflike(2, 0); ++sudo_noreturn sudo_dso_public void sudo_fatal_nodebug_v1(const char *fmt, ...) sudo_printf0like(1, 2); ++sudo_noreturn sudo_dso_public void sudo_fatalx_nodebug_v1(const char *fmt, ...) sudo_printflike(1, 2); ++sudo_noreturn sudo_dso_public void sudo_gai_fatal_nodebug_v1(int errnum, const char *fmt, ...) sudo_printflike(2, 3); ++sudo_noreturn sudo_dso_public void sudo_vfatal_nodebug_v1(const char *fmt, va_list ap) sudo_printf0like(1, 0); ++sudo_noreturn sudo_dso_public void sudo_vfatalx_nodebug_v1(const char *fmt, va_list ap) sudo_printflike(1, 0); ++sudo_noreturn sudo_dso_public void sudo_gai_vfatal_nodebug_v1(int errnum, const char *fmt, va_list ap) sudo_printflike(2, 0); + sudo_dso_public void sudo_warn_nodebug_v1(const char *fmt, ...) sudo_printf0like(1, 2); + sudo_dso_public void sudo_warnx_nodebug_v1(const char *fmt, ...) sudo_printflike(1, 2); + sudo_dso_public void sudo_gai_warn_nodebug_v1(int errnum, const char *fmt, ...) sudo_printflike(2, 3); + diff --git a/app-admin/sudo/files/sudo-1.9.13-missing-bracket-as-if.patch b/app-admin/sudo/files/sudo-1.9.13-missing-bracket-as-if.patch new file mode 100644 index 000000000000..e341e93a99bc --- /dev/null +++ b/app-admin/sudo/files/sudo-1.9.13-missing-bracket-as-if.patch @@ -0,0 +1,40 @@ +https://github.com/sudo-project/sudo/commit/defec5d46eec7345b62060049f72215ffd7f3e7e + +From defec5d46eec7345b62060049f72215ffd7f3e7e Mon Sep 17 00:00:00 2001 +From: "Todd C. Miller" <Todd.Miller@sudo.ws> +Date: Tue, 14 Feb 2023 14:24:28 -0700 +Subject: [PATCH] Add missing '[' to AS_IF() call. Fixes GitHub issue #238. + +--- a/configure ++++ b/configure +@@ -24525,7 +24525,8 @@ fi + + if test X"$with_noexec" != X"no" + then : +- # Check for non-standard exec functions ++ ++ # Check for non-standard exec functions + ac_fn_c_check_func "$LINENO" "exect" "ac_cv_func_exect" + if test "x$ac_cv_func_exect" = xyes + then : +@@ -24564,7 +24565,7 @@ fi + + + fi +-] ++ + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +--- a/configure.ac ++++ b/configure.ac +@@ -3022,7 +3022,7 @@ AC_CHECK_FUNCS([setpassent setgroupent]) + dnl + dnl Function checks for sudo_noexec + dnl +-AS_IF([test X"$with_noexec" != X"no"], ++AS_IF([test X"$with_noexec" != X"no"], [ + # Check for non-standard exec functions + AC_CHECK_FUNCS([exect execvP execvpe]) + # Check for posix_spawn, and posix_spawnp + diff --git a/app-admin/sudo/sudo-1.9.13.ebuild b/app-admin/sudo/sudo-1.9.13.ebuild index 2d77e6863bd9..a4d75f41c04b 100644 --- a/app-admin/sudo/sudo-1.9.13.ebuild +++ b/app-admin/sudo/sudo-1.9.13.ebuild @@ -86,6 +86,11 @@ REQUIRED_USE=" MAKEOPTS+=" SAMPLES=" +PATCHES=( + "${FILESDIR}"/${PN}-1.9.13-missing-bracket-as-if.patch + "${FILESDIR}"/${PN}-1.9.13-gcc-13.patch +) + src_prepare() { default |