All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/erlang: fix build with BR2_TIME_BITS_64
@ 2026-10-01 14:18 Yegor Yefremov via buildroot
  2026-10-02 19:50 ` Thomas Petazzoni via buildroot
  2026-10-10  9:23 ` Thomas Perale via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-10-01 14:18 UTC (permalink / raw)
  To: buildroot; +Cc: Will Newton

From: Yegor Yefremov <yegorslists@googlemail.com>

erts/emulator/sys/unix/sys_time.c undefines _FILE_OFFSET_BITS before
including system headers. With BR2_TIME_BITS_64=y, Buildroot passes
-D_TIME_BITS=64, which glibc only accepts together with
_FILE_OFFSET_BITS=64, so the build fails with:

  error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"

Backport the upstream commit that removes this ancient workaround.

Fixes:
https://autobuild.buildroot.org/results/72443d8e794451cbc4063e906d6b2405021cb52f

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 .../erlang/0002-otp-Fix-build-on-Yocto.patch  | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 package/erlang/0002-otp-Fix-build-on-Yocto.patch

diff --git a/package/erlang/0002-otp-Fix-build-on-Yocto.patch b/package/erlang/0002-otp-Fix-build-on-Yocto.patch
new file mode 100644
index 0000000000..9f4de3508e
--- /dev/null
+++ b/package/erlang/0002-otp-Fix-build-on-Yocto.patch
@@ -0,0 +1,80 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org>
+Date: Wed, 13 Dec 2023 16:34:04 +0100
+Subject: [PATCH] otp: Fix build on Yocto
+
+A workaround to avoid breaking "micro level process accounting on
+/proc/self" broke the build on Yocto. As this is a really ancient
+workaround (pre-2009) and the comment is unclear about what
+actually breaks, we'll try removing it to see if this is still a
+problem.
+
+Upstream: https://github.com/erlang/otp/commit/c38fc7c62e818273870340f3faf83cc3905e1cf1
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+---
+ erts/configure                    |  9 ---------
+ erts/emulator/sys/unix/sys_time.c | 10 ----------
+ make/autoconf/otp.m4              |  9 ---------
+ 3 files changed, 28 deletions(-)
+
+diff --git a/erts/configure b/erts/configure
+index 1d573b4..0b046dd 100755
+--- a/erts/configure
++++ b/erts/configure
+@@ -24417,15 +24417,6 @@ else $as_nop
+ /* end confdefs.h.  */
+ 
+ /* gethrvtime procfs ioctl test */
+-/* These need to be undef:ed to not break activation of
+- * micro level process accounting on /proc/self
+- */
+-#ifdef _LARGEFILE_SOURCE
+-#  undef _LARGEFILE_SOURCE
+-#endif
+-#ifdef _FILE_OFFSET_BITS
+-#  undef _FILE_OFFSET_BITS
+-#endif
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <string.h>
+diff --git a/erts/emulator/sys/unix/sys_time.c b/erts/emulator/sys/unix/sys_time.c
+index eb2c47b..f60e345 100644
+--- a/erts/emulator/sys/unix/sys_time.c
++++ b/erts/emulator/sys/unix/sys_time.c
+@@ -22,16 +22,6 @@
+ #  include "config.h"
+ #endif
+ 
+-/* These need to be undef:ed to not break activation of
+- * micro level process accounting on /proc/self 
+- */
+-#ifdef _LARGEFILE_SOURCE
+-#  undef _LARGEFILE_SOURCE
+-#endif
+-#ifdef _FILE_OFFSET_BITS
+-#  undef _FILE_OFFSET_BITS
+-#endif
+-
+ #include <stdlib.h>
+ #include "sys.h"
+ #include "global.h"
+diff --git a/make/autoconf/otp.m4 b/make/autoconf/otp.m4
+index f543101..984ee1a 100644
+--- a/make/autoconf/otp.m4
++++ b/make/autoconf/otp.m4
+@@ -2705,15 +2705,6 @@ dnl
+ AC_MSG_CHECKING([if gethrvtime works and how to use it])
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ /* gethrvtime procfs ioctl test */
+-/* These need to be undef:ed to not break activation of
+- * micro level process accounting on /proc/self 
+- */
+-#ifdef _LARGEFILE_SOURCE
+-#  undef _LARGEFILE_SOURCE
+-#endif
+-#ifdef _FILE_OFFSET_BITS
+-#  undef _FILE_OFFSET_BITS
+-#endif
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <string.h>
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH] package/erlang: fix build with BR2_TIME_BITS_64
  2026-10-01 14:18 [Buildroot] [PATCH] package/erlang: fix build with BR2_TIME_BITS_64 Yegor Yefremov via buildroot
@ 2026-10-02 19:50 ` Thomas Petazzoni via buildroot
  2026-10-10  9:23 ` Thomas Perale via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-02 19:50 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: buildroot, Will Newton

On Thu, Oct 01, 2026 at 04:18:04PM +0200, Yegor Yefremov via buildroot wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> erts/emulator/sys/unix/sys_time.c undefines _FILE_OFFSET_BITS before
> including system headers. With BR2_TIME_BITS_64=y, Buildroot passes
> -D_TIME_BITS=64, which glibc only accepts together with
> _FILE_OFFSET_BITS=64, so the build fails with:
> 
>   error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
> 
> Backport the upstream commit that removes this ancient workaround.
> 
> Fixes:
> https://autobuild.buildroot.org/results/72443d8e794451cbc4063e906d6b2405021cb52f
> 
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Applied to master, thanks!

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH] package/erlang: fix build with BR2_TIME_BITS_64
  2026-10-01 14:18 [Buildroot] [PATCH] package/erlang: fix build with BR2_TIME_BITS_64 Yegor Yefremov via buildroot
  2026-10-02 19:50 ` Thomas Petazzoni via buildroot
@ 2026-10-10  9:23 ` Thomas Perale via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Perale via buildroot @ 2026-10-10  9:23 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Thomas Perale, buildroot

In reply of:
> erts/emulator/sys/unix/sys_time.c undefines _FILE_OFFSET_BITS before
> including system headers. With BR2_TIME_BITS_64=y, Buildroot passes
> -D_TIME_BITS=64, which glibc only accepts together with
> _FILE_OFFSET_BITS=64, so the build fails with:
> 
>   error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
> 
> Backport the upstream commit that removes this ancient workaround.
> 
> Fixes:
> https://autobuild.buildroot.org/results/72443d8e794451cbc4063e906d6b2405021cb52f
> 
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Applied to 2025.02.x & 2026.08.x. Thanks

> ---
>  .../erlang/0002-otp-Fix-build-on-Yocto.patch  | 80 +++++++++++++++++++
>  1 file changed, 80 insertions(+)
>  create mode 100644 package/erlang/0002-otp-Fix-build-on-Yocto.patch
> 
> diff --git a/package/erlang/0002-otp-Fix-build-on-Yocto.patch b/package/erlang/0002-otp-Fix-build-on-Yocto.patch
> new file mode 100644
> index 0000000000..9f4de3508e
> --- /dev/null
> +++ b/package/erlang/0002-otp-Fix-build-on-Yocto.patch
> @@ -0,0 +1,80 @@
> +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org>
> +Date: Wed, 13 Dec 2023 16:34:04 +0100
> +Subject: [PATCH] otp: Fix build on Yocto
> +
> +A workaround to avoid breaking "micro level process accounting on
> +/proc/self" broke the build on Yocto. As this is a really ancient
> +workaround (pre-2009) and the comment is unclear about what
> +actually breaks, we'll try removing it to see if this is still a
> +problem.
> +
> +Upstream: https://github.com/erlang/otp/commit/c38fc7c62e818273870340f3faf83cc3905e1cf1
> +Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> +---
> + erts/configure                    |  9 ---------
> + erts/emulator/sys/unix/sys_time.c | 10 ----------
> + make/autoconf/otp.m4              |  9 ---------
> + 3 files changed, 28 deletions(-)
> +
> +diff --git a/erts/configure b/erts/configure
> +index 1d573b4..0b046dd 100755
> +--- a/erts/configure
> ++++ b/erts/configure
> +@@ -24417,15 +24417,6 @@ else $as_nop
> + /* end confdefs.h.  */
> + 
> + /* gethrvtime procfs ioctl test */
> +-/* These need to be undef:ed to not break activation of
> +- * micro level process accounting on /proc/self
> +- */
> +-#ifdef _LARGEFILE_SOURCE
> +-#  undef _LARGEFILE_SOURCE
> +-#endif
> +-#ifdef _FILE_OFFSET_BITS
> +-#  undef _FILE_OFFSET_BITS
> +-#endif
> + #include <stdlib.h>
> + #include <unistd.h>
> + #include <string.h>
> +diff --git a/erts/emulator/sys/unix/sys_time.c b/erts/emulator/sys/unix/sys_time.c
> +index eb2c47b..f60e345 100644
> +--- a/erts/emulator/sys/unix/sys_time.c
> ++++ b/erts/emulator/sys/unix/sys_time.c
> +@@ -22,16 +22,6 @@
> + #  include "config.h"
> + #endif
> + 
> +-/* These need to be undef:ed to not break activation of
> +- * micro level process accounting on /proc/self 
> +- */
> +-#ifdef _LARGEFILE_SOURCE
> +-#  undef _LARGEFILE_SOURCE
> +-#endif
> +-#ifdef _FILE_OFFSET_BITS
> +-#  undef _FILE_OFFSET_BITS
> +-#endif
> +-
> + #include <stdlib.h>
> + #include "sys.h"
> + #include "global.h"
> +diff --git a/make/autoconf/otp.m4 b/make/autoconf/otp.m4
> +index f543101..984ee1a 100644
> +--- a/make/autoconf/otp.m4
> ++++ b/make/autoconf/otp.m4
> +@@ -2705,15 +2705,6 @@ dnl
> + AC_MSG_CHECKING([if gethrvtime works and how to use it])
> + AC_RUN_IFELSE([AC_LANG_SOURCE([[
> + /* gethrvtime procfs ioctl test */
> +-/* These need to be undef:ed to not break activation of
> +- * micro level process accounting on /proc/self 
> +- */
> +-#ifdef _LARGEFILE_SOURCE
> +-#  undef _LARGEFILE_SOURCE
> +-#endif
> +-#ifdef _FILE_OFFSET_BITS
> +-#  undef _FILE_OFFSET_BITS
> +-#endif
> + #include <stdlib.h>
> + #include <unistd.h>
> + #include <string.h>
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-10  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 14:18 [Buildroot] [PATCH] package/erlang: fix build with BR2_TIME_BITS_64 Yegor Yefremov via buildroot
2026-10-02 19:50 ` Thomas Petazzoni via buildroot
2026-10-10  9:23 ` Thomas Perale via buildroot

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.