You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The root issue here is that bindgen uses clang (not clang-cl) on windows, and on unrecognised flags, it fails. Upon adding CXXFLAGS="/clang:-flto=thin /clang:-fuse-ld=lld-link", the below code automatically adds it to bindgen's flags as well. As /clang: flags are only recognised by clang-cl, there is no way for cc and the makefile.cargo to receive the CXXFLAGS but not bindgen.
If a flag starts with /clang: on windows, do not add it to bindgen.
Add a separate BINDGEN_CXXFLAGS variable for bindgen's flags.
As said earlier, the root issue is the usage of clang, which means this error may not be just from /clang: flags but almost any cl flag. Hence, I would suggest the latter approach.
The root issue here is that bindgen uses
clang
(notclang-cl
) on windows, and on unrecognised flags, it fails. Upon addingCXXFLAGS="/clang:-flto=thin /clang:-fuse-ld=lld-link"
, the below code automatically adds it to bindgen's flags as well. As/clang:
flags are only recognised byclang-cl
, there is no way forcc
and themakefile.cargo
to receive theCXXFLAGS
but not bindgen.mozjs/mozjs-sys/build.rs
Lines 334 to 338 in c7fb1b8
There are a few possible approaches:
/clang:
on windows, do not add it to bindgen.BINDGEN_CXXFLAGS
variable for bindgen's flags.As said earlier, the root issue is the usage of
clang
, which means this error may not be just from/clang:
flags but almost anycl
flag. Hence, I would suggest the latter approach.For a concrete example of the failure, see https://github.com/Redfire75369/spiderfire/actions/runs/7112793006/job/19363443030#step:6:18053, where a
libclang error
is caused.In the event it matters for updating whatever depends on it, #136 was the original PR where this behaviour was introduced.
The text was updated successfully, but these errors were encountered: