Sparc assembler not recognising "pause" instruction on base v9 arch
Summary
Sparc assembler not recognising "pause" instruction on base v9 arch. Causes build to fail.
Report from assembler follows:
/var/tmp//ccOE2Bxb.s: Assembler messages:
/var/tmp//ccOE2Bxb.s:373: Error: Architecture mismatch on "pause ".
/var/tmp//ccOE2Bxb.s:373: (Requires v9e|v9v|v9m|m8; requested architecture is v9.)
BIND version used
Current git repository.
Steps to reproduce
Compile on sparc hardware. Used following options (taken directly from Solaris Userland Makefile):
# Specify "configure" options and features.
# FYI, The configure options are displayed by 'named -V'.
CONFIGURE_OPTIONS += --enable-full-report
# Python: specifying version helps with packaging.
CONFIGURE_OPTIONS += --with-python=$(PYTHON.$(PYTHON_VERSION))
# - Use GNU libtool: to enable building of dynamic libraries.
CONFIGURE_OPTIONS += --with-libtool
# - We don't ship static libraries
CONFIGURE_OPTIONS += --enable-static=no
# - openssl: use openssl, required for DNSSEC features.
CONFIGURE_OPTIONS += --with-openssl
# - pkcs11: Use openSSL pkcs11 engine (KMIP/KMS)
CONFIGURE_OPTIONS += --with-pkcs11=/usr/lib
# - Use xml2-config found uder /usr without checking its version.
CONFIGURE_OPTIONS += --with-libxml2=$(USRDIR)
CONFIGURE_OPTIONS += --enable-devpoll
# - Enabled fixed [order] resource-record sets for backward compatibility.
# - Requires more memory to store the sets so is not the default.
CONFIGURE_OPTIONS += --enable-fixed-rrset
# Override / set specific pathnames:
# - DNS libraries are in usr/lib/dns - Override settings from configure.mk
CONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib/dns/$(MACH64)
CONFIGURE_OPTIONS += --sysconfdir=$(ETCDIR)
CONFIGURE_OPTIONS += --localstatedir=$(VARDIR)
CONFIGURE_OPTIONS += --with-gssapi=krb5-config
CONFIGURE_OPTIONS += --with-docbook-xsl=/usr/share/sgml/docbook
# - Python modules in vendor directory
CONFIGURE_OPTIONS += --with-python-install-dir=$(PYTHON_VENDOR_PACKAGES.32)
# HTML documentation is to be provided, though this does nothing!
CONFIGURE_OPTIONS += --htmldir=$(USRSHAREDOCDIR)/bind/html
# PDF documenatation is to be provided, though this does nothing!
CONFIGURE_OPTIONS += --pdfdir=$(USRSHAREDOCDIR)/bind
What is the current bug behavior?
Can not compile for SPARC v9 architecture.
What is the expected correct behavior?
Ability to compile on SPARC for v9 arch.
Relevant configuration files
See above.
Relevant logs and/or screenshots
/bin/sh \
/builds/smarshal/bind-git/components/bind/build/sparcv9/libtool \
--mode=compile \
/usr/gcc/7/bin/gcc \
-I/builds/smarshal/bind-git/components/bind/build/sparcv9 \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/isc/unix/include \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/isc/pthreads/include \
-I./include \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/isc/include \
-I/builds/smarshal/bind-git/components/bind/build/sparcv9/lib/dns/include \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/dns/include \
-I/usr/include \
-m64 \
-O3 \
-mno-app-regs \
-D_POSIX_PTHREAD_SEMANTICS \
-pthread \
-I/usr/include/libxml2 \
-fPIC \
-W \
-Wall \
-Wmissing-prototypes \
-Wcast-qual \
-Wwrite-strings \
-Wformat \
-Wpointer-arith \
-fno-strict-aliasing \
-fno-delete-null-pointer-checks \
-c \
/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/isc/rwlock.c
libtool: \
compile: \
/usr/gcc/7/bin/gcc \
-I/builds/smarshal/bind-git/components/bind/build/sparcv9 \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/isc/unix/include \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/isc/pthreads/include \
-I./include \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/isc/include \
-I/builds/smarshal/bind-git/components/bind/build/sparcv9/lib/dns/include \
-I/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/dns/include \
-I/usr/include \
-m64 \
-O3 \
-mno-app-regs \
-D_POSIX_PTHREAD_SEMANTICS \
-pthread \
-I/usr/include/libxml2 \
-fPIC \
-W \
-Wall \
-Wmissing-prototypes \
-Wcast-qual \
-Wwrite-strings \
-Wformat \
-Wpointer-arith \
-fno-strict-aliasing \
-fno-delete-null-pointer-checks \
-c \
/builds/smarshal/bind-git/components/bind/bind-HEAD/lib/isc/rwlock.c \
-fPIC \
-DPIC \
-o \
.libs/rwlock.o
/var/tmp//ccOE2Bxb.s: Assembler messages:
/var/tmp//ccOE2Bxb.s:373: Error: Architecture mismatch on "pause ".
/var/tmp//ccOE2Bxb.s:373: (Requires v9e|v9v|v9m|m8; requested architecture is v9.)
make[3]: *** [Makefile:273: rwlock.lo] Error 1
make[3]: Leaving directory '/builds/smarshal/bind-git/components/bind/build/sparcv9/lib/isc'
make[2]: *** [Makefile:82: subdirs] Error 1
make[2]: Leaving directory '/builds/smarshal/bind-git/components/bind/build/sparcv9/lib'
make[1]: *** [Makefile:89: subdirs] Error 1
make[1]: Leaving directory '/builds/smarshal/bind-git/components/bind/build/sparcv9'
gmake: *** [/builds/smarshal/bind-git/make-rules/configure.mk:184: /builds/smarshal/bind-git/components/bind/build/sparcv9/.built] Error 2
Possible fixes
use smt_pause(3c).
Sparc assembler not recognising "pause" instruction on base v9 arch.
Patch replaces assembler call to smt_pause(3c).
--- bind9.git/lib/isc/rwlock.c
+++ bind-HEAD/lib/isc/rwlock.c
@@ -18,6 +18,10 @@
#include <stddef.h>
#include <inttypes.h>
+#if defined(__sparc) || defined(__sparc__)
+#include <synch.h> /* for smt_pause(3c) */
+#endif
+
#include <isc/atomic.h>
#include <isc/magic.h>
#include <isc/msgs.h>
@@ -54,7 +58,8 @@
#elif defined(__arm__)
# define isc_rwlock_pause() __asm__ __volatile__ ("yield")
#elif defined(__sparc) || defined(__sparc__)
-# define isc_rwlock_pause() __asm__ __volatile__ ("pause")
+/* # define isc_rwlock_pause() __asm__ __volatile__ ("pause") */
+# define isc_rwlock_pause() smt_pause()
#elif defined(__ppc__) || defined(_ARCH_PPC) || \
defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_POWER)
# define isc_rwlock_pause() __asm__ volatile ("or 27,27,27")