Article View: gnu.g++.help
Article #862Re: Problem with static linking on aix with gcc2.6.3
From: Andrew Gierth
Date: Tue, 19 Dec 1995 04:10
Date: Tue, 19 Dec 1995 04:10
52 lines
2967 bytes
2967 bytes
[I am also mailing this response to the poster] In <4b3ijh$lqp@nntp.nta.no>, knuthov@hydra.unik.no (Knut Ole Hovda) writes: >Hello, > >I have an application written in C++, which also links in a library >written in Fortran. It uses no X11 libraries, it simply reads a file, >processes the data, and writes an ASCII file. > >The application is running fine on my machine (RS6000 model 250 running >aix3.2.5), but crashes when our customers run it: > > "child killed: Illegal instruction (core dumped)" > >This happens on the same version of the operating system, and for two >different customers. None of them probably have gcc installed, though. > >So far we have assumed that this indicates that the application isn't >properly statically linked. On aix, this can be checked with the dump -H >command, which gives [snip] >which should indicate it now is statically linked. But our customers >still have the same problem: The executable crashes, even though it runs >fine here! > >So my question is how one can achieve static linking on aix when using >gcc. Or can there be another explanation to the problem? I think this is more likely to be a difference in CPU type. You don't mention what box your customer is running, but I bet it's based on the POWER or POWER2 CPU, whereas your 250 is a PowerPC 601. If you built and installed GCC on your 250, then it will have detected the CPU type and arranged to emit code generated and optimized for the PPC601. I know from personal experience that this allows instructions to appear in the executable which are not legal on the POWER chipset. It is possible to install GCC such that it generates 'common mode' code which will run on either platform; this is what the IBM compilers do by default. Look at README.RS6000 in your GCC sources, and remember that you will also need to rebuild libgcc.a in common mode as well. >-- >Knut Hovda E-mail: kho@scandpower.no >Consultant, Software Development Phone: +47 63 81 49 20 >Division for Nuclear and Petroleum Engineering Fax: +47 63 81 88 22 >Scandpower A/S, International Consultants Address: P.O. Box 3 >-- N-2007 Kjeller, NORWAY -- Andrew (andrewg@microlise.co.uk) [.sig still under construction]
Technical Details
Message-ID:
<819346202.21366@microl.demon.co.uk>Path:
arc1-ca.pugleaf.net!peer-news.britain.eu.net!demon!microl.demon.co.ukReferences:
<4b3ijh$lqp@nntp.nta.no>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!peer-news.britain.eu.net!demon!microl.demon.co.uk From: andrewg@microlise.co.uk (Andrew Gierth) Newsgroups: gnu.g++.help,gnu.gcc.help,comp.unix.aix,comp.lang.c++ Subject: Re: Problem with static linking on aix with gcc2.6.3 Followup-To: comp.unix.aix Date: Tue, 19 Dec 1995 04:10:02 GMT Organization: Microlise Engineering Ltd. Message-ID: <819346202.21366@microl.demon.co.uk> References: <4b3ijh$lqp@nntp.nta.no> Reply-To: andrewg@microlise.co.uk (Andrew Gierth) NNTP-Posting-Host: microl.demon.co.uk X-NNTP-Posting-Host: microl.demon.co.uk X-Newsreader: IBM NewsReader/2 v1.2