Re: Gcc Vs CC

Michael Peppler <[email protected]> Mon, 6 Oct 2008 20:18:31 +0200
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
--Apple-Mail-36-196776269
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: 7bit

Hi Cory,

The problem is that perl stores the parameter that should be passed to  
the compiler when the interpreter is built/configured. So if your perl  
binary was built with Sun's cc compiler it will use that information  
to build any C language extension.

The standard answer to this question is to say: "use the same compiler  
as the one used to build your binary".
However, if you feel just a little bit adventurous (and if you are  
reasonably familiar with gcc) you could edit the DBD::Sybase Makefile  
before running make to adjust the various macros that are used  
(CFLAGS, etc) so that gcc (and the appropriate gcc compiler flags) is  
used.

Michael


On Oct 6, 2008, at 4:58 PM, [email protected] wrote:

>
> Michael & crew,
>
> I have the following:
> Solaris 10(sparc)
> Active State Perl 5.10
> gcc (GCC) 3.4.6
>
>
> After running " perl Makefile.PL",
> When I run "make", it thinks I want to run "cc" instead of GCC?
> I have already used the following env setting:
> ACTIVEPERL_CONFIG_CC=/usr/local/bin/gcc
>
> How can I override parameter setting passed to GCC?  I have done  
> research over the weekend and with your archive that shows I'm  
> passing CC parameters to GCC that do not work.
>
>  make
> cp dbd-sybase.pod blib/lib/DBD/dbd-sybase.pod
> cp Sybase.pm blib/lib/DBD/Sybase.pm
> /apps/ActivePerl-5.10/bin/perl -p -e "s/~DRIVER~/Sybase/g" /apps/ 
> ActivePerl-5.10/lib/auto/DBI/Driver.xst > Sybase.xsi
> /apps/ActivePerl-5.10/bin/perl /apps/ActivePerl-5.10/lib/ExtUtils/ 
> xsubpp  -typemap /apps/ActivePerl-5.10/lib/ExtUtils/typemap   
> Sybase.xs > Sybase.xsc && mv Sybase.xsc Sybase.c
> /usr/local/bin/gcc -c  -I/apps/sybase/ASE-12_5/OCS-12_5/include - 
> DSYB_LP64 -I/apps/ActivePerl-5.10/lib/auto/DBI -D_REENTRANT - 
> xarch=v9 -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC - 
> D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -pipe  
> -O   -DVERSION=\"1.09\" -DXS_VERSION=\"1.09\" -fPIC "-I/apps/ 
> ActivePerl-5.10/lib/CORE"   Sybase.c
> gcc: language arch=v9 not recognized
> gcc: Sybase.c: linker input file unused because linking not done
> /usr/local/bin/gcc -c  -I/apps/sybase/ASE-12_5/OCS-12_5/include - 
> DSYB_LP64 -I/apps/ActivePerl-5.10/lib/auto/DBI -D_REENTRANT - 
> xarch=v9 -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC - 
> D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -pipe  
> -O   -DVERSION=\"1.09\" -DXS_VERSION=\"1.09\" -fPIC "-I/apps/ 
> ActivePerl-5.10/lib/CORE"   dbdimp.c
> gcc: language arch=v9 not recognized
> gcc: dbdimp.c: linker input file unused because linking not done
> Running Mkbootstrap for DBD::Sybase ()
> chmod 644 Sybase.bs
> rm -f blib/arch/auto/DBD/Sybase/Sybase.so
> LD_RUN_PATH="/apps/sybase/ASE-12_5/OCS-12_5/lib" gcc  -L/apps/sybase/ 
> ASE-12_5/OCS-12_5/lib  -G -xarch=v9 -L/opt/SUNWspro/prod/lib/v9 -L/ 
> usr/lib/sparcv9 -L/usr/ccs/lib/sparcv9 Sybase.o dbdimp.o  -o blib/ 
> arch/auto/DBD/Sybase/Sybase.so        \
>    -L/apps/sybase/ASE-12_5/OCS-12_5/lib -lct64 -lcs64 -ltcl64 - 
> lcomn64 -lintl64 -lblk64 -ldl -lm        \
>
> gcc: Sybase.o: No such file or directory
> gcc: dbdimp.o: No such file or directory
> make: *** [blib/arch/auto/DBD/Sybase/Sybase.so] Error 1
>
> Cory Sane
> 704 374 4499
> InfoStrat Team
> Database Technical Specialist-AVP
> Member of www.TeamSybase.com
> Certified Sybase Associate DBA for ASE 15.0

Michael Peppler              -                    Peppler Consulting  
SaRL
[email protected]         -                     http://www.peppler.org
Sybase DBA/Developer         -      TeamSybase: http://www.teamsybase.com
Sybase on Linux FAQ          -      http://www.peppler.org/FAQ/linux.html




--Apple-Mail-36-196776269
Content-Type: text/html;
	charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">Hi Cory,<div><br></div><div>The =
problem is that perl stores the parameter that should be passed to the =
compiler when the interpreter is built/configured. So if your perl =
binary was built with Sun's cc compiler it will use that information to =
build any C language extension.</div><div><br></div><div>The standard =
answer to this question is to say: "use the same compiler as the one =
used to build your binary".</div><div>However, if you feel just a little =
bit adventurous (and if you are reasonably familiar with gcc) you could =
edit the DBD::Sybase Makefile before running make to adjust the various =
macros that are used (CFLAGS, etc) so that gcc (and the appropriate gcc =
compiler flags) is =
used.</div><div><br></div><div>Michael</div><div><br></div><div><br><div><=
div>On Oct 6, 2008, at 4:58 PM, <a =
href=3D"mailto:[email protected]">CSane@EvergreenInvestments.=
com</a> wrote:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><br><font size=3D"2" face=3D"sans-serif">Michael &amp; =
crew,</font> <br> <br><font size=3D"2" face=3D"sans-serif">I have the =
following:</font> <br><font size=3D"2" face=3D"sans-serif">Solaris =
10(sparc)</font> <br><font size=3D"2" face=3D"sans-serif">Active State =
Perl 5.10</font> <br><font size=3D"2" face=3D"sans-serif">gcc (GCC) =
3.4.6</font> <br> <br> <br><font size=3D"2" face=3D"sans-serif">After =
running " perl Makefile.PL",</font> <br><font size=3D"2" =
face=3D"sans-serif">When I run "make", it thinks I want to run "cc" =
instead of GCC?</font> <br><font size=3D"2" face=3D"sans-serif">I have =
already used the following env setting:</font> <br><font size=3D"2" =
face=3D"sans-serif">ACTIVEPERL_CONFIG_CC=3D/usr/local/bin/gcc</font> =
<br> <br><font size=3D"2" face=3D"sans-serif">How can I override =
parameter setting passed to GCC? &nbsp;I have done research over the =
weekend and with your archive that shows I'm passing CC parameters to =
GCC that do not work.</font> <br> <br><font size=3D"2" =
face=3D"sans-serif">&nbsp;make</font> <br><font size=3D"2" =
face=3D"sans-serif">cp dbd-sybase.pod blib/lib/DBD/dbd-sybase.pod</font> =
<br><font size=3D"2" face=3D"sans-serif">cp Sybase.pm =
blib/lib/DBD/Sybase.pm</font> <br><font size=3D"2" =
face=3D"sans-serif">/apps/ActivePerl-5.10/bin/perl -p -e =
"s/~DRIVER~/Sybase/g" /apps/ActivePerl-5.10/lib/auto/DBI/Driver.xst > =
Sybase.xsi</font> <br><font size=3D"2" =
face=3D"sans-serif">/apps/ActivePerl-5.10/bin/perl =
/apps/ActivePerl-5.10/lib/ExtUtils/xsubpp &nbsp;-typemap =
/apps/ActivePerl-5.10/lib/ExtUtils/typemap &nbsp;Sybase.xs > Sybase.xsc =
&amp;&amp; mv Sybase.xsc Sybase.c</font> <br><font size=3D"2" =
face=3D"sans-serif">/usr/local/bin/gcc -c =
&nbsp;-I/apps/sybase/ASE-12_5/OCS-12_5/include -DSYB_LP64 =
-I/apps/ActivePerl-5.10/lib/auto/DBI -D_REENTRANT -xarch=3Dv9 =
-DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -D_LARGEFILE_SOURCE =
-D_FILE_OFFSET_BITS=3D64 -fno-strict-aliasing -pipe -O &nbsp; =
-DVERSION=3D\"1.09\" -DXS_VERSION=3D\"1.09\" -fPIC =
"-I/apps/ActivePerl-5.10/lib/CORE" &nbsp; Sybase.c</font> <br><font =
size=3D"2" face=3D"sans-serif">gcc: language arch=3Dv9 not =
recognized</font> <br><font size=3D"2" face=3D"sans-serif">gcc: =
Sybase.c: linker input file unused because linking not done</font> =
<br><font size=3D"2" face=3D"sans-serif">/usr/local/bin/gcc -c =
&nbsp;-I/apps/sybase/ASE-12_5/OCS-12_5/include -DSYB_LP64 =
-I/apps/ActivePerl-5.10/lib/auto/DBI -D_REENTRANT -xarch=3Dv9 =
-DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -D_LARGEFILE_SOURCE =
-D_FILE_OFFSET_BITS=3D64 -fno-strict-aliasing -pipe -O &nbsp; =
-DVERSION=3D\"1.09\" -DXS_VERSION=3D\"1.09\" -fPIC =
"-I/apps/ActivePerl-5.10/lib/CORE" &nbsp; dbdimp.c</font> <br><font =
size=3D"2" face=3D"sans-serif">gcc: language arch=3Dv9 not =
recognized</font> <br><font size=3D"2" face=3D"sans-serif">gcc: =
dbdimp.c: linker input file unused because linking not done</font> =
<br><font size=3D"2" face=3D"sans-serif">Running Mkbootstrap for =
DBD::Sybase ()</font> <br><font size=3D"2" face=3D"sans-serif">chmod 644 =
Sybase.bs</font> <br><font size=3D"2" face=3D"sans-serif">rm -f =
blib/arch/auto/DBD/Sybase/Sybase.so</font> <br><font size=3D"2" =
face=3D"sans-serif">LD_RUN_PATH=3D"/apps/sybase/ASE-12_5/OCS-12_5/lib" =
gcc &nbsp;-L/apps/sybase/ASE-12_5/OCS-12_5/lib &nbsp;-G -xarch=3Dv9 =
-L/opt/SUNWspro/prod/lib/v9 -L/usr/lib/sparcv9 -L/usr/ccs/lib/sparcv9 =
Sybase.o dbdimp.o &nbsp;-o blib/arch/auto/DBD/Sybase/Sybase.so &nbsp; =
&nbsp; &nbsp; &nbsp;\</font> <br><font size=3D"2" =
face=3D"sans-serif">&nbsp; &nbsp;-L/apps/sybase/ASE-12_5/OCS-12_5/lib =
-lct64 -lcs64 -ltcl64 -lcomn64 -lintl64 -lblk64 -ldl -lm &nbsp; &nbsp; =
&nbsp; &nbsp;\</font> <br><font size=3D"2" face=3D"sans-serif">&nbsp; =
</font> <br><font size=3D"2" face=3D"sans-serif">gcc: Sybase.o: No such =
file or directory</font> <br><font size=3D"2" face=3D"sans-serif">gcc: =
dbdimp.o: No such file or directory</font> <br><font size=3D"2" =
face=3D"sans-serif">make: *** [blib/arch/auto/DBD/Sybase/Sybase.so] =
Error 1</font> <br><font size=3D"2" face=3D"sans-serif"><br> Cory =
Sane<br> 704 374 4499<br> InfoStrat Team<br> Database Technical =
Specialist-AVP<br> Member of <a =
href=3D"http://www.TeamSybase.com">www.TeamSybase.com</a><br> Certified =
Sybase Associate DBA for ASE 15.0</font> </blockquote></div><br><div =
apple-content-edited=3D"true"> <span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; =
white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: =
0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div><div>Michael Peppler &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;Peppler Consulting =
SaRL</div><div>[email protected] &nbsp; &nbsp; &nbsp; &nbsp; - &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a =
href=3D"http://www.peppler.org">http://www.peppler.org</a></div><div>Sybas=
e DBA/Developer &nbsp; &nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; =
&nbsp;TeamSybase: <a =
href=3D"http://www.teamsybase.com">http://www.teamsybase.com</a></div><div=
>Sybase on Linux FAQ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; =
&nbsp;<a =
href=3D"http://www.peppler.org/FAQ/linux.html">http://www.peppler.org/FAQ/=
linux.html</a></div><div><br></div></div></div></span><br =
class=3D"Apple-interchange-newline"> </div><br></div></body></html>=

--Apple-Mail-36-196776269--