Solaris 10 x86 64 bit link problem

  • Permalink
  • submit to reddit
  • Email
  • Follow


This is a multi-part message in MIME format.
--------------050404020004040600000608
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I posted a query about this some time back and now I've been reminded it 
  never got resolved.  Google just finds my original query here and 
SunSolve is comatose yet again.

I can link w/ -m32 from a library, but not w/ -m64.  The latter results 
in failures to find the library members.

This is Solaris 10 U6 x86 w/ Studio 12 on an Ultra 20.  Does anyone have 
any suggestions?  I searched SunSolve when I ran into this the first 
time, but can't recall what I did after that.

Thanks,
Reg

Here's a console log and example code to demonstrate the problem:

==> console.log <==

sun_x86%rhb {156} make clean
rm -f *.o *.a tst_a tst_b
sun_x86%rhb {157} make CFLAGS=-m32
cc -m32   -c -o foo.o foo.c
cc -m32   -c -o bar.o bar.c
cc -m32 -o tst_a tst.c foo.o bar.o
ar crv libfoo.a foo.o bar.o
a - foo.o
a - bar.o
ranlib libfoo.a
cc -m32 -o tst_b tst.c libfoo.a
sun_x86%rhb {158} make clean
rm -f *.o *.a tst_a tst_b
sun_x86%rhb {159} make CFLAGS=-m64
cc -m64   -c -o foo.o foo.c
cc -m64   -c -o bar.o bar.c
cc -m64 -o tst_a tst.c foo.o bar.o
ar crv libfoo.a foo.o bar.o
a - foo.o
a - bar.o
ranlib libfoo.a
cc -m64 -o tst_b tst.c libfoo.a
Undefined                       first referenced
  symbol                             in file
foo                                 tst.o
ld: fatal: Symbol referencing errors. No output written to tst_b
make: *** [tst_b] Error 1
sun_x86%rhb {160} uname -a
SunOS u20 5.10 Generic_137112-02 i86pc i386 i86pc
sun_x86%rhb {161} isainfo -kv
64-bit amd64 kernel modules
sun_x86%rhb {162} cc -V
cc: Sun C 5.9 SunOS_i386 Patch 124868-05 2008/05/13
usage: cc [ options] files.  Use 'cc -flags' for details
sun_x86%rhb {163} ld -V
ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.489


==> Makefile <==

all: tst_a tst_b

libfoo.a : foo.o bar.o
         ar crv libfoo.a foo.o bar.o
         ranlib libfoo.a

tst_a : tst.c foo.o bar.o
         $(CC) $(CFLAGS) -o tst_a tst.c foo.o bar.o

tst_b : tst.o libfoo.a
         $(CC) $(CFLAGS) -o tst_b tst.c libfoo.a

clean:
         rm -f *.o *.a tst_a tst_b

==> bar.c <==

#include <stdio.h>

void bar(){

    printf( "bar\n" );

}

==> foo.c <==


void foo( int n, float* a ){

    int i;

    for( i=0; i<n; i++ ){

       a[i] *= a[i];
    }
}

==> tst.c <==

#include <stdio.h>

void foo( int n ,float* a );
void bar( void );

int main(){

    int i;
    int n = 256;

    float a[256];

    for( i=0; i<n; i++ ){
       a[i] = i;
    }

    printf( "%f \n" ,a[64] );

    foo( n ,a );

    printf( "%f \n" ,a[64] );

    bar();

}

--------------050404020004040600000608
Content-Type: text/plain;
 name="txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="txt"

==> console.log <==

sun_x86%rhb {156} make clean
rm -f *.o *.a tst_a tst_b
sun_x86%rhb {157} make CFLAGS=-m32
cc -m32   -c -o foo.o foo.c
cc -m32   -c -o bar.o bar.c
cc -m32 -o tst_a tst.c foo.o bar.o
ar crv libfoo.a foo.o bar.o
a - foo.o
a - bar.o
ranlib libfoo.a
cc -m32 -o tst_b tst.c libfoo.a
sun_x86%rhb {158} make clean
rm -f *.o *.a tst_a tst_b
sun_x86%rhb {159} make CFLAGS=-m64
cc -m64   -c -o foo.o foo.c
cc -m64   -c -o bar.o bar.c
cc -m64 -o tst_a tst.c foo.o bar.o
ar crv libfoo.a foo.o bar.o
a - foo.o
a - bar.o
ranlib libfoo.a
cc -m64 -o tst_b tst.c libfoo.a
Undefined                       first referenced
 symbol                             in file
foo                                 tst.o
ld: fatal: Symbol referencing errors. No output written to tst_b
make: *** [tst_b] Error 1
sun_x86%rhb {160} uname -a
SunOS u20 5.10 Generic_137112-02 i86pc i386 i86pc
sun_x86%rhb {161} isainfo -kv
64-bit amd64 kernel modules
sun_x86%rhb {162} cc -V
cc: Sun C 5.9 SunOS_i386 Patch 124868-05 2008/05/13
usage: cc [ options] files.  Use 'cc -flags' for details



==> Makefile <==

all: tst_a tst_b

libfoo.a : foo.o bar.o
	ar crv libfoo.a foo.o bar.o
	ranlib libfoo.a

tst_a : tst.c foo.o bar.o
	$(CC) $(CFLAGS) -o tst_a tst.c foo.o bar.o

tst_b : tst.o libfoo.a
	$(CC) $(CFLAGS) -o tst_b tst.c libfoo.a

clean:
	rm -f *.o *.a tst_a tst_b

==> bar.c <==

#include <stdio.h>

void bar(){

   printf( "bar\n" );

}

==> foo.c <==


void foo( int n, float* a ){

   int i;

   for( i=0; i<n; i++ ){

      a[i] *= a[i];
   }
}

==> tst.c <==

#include <stdio.h>

void foo( int n ,float* a );
void bar( void );

int main(){

   int i;
   int n = 256;

   float a[256];

   for( i=0; i<n; i++ ){
      a[i] = i;
   }

   printf( "%f \n" ,a[64] );

   foo( n ,a );

   printf( "%f \n" ,a[64] );

   bar();

}

--------------050404020004040600000608--
0
Reply Reginald 5/20/2009 9:52:28 PM

See related articles to this posting
comp.unix.solaris 25698 articles. 86 followers. Post

0 Replies
99 Views

Similar Articles

[PageSpeed] 55

Reply:

Similar Artilces:

64 bits solaris 64bits oracle linking problem
Can any one shed light on why am I getting following error message during linking. all executable in /usr/ccs/bin including as are 32 bits. Is this the cause of the problem ? The os is 64 bits (see below) isainfo -kv 64-bit sparcv9 kernel modules usr/ccs/bin/make -f ins_net_client.mk ntcontab.o ORACLE_HOME=/u01/app/oracle/product/9.2.0.1 (if [ "assemble" = "compile" ] ; then \ /u01/app/oracle/product/9.2.0.1/bin/gennttab > ntcontab.c ;\ cc -c ntcontab.c ;\ rm -f /u01/app/oracle/product/9.2.0.1/lib/ntcontab.o ;\ mv ntcontab.o /u01/app/oracle/product/9.2.0...

[ace-bugs] linking problem on Solaris (64 bit)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, can you help me with problem on linking libACE on Solaris (64 bits) Thank Vitezslav Kosina ACE VERSION: 5.4.1 HOST MACHINE and OPERATING SYSTEM: SunOS pressts1 5.9 Generic_112233-06 sun4u sparc SUNW,Ultra-250 TARGET MACHINE and OPERATING SYSTEM, if different from HOST: COMPILER NAME AND VERSION (AND PATCHLEVEL): cc: Sun C 5.5 Patch 112760-12 2004/07/20 CC: Sun C++ 5.5 Patch 113817-08 2004/04/13 CONTENTS OF $ACE_ROOT/ace/config.h [if you use a link to a platform- specific file, simply state which one]: #inclu...

Known 64 bit problem with Kerberos in Solaris 10 (u5)?
Tried to compile a *very* simple test program that uses Solaris Kerberos library to authenticate a user, but for some reason it always coredumps on my when compiled as a 64 bit binary. Works perfect as a 32 bit binary though... Anyone know if this is a known problem (ie: should I bother fighting Sun support for this issue or not? :-) - Peter dbx traceback: Misaligned read (mar): Attempting to read 8 bytes at address 0xffffffff7fffbe9c which is 1612 bytes above the current stack pointer stopped in get_ulong_attr_from_template at 0xffffffff5ad0d940 0xffffffff5ad0d940: get_ulong_attr_fro...

RE: [ace-bugs] linking problem on Solaris (64 bit)
Hi, > ACE VERSION: 5.4.1 Thanks for using the PRF form. Did you already try the x.4.2 release which you can obtain from http://deuce.doc.wustl.edu/Download.html? Where did you get this PRF template from? The question about the default.features file is added by me last week and is not in the x.4.1 release, I find this very strange. I think google is your friend here maybe try to add the following to your platform_macros.GNU file as a test: LDFLAGS += -Wl,-xarch=v9 I don't have access to a box with 64bit solaris, so this is a hard one to test for me. Rega...

RE: [ace-users] linking problem on Solaris (64 bit)
Hi, It doesn't make any sense to repost your question within 12 hours, mailing lists are best effort and you are now only wasting time and bandwith. Regards, Johnny Willemsen Remedy IT Leeghwaterstraat 25 2811 DT Reeuwijk The Netherlands www.theaceorb.nl / www.remedy.nl > Hello, > > can you help me with problem on linking libACE on Solaris (64 bits) > > Thank > > Vitezslav Kosina > > > ACE VERSION: 5.4.1 > > HOST MACHINE and OPERATING SYSTEM: > SunOS pressts1 5.9 Generic_112233-06 sun4u sparc SUNW,Ultra-250 &g...

64 bit ncrs driver missing from Solaris 10 b72 x86
Just installed Solaris 10 beta 72 on an AMD64 machine with Symbios Logic 53c875 SCSI adapter. At bootup it complains it cannot load the ncrs driver which is not surprising since there is no ncrs in /kernel/drv/amd64. Is this a known problem? Is there a place on the net which has all the known Solaris 10 problems listed? Thanks. -- Koef. In article <d5bde189.0412040943.656e8639@posting.google.com>, koef@xs4all.nl (Koef) writes: > Just installed Solaris 10 beta 72 on an AMD64 machine with Symbios > Logic 53c875 SCSI adapter. At bootup it complains it cannot load the > ncrs d...

Re: [ace-users] linking problem on Solaris (64 bit) #2
Hi > > ACE VERSION: 5.4.1 Thanks for using the PRF! > > > > HOST MACHINE and OPERATING SYSTEM: > > SunOS pressts1 5.9 Generic_112233-06 sun4u sparc SUNW,Ultra-250 > > > > TARGET MACHINE and OPERATING SYSTEM, if different from HOST: > > COMPILER NAME AND VERSION (AND PATCHLEVEL): > > cc: Sun C 5.5 Patch 112760-12 2004/07/20 > > CC: Sun C++ 5.5 Patch 113817-08 2004/04/13 > > > > CONTENTS OF $ACE_ROOT/ace/config.h [if you use a link to a platform- > > specific file, simply state which one]: > > #...

Problem building 64-bit python 2.6.2 on Solaris 10
Hi, I'm trying to build python 2.6.2 on Solaris 10 (SPARC 64), using Sun Studio 12, but I'm having a few problems getting a clean build. The python configure options are: with_gcc=no with_universal_archs=64-bit with_cxx_main="CC -m64" The first problem I'm having is _ssl.so not building: cc -m64 -xcode=pic32 -DNDEBUG -g -xs -xtarget=ultraT1 -xarch=sparcvis2 -m64 -mt -xcode=pic32 -xmemalign=8s -xpagesize=default -I. -I/opt/ws/dists/ Python-2.6.2/. /Include -I. -IInclude -I./Include -I/opt/db/include -I/opt/tcl8/ include -I/opt/ openssl/include -I/opt/gnu/include -I/op...

Will apache2, php5, mcrypt,etc run on solaris 10 x86 in 64 bit
Hi All, We are trying to get apache2 and php5 with support for mcrypt, mhash, gd, soap, gettext, imap, ftp, openssl, oracle, mysql, db4 curl work. We have struck a file discripter limit in 32 bit and we are wondering anyone has got this config running well in 64 bit. Has anyone had any success? Thanks, Terry In article <1153121820.007274.279450@i42g2000cwa.googlegroups.com>, terry.cullen@gmail.com wrote: > Hi All, > We are trying to get apache2 and php5 with support for mcrypt, mhash, > gd, soap, gettext, imap, ftp, openssl, oracle, mysql, db4 curl work. > We have struc...