This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Android native build of GCC
- From: Cyd Haselton <chaselton at gmail dot com>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: Andrew Haley <aph at redhat dot com>,Hans-Peter Nilsson <hp at bitrange dot com>,"gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sun, 15 Feb 2015 17:03:33 -0600
- Subject: Re: Android native build of GCC
- Authentication-results: sourceware.org; auth=none
- References: <54AE581C dot 5070003 at redhat dot com> <alpine dot BSF dot 2 dot 02 dot 1502060258210 dot 10842 at arjuna dot pair dot com> <54D48673 dot 9070901 at redhat dot com> <alpine dot BSF dot 2 dot 02 dot 1502060458370 dot 29537 at arjuna dot pair dot com> <54D49731 dot 7030407 at redhat dot com> <F47323AC-2C7B-47B8-B630-D03A629DD347 at gmail dot com> <54D4A6C2 dot 1040808 at redhat dot com> <CAHu5Prbo2J1p2ueC3G5A6r-ZUo0z6JG1X_9OmshEyKPjjh0hTQ at mail dot gmail dot com> <54D4EA79 dot 10909 at redhat dot com> <6A2D97AB-19B8-4A78-ABE7-B486D1C41FCC at gmail dot com> <54DB14AB dot 3040501 at redhat dot com> <87A6FCF6-9A36-43DE-9981-6663EF51D81F at gmail dot com> <54DB3CB7 dot 1040108 at redhat dot com> <9EFDD493-55C2-4E38-B631-48296428F0AE at gmail dot com> <54DF2CA7 dot 3050303 at redhat dot com> <26AEFC9C-852D-4DE4-A396-79707D3CF48B at gmail dot com> <alpine dot LNX dot 2 dot 11 dot 1502152049120 dot 9341 at monopod dot intra dot ispras dot ru> <CAHu5Prb9wDhmbJU5nvaZTPQbu3ZUw4+0Hj5WUem76KhOe8mPSw at mail dot gmail dot com> <CAHu5PrZ_uBANWL-P3XqM8gRa2UUfReFgyvAB=-_=RsbdjYKymg at mail dot gmail dot com> <alpine dot LNX dot 2 dot 11 dot 1502152152260 dot 9341 at monopod dot intra dot ispras dot ru>
On February 15, 2015 12:57:18 PM CST, Alexander Monakov <amonakov@ispras.ru> wrote:
>
>
>On Sun, 15 Feb 2015, Cyd Haselton wrote:
>
>> On Sun, Feb 15, 2015 at 12:41 PM, Cyd Haselton <chaselton@gmail.com>
>wrote:
>>
>> *snip*
>> >
>> >> So to obtain the pointer to
>> >> dlopen the code like above can use dlsym(RTLD_DEFAULT, "dlopen"),
>but not
>> >> RTLD_NEXT (the loader precedes the fakeroot library in the lookup
>chain).
>> >>
>> *snip*
>>
>> Just a quick update: RTLD_DEFAULT is definitely not the solution
>here
>> as it results in a segfault when libfakechroot loads. Perhaps a
>> different RTLD_FLAG was meant?
>
>I think you need to use RTLD_DEFAULT only when resolving "dlopen", and
>keep
>RTLD_NEXT for all other symbol names (unless later on you run into
>other
>symbols with similar behavior). Something like
>
> ... = dlsym(strcmp(name, "dlopen") ? RTLD_NEXT : RTLD_DEFAULT, name);
>
>Alexander
I believe that worked perfectly; compiling Python no longer causes fakechroot to throw an undefined reference to dlopen(). Many, many thanks.
For my future reference, are there recommended references/documentation for Android's linker in particular and dynamic linking, shared/static libraries, and symbol resolution in general...other than man dlopen/dlsym/etc?
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.