On Thu, Dec 08, 2005 at 10:22:14AM -0500, Eric Rybski wrote:
> All,
> 
>    I just tried to install DBI 1.49, and found that it is not loading
>    any of my compiler and linker flags from the perl configuration
>    (critical for 64-bit solaris, as there are specific gcc flags
>    required to enable 64-bit library building).  This is preventing
>    DBI from building correctly under 64-bit Solaris.  I have never had
>    a problem with any other DBI in the past, and just verified that I
>    can build DBI 1.48 again without any issues this morning.
> 
> Without digging into details, I see that Makefile.PL has changed some
> since the last release, including changes regarding compiler flags.
> It looks like this might create serious issues for anyone who has
> built perl with custom compiler & linker flags specific to their
> architecture and expects modules to be built the same way.
> 
> Does anyone have any idea of the scope of the changes and how I might
> resolve this issue for the short term (until a new release with the
> corrections is made available on CPAN)?  

See http://search.cpan.org/diff?from=DBI-1.48&to=DBI-1.49#Makefile.PL
(seems few people know that you can ask search.cpan.org to do diffs)

> Below is my perl5 Config summary.  Below that is a comparison of the make of 
> DBI 1.49 vs DBI 1.48.  

That's for the detailed report.

> ------------------------------------------------------------------------
> perl -V:
> ------------------------------------------------------------------------
>   Compiler:
>     cc='gcc', ccflags ='-D_REENTRANT -mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 
> -m64 -I/usr/local/include/v9 -fno-strict-aliasing -pipe -I/usr/local/include 
> -I/usr/local/BerkeleyDB64/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>     optimize='-O2',
>     cppflags='-D_REENTRANT -mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 -m64 
> -I/usr/local/include/v9 -fno-strict-aliasing -pipe -I/usr/local/include 
> -I/usr/local/BerkeleyDB64/include'
>   Linker and Libraries:
>     ld='gcc', ldflags =' -m64 -mcpu=v9 -m64 -L/usr/lib/sparcv9 
> -L/usr/local/lib/sparcv9 -L/usr/local/BerkeleyDB64/lib -L/usr/lib 
> -L/usr/local/lib -R/usr/lib/sparcv9 -R/usr/local/lib/sparcv9 
> -R/usr/local/BerkeleyDB64/lib '
>     libpth=/usr/lib/sparcv9 /usr/local/lib/sparcv9 /usr/local/BerkeleyDB64/lib
>     libs=-lsocket -lnsl -ldb -ldl -lm -lpthread -lc
>     perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
>     libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=true, libperl=libperl.so
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -R 
> /usr/local/lib/perl5/5.8.7/sun4-solaris-thread-multi-64/CORE'
>     cccdlflags='-fPIC', lddlflags=' -G -m64 -mcpu=v9 -m64 -L/usr/lib/sparcv9 
> -L/usr/local/lib/sparcv9 -L/usr/local/BerkeleyDB64/lib -L/usr/lib 
> -L/usr/local/lib -R/usr/lib/sparcv9 -R/usr/local/lib/sparcv9 
> -R/usr/local/BerkeleyDB64/lib'

> ------------------------------------------------------------------------
> DBI 1.49: perl Makefile.PL && make
> ------------------------------------------------------------------------
> /usr/bin/perl /usr/local/lib/perl5/5.8.7/ExtUtils/xsubpp  -typemap 
> /usr/local/lib/perl5/5.8.7/ExtUtils/typemap -typemap typemap  Perl.xs > 
> Perl.xsc && mv Perl.xsc Perl.c
> gcc -c    -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment 
> -Wno-sign-compare -Wno-cast-qual -Wdisabled-optimization -Wmissing-noreturn 
> -Wno-unused-parameter -O2    -DVERSION=\"1.49\"  -DXS_VERSION=\"1.49\" -fPIC 
> "-I/usr/local/lib/perl5/5.8.7/sun4-solaris-thread-multi-64/CORE"   Perl.c

> LD_RUN_PATH="" gcc  -G -m64 -mcpu=v9 -m64 -L/usr/lib/sparcv9 
> -L/usr/local/lib/sparcv9 -L/usr/local/BerkeleyDB64/lib -L/usr/lib 
> -L/usr/local/lib -R/usr/lib/sparcv9 -R/usr/local/lib/sparcv9 
> -R/usr/local/BerkeleyDB64/lib DBI.o  -o blib/arch/auto/DBI/DBI.so
> ld: fatal: file DBI.o: wrong ELF class: ELFCLASS32
> 
> ------------------------------------------------------------------------
> DBI 1.48: perl Makefile.PL && make
> ------------------------------------------------------------------------
> /usr/bin/perl /usr/local/lib/perl5/5.8.7/ExtUtils/xsubpp  -typemap 
> /usr/local/lib/perl5/5.8.7/ExtUtils/typemap -typemap typemap  Perl.xs > 
> Perl.xsc && mv Perl.xsc Perl.c
> gcc -c    -D_REENTRANT -mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 -m64 
> -I/usr/local/include/v9 -fno-strict-aliasing -pipe -I/usr/local/include 
> -I/usr/local/BerkeleyDB64/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
> -O2    -DVERSION=\"1.48\"  -DXS_VERSION=\"1.48\" -fPIC 
> "-I/usr/local/lib/perl5/5.8.7/sun4-solaris-thread-multi-64/CORE"  -Wall 
> -Wno-comment Perl.c

I see the same effect here, and it's fixed by commenting out the
"if (my $gccversion = ..." block. But all that block does is *append* strings
to $opts{CCFLAGS}. Odd.

Changing it to append to $opts{DEFINE} instead of $opts{CCFLAGS} fixes it
(though I don't know why off-hand).

I've appended a patch. Works for me. Please let me know asap if it fixes
the problem for you.

I'll make a new release soon as this is a serious problem for some
configurations (potentially generating a DBI that is subtly incompatible
with the perl binary).

Thanks again for the bug report.

Tim.

Index: Makefile.PL
===================================================================
--- Makefile.PL (revision 2286)
+++ Makefile.PL (working copy)
@@ -143,13 +143,13 @@
     warn "WARNING: Your GNU C $gccversion compiler is very old. Please upgrade 
it and rebuild perl.\n"
        if $gccversion =~ m/^\D*(1|2\.[1-8])/;
     $gccversion =~ s/[^\d\.]//g; # just a number please
-    $opts{CCFLAGS} .= ' -W -Wall -Wpointer-arith -Wbad-function-cast';
-    $opts{CCFLAGS} .= ' -Wno-comment -Wno-sign-compare -Wno-cast-qual';
-    $opts{CCFLAGS} .= ' -Wdisabled-optimization -Wmissing-noreturn 
-Wno-unused-parameter'
+    $opts{DEFINE} .= ' -W -Wall -Wpointer-arith -Wbad-function-cast';
+    $opts{DEFINE} .= ' -Wno-comment -Wno-sign-compare -Wno-cast-qual';
+    $opts{DEFINE} .= ' -Wdisabled-optimization -Wmissing-noreturn 
-Wno-unused-parameter'
         if $gccversion ge "3.0";
     if ($is_developer && $::opt_g) {
-        $opts{CCFLAGS} .= ' -DPERL_GCC_PEDANTIC -ansi -pedantic' if 
$gccversion ge "3.0";
-        $opts{CCFLAGS} .= ' -Wmissing-prototypes';
+        $opts{DEFINE} .= ' -DPERL_GCC_PEDANTIC -ansi -pedantic' if $gccversion 
ge "3.0";
+        $opts{DEFINE} .= ' -Wmissing-prototypes';
     }
 }
 

Reply via email to