comp.lang.ada
 help / color / mirror / Atom feed
* how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux
@ 2012-06-26 17:47 Nasser M. Abbasi
  2012-06-26 18:08 ` Nasser M. Abbasi
  2013-03-17 19:17 ` claragranell
  0 siblings, 2 replies; 6+ messages in thread
From: Nasser M. Abbasi @ 2012-06-26 17:47 UTC (permalink / raw)


I've see this error before, and I googled it. But the
solutions I found not helping.

Does any one know how to make gnat see crt1.o?

I installed gnat 2012 ok. Followed all the questions,
and all went well. It installed to /usr/gnat.
I am on linux.

Now when I try to compile a file, I get this error:

------------------------------
>gnatmake t44.adb
gnatbind -x t44.ali
gnatlink t44.ali
/usr/gnat/libexec/gcc/i686-pc-linux-gnu/4.5.4/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
gnatlink: error when calling /usr/gnat/bin/gcc
gnatmake: *** link failed.
--------------------------

locate shows this

----------------------------
>locate crt1.o
/usr/lib/i386-linux-gnu/Mcrt1.o
/usr/lib/i386-linux-gnu/Scrt1.o
/usr/lib/i386-linux-gnu/crt1.o
/usr/lib/i386-linux-gnu/gcrt1.o
--------------------------

and

-----------------------------
>sudo apt-get install libc6-dev
[sudo] password for me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dev is already the newest version
---------------------------------

and

---------------------------
>which gnatmake
/usr/gnat/bin/gnatmake
>gnatmake -v

GNATMAKE GPL 2012 (20120509)
----------------------------------

and
--------------
>echo $PATH
/usr/gnat/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
---------------

SO, I think I just need to tell it to use the crt1.o
in /usr/lib/i386-linux-gnu/crt1.o, right?

I forgot how to do that. Do I need to run some Linux
command or something? the gnat README did not say
another, other that to run the doinstall script, which
I did ofcourse.

thank you,
--Nasser



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux
  2012-06-26 17:47 how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux Nasser M. Abbasi
@ 2012-06-26 18:08 ` Nasser M. Abbasi
  2012-06-26 23:17   ` Brian Drummond
  2012-06-27 19:16   ` Georg Bauhaus
  2013-03-17 19:17 ` claragranell
  1 sibling, 2 replies; 6+ messages in thread
From: Nasser M. Abbasi @ 2012-06-26 18:08 UTC (permalink / raw)


solved it!

here it is, in case someone else hits this problem:

>export LIBRARY_PATH=/usr/lib/i386-linux-gnu/

>gnatmake -gnat2012 t44.adb
gcc -c -gnat2012 t44.adb
gnatbind -x t44.ali
gnatlink t44.ali

I do not know why it happens, but the above will fix it.

--Nasser


On 6/26/2012 12:47 PM, Nasser M. Abbasi wrote:
> I've see this error before, and I googled it. But the
> solutions I found not helping.
>
> Does any one know how to make gnat see crt1.o?
>
> I installed gnat 2012 ok. Followed all the questions,
> and all went well. It installed to /usr/gnat.
> I am on linux.
>
> Now when I try to compile a file, I get this error:
>
> ------------------------------
>> gnatmake t44.adb
> gnatbind -x t44.ali
> gnatlink t44.ali
> /usr/gnat/libexec/gcc/i686-pc-linux-gnu/4.5.4/ld: crt1.o: No such file: No such file or directory
> collect2: ld returned 1 exit status
> gnatlink: error when calling /usr/gnat/bin/gcc
> gnatmake: *** link failed.
> --------------------------
>
> locate shows this
>
> ----------------------------
>> locate crt1.o
> /usr/lib/i386-linux-gnu/Mcrt1.o
> /usr/lib/i386-linux-gnu/Scrt1.o
> /usr/lib/i386-linux-gnu/crt1.o
> /usr/lib/i386-linux-gnu/gcrt1.o
> --------------------------
>
> and
>
> -----------------------------
>> sudo apt-get install libc6-dev
> [sudo] password for me:
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> libc6-dev is already the newest version
> ---------------------------------
>
> and
>
> ---------------------------
>> which gnatmake
> /usr/gnat/bin/gnatmake
>> gnatmake -v
>
> GNATMAKE GPL 2012 (20120509)
> ----------------------------------
>
> and
> --------------
>> echo $PATH
> /usr/gnat/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> ---------------
>
> SO, I think I just need to tell it to use the crt1.o
> in /usr/lib/i386-linux-gnu/crt1.o, right?
>
> I forgot how to do that. Do I need to run some Linux
> command or something? the gnat README did not say
> another, other that to run the doinstall script, which
> I did ofcourse.
>
> thank you,
> --Nasser
>





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux
  2012-06-26 18:08 ` Nasser M. Abbasi
@ 2012-06-26 23:17   ` Brian Drummond
  2012-06-27 19:16   ` Georg Bauhaus
  1 sibling, 0 replies; 6+ messages in thread
From: Brian Drummond @ 2012-06-26 23:17 UTC (permalink / raw)


On Tue, 26 Jun 2012 13:08:55 -0500, Nasser M. Abbasi wrote:

> solved it!
> 
> here it is, in case someone else hits this problem:
> 
>>export LIBRARY_PATH=/usr/lib/i386-linux-gnu/
...
> 
> I do not know why it happens, but the above will fix it.

The basic problem is that some Linux distributions (Debian,Ubuntu) 
support multilib (libs for various target machines, e.g. cross-compiling 
for Arm, AVR or even Windows, or even just 32 and 64 bit x86), and some 
tool chains don't.

If you are using Debian or Ubuntu, but installing another Gnat, this is 
possible.
export LIBRARY_PATH seems to be the easiest fix. Or install Debian's own 
Gnat package, as appropriate.

- Brian



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux
  2012-06-26 18:08 ` Nasser M. Abbasi
  2012-06-26 23:17   ` Brian Drummond
@ 2012-06-27 19:16   ` Georg Bauhaus
  2012-11-20 19:48     ` giorgio.piantella
  1 sibling, 1 reply; 6+ messages in thread
From: Georg Bauhaus @ 2012-06-27 19:16 UTC (permalink / raw)


"Nasser M. Abbasi" <nma@12000.org> wrote:
> solved it!
> 
> here it is, in case someone else hits this problem:
> 
>> export LIBRARY_PATH=/usr/lib/i386-linux-gnu/

> I do not know why it happens, but the above will fix it.

The issue seems to be an early disagreement between the
developers of Debian an Ubuntu on the one side and
GCC on the other side on hoe to handle multi arch support.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux
  2012-06-27 19:16   ` Georg Bauhaus
@ 2012-11-20 19:48     ` giorgio.piantella
  0 siblings, 0 replies; 6+ messages in thread
From: giorgio.piantella @ 2012-11-20 19:48 UTC (permalink / raw)



> 
> >> export LIBRARY_PATH=/usr/lib/i386-linux-gnu/
> 

attention depends of your system because depends from where is the file crt1.o

I recommend:

$ locate crt1.o
...
/usr/lib/debug/usr/lib32/ ...
/usr/lib/x86_64-linux-gnu/Mcrt1.o
/usr/lib/x86_64-linux-gnu/Scrt1.o

/usr/lib/x86_64-linux-gnu/crt1.o
--------------------------^^^^^^

/usr/lib/x86_64-linux-gnu/gcrt1.o
...

required to locate the path of the file and then
the correct invocation of export is:

$ export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux
  2012-06-26 17:47 how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux Nasser M. Abbasi
  2012-06-26 18:08 ` Nasser M. Abbasi
@ 2013-03-17 19:17 ` claragranell
  1 sibling, 0 replies; 6+ messages in thread
From: claragranell @ 2013-03-17 19:17 UTC (permalink / raw)
  Cc: nma


Thank you Nasser. This solved the problem I had using mac 10.7.4 and GNAT. Thank you!



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-17 19:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-26 17:47 how to fix crt1.o: No such file or directory (link error for gnat)? after installing gnat 2012 on linux Nasser M. Abbasi
2012-06-26 18:08 ` Nasser M. Abbasi
2012-06-26 23:17   ` Brian Drummond
2012-06-27 19:16   ` Georg Bauhaus
2012-11-20 19:48     ` giorgio.piantella
2013-03-17 19:17 ` claragranell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox