llvm-capstone/compiler-rt
Martin Storsjö 7a5cba8bea [compiler-rt] Remove duplicate MS names for chkstk symbols (#80450)
Prior to 885d7b759b, the builtins library
contained two chkstk implementations for each of i386 and x86_64, one
that was used in mingw environments, and one unused (with a symbol name
not matching anything that is used anywhere). Some of the functions
additionally had other, also unused, aliases.

After cleaning this up in 885d7b759b, the
unused symbol names were removed.

At the same time, symbol aliases were added for the names as they are
used by MSVC; the functions are functionally equivalent, but have
different names between mingw and MSVC style environments.

By adding a symbol alias (so that one object file contains two different
symbols for the same function), users can run into problems with
duplicate definitions, if they themselves define one of the symbols (for
various reasons), but need to link in the other one.

This happens for Wine, which provides their own definition of
"__chkstk", but when built in mingw mode does need compiler-rt to
provide the mingw specific symbol names; see
https://github.com/mstorsjo/llvm-mingw/issues/397.

To avoid the issue, remove the extra MS style names. They weren't
entirely usable as such for MSVC style environments anyway, as
compiler-rt builtins don't build these object files at all, when built
in MSVC mode; thus, the effort to provide them for MSVC style
environments in 885d7b759b was a
half-hearted step towards that.

If we really do want to provide those functions (as an alternative to
the ones provided by MSVC itself), we should do it in a separate object
file (even if the function implementation is the same), so that users
who have a definition of one of them but need a definition of the other,
won't have conflicts.

Additionally, if we do want to provide them for MSVC, those files
actually should be built when building the builtins in MSVC mode as well
(see compiler-rt/lib/builtins/CMakeLists.txt).

If we do that, there's a risk that an MSVC style build ends up linking
in and preferring our implementation over the one provided by MSVC,
which would be suboptimal. Our implementation always probes the
requested amount of stack, while the MSVC one checks the amount of
allocated stack and only probes as much as really is needed.

In short - this reverts the situation to what it was in the 17.x release
series (except for unused functions that have been removed).

(cherry picked from commit 248aeac1ad2cf4f583490dd1312a5b448d2bb8cc)
2024-02-05 11:39:38 -08:00
..
cmake [AArch64][compiler-rt] Add memcpy, memset, memmove, memchr builtins. (#77496) 2024-01-23 11:26:20 +00:00
docs Fix typos in documentation 2023-05-28 13:13:12 -07:00
include [PGO] Reland PGO's Counter Reset and File Dumping APIs #76471 (#78285) 2024-01-22 14:54:58 -05:00
lib [compiler-rt] Remove duplicate MS names for chkstk symbols (#80450) 2024-02-05 11:39:38 -08:00
test [NFC] Size and element numbers are often swapped when calling calloc (#79081) 2024-01-23 11:13:55 -08:00
tools
unittests Remove config.aarch64_sme from compiler-rt/unittests/lit.common.unit.configured.in 2024-01-23 15:19:36 +00:00
utils
www [compiler-rt][www] replace deprecated LLVM_CONFIG_PATH with LLVM_CMAKE_DIR (#71500) 2023-11-09 08:05:32 +00:00
.clang-tidy
.gitignore
CMakeLists.txt [GTest][c++17] Silence warnings when building GTest with gcc-toolset-12 2023-12-05 13:50:52 -05:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt

Compiler-RT
================================

This directory and its subdirectories contain source code for the compiler
support routines.

Compiler-RT is open source software. You may freely distribute it under the
terms of the license agreement found in LICENSE.txt.

================================