NetBSD Problem Report #57687

From www@netbsd.org  Wed Nov  8 07:28:06 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 488D01A9238
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  8 Nov 2023 07:28:06 +0000 (UTC)
Message-Id: <20231108072804.0992E1A9239@mollari.NetBSD.org>
Date: Wed,  8 Nov 2023 07:28:03 +0000 (UTC)
From: hiroshi-hakoyama@nagano.ac.jp
Reply-To: hiroshi-hakoyama@nagano.ac.jp
To: gnats-bugs@NetBSD.org
Subject: openssl-3.1.4 fails to install in Solaris 10 SPARC
X-Send-Pr-Version: www-1.0

>Number:         57687
>Category:       pkg
>Synopsis:       openssl-3.1.4 fails to install in Solaris 10 SPARC
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    solaris-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 08 07:30:00 +0000 2023
>Last-Modified:  Wed Nov 08 07:36:28 +0000 2023
>Originator:     Hiroshi Hakoyama
>Release:        pkgsrc_current
>Organization:
Institute of Freshwater Biology, Nagano University
>Environment:
SunOS ec21 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Blade-1000
>Description:
Despite specifying 32 bit ABI gcc in mk.conf, openssl-3.1.4 configures with solaris64-sparcv9-gcc. Also, the proper options for Solaris (-pthreads and -lrt) are not set (https://github.com/openssl/openssl/issues/6333). These are causing the build to not work.
Below is the full text of mk.conf and the full text of the error:


mk.conf

# more /usr/pkg/etc/mk.conf
# Example /usr/pkg/etc/mk.conf file produced by bootstrap-pkgsrc

.ifdef BSD_PKG_MK       # begin pkgsrc settings

ABI=                    32
PKGSRC_COMPILER=        gcc
GCCBASE=                /opt/csw/gcc5
#GCC_VERSION=            5.5.0
#GCC_VERSION_SUFFIX=            /opt/csw/bin/gcc

PKG_DBDIR=              /usr/pkg/pkgdb
LOCALBASE=              /usr/pkg
VARBASE=                /var
PKG_TOOLS_BIN=          /usr/pkg/sbin
PKGINFODIR=             info
PKGMANDIR=              man

TOOLS_PLATFORM.install?=        /usr/pkg/bin/bsdinstall
TOOLS_PLATFORM.awk?=            /usr/pkg/bin/nawk
TOOLS_PLATFORM.sed?=            /usr/pkg/bin/nbsed
TOOLS_PLATFORM.sh?=             /usr/bin/bash

PKG_VERBOSE=yes

CFLAGS+=                -O3 -mcpu=ultrasparc3 -mtune=ultrasparc3
CXXFLAGS+=              -O3 -mcpu=ultrasparc3 -mtune=ultrasparc3
DBG=                    # prevent DBG from adding default optimizer flags

FETCH_USING=fetch # initially tnftp's sircular-dependency

X11_TYPE= modular
USE_INET6= no

PKG_OPTIONS.tnftp= -inet6
PKG_OPTIONS.xz= -nls
PKG_OPTIONS.cvs = -kerberos
PKG_OPTIONS.groff= -x11 -groff-docs
PKG_OPTIONS.gd+= -x11 -libimagequant -tiff
PKG_OPTIONS.libwebp+= -tiff
PKG_OPTIONS.openssh= -editline -fido
PKG_OPTIONS.apache= -http2 -brotli
PKG_OPTIONS.python37= -x11 -pymalloc
PKG_OPTIONS.curl= -idn -inet6 -http2 -gssapil -libssl2 -ldap -rtmp

USE_BUILTIN.cc= no

IS_BUILTIN.brotli= yes
USE_BUILTIN.brotli= yes

IS_BUILTIN.zlib= yes
USE_BUILTIN.zlib= no
PREFER.zlib= pkgsrc

USE_BUILTIN.bzip2= no
PREFER.bzip2= pkgsrc
USE_BZIP2= yes

ACCEPTABLE_LICENSES+=vim-license

# LOCALPATCHES= /usr/local/pkgsrcpatches

PKG_OPTIONS.glib2= -fam

.endif                  # end pkgsrc settings

----------------------------------------------

# make
=> Bootstrap dependency digest>=20211023: found digest-20220214
=> Bootstrap dependency fetch-[0-9]*: found fetch-1.9nb2
=> Checksum BLAKE2s OK for openssl-3.1.4.tar.gz
=> Checksum SHA512 OK for openssl-3.1.4.tar.gz
===> Installing dependencies for openssl-3.1.4
==========================================================================
The supported build options for openssl are:

        threads zlib

The currently selected options are:

        threads

You can select which build options to use by setting PKG_DEFAULT_OPTIONS
or the following variable.  Its current value is shown:

        PKG_OPTIONS.openssl (not defined)

==========================================================================
=> Tool dependency m4>=1.4: found m4-1.4.19nb1
=> Tool dependency nbpatch-[0-9]*: found nbpatch-20151107
=> Tool dependency perl>=5.0: found perl-5.38.0
=> Tool dependency cwrappers>=20150314: found cwrappers-20220403
===> Invoking ``all'' after barrier for openssl-3.1.4
===> Skipping vulnerability checks.
WARNING: No /usr/pkg/pkgdb/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities'.
===> Overriding tools for openssl-3.1.4
===> Extracting for openssl-3.1.4
===> Patching for openssl-3.1.4
=> Applying pkgsrc patches for openssl-3.1.4
=> Verifying /usr/pkgsrc/security/openssl/patches/patch-Configurations_unix-Makefile.tmpl
=> Applying pkgsrc patch /usr/pkgsrc/security/openssl/patches/patch-Configurations_unix-Makefile.tmpl
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-Configurations_unix-Makefile.tmpl,v 1.6 2023/10/27 18:30:12 jperkin Exp $
|
|Do not build or install HTML documentation.
|
|--- Configurations/unix-Makefile.tmpl.orig     2023-10-24 13:41:51.000000000 +0000
|+++ Configurations/unix-Makefile.tmpl
--------------------------
Patching file Configurations/unix-Makefile.tmpl using Plan A...
Hunk #1 succeeded at 502.
Hunk #2 succeeded at 611.
done
===> Creating toolchain wrappers for openssl-3.1.4
===> Configuring for openssl-3.1.4
NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI and you wish
        to build 64-bit library, do this:
        /usr/pkgsrc/security/openssl/work/openssl-3.1.4/Configure solaris64-sparcv9-gcc
You have about five seconds to abort: 
Configuring OpenSSL version 3.1.4 for target solaris64-sparcv9-cc
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
WARNING: *** Please consider adding c++ to USE_LANGUAGES in the package Makefile.
===> Building for openssl-3.1.4
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/bn_conf.h.in > include/crypto/bn_conf.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/crypto/dso_conf.h.in > include/crypto/dso_conf.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1.h.in > include/openssl/asn1.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1t.h.in > include/openssl/asn1t.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/bio.h.in > include/openssl/bio.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cmp.h.in > include/openssl/cmp.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cms.h.in > include/openssl/cms.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/conf.h.in > include/openssl/conf.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/crmf.h.in > include/openssl/crmf.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/crypto.h.in > include/openssl/crypto.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ct.h.in > include/openssl/ct.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/err.h.in > include/openssl/err.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ess.h.in > include/openssl/ess.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/fipskey.h.in > include/openssl/fipskey.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/lhash.h.in > include/openssl/lhash.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ocsp.h.in > include/openssl/ocsp.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/opensslv.h.in > include/openssl/opensslv.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/pkcs12.h.in > include/openssl/pkcs12.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/pkcs7.h.in > include/openssl/pkcs7.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/safestack.h.in > include/openssl/safestack.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/srp.h.in > include/openssl/srp.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ssl.h.in > include/openssl/ssl.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ui.h.in > include/openssl/ui.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509.h.in > include/openssl/x509.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509_vfy.h.in > include/openssl/x509_vfy.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509v3.h.in > include/openssl/x509v3.h
/usr/pkg/bin/perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" test/provider_internal_test.cnf.in > test/provider_internal_test.cnf
/usr/sfw/bin/gmake depend && /usr/sfw/bin/gmake _build_sw
gmake[1]: Entering directory `/usr/pkgsrc/security/openssl/work/openssl-3.1.4'
gmake[1]: Leaving directory `/usr/pkgsrc/security/openssl/work/openssl-3.1.4'
gmake[1]: Entering directory `/usr/pkgsrc/security/openssl/work/openssl-3.1.4'
cc  -I. -Iinclude -Iapps/include  -KPIC -m64 -xarch=sparc -xstrconst -Xa -O3 -mcpu=ultrasparc3 -mtune=ultrasparc3 -I/usr/include -DFILIO_H -DB_ENDIAN -DBN_DIV2W -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/pkg/etc/openssl\"" -DENGINESDIR="\"/usr/pkg/lib/engines-3\"" -DMODULESDIR="\"/usr/pkg/lib/ossl-modules\"" -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -I/usr/include -MMD -MF apps/lib/libapps-lib-app_libctx.d.tmp -MT apps/lib/libapps-lib-app_libctx.o -c -o apps/lib/libapps-lib-app_libctx.o apps/lib/app_libctx.c
gcc: error: unrecognized command line option '-Xa'
gmake[1]: *** [apps/lib/libapps-lib-app_libctx.o] Error 1
gmake[1]: Leaving directory `/usr/pkgsrc/security/openssl/work/openssl-3.1.4'
gmake: *** [build_sw] Error 2
*** Error code 2

Stop.
bmake[1]: stopped in /usr/pkgsrc/security/openssl
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/security/openssl



>How-To-Repeat:
# cd /usr/pkgsrc/security/openssl
# make
>Fix:
1. Make sure to configure solaris-sparcv8-gcc correctly (util/perl/OpenSSL/config.pm).
2. Apply -pthreads and -lrt patches (Configurations/unix-Makefile.tmpl).

CNF_CFLAGS=-m32 -mcpu=ultrasparc3 -pthreads
CNF_EX_LIBS=-lsocket -lnsl -ldl -pthreads -lrt

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Wed, 08 Nov 2023 07:36:28 +0000
Responsible-Changed-Why:
Solaris pkgsrc issue


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.