Bug 1585004 - ppc64le opensslconf.h is incompatible with swig
Summary: ppc64le opensslconf.h is incompatible with swig
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssl
Version: 7.5
Hardware: ppc64le
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: Hubert Kario
URL:
Whiteboard:
Depends On: 1584994
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-01 06:39 UTC by Yaakov Selkowitz
Modified: 2018-10-30 11:25 UTC (History)
3 users (show)

Fixed In Version: openssl-1.0.2k-14.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1584994
Environment:
Last Closed: 2018-10-30 11:24:02 UTC
Target Upstream Version:


Attachments (Terms of Use)
Patch for rhel-7.6 (1.50 KB, patch)
2018-06-05 22:25 UTC, Yaakov Selkowitz
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3221 None None None 2018-10-30 11:25:57 UTC

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


Note You need to log in before you can comment on or make changes to this bug.