Solaris 10 x86 64 bit link problem

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
Reginald
5/20/2009 9:52:28 PM
comp.unix.solaris 25868 articles. 89 followers. Post Follow

0 Replies
211 Views

Similar Articles

[PageSpeed] 35
Reply:
Similar Artilces:

PPP communication problem on uclinux
Hi, I'm quite new at programming in linux (and uclinux), so if I'm asking for obvious answers here, please excuse me. Here's the situation: I'm programming an application for the Intermec CK1 handheld computer, which runs uclinux. Using some functions provided by the hardware manufacturer, I create a serial PPP connection to my host PC and start communicating with the host using streams which I created from my socket discriptor. I send and receive data using the function fputc() and fgetc(). My problem is, when the serial connection is lost for some reason (cab...

[9fans] python won't link with type safe linker, i.e. -T
they do things like this: foo.h: struct x { #ifdef ZARDOZ int i; #endif int j; }; provider.c: int somefunc(struct x *x){ x->j = 1; } a.c: #include foo.h struct x x; somefunc(&x); b.c #define ZARDOZ #include a.c Yes, include a.c. I kid you not. So the type signature of the function somefunc is different in a and b. This will all "work", with -T turned off, but it's too clever for me. We go for simpler things here in NM, such as a school down south that, having had a principal dismissed on drug charges, and gang fights, and sundry other problems, decided to hire an...

Re: [tao-users] CORBA::release() is causing core dump on solaris
Hi > TAO VERSION: 1.3.3 > ACE VERSION: 5.3.3 Thanks for using the PRF! > HOST MACHINE and OPERATING SYSTEM: > > SunOS portal42 5.8 Generic_108528-23 sun4u sparc SUNW,Ultra-80 > > If on Windows based OS's, which version of WINSOCK do you > use?: > > TARGET MACHINE and OPERATING SYSTEM, if different from HOST: > COMPILER NAME AND VERSION (AND PATCHLEVEL): > > CC: Sun WorkShop 6 update 1 C++ 5.2 Patch 109508-09 2002/07/08 > > AREA/CLASS/EXAMPLE AFFECTED: > [What example failed? ...

Problem linking with Fortran NAG library
Hi there, I'm trying to compile some code that uses the Fortran NAG library. I'm not sure how to link to the library, however. When I type g95 nhmm.f forbac.f makea.f objfun.f sumpi.f variance.f viterbi.f condsim.f beta.f cmlib.f dldp.f emalg.f I get the following link errors. I am running Debian Sarge (3.1) /tmp/ccwUzgR2.o(.text+0x19a): In function `emalg_': : undefined reference to `e04uef_' /tmp/ccwUzgR2.o(.text+0x1ae): In function `emalg_': : undefined reference to `e04uef_' /tmp/ccwUzgR2.o(.text+0x1c2): In function `emalg_': : undefined reference to `e04u...

Software Express: get the development version of Solaris today
Buried deep in one of todays press releases: Software Express for Solaris is a Web-based program that gives customers a competitive edge, delivering state-of-the-art technologies with online support and a community forum. The program will include features of future versions of Solaris, such as NFS v4, the standards-based Network File System optimized for Internet use, DTrace -- a set of capabilities for rapidly diagnosing problems and bottlenecks in applications and Solaris Zones -- a server virtualization technology that provides security isolation and fault containment. T...

Reduce::inex problem
Hello, This seems like a pretty simple set of equations, but it's stumping reduce: { Subscript[V, b] == 4/3*Pi*Subscript[r, b]^3, Subscript[V, a] == 4/3*Pi*Subscript[r, a]^3, V == Subscript[V, b] - Subscript[V, a], \[Rho] == m/V }; % /. {Subscript[r, b] -> 5.75, Subscript[r, a] -> 5.70, \[Rho] -> 8.92}; Reduce[%] Of course, Solve can handle it. (Change the last expression to Solve[%,m].) Any thoughts on helping Reduce out here? Ed On 1 Dec 2010, at 08:13, Eduardo Cavazos wrote: > Hello, > > This seems like a pretty simple ...

NYC LOCAL: Thursday 12 January 2012 UNIGROUP: Isaac Rozenfeld on Oracle Sun Solaris 11 Release
<blockquote what="official UNIGROUP announcement" assurance="there will be giveaways and food" rsvp="registration requested, see below" entrance-fee="yes, see http://www.unigroup.org/unigroup-fees.html" location="The Cooper Union School of Engineering, see below" info="http://www.unigroup.org" edits="some paragraphs removed so notice fits in mailboxen"> Date: Fri, 6 Jan 2012 08:18:49 -0500 (EST) From: Unigroup_of_NY <unilist@unigroup.org> Subject: UNIGROUP 12-JAN-2012 (2nd Thu): Solaris 11 Relea...

AT91RM9200 16 bit SDRAM bus
I have built a board containing an At91RM9200 in PQFP208 and an Infineon HYB39S256160DT 16M*16 SDRAM. I wired it as shown on on page 139 of the datasheet of the AT1RM9200. Has anyone had success with this chip and 16bit SDRAM? I get the last value written to SDRAM back whenever I write it. I will be releasing all the design info for the board under the GPL whenever I get it working. Anyone see what might be wrong with the initialzation? Initialization code for SDRAM *SDRAMC_CR = 0x11112255; /* CAS, rows, cols, ... P.204 AT91RM9200 Manual*/ *SDRAMC_MR = 0x00000012; /* All Bank...

urgent help #10
Please could you help me dividing the image into 3x3 and applying the following equation to an image? P(G,C)(i,j)=&#8721;(k=0..7)angle (d k,d((k+1) mod 8)) In article <fn7tu3$mm1$1@fred.mathworks.com>, Mohammed Khalil <sayim133@gmail.com> wrote: >Please could you help me dividing the image into 3x3 and >applying the following equation to an image? >P(G,C)(i,j)=&#8721;(k=0..7)angle (d k,d((k+1) mod 8)) Please try that again. After the P(G,C)(i,j)= you have ampersand number-sign 8 7 2 1 semi-colon which is probably an encoding for a character that is not in th...

Eigendecomposition problem
Hi, As you know if x is Hermitian matrix ,by Eigendecomposition we should have orthonormal eigen vectors but If you run the following lines, you see that V(collection of eigen vectors) does not contain orthonormal eigenvectors(t is not Identity matrix). clear; clc; x=[1i+4,2i,3-1i -2i,5+1i,1+6i 3+1i,1-6i,8-2i] [V,D]=eig(x); t=V'*V; Can you help me what should I do? Best, David Your x matrix is not hermitian (look at the diagonal terms) Bruno "David Angel" <david.angel2004@yahoo.com> wrote in message <hiqdtq$t81$1@fred.mathworks.com>... > Hi, > ...

problems with compilation on Solaris 9
I am a complete newbie to sendmail compilation. But I keep getting a consistent error in the compilation. My OS is Solaris 9. The sendmail version is 8.12.11. I have BerkeleyDB.4.2 installed. I am compiling with GCC-version 3.4.0. I am using the regular ../devtools/OS/SunOS.5.9 config file included with the source files. I also have a site.config.m4 file under .../devtools/Site dir. APPENDDEF(`confLIBDIRS', `-L/usr/local/BerkeleyDB.4.2/lib -R/usr/local/BerkeleyDB.4.2/lib')dnl is the only line in the file. I would like to add MILTER later on after I put this compile error behi...

Do I have a drive problem with one of a matched pair?
I have two WD 2500JD 250GB SATA disks no raid and no extra partitions. C: has xp Prof and is 46% full D: has redundant xp prof (for emergency) some programs in C: registry and some large DV avi files and is 45% full Both have been XP defragged until no more improvement seen On running HD Tach or Sandra I get: C: CPU utilization 5% Average read time 48.6MB/s D: CPU utilization 93% Average read time 10.5MB/s I'm concerned that the D: drive has a problem or could it be something else? Beemer Previously Beemer <Beemer@nowhere.com> wrote: > I have two WD 250...

Gnus Width problem.
How do I adjust the width of the line? When I type, it goes on one line without going to the next line. I would like the line to be within the standards of a usenet post. Is there an option I can set in my .gnus file? Thanks you. Mike Cox wrote: > How do I adjust the width of the line? When I type, it goes on one line without going to the next line. I would like the line to be within the standards of a usenet post. Is there an option I can set in my .gnus file? > > Thanks you. If you want the word wrap feature than you need to turn on the auto fill option. (add-hook '...

FA: Cybervision 64/3D, complete SCSI-kit, KickRom 3.1, world time receiver
X-No-Archive: Yes Hi! Some amiga-items from me: Cybervision 64/3D complete SCSI-kit (host, CD, HDD, cables, etc.) Kickstart ROM 3.1 for A4000 DCF-77 time receiver for battery-less big box amigas http://shop.ebay.de/cph_ao/m.html?_dmd=1&_ipg=50&_sop=12&_rdc=1 ending this sunday: RAM expansion for Commodore A590 SCSI host adapter external floppy drive from Golden Image case from Apple Power Mac G4 (mirrored door drives), perfect case for an A1 or Pegasos also check out my offers on hood.de: http://www.hood.de/auktionen/10223/chrisp_h_.ht...

Looking for 10 Independent Sales Consultants
This is a multi-part message in MIME format. ------=_NextPart_000_0045_01C5AFF7.EBCA8C30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I Love What I do... and You Can Too! I would love for you to be a part = of my team. I'm looking for 10 motivated people - all you need to know = is "people with skin."=20 =20 I had no idea when I started my business how fun and rewarding a career = with Mary Kay=AE would be. I'm getting out in the community, mingling = with new people, setting my own hours, and earning...

Problem with awaitTermination in ThreadpoolExecutor.
Hi, The javadoc for awaitTermination in ExecutorService and ThreadPoolExecutor includes the following: Description Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first. Returns: true if this executor terminated and false if the timeout elapsed before termination We have occasionally noticed that awaitTermination returns true when tasks submitted to the executor are still running, a timeout has not occurred, and the submitting thread was not interrupted. This has been an infrequent occu...

Re: FireFox 0.9 problem
mark nassy wrote: > when i launch firefox 0.9 the application appears in the dock then > disappears. it does so over and over. one way i found to stop the > cycle is to log out and back in again. i am using nfs networked home > directories, and firefox is on an afp sharepoint. This sounds like what happened to me: I downloaded the Darwin version rather than the MacOS X version. ...

File Manager in CDE in Solaris 9
I'm using CDE with Solaris 9. I'd like to run (start) the file manager from the command line. What is the command I need to execute? Thanks! Erik Jensen wrote: > I'm using CDE with Solaris 9. I'd like to run (start) the file manager > from the command line. What is the command I need to execute? > > Thanks! man -k "file manager" | grep CDE dtfile dtfile (1) - the CDE File Manager dtfile.config dtfile.config (4) - CDE File Manager configuration file dtfile_copy dtfile_copy (1) - the CDE File Manager copy utility dtfile_error dtf...

Build failing on Solaris
I've tried to google-up an answer but am not finding it, even tho i have seen passing reference to what sounds like the same problem from others. On a Solaris-8 machine i'm trying to build Python-2.3.2. Using gcc-3.2. All seems to go pretty well for a while, but them i'm getting the following: -------------------- $ make .... case $MAKEFLAGS in \ *-s*) CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build;; \ *) CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstri...

Problem with linking C shared library into C++ shared library
Hello! A Corba Components server uses Components as shared libraries that are loaded into the server at runtime. Everything is C++ but I wrote a component which uses libmpeg2 for video decoding and displaying. I use "extern C" to use the mpeg2 C code inside the C++ component. The component shared library compiles and links ok, but when I try to load it into the server I get a "cannot load shared library; undefined symbol" error, for all symbols from libmpeg2. The mpeg2 libraries are all linked and it should work: I tried a simple executable with mpeg2, the c...

there is a person who has a solution of my problem???
Hi! I have this code, it's workimg but very slowly How can reduce the number of IF loops or what can i do to make it more rapid , Thanks clear all clc temps_lest2= []; all_files = dir('2A25*'); data=load('Jimenez_out_horaire.txt'); y= data(:,1); m= data(:,2); day= data(:,3); h= data(:,4); min= data(:,5); niv= data(:,6); val= data(:,7); lat= data(:,8); lon= data(:,9); valh= data(:,10); for J=1:length(all_files); donnees = load(all_files(J).name); annee = donnees(:,1); mois = donnees(:,2); jour = donnees(:,3); n=donnees(:,4); scan=donnees(:,5); heure = donnees(:,6); minute =...

problem in my new note book
hi, i bought a new laptop a week back. i use a wireless card to access internet. i can't open google in my note book. whenever i ping the google it says the host is unreachable. every other site runs perfectly except for google, if anyone could find a solution for this i will be very grateful. thank u Shastri ...

RMagick 1.10.1 win32 gem beta withdrawn
Kaspar Schiess, the RMagick Win32 guru, has confirmed that the beta RMagick 1.10.1 win32 does indeed cause problems when used in a Rails application with Ruby 1.8.4. Currently we believe this is due to an incompatibility between the mingw32 compiler that Kaspar uses to compile RMagick and the VC++ 6.0 compiler used to compile Ruby 1.8.4. After consulting with Kaspar I have withdrawn the beta RMagick 1.10.1 win32 gem until we can work out a solution and make a new gem. Kaspar regrets to say that due to time conflicts this will be no earlier than the end of May. Until a new RMagick 1.10....

oid size on 64 bit machine
Do I get more oids on a 64 bit machine? That is, is it also an unsigned four-byte integer on a 64 bit machine? -- Until later, Geoffrey ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly Geoffrey <esoteric@3times25.net> writes: > Do I get more oids on a 64 bit machine? No. regards, tom lane ---------------------------(end of broadcast)--...

Solaris term problem
I'm having a problem in console (not using X) on a x86 laptop. When I change the TERM variable the console changes where the # prompt starts at the top and when it gets to the bottom of the screen it erases the whole screen and starts at the top again. Any help would be appreciated. What are you setting term to? Are you using telnet across the network or hyperterminal to the serial port? Tim dacrud@gmail.com wrote: > I'm having a problem in console (not using X) on a x86 laptop. When I > change the TERM variable the console changes where the # prompt starts > at the ...