Skip to contentSkip to conversation

MariaDB 11 for buildroot

Buildroot Andreas Ziegler 4 participants 4 messages Aug 26, 2025 – Aug 29, 2025 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Horst,

Quoted 19 lines · Horst Noecker

Dear Buildroot community,

I'm trying to build MariaDB 11.4.8 with Buildroot for Aarch64 for a RasPi4 / Compute Module 4.

I've been doing this all the time by downloading the sources, configuring it with cmake-gui, using the toolchain built by buildroot, build it and put the binaries, libs, etc. into an overlay being then packaged into the image by buildroot.

That worked fine for years - also with MariaDB 11.4.x. - but only for Arm32 (ARMv7a, gnueabihf, etc. etc.). For Aarch64 the only version that works is the latest 10.11.11.

I've also tried to adapt the mariadb-package from buildroot to have it build inside by builtroot itself.

Quoted 9 lines

The build itself works for Arm32 and AArch64.

BUT: no matter what I do, when trying to start mariadbd (i.e. the server) it gives a segmentation fault without any further hint (in the log file it only states that it started and immediately stopped).

If anybody has any clue that would be awesome!

Which standard library do you use? MariaDB is a C++ project and uClibc does not fully implement thread local storage on Aarch64, which is used by C++ exception handling. C code works, C++ code dies with SIGSEGV on the first try/catch block. musl functions correctly and glibc should work.

Kind regards,
Andreas

Quoted 4 lines

Kind regards,

Horst

<cut>
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
Quoted 29 lines · Andreas Ziegler

Hi Horst,

Quoted 26 lines · Horst Noecker

Dear Buildroot community,

I'm trying to build MariaDB 11.4.8 with Buildroot for Aarch64 for a RasPi4 / Compute Module 4.

I've been doing this all the time by downloading the sources, configuring it with cmake-gui, using the toolchain built by buildroot, build it and put the binaries, libs, etc. into an overlay being then packaged into the image by buildroot.

That worked fine for years - also with MariaDB 11.4.x. - but only for Arm32 (ARMv7a, gnueabihf, etc. etc.). For Aarch64 the only version that works is the latest 10.11.11.

I've also tried to adapt the mariadb-package from buildroot to have it build inside by builtroot itself.

The build itself works for Arm32 and AArch64.

BUT: no matter what I do, when trying to start mariadbd (i.e. the server) it gives a segmentation fault without any further hint (in the log file it only states that it started and immediately stopped).

Quoted 4 lines
Quoted 2 lines

If anybody has any clue that would be awesome!

Which standard library do you use? MariaDB is a C++ project and uClibc does not fully implement thread local storage on Aarch64, which is used by C++ exception handling. C code works, C++ code dies with SIGSEGV on the first try/catch block. musl functions correctly and glibc should work.

It is more complicated than that IIRC: uclibc-ng implements thread local storage, but GCC has optimizations that assumes that the thread local storage implementation works like glibc. And unlike for other architectures where the requirements are spelled out¹, what GCC expects from the arm/aarch64 TLS implementation is not documented.

Also, errno in C uses thread local storage and C11 programs can also use thread local storage, so C programs are not immune.

[1]: https://uclibc.org/docs/tls.pdf
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Dear Andreas and Nicolas,

I'm using glibc.

Furthermore: Maria 10.11.11 and 11.4.8 work with arm32 - Maria 10.11.11 works with aarch64 and only Maria 11.4.8 (and 11.8.2 and 11.4.7) give a sigsegv when trying to start.

Am 26.08.25 um 09:23 schrieb Nicolas Cavallari:

Quoted 41 lines · Andreas Ziegler
Quoted 29 lines

Hi Horst,

Quoted 26 lines · Horst Noecker

Dear Buildroot community,

I'm trying to build MariaDB 11.4.8 with Buildroot for Aarch64 for a RasPi4 / Compute Module 4.

I've been doing this all the time by downloading the sources, configuring it with cmake-gui, using the toolchain built by buildroot, build it and put the binaries, libs, etc. into an overlay being then packaged into the image by buildroot.

That worked fine for years - also with MariaDB 11.4.x. - but only for Arm32 (ARMv7a, gnueabihf, etc. etc.). For Aarch64 the only version that works is the latest 10.11.11.

I've also tried to adapt the mariadb-package from buildroot to have it build inside by builtroot itself.

The build itself works for Arm32 and AArch64.

BUT: no matter what I do, when trying to start mariadbd (i.e. the server) it gives a segmentation fault without any further hint (in the log file it only states that it started and immediately stopped).

Quoted 4 lines
Quoted 2 lines

If anybody has any clue that would be awesome!

Which standard library do you use? MariaDB is a C++ project and uClibc does not fully implement thread local storage on Aarch64, which is used by C++ exception handling. C code works, C++ code dies with SIGSEGV on the first try/catch block. musl functions correctly and glibc should work.

It is more complicated than that IIRC: uclibc-ng implements thread local storage, but GCC has optimizations that assumes that the thread local storage implementation works like glibc.  And unlike for other architectures where the requirements are spelled out¹, what GCC expects from the arm/aarch64 TLS implementation is not documented.

Also, errno in C uses thread local storage and C11 programs can also use thread local storage, so C programs are not immune.

[1]: https://uclibc.org/docs/tls.pdf

Signature · 35 lines
bar

  Horst Noecker
- Geschäftsführer -
Logo
  CellOmation GmbH & Co. KG

www.cellomation.de <http://www.cellomation.de/>

- Stammsitz -
  Staufenstr. 1

  63128 Dietzenbach

  Mobil: +49 160 5 30 26 48

[email protected]

  HRA Nr.: 41648
  USt-IdNr.: DE280920848
  Gerichtsstand: Amtsgericht Offenbach

bar

Diese Information ist ausschliesslich fuer den Adressaten bestimmt und kann vertraulich oder gesetzlich
geschuetzte Informationen enthalten. Wenn Sie nicht der bestimmungsgemaesse Adressat sind, unterrichten
Sie bitte den Absender und vernichten Sie diese Mail. Anderen als dem bestimmungsgemaessen Adressaten
ist es untersagt, diese E-Mail zu lesen, zu speichern, weiterzuleiten oder ihren Inhalt auf welche Weise auch
immer zu verwenden. Wir verwenden aktuelle Virenschutzprogramme. Fuer Schaeden, die dem Empfaenger
gleichwohl durch von uns zugesandte mit Viren befallene E-Mails entstehen, schliessen wir jede Haftung aus.
The information contained in this email is intended only for its addressee and may contain confidential and/or
privileged information. If the reader of this email is not the intended recipient, you are hereby notified that
reading, saving, distribution or use of the content of this email in any way is prohibited. If you have received
this email in error, please notify the sender and delete the email. We use updated antivirus protection software
We do not accept any responsibility for damages caused anyhow by viruses transmitted via email.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Dear Horst, Nicolas, All,

I ran some tests using the 'stable' mariadb versions on a rather ancient RPi 4 (Rev1.3). The daemon starts, but aborts due to missing configurations and not enough space on the root filesystem. Log entries for the versions were fairly consistent (example below).

The system is headless, rather bleeding-edge, and uses musl as standard library ...

Quoted 7 lines · Horst Noecker

Dear Andreas and Nicolas,

I'm using glibc.

Furthermore: Maria 10.11.11 and 11.4.8 work with arm32 - Maria 10.11.11 works with aarch64 and only Maria 11.4.8 (and 11.8.2 and 11.4.7) give a sigsegv when trying to start.

stable release  smoke test results
      10.11.14  OK
      11.4.8    OK
      11.8.3    OK
      12.0.2    OK

Some patches were necessary for the build:
all: missing header file
11,12: try_run used in CMAKE_CROSSCOMPILING mode remove COLUMNSTORE from host build (see also [1])

The interesting parts of the defconfig:
BR2_aarch64=y
BR2_cortex_a72=y
BR2_TOOLCHAIN_BUILDROOT_MUSL=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_16=y
BR2_BINUTILS_VERSION_2_44_X=y
BR2_GCC_VERSION_15_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
# BR2_PIC_PIE is not set
BR2_SSP_NONE=y
BR2_RELRO_NONE=y
...
BR2_PACKAGE_MARIADB=y
BR2_PACKAGE_MARIADB_SERVER=y

Kernel: 6.17.0-rc3-rt1
Init system: Busybox w/ mdev

Start sequence:
[nabla]# /etc/init.d/S97mysqld start
Starting mysql ... FAIL
[nabla]# cat /tmp/mysql/mysqld.log
250829 11:42:07 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql

2025-08-29 11:42:07 0 [Note] Starting MariaDB 12.0.2-MariaDB source revision aab83aecdca15738d114cf5a2f223f1d12e4e6bd server_uid BwSs9p0iC7M6snGTru568oZhReU= as process 790
2025-08-29 11:42:07 0 [ERROR] mariadbd: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2025-08-29 11:42:07 0 [ERROR] mariadbd: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2025-08-29 11:42:07 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2025-08-29 11:42:07 0 [Note] InnoDB: The first data file './ibdata1' did not exist. A new tablespace will be created!
2025-08-29 11:42:07 0 [Note] InnoDB: Compressed tables use zlib 1.3.1
2025-08-29 11:42:07 0 [Note] InnoDB: Number of transaction pools: 1
2025-08-29 11:42:07 0 [Note] InnoDB: Using ARMv8 crc32 instructions
2025-08-29 11:42:07 0 [Note] InnoDB: Using Linux native AIO
2025-08-29 11:42:07 0 [Note] InnoDB: innodb_buffer_pool_size_max=128m, innodb_buffer_pool_size=128m
2025-08-29 11:42:07 0 [Note] InnoDB: Completed initialization of buffer pool
2025-08-29 11:42:07 0 [Note] InnoDB: Setting file './ibdata1' size to 12.000MiB. Physically writing the file full; Please wait ...
2025-08-29 11:42:07 0 [Note] InnoDB: File './ibdata1' size is now 12.000MiB.
2025-08-29 11:42:07 0 [ERROR] InnoDB: preallocating 100663296 bytes for file ./ib_logfile101 failed with error 28
2025-08-29 11:42:07 0 [ERROR] InnoDB: Cannot set log file ./ib_logfile101 size to 96.000MiB
2025-08-29 11:42:07 0 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2025-08-29 11:42:07 0 [Note] InnoDB: Starting shutdown...
2025-08-29 11:42:07 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2025-08-29 11:42:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2025-08-29 11:42:07 0 [Note] Plugin 'wsrep-provider' is disabled.
2025-08-29 11:42:07 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2025-08-29 11:42:07 0 [ERROR] Failed to initialize plugins.
2025-08-29 11:42:07 0 [ERROR] Aborting

250829 11:42:07 mysqld_safe mysqld from pid file /run/mysql/mysqld.pid ended

I am not aware that CM4 has major differences to a standard Pi4. Do you have any exotic packages in your configuration?

Kind regards,
Andreas

Quoted 42 lines

Am 26.08.25 um 09:23 schrieb Nicolas Cavallari:

Quoted 40 lines · Andreas Ziegler
Quoted 29 lines

Hi Horst,

Quoted 26 lines · Horst Noecker

Dear Buildroot community,

I'm trying to build MariaDB 11.4.8 with Buildroot for Aarch64 for a RasPi4 / Compute Module 4.

I've been doing this all the time by downloading the sources, configuring it with cmake-gui, using the toolchain built by buildroot, build it and put the binaries, libs, etc. into an overlay being then packaged into the image by buildroot.

That worked fine for years - also with MariaDB 11.4.x. - but only for Arm32 (ARMv7a, gnueabihf, etc. etc.). For Aarch64 the only version that works is the latest 10.11.11.

I've also tried to adapt the mariadb-package from buildroot to have it build inside by builtroot itself.

The build itself works for Arm32 and AArch64.

BUT: no matter what I do, when trying to start mariadbd (i.e. the server) it gives a segmentation fault without any further hint (in the log file it only states that it started and immediately stopped).

Quoted 4 lines
Quoted 2 lines

If anybody has any clue that would be awesome!

Which standard library do you use? MariaDB is a C++ project and uClibc does not fully implement thread local storage on Aarch64, which is used by C++ exception handling. C code works, C++ code dies with SIGSEGV on the first try/catch block. musl functions correctly and glibc should work.

It is more complicated than that IIRC: uclibc-ng implements thread local storage, but GCC has optimizations that assumes that the thread local storage implementation works like glibc.  And unlike for other architectures where the requirements are spelled out¹, what GCC expects from the arm/aarch64 TLS implementation is not documented.

Also, errno in C uses thread local storage and C11 programs can also use thread local storage, so C programs are not immune.

[1]: https://uclibc.org/docs/tls.pdf

[2] https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot