From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5fad37e7b6e75b9d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.30.202 with SMTP id u10mr385997pbh.1.1319229325789; Fri, 21 Oct 2011 13:35:25 -0700 (PDT) Path: d5ni40787pbc.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!newsfeed.kamp.net!newsfeed.kamp.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Linking problem in GPS 2011 Date: Fri, 21 Oct 2011 22:35:24 +0200 Organization: A noiseless patient Spider Message-ID: <87fwimjd6b.fsf@ludovic-brenta.org> References: <5140065e-51a7-446d-8b86-13bd59b92bde@x7g2000yqn.googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="A2j0+JRWXRJRZZCiWTUNkQ"; logging-data="13632"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dT0jQoDqWUu27HwWZ7Rz9" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:BQndEpsqQDUL2t1h6xoKGuL3x9U= sha1:2PKTR24Cg8nAwXYUH0eSo0kh5Ig= Xref: news2.google.com comp.lang.ada:14138 Content-Type: text/plain; charset=us-ascii Date: 2011-10-21T22:35:24+02:00 List-Id: 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.