Skip to content

Commit 08670ac

Browse files
committed
Run another sync to get Pyodide fix
1 parent d64016e commit 08670ac

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

lib-rt/base64/arch/neon64/codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <arm_neon.h>
1313

1414
// Only enable inline assembly on supported compilers.
15-
#if defined(__GNUC__) || defined(__clang__)
15+
#if !defined(__wasm__) && (defined(__GNUC__) || defined(__clang__))
1616
#define BASE64_NEON64_USE_ASM
1717
#endif
1818

lib-rt/base64/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define BASE64_WITH_NEON32 0
1414
#define HAVE_NEON32 BASE64_WITH_NEON32
1515

16-
#if defined(__APPLE__) && defined(__aarch64__)
16+
#if (defined(__APPLE__) && defined(__aarch64__)) || (defined(__wasm__) && defined(__wasm_simd128__))
1717
#define BASE64_WITH_NEON64 1
1818
#else
1919
#define BASE64_WITH_NEON64 0

lib-rt/setup.py

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,41 @@
4242

4343
ccompiler.CCompiler.__spawn = ccompiler.CCompiler.spawn # type: ignore[attr-defined]
4444
X86_64 = platform.machine() in ("x86_64", "AMD64", "amd64")
45+
PYODIDE = "PYODIDE" in os.environ
4546

4647

4748
def spawn(self, cmd, **kwargs) -> None: # type: ignore[no-untyped-def]
48-
compiler_type: str = self.compiler_type
49-
extra_options = EXTRA_FLAGS_PER_COMPILER_TYPE_PER_PATH_COMPONENT[compiler_type]
50-
new_cmd = list(cmd)
51-
if X86_64 and extra_options is not None:
52-
# filenames are closer to the end of command line
49+
if PYODIDE:
50+
new_cmd = list(cmd)
5351
for argument in reversed(new_cmd):
54-
# Check if the matching argument contains a source filename.
5552
if not str(argument).endswith(".c"):
5653
continue
57-
58-
for path in extra_options.keys():
59-
if path in str(argument):
60-
opts = extra_options[path]
61-
if "PYODIDE_PACKAGE_ABI" in os.environ:
62-
opts += ["-msimd128"]
63-
if compiler_type == "bcpp":
64-
compiler = new_cmd.pop()
65-
# Borland accepts a source file name at the end,
66-
# insert the options before it
67-
new_cmd.extend(opts)
68-
new_cmd.append(compiler)
69-
else:
70-
new_cmd.extend(opts)
71-
72-
# path component is found, no need to search any further
73-
break
54+
if "base64/arch/" in str(argument):
55+
new_cmd.extend(["-msimd128"])
56+
else:
57+
compiler_type: str = self.compiler_type
58+
extra_options = EXTRA_FLAGS_PER_COMPILER_TYPE_PER_PATH_COMPONENT[compiler_type]
59+
new_cmd = list(cmd)
60+
if X86_64 and extra_options is not None:
61+
# filenames are closer to the end of command line
62+
for argument in reversed(new_cmd):
63+
# Check if the matching argument contains a source filename.
64+
if not str(argument).endswith(".c"):
65+
continue
66+
67+
for path in extra_options.keys():
68+
if path in str(argument):
69+
if compiler_type == "bcpp":
70+
compiler = new_cmd.pop()
71+
# Borland accepts a source file name at the end,
72+
# insert the options before it
73+
new_cmd.extend(extra_options[path])
74+
new_cmd.append(compiler)
75+
else:
76+
new_cmd.extend(extra_options[path])
77+
78+
# path component is found, no need to search any further
79+
break
7480
self.__spawn(new_cmd, **kwargs)
7581

7682

0 commit comments

Comments
 (0)