This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC Problem, 32-bit vs. 64-bit?
- From: Andrew Haley <aph at redhat dot com>
- To: Amiri Barksdale <amiribarksdale at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 24 Nov 2007 14:44:16 +0000
- Subject: Re: GCC Problem, 32-bit vs. 64-bit?
- References: <F4EFD4C9-8DFA-4919-A2B2-3DD8EBE084E8@gmail.com>
Amiri Barksdale writes:
> I am a developer running CentOS 4 on a web server (no desktop), and am
> running into what I can only imagine must be a problem with 32 bit
> versus 64 bit code.
>
> I am trying to compile an unfortunately closed-source module from a
> company called Cybersource. The error message is the following:
>
> gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -
> Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -
> D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m64 -
> DVERSION=\"5.0.0\" -DXS_VERSION=\"5.0.0\" -fPIC "-I/usr/lib64/
> perl5/5.8.8/x86_64-linux-thread-multi/CORE" SOAPI.c
> In file included from SOAPI.xs:5:
> ppport.h:227:1: warning: "PERL_UNUSED_DECL" redefined
> In file included from SOAPI.xs:2:
> /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perl.h:163:1:
> warning: this is the location of the previous definition
> Running Mkbootstrap for CyberSource::SOAPI ()
> chmod 644 SOAPI.bs
> rm -f blib/arch/auto/CyberSource/SOAPI/SOAPI.so
> LD_RUN_PATH="/home/amiri/simapi-perl-5.0.0/lib" gcc -shared SOAPI.o -
> o blib/arch/auto/CyberSource/SOAPI/SOAPI.so \
> -L/home/amiri/simapi-perl-5.0.0/lib -lcybersource -lspapache -lstdc
> ++ -lxalan-c1_5_0 -lxerces-c \
>
> /usr/bin/ld: skipping incompatible /home/amiri/simapi-perl-5.0.0/lib/
> libcybersource.a when searching for -lcybersource
> /usr/bin/ld: cannot find -lcybersource
> collect2: ld returned 1 exit status
> make: *** [blib/arch/auto/CyberSource/SOAPI/SOAPI.so] Error 1
>
> I see quite clearly that it is skipping an incompatible binary. But I
> should be able to make it use the proper tool, no? I do not know how.
>
> I have tried aliasing gcc to gcc -m32; I have tried changing my
> Makefile so that LDFLAGS=-m32, and so that CC=gcc -m32, etc., but none
> of that worked.
>
> If I do use those -m32 flags, I get the following:
>
> cp lib/libcybersource.a blib/lib/libcybersource.a
> cp lib/libstdc++.so.4 blib/lib/libstdc++.so.4
> cp lib/libxerces-c.so blib/lib/libxerces-c.so
> cp lib/libspapache.so blib/lib/libspapache.so
> cp SOAPI.pm blib/lib/CyberSource/SOAPI.pm
> AutoSplitting blib/lib/CyberSource/SOAPI.pm (blib/lib/auto/CyberSource/
> SOAPI)
> cp lib/libxerces-c.so.21 blib/lib/libxerces-c.so.21
> cp lib/libxalan-c1_5_0.so blib/lib/libxalan-c1_5_0.so
> /usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/
> perl5/5.8.8/ExtUtils/typemap -typemap typemap SOAPI.xs > SOAPI.xsc &&
> mv SOAPI.xsc SOAPI.c
> Please specify prototyping behavior for SOAPI.xs (see perlxs manual)
> /usr/bin/gcc -m32 -c -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-
> aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -
> D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -
> pipe -m64 -DVERSION=\"5.0.0\" -DXS_VERSION=\"5.0.0\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" SOAPI.c
This wrong: if you're using -m32, you can't also use -m64. You should
be including /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE instead
of /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/.
Andrew.
--
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903