Commit Graph

192 Commits

Author SHA1 Message Date
Thomas Pöchtrager
a4f3a3e0ea ld64 450.3 & cctools 927.0.2 2019-10-31 20:06:41 +01:00
Thomas Pöchtrager
3764b223c0 Fix glibc sys/sysctl.h deprecation warnings 2019-10-07 15:18:32 +02:00
Thomas Pöchtrager
20af0932d4 iOS toolchain: No need to run 'autogen.sh' (#70) 2019-09-11 16:20:21 +02:00
Thomas Pöchtrager
8b155ce07e Revert "Revert "Make 'as' relocatable""
This reverts commit 8bd2c684ac.
2019-08-19 19:28:30 +02:00
Thomas Pöchtrager
8bd2c684ac Revert "Make 'as' relocatable"
This reverts commit 5674c31aac.

https://github.com/tpoechtrager/osxcross/issues/191
2019-08-19 19:24:29 +02:00
Thomas Pöchtrager
5674c31aac Make 'as' relocatable 2019-08-17 11:48:05 +02:00
Thomas Pöchtrager
3f979bbcd7
Merge pull request #69 from froydnj/fix-atom-alias-information
fix atom alias information in LTO linking
2019-07-02 18:38:02 +02:00
Nathan Froyd
3d4795134b fix atom alias information in LTO linking
When performing LTO, `ld64` reads in any LLVM bitcode files, creates
atoms for them, and compiles the bitcode files to their corresponding
in-memory Mach-O files.  These Mach-O files are then
loaded (lto_file.cpp:Parser::loadMachO), and information from the atoms
in the Mach-O files is then synced to the corresponding atoms from the
LLVM bitcode files.

However, the underlying function (ld.hpp:Atom::setAttributesFromAtom)
fails to copy over the alias bit from the Mach-O symbol.  This omission
means that the original LLVM atom is not correctly marked as an alias
and therefore not correctly sorted prior to the symbol it is an alias
for (order.cpp:Layout::Comparer::operator()).  The end result is that
the alias symbol winds up pointing at a different symbol, with
predictably disastrous consequences when the aliased symbol is called.

This problem has been observed when performing cross-language LTO with
Firefox.  See also
https://bugzilla.mozilla.org/show_bug.cgi?id=1486042#c92 for more
details.

The fix is simple: we need to copy the alias bit over, just like other
fields.
2019-07-02 12:08:12 -04:00
Thomas Pöchtrager
a2e02aad90 Update autogenerated files 2019-06-04 18:20:13 +02:00
Thomas Pöchtrager
4d099de815 Add --with-libxar=<path> configure option 2019-06-04 18:18:52 +02:00
Thomas Pöchtrager
5321df7206
Merge pull request #67 from fanquake/sudo_deprecated
travis: remove deprecated use of sudo
2019-06-04 15:19:18 +02:00
fanquake
dd8e38a1e9
travis: remove deprecated use of sudo 2019-06-03 16:15:36 -04:00
Thomas Pöchtrager
7731c655fd Fix ARM and AArch64 build 2019-06-02 17:48:09 +02:00
Thomas Pöchtrager
f22b786968 Fix FreeBSD build 2019-06-02 14:28:21 +02:00
Thomas Pöchtrager
da74096c93 ld64: Fix finding object files without TAPI library 2019-06-01 20:53:55 +02:00
Thomas Pöchtrager
349383cb2a Update README.md 2019-06-01 19:33:42 +02:00
Thomas Pöchtrager
1433da83e9 Update .travis.yml 2019-06-01 19:33:42 +02:00
Thomas Pöchtrager
634c77e4f1 Misc fixes 2019-06-01 19:33:42 +02:00
Thomas Pöchtrager
4ca06cb720 Fix LTO_API_VERSION ifdefs
The documentation is wrong about these.
2019-06-01 19:33:42 +02:00
Thomas Pöchtrager
873c023069 An attempt to get TAPI platform "zippered" working
90d0bae361
2019-06-01 19:33:42 +02:00
Thomas Plöchtrager
c736cb58bd ld64: Silence i386 deprecation warning for now 2019-06-01 19:33:42 +02:00
Matthew Bauer
cf234de0a5 Run autoreconf
Command run was:

nix-shell -I nixpkgs=channel:nixos-19.03 -p autoconf automake libtool --run 'autoreconf -if'
2019-06-01 19:33:42 +02:00
Matthew Bauer
13acc08aeb Add manpages for ld64 2019-06-01 19:33:42 +02:00
Thomas Plöchtrager
5755bd8451 cctools 921 & ld64 409.12 2019-06-01 19:33:42 +02:00
Thomas Pöchtrager
1e3f614aff
Merge pull request #62 from delroth/ranlib-utime
ranlib: attempt to use utimens variants when available
2018-12-13 17:25:43 +01:00
Pierre Bourdon
17c2bf9247
ranlib: attempt to use utimens variants when available
When finalizing an archive, ranlib performs the following operations:
1. stat to obtain the current mtime (pre-write mtime)
2. rewrite the timestamp in the archive header
3. utime to restore the pre-write mtime

Unfortunately, utime only supports a 1s resolution. This means that on systems
with sub-second filesystem timestamps resolution (one notable example being
APFS), the following sequence of events can happen:
1. stat to obtain the current mtime (pre-write mtime) returns hh:mm:ss.123
2. rewrite the timestamp in the archive header
3. utime to restore the pre-write mtime ends up restoring hh:mm:ss.000.

This can cause ranlib to roll back the mtime of an archive in the past instead
of moving it into the future. Given that "make" heavily relies on filesystem
timestamps to determine dependencies and required rebuilds, this can lead to
many problems. This was discovered because it caused random failures when
parallel building postgresql.

To address the issue, we attempt to use utimensat if available. This is checked
via autoconf, but on macOS this is not enough: utimensat can be present at
compile time without being available at link time, and it was only added very
recently (10.13). Inspired by how CPython is handling this, we use #pragma weak
to make the runtime dependency optional.
2018-11-30 05:12:50 +01:00
Thomas Pöchtrager
07619027f8 Update autogenerated files 2018-10-24 22:04:36 +02:00
Thomas Pöchtrager
d75ed048cd Fix building otool 2018-10-24 22:04:25 +02:00
Thomas Pöchtrager
967bc9d48f
Merge pull request #61 from matthewbauer/add-manpages
Install man pages by default
2018-10-24 21:30:54 +02:00
Matthew Bauer
dee6322ea0 Update autogenerated files
I used automake 1.16.1 and autoconf 2.69.
2018-10-20 18:31:53 -05:00
Matthew Bauer
6f4d579f98 Install man pages by default
Fixes #40
2018-10-20 18:30:31 -05:00
Thomas Pöchtrager
ecb84d757b
Merge pull request #59 from glandium/issue58
During ThinLTO, avoid merging static data with non-static data with t…
2018-08-22 22:17:04 +02:00
Mike Hommey
328c737100 During ThinLTO, avoid merging static data with non-static data with the same name
When doing ThinLTO, the linker updates LTO proxy atoms to point to the
right linker atoms. When there are atoms with different scope with the
same name (in the case where e.g. one translation unit has a static
instance of data and another has a global instance of data with the same
name), we may end up making all translation units using a symbol with
that name link against the one global symbol with that name.
Presumably, the same problem can happen with static/global functions
with the same name too.

When the data/code under those names happen to be identical, that's
fine, but when they're not, bad things happen.

So when dealing with LTO proxy atoms for the translation unit scope,
don't look up in the list of atoms from the linker (for global symbols).

Fixes #58
2018-08-22 16:42:39 +09:00
Thomas Pöchtrager
41561b826d
Merge pull request #57 from glandium/fLtoCachePath
Add missing initialization for fLtoCachePath
2018-07-27 07:10:34 +02:00
Mike Hommey
82381f5038 Add missing initialization for fLtoCachePath
When ThinLTO is enabled, this leads to a spurious warning to create
a directory at best, or a segfault while trying to print that
warning in the worst case.
2018-07-27 11:25:44 +09:00
Thomas Pöchtrager
f53c618639
Merge pull request #47 from sezero/tapi-check
fix and rewrite the tapi.h / libtapi support check
2018-03-20 20:15:59 +01:00
sezero
08260b0151 fix typo in previous commit 2018-03-08 23:04:37 +03:00
sezero
13d098fbb0 rewrote tapi.h / libtapi support check:
it now works if the __block keyword issue is present.
2018-03-08 22:51:50 +03:00
Thomas Pöchtrager
e527b6f87f
Merge pull request #46 from jprjr/musl
Add musl-fts as an optional dependency
2018-01-19 15:51:09 +01:00
John Regan
43062856c5 add musl-fts as dependency 2018-01-18 20:35:59 -06:00
Keno Fischer
90214560fa Port to musl libc
Mostly make sure not to use a few glibc-isms. I should note that cctools'
ar doesn't work properly when built against musl. I didn't investigate
further because dropping in llvm-ar works just fine. The error you see
with the broken ar is:

```
`x86_64-apple-darwin14-ranlib: archive member: libgcc.a(3) size too large (archive member extends past the end of the file)`
```
2017-10-26 15:25:21 -04:00
Thomas Pöchtrager
c1cc75893e Merge pull request #35 from Flow86/patch-1
FIX: wrong libexecdir used so as does not find its assembler
2017-10-01 22:47:04 +02:00
Flow86
82b4ce048d FIX: since LIB and LOCALLIB are absolute ...
... via configure, we have to remove the wrong prefix now
2017-10-01 12:19:28 +02:00
Flow86
d71e224dc2 FIX: wrong libexecdir used so as does not find its assembler
if you set a libexecdir via configure, the as tool does not find its assembler.

This is caused by a wrong search-path used. I compared it with the old odcctools which I used before, and found that the define for the directory was not used anymore
2017-10-01 12:09:45 +02:00
John Ericson
8395d4b2c3 ld: Add --dump-normalized-lib-args flag
This allows scripts to see how cctools resolves inputs. The flags are
\0-separated.

Fixes #32; See that issue for a more in-depth explanation of the
purpose of this change.
2017-09-06 17:52:37 -04:00
Thomas Pöchtrager
22ebe727a5 Add TAPIv2 support 2017-04-01 20:42:35 +02:00
Thomas Pöchtrager
8e9c3f2506 ld64: Fix use after free 2017-02-05 09:05:12 +01:00
Thomas Pöchtrager
42b9d15e80 Update README.md 2017-02-04 13:21:45 +01:00
Thomas Pöchtrager
b7f4bf37ce Misc fixes 2017-02-04 13:18:09 +01:00
Thomas Pöchtrager
1bcd6f8a76 ld64: Revert TAPIv2 (patch by @jeremyhu) 2017-02-04 13:17:51 +01:00