This patch fixes compilation and linking issues for Windows (MinGW)
and Cygwin. It ensures that JIT symbols are correctly exported in DLL
builds and provides a fallback for the missing ffs() function in the
Windows C runtime.
-
lightening.h (JIT_API): Do not use the hidden visibility attribute
on Windows or Cygwin. The PE/COFF format used on these platforms
requires standard visibility for symbols to be correctly exported
when building Guile as a DLL.
-
lightening/x86-cpu.c (__ffs): New static function. Fallback
implementation using __builtin_ffs() as the standard POSIX ffs()
is unavailable in MSVCRT/UCRT.
(ffsw): Use the internal __ffs wrapper for bit-scan operations to
ensure consistency across all Windows toolchains.
Note: an identical patch has been provided as guile/guile@71d21b9ae6 in guile/guile#68.
This patch fixes compilation and linking issues for Windows (MinGW)
and Cygwin. It ensures that JIT symbols are correctly exported in DLL
builds and provides a fallback for the missing ffs() function in the
Windows C runtime.
* lightening.h (JIT_API): Do not use the hidden visibility attribute
on Windows or Cygwin. The PE/COFF format used on these platforms
requires standard visibility for symbols to be correctly exported
when building Guile as a DLL.
* lightening/x86-cpu.c (__ffs): New static function. Fallback
implementation using __builtin_ffs() as the standard POSIX ffs()
is unavailable in MSVCRT/UCRT.
(ffsw): Use the internal __ffs wrapper for bit-scan operations to
ensure consistency across all Windows toolchains.
Note: an identical patch has been provided as https://codeberg.org/guile/guile/commit/71d21b9ae6 in https://codeberg.org/guile/guile/pulls/68.