about summary refs log tree commit diff
path: root/library/compiler-builtins/crates/musl-math-sys/c_patches/alias.c
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-06-03 19:52:05 +0000
committerbors <bors@rust-lang.org>2025-06-03 19:52:05 +0000
commit59aa1e873028948faaf8b97e5e02d4db340ad7b1 (patch)
treee24e0d236c31a4f37fca6d5bf52b4ddaedf2f09a /library/compiler-builtins/crates/musl-math-sys/c_patches/alias.c
parenta124fb3cb7291d75872934f411d81fe298379ace (diff)
parentaff21f659f5abeba49b05368affd8c829807b1f1 (diff)
downloadrust-59aa1e873028948faaf8b97e5e02d4db340ad7b1.tar.gz
rust-59aa1e873028948faaf8b97e5e02d4db340ad7b1.zip
Auto merge of #141229 - tgross35:builtins-josh-subtree, r=Kobzol
Merge `compiler-builtins` as a Josh subtree

Use the Josh [1] utility to add `compiler-builtins` as a subtree, which
will allow us to stop using crates.io for updates. This is intended to
help resolve some problems when unstable features change and require
code changes in `compiler-builtins`, which sometimes gets trapped in a
bootstrap cycle.

This was done using `josh-filter` built from the r24.10.04 tag:

    git fetch https://github.com/rust-lang/compiler-builtins.git 233434412fe7eced8f1ddbfeddabef1d55e493bd
    josh-filter ":prefix=library/compiler-builtins" FETCH_HEAD
    git merge --allow-unrelated FILTERED_HEAD

The HEAD in the `compiler-builtins` repository is 233434412f ("fix an if
statement that can be collapsed").

[1]: https://github.com/josh-project/josh
Diffstat (limited to 'library/compiler-builtins/crates/musl-math-sys/c_patches/alias.c')
-rw-r--r--library/compiler-builtins/crates/musl-math-sys/c_patches/alias.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/library/compiler-builtins/crates/musl-math-sys/c_patches/alias.c b/library/compiler-builtins/crates/musl-math-sys/c_patches/alias.c
new file mode 100644
index 00000000000..63e0f08d5eb
--- /dev/null
+++ b/library/compiler-builtins/crates/musl-math-sys/c_patches/alias.c
@@ -0,0 +1,40 @@
+/* On platforms that don't support weak symbols, define required aliases
+ * as wrappers. See comments in `features.h` for more.
+ */
+#if defined(__APPLE__) || defined(__MINGW32__)
+
+double __lgamma_r(double a, int *b);
+float __lgammaf_r(float a, int *b);
+long __lgammal_r(long double a, int *b);
+double exp10(double a);
+float exp10f(float a);
+long exp10l(long double a);
+double remainder(double a, double b);
+float remainderf(float a, float b);
+
+double lgamma_r(double a, int *b) {
+	return __lgamma_r(a, b);
+}
+float lgammaf_r(float a, int *b) {
+	return __lgammaf_r(a, b);
+}
+long double lgammal_r(long double a, int *b) {
+	return __lgammal_r(a, b);
+}
+double pow10(double a) {
+	return exp10(a);
+}
+float pow10f(float a) {
+	return exp10f(a);
+}
+long double pow10l(long double a) {
+	return exp10l(a);
+}
+double drem(double a, double b) {
+	return remainder(a, b);
+}
+float dremf(float a, float b) {
+	return remainderf(a, b);
+}
+
+#endif