]> git.ipfire.org Git - thirdparty/bind9.git/commit
configure.ac: autodetect 'pause' instruction presence on sparc
authorSergei Trofimovich <slyfox@gentoo.org>
Thu, 8 Aug 2019 07:33:10 +0000 (08:33 +0100)
committerOndřej Surý <ondrej@sury.org>
Thu, 8 Aug 2019 12:03:29 +0000 (14:03 +0200)
commite39b03d06d131f6d76f0fce95062858b34242538
treef7ac275963f2f1ef625b7f423292139e541729c1
parente7b8c9b4512c6af9f1622208aa4c845782214c69
configure.ac: autodetect 'pause' instruction presence on sparc

The change fixes the following build failure on sparc T3 and older CPUs:

```
sparc-unknown-linux-gnu-gcc ... -O2 -mcpu=niagara2 ... -c rwlock.c
{standard input}: Assembler messages:
{standard input}:398: Error: Architecture mismatch on "pause ".
{standard input}:398: (Requires v9e|v9v|v9m|m8; requested architecture is v9b.)
make[1]: *** [Makefile:280: rwlock.o] Error 1
```

`pause` insutruction exists only on `-mcpu=niagara4` (`T4`) and upper.

The change adds `pause` configure-time autodetection and uses it if available.
config.h.in got new `HAVE_SPARC_PAUSE` knob. Fallback is a fall-through no-op.

Build-tested on:

- sparc-unknown-linux-gnu-gcc (no `pause`, build succeeds)
- sparc-unknown-linux-gnu-gcc -mcpu=niagara4 (`pause`, build succeeds)

Reported-by: Rolf Eike Beer
Bug: https://bugs.gentoo.org/691708
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
(cherry picked from commit a5ad6b16c5c0bfd333758d707a6397be79a92914)
config.h.in
configure
configure.ac
lib/isc/rwlock.c