[PATCH 1/2] Bionic lacks ttyname_r; provide a workaround

Rich Felker dalias at libc.org
Fri Apr 24 22:24:08 UTC 2015


On Fri, Apr 24, 2015 at 05:22:57PM -0400, Matt Whitlock wrote:
> I think providing an alternative implementation of ttyname_r() in
> missing_syscalls.c won't work. Busybox cannot be statically linked
> when ttyname_r is defined in missing_syscalls.o:
> 
> ld: error: /usr/local/arm-linux-androideabi/bin/../sysroot/usr/lib/libc.a(stubs.o): multiple definition of 'ttyname_r'
> ld: libbb/lib.a(missing_syscalls.o): previous definition here

This is only happening because another function from stubs.o is being
pulled in. Passing -Wl,-t might be able to show the reason. But it's
probably best to #define ttyname_r to something else when providing a
fallback to avoid the problem.

Rich


More information about the busybox mailing list