Summary: | sys-apps/gawk: failed build on macOS Big Sur (error: implicitly declaring library function 'malloc' with type 'void *(unsigned long)') | ||
---|---|---|---|
Product: | Gentoo/Alt | Reporter: | Sam James <sam> |
Component: | Prefix Support | Assignee: | Gentoo Prefix <prefix> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | cognifloyd+gentoobugs |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | Workaround: compile with -Wno-implicit-function-declaration | ||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 755644 | ||
Attachments: | build.log |
Using 5.1.0 will make Bash compilation fail though, so best to just use -Wno-implicit-function-declaration instead. I'm not sure if I had the same problem with gawk, but gawk 4.0.1 and lower would not compile on MacOS Catalina for me. I updated to gawk 5.1.0 and bash 5.1_rc3 (as there are several mac build issues in 5.0 that are fixed in 5.1). https://gist.github.com/cognifloyd/f4ff46e3dcfd48ca9827c32e04a8fe90#file-bootstrap-prefix-sh-L1336 https://gist.github.com/cognifloyd/f4ff46e3dcfd48ca9827c32e04a8fe90#file-bootstrap-prefix-sh-L1350 For stage2, I had to keyword the bash 5.1_rc3 ebuild for ~x64-macos and adjust three lines: Make the ebuild think that _rc is a release build so it uses the already compiled version of readline: > is_release() { > return 0 > ... > } and update the readline version so you don't have to keyword that ebuild too: > # The version of readline this bash normally ships with. > - READLINE_VER="8.1_rc3" > + READLINE_VER="8.0" and under src_prepare, change this line (add {} as characters before/after RL_LIBSRC): > - sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die > + sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]]*.h::g' Makefile.in || die (In reply to Sam James from comment #1) > Using 5.1.0 will make Bash compilation fail though, so best to just use > -Wno-implicit-function-declaration instead. that our force c89 standard again instead of c99 gawk is bumped for stage1. As for the other fixes, I'll keep this bug open for a bit, I think I'm not far enough yet. I think these problems are all fixed now |
Created attachment 674380 [details] build.log gcc -DDEFPATH='".:/Users/sam/Gentoo/tmp/usr/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/Users/sam/Gentoo/tmp/usr/share/locale"' -I. -g -O2 -MT getopt1.o -MD -MP -MF .deps/getopt1.Tpo -c -o getopt1.o getopt1.c getopt.c:578:30: error: implicitly declaring library function 'malloc' with type 'void *(unsigned long)' [-Werror,-Wimplicit-function-declaration] struct option_list *newp = malloc (sizeof (*newp)); ^ getopt.c:578:30: note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc' getopt.c:642:7: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration] free(ambig_list); ^ 2 errors generated. ---- Works fine if I swap to the latest gawk (5.1.0).