* gnat3.07 on AIX4.1.4: link problems
@ 1996-12-12 0:00 Meskovic Zlatko
[not found] ` <01bbe8ce$b6813a50$262a6282@cln49ae>
1996-12-19 0:00 ` Ken Thomas
0 siblings, 2 replies; 4+ messages in thread
From: Meskovic Zlatko @ 1996-12-12 0:00 UTC (permalink / raw)
Hi all,
I have a little problem with linking ada on my PowerPC.
I ported (or should i say, i rewrote some packages) gnat3.07 to
PowerPC running AIX4.1.4 so that it uses pthreads for tasking.
Tasking is now running very well, i didn't discover any error until now.
But for building a program i have to run following script:
gcc -c x.adb
gnatbind x.ali
gnatlink -gnatlink /bin/ld -o x x.ali \
-L/usr/local/lib/gcc-lib/powerpc-ibm-aix4.1.4.0/2.7.2.1/ \
-L/usr/lib/threads \
-lgcc -lgnat /lib/crt0_r.o -lc_r -lc
~~~~~~~~ ~~~
This i a little bit complicated and i would prefer to use gnatmake.
But when i use the normal 'gnatmake x.adb'
the program aborts with an exception
raised STORAGE_ERROR
because gnatlink used only '/lib/crt0.o -lc' for linking.
When i run 'gnatmake x.adb -largs /lib/crt0_r.o -lc_r'
then i get the link warning
ld: 0711-224 WARNING: Duplicate symbol: __start
ld: 0711-224 WARNING: Duplicate symbol: .__start
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
the -bnoquiet option says:
The following duplicates were found:
Symbol Source-File(Object) OR Import-File{Shared-object}
------------------------- -------------------------------------------------
__start crt0main.s(/lib/crt0.o)
** Duplicate ** crt0main.s(/lib/crt0_r.o)
ld: 0711-224 WARNING: Duplicate symbol: .__start
.__start crt0main.s(/lib/crt0.o)
** Duplicate ** crt0main.s(/lib/crt0_r.o)
############
It looks like gnatlink allways takes /lib/crt0.o first.
Now to my question:
How can i force gnatlink _not_ to use /lib/crt0.o but
to use /lib/crt0_r.o -lc_r instead ???
thanks i advance for any help
zlatko
--
Zlatko B. Meskovic
Union Bank of Switzerland
Bahnhofstrasse 41
CH-8021 Zuerich
Email: zlatko.meskovic@ubs.com
Phone: +41 - 236 82 50
FAX: +41 - 236 94 40
^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <01bbe8ce$b6813a50$262a6282@cln49ae>]
* Re: gnat3.07 on AIX4.1.4: link problems
[not found] ` <01bbe8ce$b6813a50$262a6282@cln49ae>
@ 1996-12-16 0:00 ` Meskovic Zlatko
[not found] ` <01bbeb38$069d5210$262a6282@cln49ae>
0 siblings, 1 reply; 4+ messages in thread
From: Meskovic Zlatko @ 1996-12-16 0:00 UTC (permalink / raw)
Pascal Obry wrote:
>
> ...
>
> 1) first solution
>
I did not try this
> 2) second solution (the best)
>
> There is a specs file under /.../lib/gcc-lib/.../2.7.2/.
>
> In this file you'll find a section *startfile: that say which startup file
> to link with. You must use a variable to switch between crt0 and crt0_r.
> The line after *startfile: should read like this :
>
> %{mcrtr:crt0_r%O%s} %{!mcrtr:crt0%O%s}
>
> This mean that if crtr is defined then use crtO_r.o else use crt0.o
>
> Now you must call gnatmake like this :
>
> > gnatmake hello -largs -mcrtr
>
I tried this one, and it works.
Where is a description of this specs file ?
thank you pascal
zlatko
--
Zlatko B. Meskovic
Union Bank of Switzerland
Bahnhofstrasse 41
CH-8021 Zuerich
Email: zlatko.meskovic@ubs.com
Phone: +41 - 236 82 50
FAX: +41 - 236 94 40
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gnat3.07 on AIX4.1.4: link problems
1996-12-12 0:00 gnat3.07 on AIX4.1.4: link problems Meskovic Zlatko
[not found] ` <01bbe8ce$b6813a50$262a6282@cln49ae>
@ 1996-12-19 0:00 ` Ken Thomas
1 sibling, 0 replies; 4+ messages in thread
From: Ken Thomas @ 1996-12-19 0:00 UTC (permalink / raw)
To: Meskovic Zlatko
[-- Attachment #1: Type: text/plain, Size: 752 bytes --]
Meskovic Zlatko wrote:
>
> Hi all,
>
> I have a little problem with linking ada on my PowerPC.
>
It is good news that tasking is working on this version as I am
developing code for the parallel IBM SP2. One aspect of this is an Ada95
binding to MPI in which alternative startup code (crt0.o) is used.
After some experimentation the attached makefile was produced.
The "trick" is to use the option -nostartfiles as a parameter to
gnatlink. The MPI-Ada code is called from an enclosing C program.
Hope this helps.
Ken
--
Dr K.S. Thomas
Department of Electronics and Computer Science
University of Southampton
Highfield
Southampton SO17 1BJ
United Kingdom
Telephone : (+44) 01703 593029
Fax : (+44) 01703 593903
email: kst@ecs.soton.ac.uk
[-- Attachment #2: Makefile --]
[-- Type: text/plain, Size: 797 bytes --]
MPI_LINK = -nostartfiles -L/usr/lpp/ppe.poe/lib -L/usr/lpp/ppe.poe/lib/ip -lmpi -lvtd -lppe -lc
GNAT = -L/home/kst/SP2/GNAT.3.05/lib/gcc-lib/rs6000-ibm-aix3.2/2.7.2 -lgnat
EXTRA_LINK = /usr/lpp/ppe.poe/lib/crt0.o
wrapper1.o: wrapper1.c
mpcc -c -I/usr/lpp/ppe.poe/include wrapper1.c
wrapper.o: wrapper.c
gcc -c -I/usr/lpp/ppe.poe/include wrapper.c
test1.ali: test1.adb
gnatmake -c test1
test1: wrapper1.o test1.ali
gnatbind -n test1.ali
gnatlink $(MPI_LINK) $(EXTRA_LINK) test1.ali wrapper1.o
rm test1.ali
test2.ali: test2.adb
gnatmake -c test2
test2: wrapper.o test2.ali
gnatbind -n test2.ali
gnatlink $(MPI_LINK) $(EXTRA_LINK) test2.ali wrapper.o
rm test2.ali
one.o: one.c
gcc -c -I/usr/lpp/ppe.poe/include one.c
one: one.o
gcc -o one $(MPI_LINK) $(EXTRA_LINK) one.o
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1996-12-19 0:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-12-12 0:00 gnat3.07 on AIX4.1.4: link problems Meskovic Zlatko
[not found] ` <01bbe8ce$b6813a50$262a6282@cln49ae>
1996-12-16 0:00 ` Meskovic Zlatko
[not found] ` <01bbeb38$069d5210$262a6282@cln49ae>
1996-12-16 0:00 ` Stephen Leake
1996-12-19 0:00 ` Ken Thomas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox