[cfe-commits] [PATCH] Add -ldl for libgcc in Android environment

Logan Chien tzuhsiang.chien at gmail.com
Mon Nov 19 04:05:11 PST 2012


Thanks.  Committed as r168310 with following change:

+  // According to Android ABI, we have to link with libdl if we are
+  // linking with non-static libgcc.
+  //
+  // NOTE: This fixes a link error on Android MIPS as well.  The non-static
+  // libgcc for MIPS relies on _Unwind_Find_FDE and dl_iterate_phdr from
libdl.
+  if (isAndroid && !StaticLibgcc)
+    CmdArgs.push_back("-ldl");

Thanks for your help.



On Mon, Nov 19, 2012 at 7:02 PM, Chandler Carruth <chandlerc at google.com>wrote:

> LGTM with the following tweak:
>
> +  if (!StaticLibgcc && isAndroid)
> +    CmdArgs.push_back("-ldl");
>
> I would start with the 'isAndroid' condition just to make it more
> clear that this is an android-specific hack. I would also add a
> comment similar to your original email. It is really important to
> document this type of surprising constraint in the source, not just in
> the email. ;]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121119/88f8a553/attachment.html>


More information about the cfe-commits mailing list