platform_bionic/libc/upstream-netbsd
Elliott Hughes eb847bc866 Fix x86_64 build, clean up intermediate libraries.
The x86_64 build was failing because clone.S had a call to __thread_entry which
was being added to a different intermediate .a on the way to making libc.so,
and the linker couldn't guarantee statically that such a relocation would be
possible.

  ld: error: out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(clone.o): requires dynamic R_X86_64_PC32 reloc against '__thread_entry' which may overflow at runtime; recompile with -fPIC

This patch addresses that by ensuring that the caller and callee end up in the
same intermediate .a. While I'm here, I've tried to clean up some of the mess
that led to this situation too. In particular, this removes libc/private/ from
the default include path (except for the DNS code), and splits out the DNS
code into its own library (since it's a weird special case of upstream NetBSD
code that's diverged so heavily it's unlikely ever to get back in sync).

There's more cleanup of the DNS situation possible, but this is definitely a
step in the right direction, and it's more than enough to get x86_64 building
cleanly.

Change-Id: I00425a7245b7a2573df16cc38798187d0729e7c4
2013-10-09 16:00:17 -07:00
..
common/lib/libc Upgrade more functions to the current upstream NetBSD copy. 2012-10-23 12:29:53 -07:00
libc Upgrade to current NetBSD popen/pclose. 2013-03-06 16:20:55 -08:00
env.h Upgrade to current NetBSD popen/pclose. 2013-03-06 16:20:55 -08:00
extern.h Fix several compiler warnings. 2012-09-26 14:20:22 -07:00
fd_setsize.h More upstream NetBSD upgrades. 2012-10-23 16:05:09 -07:00
namespace.h Fix nice... 2012-08-13 16:38:29 -07:00
netbsd-compat.h Upgrade to current NetBSD popen/pclose. 2013-03-06 16:20:55 -08:00
port_after.h Upgrade more functions to the current upstream NetBSD copy. 2012-10-23 12:29:53 -07:00
port_before.h Fix x86_64 build, clean up intermediate libraries. 2013-10-09 16:00:17 -07:00
rand48.h Fix x86_64 build, clean up intermediate libraries. 2013-10-09 16:00:17 -07:00
README.txt Revert "Revert "Switch to NetBSD's strxfrm(3)."" 2012-08-10 12:10:10 -07:00
reentrant.h Upgrade to current NetBSD popen/pclose. 2013-03-06 16:20:55 -08:00

This directory contains upstream NetBSD source. You should not edit these
files directly. Make fixes upstream and then pull down the new version of
the file.

Note that code in the other 'netbsd' directory contains Android modifications.
We should work towards getting as many of those changes as possible upstream
and then losing those files in favor of pure upstream copies here instead.

TODO: write a script to make this process automated.