Issue 77: Error during installation: "-fstack-protector", `ssp-buffer-size'
Status:  NoFix
Owner: ----
Closed:  Dec 2009
Reported by maxim.ch...@gmail.com, Nov 11, 2009
What steps will reproduce the problem?
1. Log on to CentOS release 5.2 (Final)
2. Extract 2.1.6 zip and run "python setup.py build"


What is the expected output? What do you see instead?

pyodbc probably should compile, instead I'm getting error:

gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-
D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 
-m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC -DPYODBC_MAJOR=2 -
DPYODBC_MINOR=1 -DPYODBC_MICRO=6 -DPYODBC_BUILD=0 -I/usr/include/python2.4 
-c /home/chernm/pyodbc-2.1.6/src/connection.cpp -o build/temp.linux-x86_64-
2.4/home/chernm/pyodbc-2.1.6/src/connection.o -Wno-write-strings
cc1plus: error: unrecognized command line option "-fstack-protector"
cc1plus: error: invalid parameter `ssp-buffer-size'
/home/chernm/pyodbc-2.1.6/src/connection.cpp:1: error: bad value (generic) 
for -mtune= switch
error: command 'gcc' failed with exit status 1


What version of the product are you using? On what operating system?
2.1.6, CentOS 5.2

Please provide any additional information below.


Nov 11, 2009
#1 maxim.ch...@gmail.com
Forgot to mention Python version:
Python 2.4.3 (#1, May 24 2008, 13:57:05)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2

Nov 11, 2009
Project Member #2 mkleehammer
What is happening is the Python distutils library, which is responsible for
generating the compilation command line is passing two values that GCC 4.1.2 doesn't
recognize:

  cc1plus: error: unrecognized command line option "-fstack-protector"
  cc1plus: error: invalid parameter `ssp-buffer-size'

If I am thinking about this correctly, I believe it means that Python was compiled
with these flags by CentOS, but the version of GCC provided does not recognize them.

It is also possible that Python's distutils generated incorrect flags and that Python
*wasn't* compiled that way.

The versions look correct.  Can you compile any Python C extensions?  I would expect
them all to fail the same way (since pyodbc isn't generating the command line). 
Also, try asking on the CentOS forums also.  Perhaps someone has seen this before.
Status: Investigating
Nov 11, 2009
#3 maxim.ch...@gmail.com
Thank you for prompt reply - you're right, other packages don't too. 

- python and gcc were not compiled but were installed with "yum install". I'll try to 
get the latest versions now.

I've doublechecked I have the latest gcc and python:

[root@hashed ~]# yum update python
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * base: mirror.rackspace.com
 * updates: pubmirrors.reflected.net
 * addons: mirrors.netdna.com
 * extras: www.muug.mb.ca
Setting up Update Process
Could not find update match for python
No Packages marked for Update
[root@hashed ~]# yum update gcc
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * base: mirror.rackspace.com
 * updates: pubmirrors.reflected.net
 * addons: mirrors.netdna.com
 * extras: mirrors.cmich.edu
Setting up Update Process
Could not find update match for gcc
No Packages marked for Update

Google gives no answers so far.

Thank you for help
Nov 11, 2009
#4 maxim.ch...@gmail.com
Got it working on clean Ubuntu 9.04 after installing unixodbc-dev, gcc and some 
development stuff.

Thank you, 

Will try a clean CentOS 5.3
Nov 14, 2009
#5 maxim.ch...@gmail.com
compiled it after uninstalling/reinstalling "gcc-c++" package. Thank you.
Dec 31, 2009
Project Member #6 mkleehammer
(No comment was entered for this change.)
Status: Invalid
Nov 21, 2010
Project Member #7 mkleehammer
(No comment was entered for this change.)
Status: NoFix