1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/app/Commands
Łukasz Czajka 6c08cbb8d8
Avoid the -Os option when generating WebAssembly (#2378)
With `-Os` ill-typed code is generated for the following:
```
module wasmcrash.juvix;

import Stdlib.Prelude open;

{-# inline: false #-}
I {A} (x : A) : A := x;

{-# inline: false #-}
I' {A} (x : A) : A := x;

main : Nat := I' (I I 1);
```
Running the generated WASM file with `wasmer` or `wasmtime` gives an
error:
```
Validation error: type mismatch: expected i32 but nothing on stack (at offset 740)
```
The issue occurs with clang version 16.0.5 but not 16.0.0. The issue
does not occur with any other optimization option (`-O1`, `-O2`, `-O3`).
There is no issue with `-Os` used with the native target.

This is thus likely a bug in a specific version of LLVM. It could be
theoretically some very subtle non-conformance to the C standard in our
generated code, but this seems less likely. Creating a minimum C file
exposing the bug would be very time-consuming, so I propose to just
avoid using the `-Os` option for now.
2023-09-21 13:15:36 +01:00
..
Compile Fix: add supported targets as option for compile commands (#1983) 2023-04-13 14:16:07 +02:00
Dev VampIR range checks and error handling (#2344) 2023-09-12 19:56:28 +02:00
Doctor Global offline flag (#2335) 2023-09-05 17:11:17 +02:00
Eval Print values in juvix eval (#2179) 2023-06-06 12:35:01 +02:00
Extra Avoid the -Os option when generating WebAssembly (#2378) 2023-09-21 13:15:36 +01:00
Format Remove old function syntax (#2305) 2023-08-24 16:24:47 +02:00
Html Show all available html themes in the CLI automatically (#2322) 2023-08-31 16:53:10 +02:00
Repl Add field projections for records (#2260) 2023-08-01 09:46:22 +01:00
Typecheck Support basic dependencies (#1622) 2022-12-20 13:05:40 +01:00
Base.hs Refactor CLI (#1527) 2022-09-14 16:16:15 +02:00
Clean.hs Update ci to use ormolu 0.5.3.0 and reformat project (#2313) 2023-08-25 17:37:23 +01:00
Compile.hs Add main field to juvix.yaml (#2120) 2023-05-24 15:42:20 +02:00
Dev.hs Add juvix dev repl command (#1941) 2023-03-31 00:57:44 +02:00
Doctor.hs Global offline flag (#2335) 2023-09-05 17:11:17 +02:00
Eval.hs Fix 'function not found' error in juvix eval (#2178) 2023-06-06 13:26:43 +02:00
Format.hs Update ci to use ormolu 0.5.3.0 and reformat project (#2313) 2023-08-25 17:37:23 +01:00
Html.hs Support more paths (#2000) 2023-04-19 15:56:48 +01:00
Init.hs External package dependencies (#2272) 2023-09-01 12:37:06 +01:00
Repl.hs Add Internet effect (#2337) 2023-09-07 18:26:19 +02:00
Typecheck.hs Update ci to use ormolu 0.5.3.0 and reformat project (#2313) 2023-08-25 17:37:23 +01:00