[Buildroot] [PATCH 1/1] package/glibc: fix fsconfig_command redeclaration bug

Yann E. MORIN yann.morin.1998 at free.fr
Sat Oct 1 15:56:15 UTC 2022


Athaariq, All,

On 2022-10-01 02:05 +0000, Athaariq Ardhiansyah spake thusly:
> Temporary fix for buildroot-specific bug.

How is this a buildroot-specific bug? Can you elaborate on that part? If
it is really a buildroot-related bug, then we want to understand it, and
fix it, not work around it.

> Ideally, we should install linux-headers first then glibc. Is this actually possible on Buildroot?

This is exactly what we are doing already, and for as long as Buildroot
has supported building a glibc-ased toolchain, as the kernel headers are
required to build glibc; see package/glibc/glibc.mk at 28:

   26 # Before glibc is configured, we must have the first stage
   27 # cross-compiler and the kernel headers
   28 GLIBC_DEPENDENCIES = host-gcc-initial linux-headers host-bison host-gawk \

> If yes, then we can also fix bug #15021 simultaneously if linux-headers being installed first as possible.

This part does not apply (or makes sense), as linux headers *are*
installed before glibc is even configured.

This issue is really weird, because the glibc commit we are using is
supposed to contain the related fixes:

    $ git los --oneline 2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3
    2628500f5d m68k: Enforce 4-byte alignment on internal locks (BZ #29537)
    [...]
    3bd3c612e9 Linux: Fix enum fsconfig_command detection in <sys/mount.h>
    bb1e8b0ca9 linux: Fix sys/mount.h usage with kernel headers
    d48813227b linux: Use compile_c_snippet to check linux/mount.h availability

(There are two new commits on the release/2.36/master branch, but they
seem unrelated to the issue:
    76e05613ee (origin/release/2.36/master) stdlib: Fix __getrandom_nocancel type and arc4random usage (BZ #29638)
    227c903587 get_nscd_addresses: Fix subscript typos [BZ #29605]
)

To be noted, and as Thomas noticed, OpenEmbeded is also using a glibc
2.36 commit, and even one older than ours, but they do not seem to have
issues.

So, we'd like to understand why this is causing an issue for us. Hence,
if you could elaborate on the firt part of your message, above, that
would be extermely useful!

Regards,
Yann E. MORIN.

> Signed-off-by: Athaariq Ardhiansyah <buildroot at athaariq.my.id>
> ---
>  .../0002-fsconfig_command-workaround.patch      | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>  create mode 100644 package/glibc/0002-fsconfig_command-workaround.patch
> 
> diff --git a/package/glibc/0002-fsconfig_command-workaround.patch b/package/glibc/0002-fsconfig_command-workaround.patch
> new file mode 100644
> index 0000000000..27dd25b244
> --- /dev/null
> +++ b/package/glibc/0002-fsconfig_command-workaround.patch
> @@ -0,0 +1,17 @@
> +diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
> +index 19841d0738..43a681d097 100644
> +--- a/sysdeps/unix/sysv/linux/sys/mount.h
> ++++ b/sysdeps/unix/sysv/linux/sys/mount.h
> +@@ -27,11 +27,7 @@
> + #include <stddef.h>
> + #include <sys/ioctl.h>
> + 
> +-#ifdef __has_include
> +-# if __has_include ("linux/mount.h")
> +-#  include "linux/mount.h"
> +-# endif
> +-#endif
> ++#include "linux/mount.h"
> + 
> + 
> + #define BLOCK_SIZE_BITS	10
> -- 
> 2.37.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list