clCompileProgram causes SIGABRT on Mac OSX

Hello,

I am trying to compile a simple OpenCL code using clCompileProgram:

__kernel void vec_add(__global const float *A, __global const float *B, __global float *C) {
    int i = get_global_id(0);
    C[i] = A[i] + B[i];
}

This causes a crash - relevant stack trace is:

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00000001951d2a60 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x000000019520ac20 libsystem_pthread.dylib`pthread_kill + 288
    frame #2: 0x0000000195117a30 libsystem_c.dylib`abort + 180
    frame #3: 0x000000010036ae98 AppleMetalOpenGLRenderer`gldCreateComputeModule + 16
    frame #4: 0x00000001ec283644 OpenCL`___lldb_unnamed_symbol753 + 672
    frame #5: 0x00000001ec29262c OpenCL`clCompileProgram + 1888

If I use clBuildProgram instead, all works as expected.

The machine is 2021 MacBook Pro (Apple M1). If I take the same code to a linux machine with debian and nvidia card + drivers, all works as expected, so I am suspecting something wrong on the Apple side.

Anybody experienced this?