From eb847bc8666842a3cfc9c06e8458ad1abebebaf0 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 9 Oct 2013 15:50:50 -0700 Subject: 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 --- linker/dlfcn.cpp | 6 +++--- linker/linker.cpp | 6 +++--- linker/linker_environ.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'linker') diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index 3553af7..d234787 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp @@ -22,9 +22,9 @@ #include #include -#include -#include -#include +#include "private/bionic_tls.h" +#include "private/ScopedPthreadMutexLocker.h" +#include "private/ThreadLocalBuffer.h" /* This file hijacks the symbols stubbed out in libdl.so. */ diff --git a/linker/linker.cpp b/linker/linker.cpp index 8f613b1..cabbb99 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -40,9 +40,9 @@ #include // Private C library headers. -#include -#include -#include +#include "private/bionic_tls.h" +#include "private/KernelArgumentBlock.h" +#include "private/ScopedPthreadMutexLocker.h" #include "linker.h" #include "linker_debug.h" diff --git a/linker/linker_environ.cpp b/linker/linker_environ.cpp index edc659a..846624b 100644 --- a/linker/linker_environ.cpp +++ b/linker/linker_environ.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include "private/KernelArgumentBlock.h" static char** _envp; static bool _AT_SECURE_value = true; -- cgit v1.1