File: examples-mandelbrot-add-multivalue-reference-types-to-was.patch

package info (click to toggle)
wasmedge 0.14.1%2Bdfsg-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,416 kB
  • sloc: cpp: 133,450; asm: 26,333; ansic: 12,397; java: 2,553; sh: 2,086; javascript: 1,440; python: 1,330; pascal: 897; xml: 681; makefile: 100
file content (26 lines) | stat: -rw-r--r-- 1,357 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Faidon Liambotis <paravoid@debian.org>
Date: Tue, 5 Nov 2024 14:31:07 +0200
Subject: examples/mandelbrot: add multivalue/reference-types to wasm-ld

These are now enabled by default in LLVM 19. Since --features is passed
already for other features, we need to pass these too, otherwise
compilation fails with:
  # wasm-ld: error: Target feature 'reference-types' used by mandelbrot.o is not allowed.
  # wasm-ld: error: Target feature 'multivalue' used by mandelbrot.o is not allowed.
---
 examples/capi/mandelbrot-set-in-threads/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/capi/mandelbrot-set-in-threads/Makefile b/examples/capi/mandelbrot-set-in-threads/Makefile
index 3cb74d0..f8ad51c 100644
--- a/examples/capi/mandelbrot-set-in-threads/Makefile
+++ b/examples/capi/mandelbrot-set-in-threads/Makefile
@@ -5,7 +5,7 @@ mandelbrot.o: mandelbrot.c
 	clang -O3 --no-standard-libraries --target=wasm32 -c -o $@ $^
 
 mandelbrot.wasm: mandelbrot.o
-	wasm-ld --no-entry $^ -o $@ --import-memory --export-all --shared-memory --features=mutable-globals,atomics,bulk-memory
+	wasm-ld --no-entry $^ -o $@ --import-memory --export-all --shared-memory --features=mutable-globals,atomics,bulk-memory,multivalue,reference-types
 
 mandelbrot.wat: mandelbrot.wasm
 	wasm2wat --enable-all mandelbrot.wasm -o mandelbrot.wat