-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
diff -uNr a/flang/lib/Evaluate/constant.cpp b/flang/lib/Evaluate/constant.cpp | ||
--- a/flang/lib/Evaluate/constant.cpp | ||
+++ b/flang/lib/Evaluate/constant.cpp | ||
@@ -10,6 +10,7 @@ | ||
#include "flang/Evaluate/expression.h" | ||
#include "flang/Evaluate/shape.h" | ||
#include "flang/Evaluate/type.h" | ||
+#include "flang/Common/idioms.h" | ||
#include <string> | ||
--- a/flang/include/flang/Common/idioms.h | ||
+++ b/flang/include/flang/Common/idioms.h | ||
@@ -89,6 +89,8 @@ | ||
#define CHECK(x) ((x) || (DIE("CHECK(" #x ") failed"), false)) | ||
// Same as above, but with a custom error message. | ||
#define CHECK_MSG(x, y) ((x) || (DIE("CHECK(" #x ") failed: " #y), false)) | ||
+#elif !defined(CHECK_MSG) | ||
+#define CHECK_MSG(x, y) CHECK(x) | ||
#endif | ||
|
||
namespace Fortran::evaluate { | ||
// User-defined type traits that default to false: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/flang/runtime/time-intrinsic.cpp | ||
+++ b/flang/runtime/time-intrinsic.cpp | ||
@@ -139,7 +139,7 @@ | ||
} | ||
} | ||
|
||
-#ifndef _AIX | ||
+#if !defined(_AIX) && !(defined(__ANDROID__) && __ANDROID__ < 29) | ||
// This is the fallback implementation, which should work everywhere. | ||
template <typename Unused = void> | ||
count_t GetSystemClockCount(int kind, fallback_implementation) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- a/flang/runtime/Float128Math/complex-math.h | ||
+++ b/flang/runtime/Float128Math/complex-math.h | ||
@@ -34,6 +34,23 @@ | ||
#elif LDBL_MANT_DIG == 113 | ||
/* Use 'long double' versions of libm functions. */ | ||
#include <complex.h> | ||
+#if defined(__ANDROID__) && __ANDROID_API__ < 26 | ||
+long double complex cacosl (long double complex); | ||
+long double complex cacoshl(long double complex); | ||
+long double complex casinl (long double complex); | ||
+long double complex casinhl(long double complex); | ||
+long double complex catanl (long double complex); | ||
+long double complex catanhl(long double complex); | ||
+long double complex ccosl (long double complex); | ||
+long double complex ccoshl (long double complex); | ||
+long double complex cexpl (long double complex); | ||
+long double complex clogl (long double complex); | ||
+long double complex cpowl (long double complex, long double complex); | ||
+long double complex csinl (long double complex); | ||
+long double complex csinhl (long double complex); | ||
+long double complex ctanl (long double complex); | ||
+long double complex ctanhl (long double complex); | ||
+#endif | ||
|
||
#define CAbs(x) cabsl(x) | ||
#define CAcos(x) cacosl(x) |
26 changes: 26 additions & 0 deletions
26
packages/flang/0006-dummy-bessel-functions-for-long-double.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- a/flang/runtime/Float128Math/math-entries.h | ||
+++ b/flang/runtime/Float128Math/math-entries.h | ||
@@ -185,9 +185,11 @@ | ||
DEFINE_SIMPLE_ALIAS(Ilogb, std::ilogb) | ||
DEFINE_SIMPLE_ALIAS(Isinf, std::isinf) | ||
DEFINE_SIMPLE_ALIAS(Isnan, std::isnan) | ||
+#ifndef __ANDROID__ | ||
DEFINE_SIMPLE_ALIAS(J0, j0l) | ||
DEFINE_SIMPLE_ALIAS(J1, j1l) | ||
DEFINE_SIMPLE_ALIAS(Jn, jnl) | ||
+#endif | ||
DEFINE_SIMPLE_ALIAS(Ldexp, std::ldexp) | ||
DEFINE_SIMPLE_ALIAS(Lgamma, std::lgamma) | ||
DEFINE_SIMPLE_ALIAS(Llround, std::llround) | ||
@@ -204,9 +206,11 @@ | ||
DEFINE_SIMPLE_ALIAS(Tanh, std::tanh) | ||
DEFINE_SIMPLE_ALIAS(Tgamma, std::tgamma) | ||
DEFINE_SIMPLE_ALIAS(Trunc, std::trunc) | ||
+#ifndef __ANDROID__ | ||
DEFINE_SIMPLE_ALIAS(Y0, y0l) | ||
DEFINE_SIMPLE_ALIAS(Y1, y1l) | ||
DEFINE_SIMPLE_ALIAS(Yn, ynl) | ||
+#endif | ||
|
||
// Use numeric_limits to produce infinity of the right type. | ||
#define F128_RT_INFINITY \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/libllvm/clang-lib-Driver-ToolChains-CommonArgs.cpp.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
@@ -1281,6 +1281,9 @@ | ||
if (AsNeeded) | ||
addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false); | ||
} | ||
+ if (TC.getTriple().isAndroid()) { | ||
+ CmdArgs.push_back("-l:libandroid-complex-math.a"); | ||
+ } | ||
CmdArgs.push_back("-lFortranRuntime"); | ||
CmdArgs.push_back("-lFortranDecimal"); | ||
} |