Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/python-wasm
Path: blob/main/python/py-numpy/src/patches/05-no-backtrace.patch
1393 views
1
--- native/numpy/core/setup_common.py 2022-09-09 06:36:30.443449000 -0700
2
+++ wasm/numpy/core/setup_common.py 2022-09-23 17:24:28.115837013 -0700
3
@@ -131,7 +131,14 @@
4
5
OPTIONAL_LOCALE_FUNCS = ["strtold_l"]
6
OPTIONAL_FILE_FUNCS = ["ftello", "fseeko", "fallocate"]
7
-OPTIONAL_MISC_FUNCS = ["backtrace", "madvise"]
8
+
9
+# On WASM the feature detection for backtrace doesn't work properly,
10
+# and I don't know any way to disable this via a command line flag,
11
+# so we change code here to not even look for backtrace. This is needed
12
+# with clang15 just to compile, since backtrace isn't declared. Of course,
13
+# WASM can't possible provide backtraces, as that violates their security
14
+# model, so it's best to not build C code that thinks this is available.
15
+OPTIONAL_MISC_FUNCS = ["madvise"] # ["backtrace", "madvise"]
16
17
18
OPTIONAL_HEADERS = [
19
20