Commit Graph

13 Commits

Author SHA1 Message Date
Petr Hosek dffbaa4014 [libcxx] Drop -D option from libtool when merging archives
This is a follow up to D74108. This option is not supported by older
versions of libtool so remove it. We keep the -s option to build the
index.
2020-03-02 16:07:18 -08:00
Petr Hosek 603acd9626 [libcxx] When merging archives, build index even on Darwin
We always want to build the table of contents. Additionally, we also
set the flag to make the output deterministic which is already the
default for llvm-ar.

Differential Revision: https://reviews.llvm.org/D74108
2020-03-02 11:02:42 -08:00
Louis Dionne 344eee9227 [libc++] Improve Python 3 compatibility for merge_archives.py
Popen.communicate() method in Python 2 returns a pair of strings, and in
Python 3 it returns a pair of byte-like objects unless universal_newlines
is set to True. This led to an error when using Python 3. With this patch,
merge_archives.py works fine with Python 3.

Thanks to Sergej Jaskiewicz for the patch.
Differential Revision: https://reviews.llvm.org/D66649

llvm-svn: 369764
2019-08-23 15:05:54 +00:00
Petr Hosek 737de4d363 [libcxx] Use libtool when merging archives on Apple platforms
ar doesn't produce the correct results when used for linking static
archives on Apple platforms, so instead use libtool -static which is
the official way to build static archives on those platforms.

Differential Revision: https://reviews.llvm.org/D62770

llvm-svn: 362311
2019-06-02 01:14:31 +00:00
Louis Dionne 976073794e [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms
Summary:
I can't see a good reason to disallow this, even though it isn't the
standard way we build libc++ for Apple platforms.

Making this work on Apple platforms requires using different flags for
--whole-archive and removing the -D flag when running `ar` to merge
archives because that flag isn't supported by the `ar` shipped on Apple
platforms. This shouldn't be an issue since the -D option appears to be
enabled by default in GNU `ar`.

Reviewers: phosek, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59513

llvm-svn: 356903
2019-03-25 14:56:29 +00:00
Petr Hosek 1405ac457b [libcxx] Preserve order, avoid duplicates when merging static archives
glob can return files in arbitrary order which breaks deterministic
builds. Rather, use `ar t` to list the files in each archive and
preserve the original order. Using `ar q` results in duplicate entries
in the archive, instead use `ar r` to avoid duplicates.

Differential Revision: https://reviews.llvm.org/D58024

llvm-svn: 353671
2019-02-11 08:48:47 +00:00
Chandler Carruth 57b08b0944 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351648
2019-01-19 10:56:40 +00:00
Martin Storsjo fb8eb6fce8 Use CMAKE_AR instead of the system default 'ar' for merging static libraries
Using the system default 'ar' might not be the right choice when
cross compiling.

Don't prepend the ar options by a dash, not all ar implementations
support that (llvm-ar doesn't).

Also pass the 's' option when creating the merged library, to create
an index.

Differential Revision: https://reviews.llvm.org/D37134

llvm-svn: 313122
2017-09-13 06:55:44 +00:00
Martell Malone f922501d98 libcxx: fix merge_archives error variable name
Differential Revision: https://reviews.llvm.org/D37728

llvm-svn: 313084
2017-09-12 22:32:02 +00:00
Martin Storsjo 499f58a548 Handle object files named *.obj in merge_archives.py
Differential Revision: https://reviews.llvm.org/D37133

llvm-svn: 313072
2017-09-12 20:54:15 +00:00
Eric Fiselier bf58c8eddb Make LIBCXX_ENABLE_STATIC_ABI_LIBRARY merge libc++.a and libc++abi.a
llvm-svn: 287373
2016-11-18 19:53:45 +00:00
Eric Fiselier 5f7878964a Make merge_archives.py executable
llvm-svn: 287337
2016-11-18 11:29:05 +00:00
Eric Fiselier be8f020642 Add merge_archives.py utility
llvm-svn: 287336
2016-11-18 11:26:14 +00:00