On Sat, Dec 13, 2014 at 6:45 PM, Cyd Haselton <chaselton@xxxxxxxxx> 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.