Welcome! Please see the About page for a little more info on how this works.
The clojure.spec.test.alpha namespace in clojure.spec 0.3.214 namepace is still AOT-compiled using the locking macro from clojure 1.10.1:
0.3.214
<clojure.version>1.10.1</clojure.version>
https://github.com/clojure/spec.alpha/blob/a924efab53b0465f7d2a589d4ae3c79a3826403b/pom.xml#L39
https://github.com/clojure/spec.alpha/blob/a924efab53b0465f7d2a589d4ae3c79a3826403b/src/main/clojure/clojure/spec/test/alpha.clj#L363
This old locking macro is troublesome with GraalVM native image. See CLJ-1472.
I think if you compile clojure.spec with clojure 1.10.3 then you can just keep using locking and the old locking2 workaround can be removed over here:
https://github.com/clojure/spec.alpha/blob/a924efab53b0465f7d2a589d4ae3c79a3826403b/src/main/clojure/clojure/spec/gen/alpha.clj#L17
An alternative solution would be to also use the locking2 macro in clojure.spec.test.alpha.
Released spec.alpha 0.3.218