From 79726a0507e09d31a838d1a42ab734dfa9fff3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 16 Sep 2024 10:06:01 +0200 Subject: [PATCH] gnu: sudo: Fix cross-compilation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a regression introduced in be50b25b7b093f3879623f2252ebfae5db7fc5cd. * gnu/packages/admin.scm (sudo)[arguments]: Define ‘ac_cv_*’ when cross-compiling. Change-Id: Iaa6f856c902ff8e06d790f8b1bc49ecda66ce5f2 --- gnu/packages/admin.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index cb0ef85c54..f842abea78 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -2072,7 +2072,16 @@ (define-public sudo ;; provide it. (string-append "CPPFLAGS=-D_PATH_MV=\\\"" (assoc-ref %build-inputs "coreutils") - "/bin/mv\\\"")) + "/bin/mv\\\"") + + ;; When cross-compiling, assume we have a working 'snprintf' and + ;; 'vsnprintf' (which we do, when using glibc). The default + ;; choice fails with undefined references to 'sudo_snprintf' & + ;; co. when linking. + ,@(if (%current-target-system) + '("ac_cv_have_working_snprintf=yes" + "ac_cv_have_working_vsnprintf=yes") + '())) ;; Avoid non-determinism; see . #:parallel-build? #f