[cairo] [PATCH] pixman solaris hwcap configure test
M Joonas Pihlaja
jpihlaja at cc.helsinki.fi
Sun Jul 19 09:13:23 PDT 2009
Hey,
The GNU linker doesn't understand the Solaris linker's hwcap files,
but also doesn't seem to have the problem of marking the final .so as
SSE/MMX only -- a feature of the native linker which required the
mapfile in the first place. The patch below adds a configure test
to see if the linker understands the hwcap mapfile.
Cheers,
Joonas
commit 6aa26296f5831bddc9b3f3e3e2ea018fc0cefb75
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date: Sun Jul 19 18:20:53 2009 +0300
Check whether the linker understands the hwcap file before using it.
If we're trying to use the GNU linker on Solaris we shouldn't use
our solaris-hwcap.mapfile since it doesn't grok the mapfile format.
diff --git a/configure.ac b/configure.ac
index ea9c4fd..76cf691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -267,9 +267,19 @@ case $host_os in
solaris*)
# When building 32-bit binaries, apply a mapfile to ensure that
the
# binaries aren't flagged as only able to run on MMX+SSE
capable CPUs
- # since they check at runtime before using those instructions
+ # since they check at runtime before using those instructions.
+ # Not all linkers grok the mapfile format so we check for that first.
if test "$AMD64_ABI" = "no" ; then
- HWCAP_LDFLAGS='-Wl,-M,$(srcdir)/solaris-hwcap.mapfile'
+ use_hwcap_mapfile=no
+ AC_MSG_CHECKING(whether to use a hardware capability map
file)
+ hwcap_save_LDFLAGS="$LDFLAGS"
+ HWCAP_LDFLAGS='-Wl,-M,$(srcdir)/solaris-hwcap.mapfile'
+ LDFLAGS="$LDFLAGS -Wl,-M,pixman/solaris-hwcap.mapfile"
+ AC_LINK_IFELSE([int main() { return 0; }],
+ use_hwcap_mapfile=yes,
+ HWCAP_LDFLAGS="")
+ LDFLAGS="$hwcap_save_LDFLAGS"
+ AC_MSG_RESULT($use_hwcap_mapfile)
fi
if test "x$MMX_LDFLAGS" = "x" ; then
MMX_LDFLAGS="$HWCAP_LDFLAGS"
More information about the cairo
mailing list