9.14.1 will not compile on OpenBSD 6.5 on AMD64
named_w_gcc.logI have begun work on upgrading a group of OpenBSD boxes that are used at a bunch of small sites as a "network services" processor and gateway.. The existing boxes are mostly running some version of 9.12, though one is running a 9.11. Aside from the usual "version-ites" problems, this has been a largely mechanical "turn the crank and let the scripts run" process.
EXCEPT for Bind. The build process keeps failing when it gets down far enough to trying to compile isc/lib/rwlock.c which fails miserably.. Using the "out of the box" gcc compiler generates the following:
--- snip ---
gcc -std=gnu99 -I/opt/src/bind-9.14.1 -I../.. -I./unix/include -I./pthreads/include -I./include -I./include -I/opt/src/bind-9.14.1/lib/dns/include -I../../lib/dns/include -I/usr/include -g -O2 -pthread -I /usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include -I /usr/local/include -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing -fno-delete-null-pointer-checks -c rwlock.c
rwlock.c:51:24: error: immintrin.h: No such file or directory
rwlock.c: In function 'isc__rwlock_lock':
rwlock.c:302: warning: cast to pointer from integer of different size
rwlock.c:302: warning: cast to pointer from integer of different size
rwlock.c:302: warning: assignment makes integer from pointer without a cast
rwlock.c: In function 'isc_rwlock_lock':
rwlock.c:342: warning: implicit declaration of function '_mm_pause'
rwlock.c: In function 'isc_rwlock_trylock':
rwlock.c:395: warning: cast to pointer from integer of different size
rwlock.c:395: warning: cast to pointer from integer of different size
rwlock.c:395: warning: assignment makes integer from pointer without a cast
rwlock.c: In function 'isc_rwlock_tryupgrade':
rwlock.c:427: warning: cast to pointer from integer of different size
rwlock.c:427: warning: cast to pointer from integer of different size
rwlock.c:427: warning: assignment makes integer from pointer without a cast
*** Error 1 in lib/isc (Makefile:273 'rwlock.o')
*** Error 1 in lib (Makefile:89 'subdirs')
*** Error 1 in /opt/src/bind-9.14.1 (Makefile:96 'subdirs')
--- snip ---
After looking, I found that the ./configure had selected the default gcc ( 4.2.1 ) which is old. I have since retried this with both clang (7.0.1) and egcc (8.3.0) with similar, but slightly more illuminating results.
--- snip ---
/usr/bin/cc -I/opt/src/bind-9.14.1 -I../.. -I./unix/include -I./pthreads/include -I./include -I./include -I/opt/src/bind-9.14.1/lib/dns/include -I../../lib/dns/include -I/usr/include -g -O2 -pthread -I /usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include -I /usr/local/include -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing -fno-delete-null-pointer-checks -c rwlock.c
In file included from rwlock.c:51:
In file included from /usr/lib/clang/7.0.1/include/immintrin.h:28:
/usr/include/mmintrin.h:312:40: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2);
^~~~~~~~~~~~~~~
/usr/include/mmintrin.h:416:40: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psubq ((long long)__m1, (long long)__m2);
^~~~~~~~~~~~~~~
/usr/include/mmintrin.h:523:53: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (long long)__count);
^~~~~~~~~~~~~~~~~~
/usr/include/mmintrin.h:535:53: error: passing 'int' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count);
^~~~~~~
/usr/include/mmintrin.h:548:53: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_pslld ((__v2si)__m, (long long)__count);
^~~~~~~~~~~~~~~~~~
/usr/include/mmintrin.h:560:53: error: passing 'int' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count);
^~~~~~~
/usr/include/mmintrin.h:573:40: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count);
^~~~~~~~~~~~~~
/usr/include/mmintrin.h:585:40: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count);
^~~~~~~~~~~~~~
/usr/include/mmintrin.h:598:53: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (long long)__count);
^~~~~~~~~~~~~~~~~~
/usr/include/mmintrin.h:610:53: error: passing 'int' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count);
^~~~~~~
/usr/include/mmintrin.h:623:53: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psrad ((__v2si)__m, (long long)__count);
^~~~~~~~~~~~~~~~~~
/usr/include/mmintrin.h:635:53: error: passing 'int' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count);
^~~~~~~
/usr/include/mmintrin.h:648:53: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (long long)__count);
^~~~~~~~~~~~~~~~~~
/usr/include/mmintrin.h:660:53: error: passing 'int' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count);
^~~~~~~
/usr/include/mmintrin.h:673:53: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psrld ((__v2si)__m, (long long)__count);
^~~~~~~~~~~~~~~~~~
/usr/include/mmintrin.h:685:53: error: passing 'int' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count);
^~~~~~~
/usr/include/mmintrin.h:698:40: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count);
^~~~~~~~~~~~~~
/usr/include/mmintrin.h:710:40: error: passing 'long long' to parameter of incompatible type '__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value)
return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count);
^~~~~~~~~~~~~~
In file included from rwlock.c:51:
In file included from /usr/lib/clang/7.0.1/include/immintrin.h:32:
/usr/include/xmmintrin.h:105:10: error: invalid conversion between vector type '__m128' (vector of 4 'float' values) and integer type 'int' of different size
return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Error 1 in lib/isc (Makefile:273 'rwlock.o')
*** Error 1 in lib (Makefile:89 'subdirs')
*** Error 1 in /opt/src/bind-9.14.1 (Makefile:96 'subdirs')
--- snip ---
While I'm not much of a C programmer, the problem appears to be in the "new code" that was added between 9.12.4-P1 (which builds fine on this same platform) and the 9.14 version.
--- snip from rwlock.c ---
#if defined(_MSC_VER)
# include <intrin.h>
# define isc_rwlock_pause() YieldProcessor()
#elif defined(__x86_64__)
# include <immintrin.h>
# define isc_rwlock_pause() _mm_pause()
#elif defined(__i386__)
--- snip ---
Since I know you are going to ask, I'm trying to use the following configure:
CC=/usr/bin/cc ./configure --prefix=/usr/local \
--sbindir=/usr/local/sbin \
--bindir=/usr/local/sbin \
--libdir=/usr/local/lib \
--includedir=/usr/local/include \
--mandir=/usr/local/share/man \
--sysconfdir=/etc \
--enable-shared \
--enable-static \
--with-openssl=/usr \
--with-python=/usr/local/bin/python \
--with-libxml2 \
--with-libjson \
--without-readline \
--without-protobuf-c \
--without-libfstrm \
--with-lmdb \
--disable-dnstap \
--with-dlopen=no
I have tried this with variations on this theme ( with libtool, etc.).
Recreating:
untar
./configure
make depend
make