[llvm-commits] Fixing the libc++ cmake build (Mac OS)

Michael Spencer bigcheesegs at gmail.com
Thu Sep 6 12:12:30 PDT 2012


On Thu, Sep 6, 2012 at 9:13 AM, Marshall Clow <mclow.lists at gmail.com> wrote:
> On Mac OS, the libc++ build is currently broken.
> It fails when linking, with a list of undefined references.
> The problem is that it needs to link against libc++abi.
>
> This patch fixes that, but I'm not 100% convinced that it is the best way. (I am not a cmake guru)
> Comments?
>
>> Index: lib/CMakeLists.txt
>> ===================================================================
>> --- lib/CMakeLists.txt        (revision 163313)
>> +++ lib/CMakeLists.txt        (working copy)
>> @@ -37,7 +37,9 @@
>>  append_if(libraries LIBCXX_HAS_M_LIB m)
>>  append_if(libraries LIBCXX_HAS_RT_LIB rt)
>>  append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc_s)
>> +append_if(libraries APPLE c++abi)
>>
>> +
>>  target_link_libraries(cxx ${libraries})
>>
>>  # Setup flags.
>>
>
> -- Marshall
>
> Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>
>
> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
>         -- Yu Suzuki
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

That's fine, but we need to duplicate all this from the buildit file:

	    LDSHARED_FLAGS="-o libc++.1.dylib \
			-dynamiclib -nodefaultlibs  \
			-current_version ${RC_ProjectSourceVersion} \
			-compatibility_version 1 \
			-install_name /usr/lib/libc++.1.dylib \
			-lSystem  \
			-Wl,-unexported_symbols_list,libc++unexp.exp  \
			${RE_EXPORT_LINE}  \
			-Wl,-force_symbols_not_weak_list,notweak.exp \
			-Wl,-force_symbols_weak_list,weak.exp"

To get a proper binary.

- Michael Spencer



More information about the llvm-commits mailing list