x86_64-pc-linux-gnu-gcc -Wl,--as-needed -o sash sash.o cmds.o cmd_dd.o cmd_ed.o cmd_grep.o cmd_ls.o cmd_tar.o cmd_gzip.o cmd_find.o cmd_file.o cmd_chattr.o cmd_ar.o utils.o -lz -lreadline -lncurses sash.o: In function `dupstr': /var/tmp/portage/app-shells/sash-3.7-r2/work/sash-3.7/sash.c:504: undefined reference to `xmalloc' collect2: ld returned 1 exit status make: *** [sash] Error 1 * ERROR: app-shells/sash-3.7-r2 failed (compile phase): * emake failed Looking at the source code, sash.c will simply assume that there is a function called xmalloc, without any preprocessor switches or fallback alternatives: $ grep -r xmalloc * sash.c:extern char *xmalloc (); sash.c: r = xmalloc (strlen (s) + 1); This is a remerge due to the introduction of the static flag in IUSE, so I had this very same package merged in the past. Bug #355145 might be related; it appears that libreadline used to export that symbol but that more recent versions like >=sys-libs/readline-6.2 renamed it to _rl_malloc.
The reference to xmalloc comes from sash-3.6-readline.patch, so it is specific to Gentoo and not a problem with the plain vanilla tarball.
I'll pick this up as I made it non-static.
Fixed in -r3 by ... removing the patch altogether. The xmalloc/_rl_malloc interface is private and it shouldn't have used it in the first place. Given that the package is orphaned, it's easier to just not support the custom code, and at some point drop it altogether.
*** Bug 381743 has been marked as a duplicate of this bug. ***