NetBSD Problem Report #38870

From martin@duskware.de  Thu Jun  5 14:30:47 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 2166863BA89
	for <gnats-bugs@gnats.netbsd.org>; Thu,  5 Jun 2008 14:30:47 +0000 (UTC)
Message-Id: <20080605142914.4F49363BA89@narn.NetBSD.org>
Date: Thu,  5 Jun 2008 14:29:14 +0000 (UTC)
From: srcshelton@gmail.com
Reply-To: srcshelton@gmail.com
To: netbsd-bugs-owner@NetBSD.org
Subject: openssl-0.9.8gnb1 fails to configure on IRIX if CFLAGS set
X-Send-Pr-Version: www-1.0

>Number:         38870
>Category:       pkg
>Synopsis:       openssl-0.9.8gnb1 fails to configure on IRIX if CFLAGS set
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    irix-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 05 14:35:00 +0000 2008
>Last-Modified:  Mon Jul 14 12:40:01 +0000 2008
>Originator:     Stuart Shelton
>Release:        pkgsrc latest from CVS
>Organization:
>Environment:
IRIX 6.5.30; MIPSpro Compilers: Version 7.4.4m
>Description:

Attempting to build the latest openssl results in:

netbsd@fuel ~/security/openssl # bmake clean && bmake test
===> su-do-clean [openssl-0.9.8gnb1] ===> Cleaning for openssl-0.9.8gnb1
=> Bootstrap dependency digest>=20010302: found digest-20080510
=> Bootstrap dependency tnftp-[0-9]*: found tnftp-20070806
===> _flavor-check-vulnerable [openssl-0.9.8gnb1] ===> Checking for vulnerabilities in openssl-0.9.8gnb1
=> Checksum SHA1 OK for openssl-0.9.8g.tar.gz
=> Checksum RMD160 OK for openssl-0.9.8g.tar.gz
===> depends-message [openssl-0.9.8gnb1] ===> Installing dependencies for openssl-0.9.8gnb1
==========================================================================
The supported build options for openssl are:

        idea mdc2 rc5

The currently selected options are:

        idea mdc2 rc5

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 = idea mdc2 rc5

==========================================================================
=> Build dependency gmake>=3.81: found gmake-3.81
=> Build dependency patch>=2.2: found patch-2.5.4nb2
===> tools-message [openssl-0.9.8gnb1] ===> Overriding tools for openssl-0.9.8gnb1
===> extract-message [openssl-0.9.8gnb1] ===> Extracting for openssl-0.9.8gnb1
===> patch-message [openssl-0.9.8gnb1] ===> Patching for openssl-0.9.8gnb1
=> Applying pkgsrc patches for openssl-0.9.8gnb1
===> wrapper-message [openssl-0.9.8gnb1] ===> Creating toolchain wrappers for openssl-0.9.8gnb1
===> configure-message [openssl-0.9.8gnb1] ===> Configuring for openssl-0.9.8gnb1
cd /usr/bsd/var/tmp/security/openssl/work/openssl-0.9.8g && /usr/bsd/bin/perl util/perlpath.pl /usr/bsd/bin/perl
Operating system: mips4-sgi-irix64
WARNING! If you wish to build 64-bit library, then you have to
         invoke './Configure irix64-mips4-cc' *manually*.
         You have about 5 seconds to press Ctrl-C to abort.
Configuring for irix-mips3-cc
target already defined - irix-mips3-cc (offending arg: 1174,1183,1185,1552,3970,3968)
*** Error code 255

Stop.
bmake: stopped in /usr/bsd/src/security/openssl
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/security/openssl

>How-To-Repeat:

My environment includes:

netbsd@fuel ~/security/openssl # env | grep FLAG
LDFLAGS=-Wl,-v,-s,-x,-n32,-mips4,-rdata_shared,-allow_jump_at_eop,-rpath,/usr/bsd/lib
CPPFLAGS=-I/usr/bsd/include -D__inline__=inline
CXXFLAGS=-O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -FE:eliminate_duplicate_inline_copies:template_in_elf_section
CFLAGS=-c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968
FFLAGS=-n32 -mip4 -r14000 -TARG:isa=mips4,platform=ip35,processor=r14000

... it appears that the Configure script for openssl picks up one or more of these and thinks that having FLAGS defined more than once is somehow an error.
>Fix:

If I invoke 'bmake clean && CFLAGS="" bmake test', then the build proceeds to:

cc -DMONOLITH -I.. -I../include  -DOPENSSL_THREADS -D_SGI_MP_SOURCE -DDSO_DLFCN -DHAVE_DLFCN_H -n32 -n32 -n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W -I/usr/bsd/include -D__inline__=inline  -c -o openssl.o openssl.c
rm -f openssl
shlib_target=; if [ -n "libcrypto.so.0.9.8 libssl.so.0.9.8" ]; then \
                shlib_target="irix-shared"; \
        fi; \
        LIBRARIES="-L.. -lssl  -L.. -lcrypto" ; \
        /usr/bsd/bin/gmake -f ../Makefile.shared -e \
                APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o spkac.o smime.o rand.o engine.o ocsp.o prime.o" \
                LIBDEPS=" $LIBRARIES -Wl,-v,-s,-x,-n32,-mips4,-rdata_shared,-allow_jump_at_eop,-rpath,/usr/bsd/lib -Wl,-rpath,/usr/bsd/lib " \
                link_app.${shlib_target}
gmake[2]: Entering directory `/usr/bsd/var/tmp/security/openssl/work/openssl-0.9.8g/apps'
ld32: ERROR   4  : Conflicting flag setting: -mips4
        -mips3 may conflict with -mips1
gmake[2]: *** [link_app.irix] Error 2
gmake[2]: Leaving directory `/usr/bsd/var/tmp/security/openssl/work/openssl-0.9.8g/apps'
gmake[1]: *** [openssl] Error 2
gmake[1]: Leaving directory `/usr/bsd/var/tmp/security/openssl/work/openssl-0.9.8g/apps'
gmake: *** [build_apps] Error 1
*** Error code 2

Stop.
bmake: stopped in /usr/bsd/src/security/openssl
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/security/openssl

... so despite my machines clearly being of mips4 ABI, openssl makes assumptions and breaks because it assumes mips3.

'CFLAGS="" LDFLAGS="${LDFLAGS/,-mips4,/,}" bmake test' does appear to work - but this should either be ensured in the pkgsrc Makefile or (better) any specified CFLAGS/LDFLAGS should actually be used rather than overridden.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->irix-pkg-people
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Sat, 07 Jun 2008 14:45:24 +0000
Responsible-Changed-Why:
Problem on IRIX.


From: "Stuart Shelton" <srcshelton@gmail.com>
To: gnats-bugs@netbsd.org
Cc: irix-pkg-people@netbsd.org, pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, 
	gnats-admin@netbsd.org, obache@netbsd.org
Subject: Re: pkg/38870 (openssl-0.9.8gnb1 fails to configure on IRIX if CFLAGS set)
Date: Mon, 14 Jul 2008 13:35:09 +0100

 Problem still exists in openssl-0.9.8h - although I've now found that
 CFLAGS don't have to be entirely unset, but that the "woff" option
 cannot be specified.  That's weird...

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.