vnmakarov / mir

A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
MIT License
2.24k stars 145 forks source link

Building with zig and failing at runtime on `mir_hash_1` #373

Open giann opened 8 months ago

giann commented 8 months ago

I'm trying to build MIR with my build.zig for buzz so that users are not required to build it separately by hand and also for it to be automatically built for the current platform.

-> https://github.com/buzz-language/buzz/blob/mir/build.zig#L639-L703

It builds and links ok but crashes at runtime here:

    frame #0: 0x0000000101216270 libbuzz.dylib`mir_hash_1 [inlined] mir_get_key_part(v=<unavailable>, len=<unavailable>, relax_p=<unavailable>) at mir-hash.h:0 [opt]
   62     return state ^ mir_mum (state, p2, relax_p);
   63   }
   64  
-> 65   static inline uint64_t mir_hash_1 (const void *key, size_t len, uint64_t seed, int relax_p) {
   66     const uint8_t *v = (const uint8_t *) key;
   67     uint64_t r = seed + len;
   68 

@vnmakarov Do you have any idea as to what I might be missing?

Note that it works perfectly when building by hand with make