This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Specify -ldl with libasan in XGCC Specs


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]