Bug 1585004 - ppc64le opensslconf.h is incompatible with swig
Summary: ppc64le opensslconf.h is incompatible with swig
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssl
Version: 7.5
Hardware: ppc64le
OS: Linux
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: Hubert Kario
Depends On: 1584994
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
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

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>
#include "opensslconf-ppc64.h"
#include "opensslconf-ppc64le.h"

*** <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
# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
# else
#  warning Cannot determine current byte order, assuming big-endian.
# 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):

How reproducible:

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.


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