This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Handle object files named *.obj in merge_archives.py
ClosedPublic

Authored by mstorsjo on Aug 25 2017, 2:18 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Aug 25 2017, 2:18 AM
compnerd requested changes to this revision.Sep 4 2017, 12:40 PM
compnerd added a subscriber: compnerd.

I think we should avoid this logic entirely and use CMake to do this.

This revision now requires changes to proceed.Sep 4 2017, 12:40 PM

Do you have any pointers on how to do it with CMake?

$<TARGET_OBJECTS:${LIBCXX_ABI_LIBRARY}> should give you the .o or .obj files used to construct the library.

$<TARGET_OBJECTS:${LIBCXX_ABI_LIBRARY}> should give you the .o or .obj files used to construct the library.

I guess that would only work if they're built all as part of the same CMake invocation? In the setup where I'm trying this (for bootstrapping a MinGW environment), they're built standalone, with the libcxx cmake invocation pointing to the built libcxxabi static library.

Ping @EricWF, who added this script

EricWF edited edge metadata.Sep 12 2017, 1:17 PM

I think we should avoid this logic entirely and use CMake to do this.

It's not that easy to do in CMake, and a CMake solution would be limited to only
merging in-tree builds together. This script allows merging any two static libraries,
including merging an installed libc++abi into an in-tree libc++ build.

Obviously I'm biased because I wrote the script initially, but I still prefer a python
solution.

EricWF added inline comments.Sep 12 2017, 1:22 PM
utils/merge_archives.py
121 ↗(On Diff #112666)

How about simply using *.o*?

mstorsjo added inline comments.Sep 12 2017, 1:23 PM
utils/merge_archives.py
121 ↗(On Diff #112666)

Sure, that would probably work as well.

mstorsjo updated this revision to Diff 114893.Sep 12 2017, 1:27 PM
mstorsjo edited edge metadata.

Using *.o* instead of checking *.obj separately.

EricWF accepted this revision.Sep 12 2017, 1:48 PM
This revision was automatically updated to reflect the committed changes.