• Sergei Trofimovich's avatar
    configure.ac: autodetect 'pause' instruction presence on sparc · a5ad6b16
    Sergei Trofimovich authored
    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/691708Signed-off-by: 's avatarSergei Trofimovich <slyfox@gentoo.org>
    a5ad6b16