Page 1 of 1

Buildroot with glibc possible?

Posted: 2025-12-10 13:49
by DaBit
Currently I do UAV telemetry with a board using the Nordic Semiconductor nRF9160. Works fine, but it will not run standard software stacks and lacks a camera interface.
Thus, i am considering designing a small PCB with a Core1106 and a regular Quectel/Simcom/Sierra/etc. LTE modem. Bought a Pico Mini A as experiment to evaluate the software development process. If the SDK is not good I move on.

I have not figured out Buildroot completely yet but got Wireguard working which is a big plus. So far, so good. Have to try a modem too, but I will be able to get that working as well I think.
However, I am not too happy with uclibc. The first piece of application software I tried to compile for the board (https://github.com/mavlink-router/mavlink-router) already failed.

Code: Select all

dabit@rockchip-dev:~/rv1103_speel/mavlink-router$ ninja -C build
ninja: Entering directory `build'
[6/25] Compiling C++ object src/mavlink-routerd.p/binlog.cpp.o
FAILED: src/mavlink-routerd.p/binlog.cpp.o 
arm-rockchip830-linux-uclibcgnueabihf-g++ -Isrc/mavlink-routerd.p -Isrc -I../src -I../modules/mavlink_c_library_v2/ardupilotmega -I. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=gnu++14 -O2 -g -Wno-inline -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wfloat-equal -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=3 -Wwrite-strings -Wno-long-long -Wno-overlength-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wchar-subscripts -Wtype-limits -Wuninitialized -include config.h -pthread -MD -MQ src/mavlink-routerd.p/binlog.cpp.o -MF src/mavlink-routerd.p/binlog.cpp.o.d -o src/mavlink-routerd.p/binlog.cpp.o -c ../src/binlog.cpp
In file included from ../src/binlog.h:20,
                 from ../src/binlog.cpp:18:
../src/logendpoint.h:22:10: fatal error: aio.h: No such file or directory
 #include <aio.h>
When compiling for ubuntu using arm-none-linux-gnueabihf it works fine, but with ubuntu I don't know how to put the USB in host mode, how to handle the camera and how to adapt the kernel.

I tried switching the sdk to glibc by replacing the arm-rockchip830-linux-uclibcgnueabihf toolchain with gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf and selecting glibc as the external toolchain library in build.sh buildrootconfig->Toolchain->Toolchain C library, but that was not succesfull

Can we somehow use buildroot with glibc or do we really need to use ubuntu then?

Re: Buildroot with glibc possible?

Posted: 2025-12-11 6:59
by yangxj121
Regrettably, currently the 1106 buildroot does not support glibc. Therefore, some tools that rely on glibc cannot be used under buildroot. You can continue to use Ubuntu, but we have suspended the maintenance and support for the Ubuntu image.

Re: Buildroot with glibc possible?

Posted: 2025-12-12 12:28
by DaBit
OK, I understand.
If this is the only issue then we can work around it.

Is it possible to enable extra uclibc features? It seems that the missing aio.h could be provided by uclibc:

(from git://uclibc.org/uClibc.git)

Code: Select all

..
..
   config UCLIBC_HAS_REALTIME
	bool "Realtime-related family of SUSv functions"
	default y
	help
	  These functions are part of the Timers option and need not
	  be available on all implementations.
	  Includes AIO, message-queue, scheduler, semaphore functions:

	  aio.h
	  mqueue.h
	  sched.h
	  semaphore.h

	  aio_cancel()
	  aio_error()
	  aio_fsync()
          ..
          ..

Re: Buildroot with glibc possible?

Posted: 2026-05-27 7:22
by gepanow

[root@luckfox root]# ldd --version
ldd (Buildroot) 2.35
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
[root@luckfox root]# ls -la /lib/ld-linux-armhf.so.3
-rwxr-xr-x 1 root root 186920 May 27 2026 /lib/ld-linux-armhf.so.3
[root@luckfox root]# ldd /usr/sbin/sshd
libcrypt.so.1 => /lib/libcrypt.so.1 (0xa6e10000)
libmd.so.0 => /usr/lib/libmd.so.0 (0xa6df0000)
libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0xa6d60000)
libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0xa6b20000)
libz.so.1 => /usr/lib/libz.so.1 (0xa6af0000)
libc.so.6 => /lib/libc.so.6 (0xa6990000)
/lib/ld-linux-armhf.so.3 (0xa6f6f000)
libatomic.so.1 => /lib/libatomic.so.1 (0xa6970000)
[root@luckfox root]# strings /lib/libc.so.6 | grep "GNU C Library"
GNU C Library (Buildroot) stable release version 2.35.
[root@luckfox root]#

Please understand that I am not very good at English.

I needed to use dynamic linking for the libraries, so I recompiled the rootfs to use glibc.
I received assistance from AI, and there were a few modifications.
The result was that glibc version 2.35 was built in the Buildroot environment, yielding the outcome described above.
Since this result was obtained after trying various complex things, the modification details are not organized.

To mention the items I remember:

* Config.in.options
> There is a bug where the PREFIX is fixed to "arm-linux" across all variants. Even if you select the armv7-eabihf-glibc variant, the build fails because the correct PREFIX (arm-buildroot-linux-gnueabihf) is not set.

* defconfig generation
> Creates a dedicated defconfig for glibc builds. This file is saved in the configs/ directory and loaded using the make command.

* Disable Sandbox
> OpenSSH 9.3 uses a sandbox via the seccomp BPF filter. On ARM Cortex-A7, this syscall filter does not function correctly, causing the privsep child to crash and the SSH connection to be immediately disconnected.

* rm -rf output/
> If you have changed the toolchain or if there is an output/ directory from a previous build, the project may build with an incorrect toolchain due to stale stamp files. Be sure to run rm -rf output/ and rebuild.

This image is based on Luckfox Pico Max.
https://naver.me/G0ppUgEG
This is the image tested above.
Please try testing it by updating the firmware using SocToolKit.

I hope this is the answer you need.

This is my first time using a luckfox product.
I plan to implement a project using pico max. I hope the forum remains active so I can gain useful information.