Bug 1584994 - ppc64le opensslconf.h is incompatible with swig
Summary: ppc64le opensslconf.h is incompatible with swig
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: openssl
Version: rawhide
Hardware: ppc64le
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1585004 1585009
TreeView+ depends on / blocked
 
Reported: 2018-06-01 06:20 UTC by Yaakov Selkowitz
Modified: 2018-06-19 14:02 UTC (History)
2 users (show)

Fixed In Version: openssl-1.1.0h-4.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1585004 1585009 (view as bug list)
Environment:
Last Closed: 2018-06-19 14:02:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Yaakov Selkowitz 2018-06-01 06:20:38 UTC
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.


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