comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Linking problem in GPS 2011
Date: Fri, 21 Oct 2011 22:35:24 +0200
Date: 2011-10-21T22:35:24+02:00	[thread overview]
Message-ID: <87fwimjd6b.fsf@ludovic-brenta.org> (raw)
In-Reply-To: 5140065e-51a7-446d-8b86-13bd59b92bde@x7g2000yqn.googlegroups.com

Hans Petter Ladim writes on comp.lang.ada:
> Hello,
> I want to use GPS 2011 GPL edition from Adacore on my Linux Mint based
> on debian.
> I have installed GPS with the doinstall command using the default
> install settings all the way.
> I have also installed libc6-dev with apt-get install libc6-dev.
> The problem is that the project in GPS will not link.
> The error from the GPS output is:
>
> gnatmake -d -P/home/hp/gpsproject/pwm/pwm.gpr
> gnatbind -I- -x /home/hp/gpsproject/pwm/test_pwm.ali
> gnatlink /home/hp/gpsproject/pwm/test_pwm.ali -o /home/hp/gpsproject/
> pwm/test_pwm
> /usr/gnat/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/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.
>
> The  command: readlink -f ld gives /home/hp/ld.
> But I also find (as given i the error above) ld in /usr/gnat/libexec/
> gcc/x86_64-pc-linux-gnu/4.5.3/ld
>
> I am new toboth Ada and Linux so this may be a very simple problem!
> I hope my information about the problem was suffcient.

Yes, your report is very detailed and I commend you for the precise
description of your problem.

From what you say, it seems that crt1.o is either absent or not where
GNAT GPL's ld looks for it.  Could you try:

$ dpkg -L libc6-dev | grep /crt1.o

$ /usr/gnat/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/ld --verbose \
 | grep SEARCH_DIR | tr ' ' '\n'

On my Debian system (where GNAT GPL Edition is not installed; I use
/usr/bin/ld instead), this yields

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

SEARCH_DIR("/usr/x86_64-linux-gnu/lib64");
SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu");
SEARCH_DIR("=/usr/local/lib64");
SEARCH_DIR("=/lib/x86_64-linux-gnu");
SEARCH_DIR("=/lib64");
SEARCH_DIR("=/usr/lib/x86_64-linux-gnu");
SEARCH_DIR("=/usr/lib64");
SEARCH_DIR("=/usr/local/lib");
SEARCH_DIR("=/lib");
SEARCH_DIR("=/usr/lib");

As you can see, on my system crt1.o is in one of the directories of the
SEARCH_DIR of ld.  This is a multiarch-aware directory, not just
/usr/lib; the transition to multiarch started in August this year and
unfortunately breaks older toolchains as explained here:

http://bugs.debian.org/637232

I suspect that your Linux Mint is recent (August 2011 or later) and that
the ld that comes with GNAT GPL Edition is not multiarch-aware and
therefore looks in /usr/lib and not in /usr/lib/x86_64-linux-gnu.

One solution is to

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu

before you call gnatmake from GPS.

Another solution is to simply use the Debian packages for Ada
development, which are all multiarch-aware:

aptitude install gnat gnat-gps

Hope this helps

-- 
Ludovic Brenta.



  reply	other threads:[~2011-10-21 20:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-21 19:41 Linking problem in GPS 2011 Hans Petter Ladim
2011-10-21 20:35 ` Ludovic Brenta [this message]
2011-10-22 10:52   ` Hans Petter Ladim
2011-10-22 11:05     ` Pascal Obry
2011-10-22 12:57     ` Ludovic Brenta
2011-10-22 13:22       ` Simon Wright
2011-10-22 13:32         ` Pascal Obry
2011-10-22 13:31       ` Pascal Obry
2011-10-22 10:57   ` Pascal Obry
2011-10-24 10:47     ` Alex R.  Mosteo
2011-10-31 20:50       ` Hans Petter Ladim
replies disabled

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