mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: u-boot-tools: Fix segfault while running tests.
Fixes <https://issues.guix.gnu.org/74270>. * gnu/packages/patches/u-boot-calloc-visibility.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/bootloaders.scm (u-boot): Use it. Reported-by: Jean-Francois GUILLAUME <Jean-Francois.Guillaume@univ-nantes.fr> Reported-by: Christopher Howard <christopher@librehacker.com> Change-Id: Id0023e17367a80a0d1abd4a80b7d8e3a0c3cc5bc
This commit is contained in:
parent
b0416b8503
commit
e526b8b11d
3 changed files with 21 additions and 1 deletions
|
@ -2255,6 +2255,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/twinkle-bcg729.patch \
|
%D%/packages/patches/twinkle-bcg729.patch \
|
||||||
%D%/packages/patches/u-boot-allow-disabling-openssl.patch \
|
%D%/packages/patches/u-boot-allow-disabling-openssl.patch \
|
||||||
%D%/packages/patches/u-boot-build-without-libcrypto.patch \
|
%D%/packages/patches/u-boot-build-without-libcrypto.patch \
|
||||||
|
%D%/packages/patches/u-boot-calloc-visibility.patch \
|
||||||
%D%/packages/patches/u-boot-nintendo-nes-serial.patch \
|
%D%/packages/patches/u-boot-nintendo-nes-serial.patch \
|
||||||
%D%/packages/patches/u-boot-rockchip-inno-usb.patch \
|
%D%/packages/patches/u-boot-rockchip-inno-usb.patch \
|
||||||
%D%/packages/patches/ucx-tcp-iface-ioctl.patch \
|
%D%/packages/patches/ucx-tcp-iface-ioctl.patch \
|
||||||
|
|
|
@ -758,7 +758,8 @@ tree binary files. These are board description files used by Linux and BSD.")
|
||||||
(patches
|
(patches
|
||||||
(list %u-boot-rockchip-inno-usb-patch
|
(list %u-boot-rockchip-inno-usb-patch
|
||||||
%u-boot-build-without-libcrypto-patch
|
%u-boot-build-without-libcrypto-patch
|
||||||
%u-boot-allow-disabling-openssl-patch))
|
%u-boot-allow-disabling-openssl-patch
|
||||||
|
(search-patch "u-boot-calloc-visibility.patch")))
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (string-append
|
||||||
"https://ftp.denx.de/pub/u-boot/"
|
"https://ftp.denx.de/pub/u-boot/"
|
||||||
|
|
18
gnu/packages/patches/u-boot-calloc-visibility.patch
Normal file
18
gnu/packages/patches/u-boot-calloc-visibility.patch
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
Arrange so that LLVM's shared object doesn't end up using 'calloc' from
|
||||||
|
U-Boot's 'malloc_simple.c' when it's initialized.
|
||||||
|
|
||||||
|
https://issues.guix.gnu.org/74270
|
||||||
|
|
||||||
|
diff --git a/common/malloc_simple.c b/common/malloc_simple.c
|
||||||
|
index 5a8ec538f8..4f5e350a3c 100644
|
||||||
|
--- a/common/malloc_simple.c
|
||||||
|
+++ b/common/malloc_simple.c
|
||||||
|
@@ -64,6 +64,8 @@ void *memalign_simple(size_t align, size_t bytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
#if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
|
||||||
|
+void *calloc(size_t nmemb, size_t elem_size)
|
||||||
|
+ __attribute__ ((visibility ("hidden")));
|
||||||
|
void *calloc(size_t nmemb, size_t elem_size)
|
||||||
|
{
|
||||||
|
size_t size = nmemb * elem_size;
|
Loading…
Add table
Add a link
Reference in a new issue