24 Mar, 2010

Error Installing PERL modules "unrecognized command line option -fstack -protector"

unrecognized command line option "-fstack-protector" error usually comes on Cygwin when installing PERL modules. For example when installing the DBI module or DBD::MySQL perl module, the following error comes on cygwin :

cp lib/DBI/Gofer/Serializer/Base.pm blib/lib/DBI/Gofer/Serializer/Base.pm
cp dbipport.h blib/arch/auto/DBI/dbipport.h
cp lib/DBI/Gofer/Execute.pm blib/lib/DBI/Gofer/Execute.pm
cp lib/DBI/DBD.pm blib/lib/DBI/DBD.pm
cp lib/Win32/DBIODBC.pm blib/lib/Win32/DBIODBC.pm
cp lib/DBI/PurePerl.pm blib/lib/DBI/PurePerl.pm
cp lib/DBD/ExampleP.pm blib/lib/DBD/ExampleP.pm
cp lib/DBI/ProfileData.pm blib/lib/DBI/ProfileData.pm
/usr/bin/perl.exe -p -e "s/~DRIVER~/Perl/g" ./Driver.xst > Perl.xsi
/usr/bin/perl.exe /usr/lib/perl5/5.10/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5
.10/ExtUtils/typemap -typemap typemap  Perl.xs > Perl.xsc && mv Perl.xsc Perl.c
gcc -c   -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -fs
tack-protector -I/usr/local/include -DUSEIMPORTLIB -O3   -DVERSION=\"1.609\" -DX
S_VERSION=\"1.609\"  "-I/usr/lib/perl5/5.10/i686-cygwin/CORE"  -W -Wall -Wpointe
r-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmiss
ing-noreturn -Wno-unused-parameter Perl.c
cc1: error: unrecognized command line option "-fstack-protector"
make: *** [Perl.o] Error 1
  TIMB/DBI-1.609.tar.gz
  /usr/bin/make -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible

This error is due to older version of GCC in your system. The stack protector was introduced as of GCC 4. Look the version in your system by running

gcc -v
.

Update your system if you are using cygwin run setup.exe and from the package list check GCC4, as shown below.
Cygwin install GCC4 solve unrecognized command line option -fstack-protector

(Search for GCC)

Now try reinstalling the PERL module, everything should be fine. :)


Comments (4) Post a comment
  • Thank you!

    Thank you! Ran into this issue when trying to install the DBI module, which is required by the git-p4raw project.

    Hopefully this keyword-stuffing will help others in my situation find this on Google :)

    By Tom on 31 May, 2010 Reply
    • Wonderful

      Great to know people find the post. I had a bad time searching for its solution. :)
      By digitalpbk on 01 Jun, 2010 Reply
  • Fixed the issue

    Thank you!

    By Ben on 20 Apr, 2010 Reply
  • Thanks for this

    Thanks very much for this solution. I did know that there was a version compliance problem, but I am pretty dumb to figure out how to exactly resolve the problem :)

    By Rajeev Sharma on 07 Apr, 2010 Reply
You may also like



Email Newsletter
Email:
Popular Posts
Recent Posts
Tags
Random photo
Rainbow appearence near Havelock Island Rainbow appearence near Havelock Island in Havelock Island Andaman
On Facebook
Recent Comments


digitalpbk