Hard to say without more information, but at the very least it would be useful to know how you invoked the compiler and whether you are using ocamlfind or not…
I locally patched my distros PKGBUILD to replace the local 4.X installation with the 5.0 alpha version as a workaround. Everything seems to be working just fine now.
Definitely smells like it was an environment issue.
(actually, I’m more suspicious that for some reason the build is using the compiler in /usr/local but inspecting the primitives in dllunix.so from your switch via CAML_LD_LIBRARY_PATH, so the question may be more exactly which version of opam is involved and possibly also the shell, as maybe PATH is wrong?)