Created attachment 884073 [details] build.log [...] clang -MMD -MP -std=c99 -D_BSD_SOURCE -D_DEFAULT_SOURCE -I/var/tmp/portage/net-libs/libdom-0.4.2/work/libdom-0.4.2/include/ -I/var/tmp/portage/net-libs/libdom-0.4.2/work/libdom-0.4.2/src -I/var/tmp/portage/net-libs/libdom-0.4.2/work/libdom-0.4.2/binding -Os -march=bdver2 -pipe -D_ALIGNED="__attribute__((aligned))" -DSTMTEXPR=1 -DNDEBUG -I/usr/include/libxml2 -D_POSIX_C_SOURCE -fPIC -DPIC -o build-x86_64-gentoo-linux-musl-x86_64-gentoo-linux-musl-release-lib-shared/src_core_element.o -c src/core/element.c bindings/xml/libxml_xmlparser.c:146:20: error: call to undeclared library function 'malloc' with type 'void *(unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 146 | return len > 0 ? malloc(len) : NULL; | ^ bindings/xml/libxml_xmlparser.c:146:20: note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc' bindings/xml/libxml_xmlparser.c:149:3: error: call to undeclared library function 'free' with type 'void (void *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 149 | free(ptr); | ^ bindings/xml/libxml_xmlparser.c:149:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'free' bindings/xml/libxml_xmlparser.c:153:9: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 153 | return realloc(ptr, len); | ^ bindings/xml/libxml_xmlparser.c:153:9: note: include the header <stdlib.h> or explicitly provide a declaration for 'realloc' bindings/xml/libxml_xmlparser.c:326:9: warning: assigning to 'xmlErrorPtr' (aka 'struct _xmlError *') from 'const xmlError *' (aka 'const struct _xmlError *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 326 | xmlerr = xmlCtxtGetLastError(parser->xml_ctx); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bindings/xml/libxml_xmlparser.c:358:9: warning: assigning to 'xmlErrorPtr' (aka 'struct _xmlError *') from 'const xmlError *' (aka 'const struct _xmlError *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 358 | xmlerr = xmlCtxtGetLastError(parser->xml_ctx); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bindings/xml/libxml_xmlparser.c:442:9: warning: assigning to 'xmlErrorPtr' (aka 'struct _xmlError *') from 'const xmlError *' (aka 'const struct _xmlError *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 442 | xmlerr = xmlCtxtGetLastError(parser->xml_ctx); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bindings/xml/libxml_xmlparser.c:519:9: warning: assigning to 'xmlErrorPtr' (aka 'struct _xmlError *') from 'const xmlError *' (aka 'const struct _xmlError *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 519 | xmlerr = xmlCtxtGetLastError(parser->xml_ctx); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 warnings and 3 errors generated. make: *** [/usr/share/netsurf-buildsystem/makefiles/Makefile.top:595: build-x86_64-gentoo-linux-musl-x86_64-gentoo-linux-musl-release-lib-shared/bindings_xml_libxml_xmlparser.o] Error 1 make: *** Waiting for unfinished jobs.... * ERROR: net-libs/libdom-0.4.2::gentoo failed (compile phase): * emake failed
Created attachment 884074 [details] emerge --info
Created attachment 884127 [details, diff] 0001-bindings-xml-libxml_xmlparser.c-add-stdlib.h-include.patch I think it's a musl thing. Here's a patch to add the include. Is that enough to fix the build for you?
Ah yes, indeed! It's a musl thing after all. And your patch fixes the build. Thanks!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4bedabe7945ed0b58b3ed67294a246d27698d7c commit e4bedabe7945ed0b58b3ed67294a246d27698d7c Author: Michael Orlitzky <mjo@gentoo.org> AuthorDate: 2024-02-03 16:57:34 +0000 Commit: Michael Orlitzky <mjo@gentoo.org> CommitDate: 2024-02-03 16:57:34 +0000 net-libs/libdom: fix the build with musl Closes: https://bugs.gentoo.org/923647 Signed-off-by: Michael Orlitzky <mjo@gentoo.org> net-libs/libdom/files/libdom-0.4.2-musl.patch | 29 +++++++++++++++++++++++++++ net-libs/libdom/libdom-0.4.2.ebuild | 2 ++ 2 files changed, 31 insertions(+)