diff --git a/Scripts/Linux/BuildScalarForLinux.sh b/Scripts/Linux/BuildScalarForLinux.sh index 7cc8afdaa1..77ea2aa84f 100755 --- a/Scripts/Linux/BuildScalarForLinux.sh +++ b/Scripts/Linux/BuildScalarForLinux.sh @@ -12,6 +12,22 @@ if [ -z $VERSION ]; then VERSION="0.2.173.2" fi +ARCH=$(uname -m) +if test "$ARCH" != "x86_64"; then + >&2 echo "architecture must be x86_64 for struct stat; stopping" + exit 1 +fi + +CC=${CC:-cc} + +echo 'main(){int i=1;const char *n="n";struct stat b;i=__xstat64(i,n,&b);}' | \ + cc -xc -include sys/stat.h -o /dev/null - 2>/dev/null + +if test $? != 0; then + >&2 echo "__xstat64() not found in libc ABI; stopping" + exit 1 +fi + # If we're building the Profiling(Release) configuration, remove Profiling() for building .NET code if [ "$CONFIGURATION" == "Profiling(Release)" ]; then CONFIGURATION=Release