Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 381231 - app-shells/sash-3.7-r2[readline]: undefined reference to `xmalloc' in function `dupstr' with sys-libs/readline-6.2_p1
Summary: app-shells/sash-3.7-r2[readline]: undefined reference to `xmalloc' in functio...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Diego Elio Pettenò (RETIRED)
URL:
Whiteboard:
Keywords:
: 381743 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-30 21:11 UTC by Martin von Gagern
Modified: 2011-09-04 06:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2011-08-30 21:11:08 UTC
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.
Comment 1 Martin von Gagern 2011-08-30 21:20:44 UTC
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.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-09-01 16:18:51 UTC
I'll pick this up as I made it non-static.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-09-01 16:21:58 UTC
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.
Comment 4 Torsten Veller (RETIRED) gentoo-dev 2011-09-04 06:49:36 UTC
*** Bug 381743 has been marked as a duplicate of this bug. ***