ffi: fix bogus error when using load-foreign-library with bytecmp

As it modifies the linker flags, the do-load-foreign-library function
only works with the C compiler.
This commit is contained in:
Marius Gerbershagen 2020-01-27 20:58:21 +01:00
parent c8003c2fc4
commit 10c4f6e6d6

View file

@ -738,9 +738,11 @@ locations. Returns the path of the first found file."
Loads a foreign library."
(declare (ignore module force-load supporting-libraries))
(let ((compile-form (and (constantp filename env)
`((eval-when (:compile-toplevel)
(do-load-foreign-library ,filename
,(ext:constant-form-value system-library))))))
`((ext:with-backend
:c/c++ (eval-when (:compile-toplevel)
(do-load-foreign-library ,filename
,(ext:constant-form-value system-library)))
:bytecodes nil))))
(dyn-form #+dffi (when (and (not system-library) *use-dffi*)
`((si:load-foreign-module ,filename)))
#-dffi nil))