[Buildroot] build failure on Ubuntu 22.04 LTS: TIME_BITS=64 is allowed only with FILE_OFFSET_BITS=64

Christian Stewart christian at aperture.us
Sat Feb 17 10:28:25 UTC 2024


Hi,

The fix I included in the e-mail below does not work in all cases.

This works to specifically fix the sudo build failure on Ubuntu 22.04.4 LTS:

On Sat, Feb 17, 2024 at 1:32 AM Christian Stewart <christian at aperture.us> wrote:
>
> On a fresh Ubuntu 22.04.4 LTS VM:
>
> git clone https://github.com/buildroot/buildroot
> cd buildroot
>
> # master as of this e-mail
> git checkout 6c455505eb5ed8ed5bbf090f2bfb6241c9f153a2
>
> cat <<EOF >> defconfig
> BR2_arm=y
> BR2_cortex_a7=y
> BR2_BINUTILS_VERSION_2_41_X=y
> BR2_GCC_VERSION_13_X=y
> BR2_TOOLCHAIN_BUILDROOT_CXX=y
> BR2_CCACHE=y
> BR2_PACKAGE_SUDO=y
> EOF
>
> make defconfig BR2_DEFCONFIG=defconfig
>
> # fails with error shown below
> make sudo
>

Here is an alternative fix which patches Sudo specifically:

>From 3e39260ea5ee16d95363f51d5684447636269096 Mon Sep 17 00:00:00 2001
From: Christian Stewart <christian at aperture.us>
Date: Sat, 17 Feb 2024 01:16:09 -0800
Subject: [PATCH] package/sudo: set FILE_OFFSET_BITS and TIME_BITS for host
 mksiglist

Add flags for 64 bit timestamps when building host mksiglist.

-D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64

Build failure fixed:

/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is
allowed only with _FILE_OFFSET_BITS=64"
   26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"

Fixes: https://github.com/skiffos/SkiffOS/issues/306

Signed-off-by: Christian Stewart <christian at aperture.us>
---
 ...e.in-set-TIME_BITS-and-FILE_OFFSET_B.patch | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644
package/sudo/0001-lib-util-Makefile.in-set-TIME_BITS-and-FILE_OFFSET_B.patch

diff --git a/package/sudo/0001-lib-util-Makefile.in-set-TIME_BITS-and-FILE_OFFSET_B.patch
b/package/sudo/0001-lib-util-Makefile.in-set-TIME_BITS-and-FILE_OFFSET_B.patch
new file mode 100644
index 0000000000..fb84002c24
--- /dev/null
+++ b/package/sudo/0001-lib-util-Makefile.in-set-TIME_BITS-and-FILE_OFFSET_B.patch
@@ -0,0 +1,28 @@
+From 7a0074a82248228062054476bd317b9a40af58dd Mon Sep 17 00:00:00 2001
+From: Christian Stewart <christian at aperture.us>
+Date: Sat, 17 Feb 2024 02:22:46 -0800
+Subject: [PATCH] lib/util/Makefile.in: set TIME_BITS and FILE_OFFSET_BITS to
+ 64
+
+Fixes a build failure building mksiglist on Ubuntu 22.04.4 LTS.
+
+Signed-off-by: Christian Stewart <christian at aperture.us>
+---
+ lib/util/Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/util/Makefile.in b/lib/util/Makefile.in
+index 05455f701..a8c84888b 100644
+--- a/lib/util/Makefile.in
++++ b/lib/util/Makefile.in
+@@ -72,6 +72,7 @@ CPPDEFS = -D_PATH_SUDO_CONF=\"@sudo_conf@\"
+ CPPFLAGS = -I$(incdir) -I$(top_builddir) -I. -I$(srcdir) $(CPPDEFS) \
+         @CPPFLAGS@ -DDEFAULT_TEXT_DOMAIN=\"@PACKAGE_NAME@\"
+ HOSTCPPFLAGS = -I$(incdir) -I$(top_builddir) -I. -I$(srcdir) $(CPPDEFS) \
++           -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 \
+            @CPPFLAGS_FOR_BUILD@ -DDEFAULT_TEXT_DOMAIN=\"@PACKAGE_NAME@\"
+
+ # Usually -O and/or -g
+--
+2.43.1
+
-- 
2.43.1


... again I am not sure if this is the right way to fix this.

Best regards,
Christian Stewart



More information about the buildroot mailing list