Issue 84583

Summary: openssl: lost definition of GCCVER
Product: Build Tools Reporter: sparcmoz <sparcmoz>
Component: external prerequisitesAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: hanya.runo, issues
Version: 4.0.0-dev   
Target Milestone: ---   
Hardware: All   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
restore GCCVER none

Description sparcmoz 2007-12-14 21:34:31 UTC
GNU Linux/SPARC m239

ccache gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENT
cc1: error: unrecognized command line option "-mv8"

jim@sun:~/vanilla/openssl$ gcc --version
gcc (GCC) 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)
Copyright (C) 2007 Free Software Foundation, Inc.

See http://www.gnu.org/software/gcc/gcc-4.0/changes.html
"The options -mv8, -msparclite, -mcypress, -msupersparc, -mf930 and -mf934 have
been removed. They have been replaced with -mcpu=xxx."

This is caused by CFLAG in openssl/unxlngs.pro/misc/build/openssl-0.9.8eMakefile
Comment 1 sparcmoz 2007-12-14 22:11:15 UTC
The full command line:
ccache gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS
-D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -I/usr/include -mv8 -DB_ENDIAN -DTERMIO
-O3 -fomit-frame-pointer -Wall -DBN_DIV2W   -c -o cryptlib.o cryptlib.c

Note: on debian the default (remove the -mv8) will output SPARC32PLUS libraries
but we need SPARC. Using -mcpu=v8 also outputs the wrong libs. More
investigation needed...

Another but possibly related issue is there are many of these messages for example:
ssl_cert.c: In function 'ssl_cert_dup':
ssl_cert.c:215: warning: function called through a non-compatible type
ssl_cert.c:215: note: if this code is reached, the program will abort

Comment 2 sparcmoz 2007-12-14 22:15:08 UTC
It appears the debian gcc wrapper now defaults to SPARC32PLUS. I need wait until
the complete build is finished - a few days - to see if all modules are the same.
Comment 3 sparcmoz 2008-08-03 10:48:28 UTC
The openssllnx.patch breaks the build on GNU/Linux SPARC.
The problem is the patch to the config file.
The purpose of the original patch was to prevent environment CC being redefined.
But the patch also stops definition of GCCVER
As a result various platforms fallback to options for a compiler earlier than 2.8

I noticed this on GNU/Linux SPARC because the fallback options are invalid on my
system.

The proposed patch achieves the original intention that the build environment CC
is preserved, while the openssl environment GCCVER is also preserved.

As this affects all GCC platforms, changing component and summary.

I cannot get a useful output from dmake create_patch at the moment so the
attached patch is hand-made. The following shows the changes:

--- config.orig	2008-08-03 18:26:44.000000000 +1000
+++ config.new	2008-08-03 18:23:31.000000000 +1000
@@ -401,10 +401,9 @@
 
 # figure out if gcc is available and if so we use it otherwise
 # we fallback to whatever cc does on the system
-if [ -z "$CC" ];then
-  GCCVER=`(gcc -dumpversion) 2>/dev/null`
+
+  GCCVER=`($CC -dumpversion) 2>/dev/null`
   if [ "$GCCVER" != "" ]; then
-    CC=gcc
     # then strip off whatever prefix egcs prepends the number with...
     # Hopefully, this will work for any future prefixes as well.
     GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
@@ -413,9 +412,6 @@
     # major and minor version numbers.
     # peak single digit before and after first dot, e.g. 2.95.1 gives 29
     GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
-  else
-    CC=cc
-  fi
 fi
 GCCVER=${GCCVER:-0}
 if [ "$SYSTEM" = "HP-UX" ];then

Comment 4 sparcmoz 2008-08-03 10:50:25 UTC
Created attachment 55512 [details]
restore GCCVER
Comment 5 sparcmoz 2008-08-03 11:41:29 UTC
start issue
Comment 6 hanya 2012-06-29 19:29:08 UTC
It looks this problem has been fixed in openssllnx.patch of AOO 3.4.0