This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Specify -ldl with libasan in XGCC Specs
- From: Cyd Haselton <chaselton at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 15 Dec 2014 06:41:14 -0600
- Subject: Re: Specify -ldl with libasan in XGCC Specs
- Authentication-results: sourceware.org; auth=none
- References: <CAHu5PrYmgnmd6qKXq9o8TcFi+DSKajtVi-Z+iOfALPuVB01Mmg at mail dot gmail dot com> <CAHu5PraZOVm0+5FHBZ-S9+F4boJaVFociJsK74R07tABPjPY-g at mail dot gmail dot com>
On Sun, Dec 14, 2014 at 7:39 PM, Cyd Haselton <chaselton@gmail.com> wrote:
> On Sat, Dec 13, 2014 at 6:45 PM, Cyd Haselton <chaselton@gmail.com> wrote:
>> This is (hopefully) related to the previous issue I posted about
>> libgcc failing to build on Android. I ran gcc -dumpspec, xgcc
>> -dumpspec, compared the two and noticed that, for the *link_command
>> -ldl is specified with -lpthread for static-libasan for the installed
>> GCC and is not for the *link_command portion of the newly built
>> XGCC...which appears to be used for building libgcc.
>>
>> Is there a way to change the link_command for the newly built xgcc so
>> that it includes -ldl?
>>
>> Alternatively, if I am off track with troubleshooting, let me know.
>
> UPDATE: I may have found the solution to this issue; googling libasan
> and libpthread yielded a link to gnu-user.h from a different repo
> which led me to hunt down the 4.8.0 version of the same file, which
> included two additional defines:
>
> /* Additional libraries needed by -static-libasan. */
> #undef STATIC_LIBASAN_LIBS
> #define STATIC_LIBASAN_LIBS "-ldl -lpthread"
>
> /* Additional libraries needed by -static-libtsan. */
> #undef STATIC_LIBTSAN_LIBS
> #define STATIC_LIBTSAN_LIBS "-ldl -lpthread"
>
> I've added these to the end of the 4.9.2 gnu-user.h and am currently
> re-running make after running make clean in the builddir/gcc
> directory.
UPDATE: This did not work because the mods were not integratedinto
dumpspecs. Trying something else...but I am open to suggestions. At
this point i'm guessing at what will work based on picking through
various bits of the toplevel/gcc dir.