Skip to content
Snippets Groups Projects
Commit c5cdb3b9 authored by Andrei Gherzan's avatar Andrei Gherzan :penguin: Committed by Bernhard Rosenkränzer
Browse files

networkmanager: Fix builds with musl


On musl, build would fail with:

| In file included from
../NetworkManager-1.22.10/shared/systemd/src/basic/env-util.c:11:
|
../NetworkManager-1.22.10/shared/systemd/src/basic/alloc-util.h:100:35:
error: static declaration of 'reallocarray' follows non-static
declaration
|   100 | _alloc_(2, 3) static inline void *reallocarray(void *p, size_t
need, size_t size) {
|       |                                   ^~~~~~~~~~~~
| In file included from
../NetworkManager-1.22.10/shared/nm-default.h:184,
|                  from
../NetworkManager-1.22.10/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:9,
|                  from
../NetworkManager-1.22.10/shared/systemd/src/basic/env-util.c:3:
|
[...]/build-linux/tmp/work/aarch64-poky-linux-musl/networkmanager/1.22.10-r0/recipe-sysroot/usr/include/stdlib.h:148:7:
note: previous declaration of 'reallocarray' with type 'void *(void *,
size_t,  size_t)' {aka 'void *(void *, long unsigned
 int,  long unsigned int)'}
|   148 | void *reallocarray (void *, size_t, size_t);
|       |       ^~~~~~~~~~~~

This is because musl does't provide reallocarray as part of malloc.h but
only as part of stdlib.h. Configure script was modified to check for its
definition in stdlib.h as well (backported patch).

Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
Signed-off-by: Bernhard Rosenkraenzer <bernhard.rosenkraenzer.ext@huawei.com> [adapt filename in .bbappend to match the actual patch filename]
parent ad08c662
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment