[libcxx-commits] [libcxx] r355756 - Revert "[libc++] Do not force building with -fPIC"
Eric Fiselier via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Mar 8 17:00:59 PST 2019
We build the objects for the shared library as an OBJECT library. Which is
why I imagine CMake isn't passing -fPIC.
On Fri, Mar 8, 2019 at 7:02 PM Shoaib Meenai <smeenai at fb.com> wrote:
> https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html
> says POSITION_INDEPENDENT_CODE should be true for shared library targets by
> default. Were you running into issues with the static library targets?
>
> On 3/8/19, 3:26 PM, "libcxx-commits on behalf of Eric Fiselier via
> libcxx-commits" <libcxx-commits-bounces at lists.llvm.org on behalf of
> libcxx-commits at lists.llvm.org> wrote:
>
> Author: ericwf
> Date: Fri Mar 8 15:27:46 2019
> New Revision: 355756
>
> URL:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D355756-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=YW9OhXPyI41BvMX2Zq1kA4dRQT4_qoAaZewnn_i9-BQ&s=Y-7rBwXxL0GFGPtQGHRacJN6k5SX5zh27MyYs6RfQtw&e=
> Log:
> Revert "[libc++] Do not force building with -fPIC"
>
> This reverts commit r355764.
>
> CMake does not turn -fPIC on for us by default. so this patch breaks
> standalone builds. The only reason it hasn't broken any bots is because
> LLVM turns on and specifies '-fPIC' for us.
>
> Modified:
> libcxx/trunk/lib/CMakeLists.txt
>
> Modified: libcxx/trunk/lib/CMakeLists.txt
> URL:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_lib_CMakeLists.txt-3Frev-3D355756-26r1-3D355755-26r2-3D355756-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=YW9OhXPyI41BvMX2Zq1kA4dRQT4_qoAaZewnn_i9-BQ&s=Gmy_hBPr3_JmAW0-p4HRD_iNz9ZvRufPu6aBtYxVN0I&e=
>
> ==============================================================================
> --- libcxx/trunk/lib/CMakeLists.txt (original)
> +++ libcxx/trunk/lib/CMakeLists.txt Fri Mar 8 15:27:46 2019
> @@ -105,6 +105,10 @@ if (LIBCXXABI_USE_LLVM_UNWINDER)
> endif()
>
> # Setup flags.
> +if (NOT WIN32)
> + add_flags_if_supported(-fPIC)
> +endif()
> +
> add_link_flags_if_supported(-nodefaultlibs)
>
> if (LIBCXX_TARGETING_MSVC)
>
>
> _______________________________________________
> libcxx-commits mailing list
> libcxx-commits at lists.llvm.org
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_libcxx-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=YW9OhXPyI41BvMX2Zq1kA4dRQT4_qoAaZewnn_i9-BQ&s=vIesftmbT9vy7WsaY43SyTTicNCVjdnT2KBcSiyaKtU&e=
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190308/ab09c562/attachment.html>
More information about the libcxx-commits
mailing list