Skip to content

Commit d26814e

Browse files
committed
Add some minimal testing with LLVM stable (v19)
Fixes: emscripten-core#11362
1 parent 512e600 commit d26814e

File tree

3 files changed

+44
-58
lines changed

3 files changed

+44
-58
lines changed

.circleci/config.yml

Lines changed: 28 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,32 @@ jobs:
802802
core2.test_exceptions_wasm
803803
core2.test_pthread_unhandledrejection"
804804
- upload-test-results
805+
test-llvm-stable:
806+
executor: focal
807+
environment:
808+
LANG: "C.UTF-8"
809+
EMTEST_SKIP_V8: "1"
810+
steps:
811+
- run:
812+
name: install llvm
813+
command: |
814+
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main" >> /etc/apt/sources.list
815+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
816+
apt-get update
817+
apt-get install -q -y clang-19 lld-19
818+
- checkout
819+
- run:
820+
name: submodule update
821+
command: git submodule update --init
822+
- pip-install
823+
- install-emsdk
824+
- install-rust
825+
- run:
826+
name: configure LLVM
827+
command: echo "LLVM_ROOT='/usr/lib/llvm-19/bin'" >> ~/emsdk/.emscripten
828+
- run: apt-get install -q -y ninja-build scons ccache
829+
- run-tests:
830+
test_targets: "core0.test_hello_world"
805831
test-other:
806832
executor: focal
807833
environment:
@@ -979,59 +1005,5 @@ jobs:
9791005
workflows:
9801006
build-test:
9811007
jobs:
982-
- ruff
983-
- mypy
984-
- eslint
985-
- build-docs
986-
- build-linux
987-
- test-sanity:
988-
requires:
989-
- build-linux
990-
- test-posixtest:
991-
requires:
992-
- build-linux
993-
- test-core0:
994-
requires:
995-
- build-linux
996-
- test-core2:
997-
requires:
998-
- build-linux
999-
- test-core3:
1000-
requires:
1001-
- build-linux
1002-
- test-wasm64:
1003-
requires:
1004-
- build-linux
1005-
- test-wasm64-4gb:
1006-
requires:
1007-
- build-linux
1008-
- test-wasm2js1:
1009-
requires:
1010-
- build-linux
1011-
- test-other:
1012-
requires:
1013-
- build-linux
1014-
- test-browser-chrome:
1015-
requires:
1016-
- build-linux
1017-
- test-browser-chrome-2gb:
1018-
requires:
1019-
- build-linux
1020-
- test-browser-chrome-wasm64:
1021-
requires:
1022-
- build-linux
1023-
- test-browser-chrome-wasm64-4gb:
1024-
requires:
1025-
- build-linux
1026-
- test-browser-firefox:
1027-
requires:
1028-
- build-linux
1029-
- test-browser-firefox-wasm64
1030-
- test-sockets-chrome:
1031-
requires:
1032-
- build-linux
1033-
- test-jsc
1034-
- test-spidermonkey
1035-
- test-node-compat
1036-
- test-windows
1037-
- test-mac-arm64
1008+
- test-llvm-stable
1009+

emcc.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,14 @@ def get_clang_flags(user_args):
385385
if '-mbulk-memory' not in user_args:
386386
flags.append('-mbulk-memory')
387387

388+
if shared.is_llvm_stable():
389+
# LLVM 19 doesn't enable these features by default, but we want
390+
# them on-by-default, like they are on LLVM tot.
391+
if '-mbulk-memory' not in user_args:
392+
flags.append('-mbulk-memory')
393+
if '-mnontrapping-fptoint' not in user_args:
394+
flags.append('-mnontrapping-fptoint')
395+
388396
if settings.RELOCATABLE and '-fPIC' not in user_args:
389397
flags.append('-fPIC')
390398

tools/shared.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
# This version currently matches the node version that we ship with emsdk
6161
# which means that we can say for sure that this version is well supported.
6262
MINIMUM_NODE_VERSION = (16, 20, 0)
63+
EXPECTED_LLVM_STABLE_VERSION = 19
6364
EXPECTED_LLVM_VERSION = 20
6465

6566
# These get set by setup_temp_dirs
@@ -298,17 +299,22 @@ def get_clang_version():
298299
return m and m.group(1)
299300

300301

302+
def is_llvm_stable():
303+
return get_clang_version().startswith('%d.' % EXPECTED_LLVM_STABLE_VERSION)
304+
305+
301306
def check_llvm_version():
302307
actual = get_clang_version()
303-
if actual.startswith('%d.' % EXPECTED_LLVM_VERSION):
308+
expected = [EXPECTED_LLVM_VERSION, EXPECTED_LLVM_STABLE_VERSION]
309+
if any(actual.startswith('%d.' % e) for e in expected):
304310
return True
305311
# When running in CI environment we also silently allow the next major
306312
# version of LLVM here so that new versions of LLVM can be rolled in
307313
# without disruption.
308314
if 'BUILDBOT_BUILDNUMBER' in os.environ:
309315
if actual.startswith('%d.' % (EXPECTED_LLVM_VERSION + 1)):
310316
return True
311-
diagnostics.warning('version-check', 'LLVM version for clang executable "%s" appears incorrect (seeing "%s", expected "%s")', CLANG_CC, actual, EXPECTED_LLVM_VERSION)
317+
diagnostics.warning('version-check', f'LLVM version for clang executable "{CLANG_CC}" appears incorrect (seeing "{actual}", expected "{EXPECTED_LLVM_VERSION}" or "{EXPECTED_LLVM_STABLE_VERSION}")')
312318
return False
313319

314320

0 commit comments

Comments
 (0)