# compiler_rt: avoid using weak aliases · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/3bc70ea2dd392499d108f05c291adb155a057939)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 3bc70ea2dd392499d108f05c291adb155a057939

Requested commit: 3bc70ea2dd392499d108f05c291adb155a057939

Commit: 3bc70ea2dd392499d108f05c291adb155a057939

Tree: d014b4e185fb0634b7e5fe9b77fe497bffa8c11d

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
compiler_rt: avoid using weak aliases

This is a partial revert of 0d533433e21621177fb291e2a4901bee11834501,
which regressed this behavior. The idea here is to avoid aliases, which
happens when the same function is exported with multiple names. The
problem with aliases is that weak aliases don't seem to work, causing
symbol collisions when multiple of the same symbol are provided, despite
the desired behavior that weak symbols are overridden.

In this case we export redundant functions with different names. Thanks
to -ffunction-sections, the unused functions will be garbage-collected
at link time. This leaves us with the best of both worlds: Zig's
compiler-rt will provide both sets of symbols, and it will be
binary-compatible with different compilers that expect different names,
while still resulting in binaries without garbage.

```

## Parents

- [9067daeb946201c204ef5556bc43a8845a0d5e3a](https://git.cafe/gitcafe/zig/commit/9067daeb946201c204ef5556bc43a8845a0d5e3a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/3bc70ea2dd392499d108f05c291adb155a057939?format=markdown)
