PyCrypto 2.3 build fails on Solaris 10

Bug #716417 reported by Wesley Schwengle
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Python-Crypto
Confirmed
Undecided
Unassigned

Bug Description

The build fails at the following point:

gcc -pthread -L/opt/csw/lib -R/opt/csw/lib -I/opt/csw/include/bdb47 -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/opt/csw/include/python2.6 -c src/SHA256.c -o build/temp.solaris-2.10-i86pc-2.6/src/SHA256.o
In file included from /usr/include/limits.h:18:0,
                 from /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.10/4.5.1/include-fixed/limits.h:169,
                 from /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.10/4.5.1/include-fixed/syslimits.h:7,
                 from /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.10/4.5.1/include-fixed/limits.h:34,
                 from /opt/csw/include/python2.6/Python.h:19,
                 from src/SHA256.c:34:
/opt/csw/gcc4/lib/gcc/i386-pc-solaris2.10/4.5.1/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
error: command 'gcc' failed with exit status 1

When running
gcc -pthread -L/opt/csw/lib -R/opt/csw/lib -I/opt/csw/include/bdb47 -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -O3 -fomit-frame-pointer -Isrc/ -I/opt/csw/include/python2.6 -c src/SHA256.c -o build/temp.solaris-2.10-i86pc-2.6/src/SHA256.o
you don't get the error.

I removed the __add_compiler_option bit from setup.py:

   122 # Tweak compiler options
   123 if self.compiler.compiler_type in ('unix', 'cygwin', 'mingw32'):
   124 # Tell GCC to compile using the C99 standard.
   125 self.__add_compiler_option("-std=c99")

adn then the build succeeds.

I got the hint from:
http://rt.openssl.org/Ticket/Display.html?id=1027

Tags: solaris10
Changed in pycrypto:
status: New → Triaged
Revision history for this message
Darsey Litzenberger (dlitz) wrote :

Is this still an issue with the latest PyCrypto from the git repository?

    https://github.com/dlitz/pycrypto.git

Patches are welcome if they're well-designed and they don't remove this option on systems where it works, but I wonder if you're doing something wrong. This error is saying "I don't support C99". C99 is a 12-year-old standard. I have trouble believing that you can't find a C compiler that will compile C99 code on a modern Unix system...

A quick Google search for 'Solaris 10 C99' gives me this:

    https://forums.oracle.com/forums/thread.jspa?threadID=2019293

and this:

    http://bugs.python.org/issue1759169

Anyway, I'm pretty sure one of the OpenCSW guys got PyCrypto working on Solaris 10 recently, but maybe he removed this option without mentioning it. See https://bugs.launchpad.net/pycrypto/+bug/518871

Revision history for this message
Darsey Litzenberger (dlitz) wrote :

Closing this bug pending more information.

Changed in pycrypto:
status: Triaged → Incomplete
Hari (haridara)
Changed in pycrypto:
status: Incomplete → Confirmed
Revision history for this message
Hari (haridara) wrote :

I can confirm that this is still an issue with the latest git repo.

I installed the Solaris 10 VM from Oracle here:

http://www.oracle.com/technetwork/cn/server-storage/solaris10/solaris-vm-405695-zhs.html

The page is in chinese, but the VM is still in English. Use google translate to know the right options to click.

I then installed solaris studio 12.4 from here:

http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.html?ssSourceSiteId=ocomen

I installed python2.6 from OpenCSW:

https://www.opencsw.org/packages/CSWpython

Added a soft link from /opt/solarisstudio12.3 to /opt/solarisstudio12.4, as OpenCSW packages are built with 12.3 and so the above Python2.6 is hardcoded to look for it under /opt/solarisstudio12.3

I finally used the above python to build pycrypto and got this error.

Revision history for this message
Hari (haridara) wrote :

I got the compilation to go through by changing buildenv file to add -D_XPG6 like this:

CC = cc -std=c99 -D_XPG6

Frankly, I don't know what that flag means, but I just thought of adding it bypass the check in /usr/include/sys/feature_tests.h where it triggers this error. I hope this information is useful to figure out a proper fix.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.