It looks like your Haskell runtime was compiled against glibc, but you're trying to compile your Haskell source against musl. In general, you cannot mix two C libraries within the same program.
Your specific problem here is that glibc supports a couple different conflicting sets of semantics for the signal
function, to match what different historical versions of UNIX provided. It chooses which version to use based on the feature test macros that your C code defines. And to actually switch between them, it uses the C preprocessor to replace your program's references to signal
with references to a version of the function with whichever semantics you've requested (in you're case, your Haskell runtime has a reference to __sysv_signal
).
The problem is that musl doesn't do this same slight of hand. It exposes a single version of signal
that matches what the POSIX standard defines its semantics to be, and it exposes it under the name signal
.
The proper way to fix this is going to be to recompile your Haskell runtime against musl's headers. I don't know if anybody's actually tried doing this yet, so YMMV.
Note that you should avoid having libraries installed in the same system directory but compiled against different C libraries. Doing so is likely to break things, because any software trying to use multiple libraries that are compiled against conflicting C libraries will run into variants of the exact problem you're having right now. You should generally compile and install musl into its own prefix, and then compile other libraries (eg. your Haskell runtime) against musl and install into that same prefix. This way, your musl and glibc libraries stay cleanly separated.