Bug 1585004

Summary: ppc64le opensslconf.h is incompatible with swig
Product: Red Hat Enterprise Linux 7 Reporter: Yaakov Selkowitz <yselkowi>
Component: opensslAssignee: Tomas Mraz <tmraz>
Status: CLOSED ERRATA QA Contact: Hubert Kario <hkario>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: hkario, szidek, yselkowi
Target Milestone: rc   
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: openssl-1.0.2k-14.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1584994 Environment:
Last Closed: 2018-10-30 11:24:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1584994    
Bug Blocks:    
Attachments:
Description Flags
Patch for rhel-7.6 none

Description Yaakov Selkowitz 2018-06-01 06:39:33 UTC
The following also applies to RHEL; duplication steps vary slightly:

1. yum uninstall m2crypto
2. yum install openssl-devel python-devel
3. easy_install-2.7 pip
4. pip install M2Crypto

+++ This bug was initially created as a clone of Bug #1584994 +++

Description of problem:
The Fedora-specific multilib opensslconf.h relies on GCC predefined macros to separate between ppc64 BE and LE:

*** multilib <openssl/opensslconf.h> ***
#elif defined(__powerpc64__)
#include <endian.h>
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#include "opensslconf-ppc64.h"
#else
#include "opensslconf-ppc64le.h"
#endif

*** <bits/endian.h> ***
#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN
# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
#  error Both BIG_ENDIAN and LITTLE_ENDIAN defined!
# endif
# define __BYTE_ORDER __BIG_ENDIAN
#else
# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
#  define __BYTE_ORDER __LITTLE_ENDIAN
# else
#  warning Cannot determine current byte order, assuming big-endian.
#  define __BYTE_ORDER __BIG_ENDIAN
# endif
#endif

However, when swig is used, it defines neither __LITTLE_ENDIAN__ nor __BIG_ENDIAN__, and so incorrectly assumes BE.

This wrapper header is only needed on multilib systems to prevent conflicts between the 31/32-bit and 64-bit openssl-devel.  Since ppc64le is not actually a multilib arch, this wrapper technically should not be necessary and could be avoided in openssl.spec:

-%define multilib_arches %{ix86} ia64 %{mips} ppc %{power64} s390 s390x sparcv9 sparc64 x86_64
+%define multilib_arches %{ix86} ia64 %{mips} ppc ppc64 s390 s390x sparcv9 sparc64 x86_64


Version-Release number of selected component (if applicable):
openssl-1.0.2k-12.el7.ppc64le


How reproducible:
100%


Steps to Reproduce:
1. dnf install openssl-devel python2-devel
2. pip2 install M2Crypto


Actual results:
    swig -python -D__powerpc64__ -D_CALL_ELF=2 -I/usr/include/python2.7 -I/usr/include/openssl -I/usr/lib/gcc/ppc64le-redhat-linux/8/include -I/usr/local/include -I/usr/include -includeall -modern -builtin -outdir /tmp/pip-build-TWu1Rg/M2Crypto/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
    /usr/include/bits/endian.h:33: Warning 204: CPP #warning, "Cannot determine current byte order, assuming big-endian.".
    /usr/include/openssl/opensslconf.h:27: Error: Unable to find 'opensslconf-ppc64.h'
    error: command 'swig' failed with exit status 1


Expected results:
Build succeeds.

Comment 3 Yaakov Selkowitz 2018-06-05 22:25:19 UTC
Created attachment 1448023 [details]
Patch for rhel-7.6

Scratch build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=16609110

Comment 7 errata-xmlrpc 2018-10-30 11:24:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:3221