Use CARGO_CFG_TARGET_ENV
to determine if the target env ABI is gnu
#31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #30
The unfortunately named
target_cfg
used in acfg()
macro / attribute is a host flag (as all othercfg()
s) when a build script using this library is compiled for the host. Instead, theENV
of the compile target should be read from an environment variable (just like$TARGET
) when this code is being run on the host to figure out what the target environment ABI is.This causes a cross-compile via
xwin
(reported in #30) to invoke theglibc
compile test even though windows doesn't provideglibc
. When cross-compiling tox86_64-pc-windows-msvc
target_env
will still be"gnu"
whileCARGO_CFG_TARGET_ENV
properly representsmsvc
.Aside from this I do think that the compile-check is valid for MSVC, the warning in that error even suggests to include
<string.h>
, but the test.c
file already does exactly this... Perhaps the arguments set up byxwin
and/or thesccache
wrapper there are incompatible with how we invoke the compiler for this test?