BIND 9.11.6-P1 build fails on Solaris

Stacey Marshall stacey.marshall at oracle.com
Fri Apr 26 17:57:14 UTC 2019


I'm struggling with this on Solaris 10 with Solaris Studio compiler.
Seems to be a couple of issues, I'm still working through...

For example configure is using -pthread option when testing OpenSSL 
which is not appropriate for Studio:

```
configure:17237: checking for OpenSSL AES support
configure:17261: /ws/on10-patch-tools/SUNWspro/SS12/bin/cc -D_STDC_C99= 
-mt -pthread -o conftest  -g  -D_XPG4_2 -D__EXTENSIONS__ 
-L/builds2/smarshal/sfw10-patch/proto/root_sparc/usr/lib 
-L/builds2/smarshal/sfw10-patch/proto/root_sparc/usr/lib/dns conftest.c 
-lcrypto -lpthread  >&5
ld: fatal: option -h and building a dynamic executable are incompatible
ld: fatal: Flags processing errors
configure:17261: $? = 1
configure: program exited with status 1
configure: failed program was:
```

'pthread' option also needs patching out of ltmain.sh, I have raised 
that as an issue with libtool.

```
libtool should not pass option '-pthread' to Solaris link-editor.
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
index 0f0a2da3f9..7c8bcfd9d2 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -7070,7 +7070,21 @@ func_mode_link ()
  	continue
  	;;

-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe 
\
+      # Solaris ld rejects as of 11.4.  Refer to Oracle bug 22985199.
+      -pthread)
+	  case $host in
+              *solaris2*) ;;
+              *)
+		  case "$new_inherited_linker_flags " in
+                      *" $arg "*) ;;
+                      * ) func_append new_inherited_linker_flags " 
$arg" ;;
+		  esac
+ 		  ;;
+	  esac
+ 	  continue
+	  ;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  	func_append compiler_flags " $arg"
  	func_append compile_command " $arg"
```


I'm running a GCC build now, with gcc from /usr/sfw/bin.  I needed to 
tell gcc to not use /usr/sfw/include, where it was finding an older 
OpenSSL include file:

```
CC =		/usr/sfw/bin/gcc
CFLAGS = 	-g -Os -Wall,packed,padded,sign-compare,pointer-arith
# override default gcc include search order (shown by 'gcc -v file.c')
# as need openssl headers to come from /usr/include and not
# /usr/sfw/include.  Note, do not seem to need gcc include dir; 
commented out.
#
CFLAGS +=	-nostdinc
# CFLAGS +=	-isystem 
/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include
CFLAGS +=	-isystem /usr/include/libxml2
CFLAGS +=	-isystem /usr/include
CFLAGS +=	-isystem /usr/sfw/include
```

Also, needed patch that I posted to 
https://gitlab.isc.org/isc-projects/bind9/issues/935


--
Stacey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20190426/2835260c/attachment.html>


More information about the bind-users mailing list