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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.75.196 with SMTP id e4mr15429148obw.36.1457314401085; Sun, 06 Mar 2016 17:33:21 -0800 (PST) X-Received: by 10.182.113.198 with SMTP id ja6mr203685obb.0.1457314401049; Sun, 06 Mar 2016 17:33:21 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!hb3no12048212igb.0!news-out.google.com!pn7ni2359igb.0!nntp.google.com!ok5no6423606igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 6 Mar 2016 17:33:20 -0800 (PST) In-Reply-To: <59c56afe-faba-42eb-bcb9-49071b240b37@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.69.190.74; posting-account=LwEypwoAAAD5lknaw_JqkoK-tug0R26e NNTP-Posting-Host: 75.69.190.74 References: <704c1384-c3d9-440c-a65f-9c0741306b85@googlegroups.com> <71bce85e-b7d7-4bf5-8e08-c119fcf3b949@googlegroups.com> <59c56afe-faba-42eb-bcb9-49071b240b37@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8e6e0f41-5855-46da-b3c7-7d63140e4303@googlegroups.com> Subject: Re: Question about GNAT gprconfig From: Zack Boll Injection-Date: Mon, 07 Mar 2016 01:33:21 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:29691 Date: 2016-03-06T17:33:20-08:00 List-Id: On Sunday, March 6, 2016 at 7:11:49 PM UTC-5, Zack Boll wrote: > On Sunday, March 6, 2016 at 5:26:20 PM UTC-5, Zack Boll wrote: > > On Sunday, March 6, 2016 at 6:17:17 AM UTC-5, Simon Wright wrote: > > > Zack Boll writes: > > >=20 > > > > I recently built a GCC Ada cross-compiler for the PowerPC64 > > > > architecture using crosstool-ng. I can compile my Ada programs fin= e > > > > using powerpc64-e6500-linux-gnu-gnatmake but I have been unable to > > > > build with gprbuild and appropriate project files. I have traced t= his > > > > down to an issue with gprconfig not recognizing my compiler. > > > > > > > > When I run gprconfig --show-targets > > > > I get: > > > > arm-linux-gnueabihf (Raspberry Pi2 Cross Compiler downloaded from > > > > Adacores website) > > > > x86_64-linux-gnu > > > > > > > > But I don't see powerpc64-e6500-linux-gnu even though the compiler > > > > executable is in my path. Does anyone know what the issue might be= ? > > >=20 > > > I think that gprconfig's compiler description file (at > > > $prefix/share/gprconfig/compilers.xml) doesn't recognise your target. > > >=20 > > > You could edit that file directly; might be better to start by writin= g a > > > description just for your compiler, starting just from the GNAT secti= on > > > at about line 687, > > >=20 > > > > > > > > > > > > GNAT-PPC64 > > > (powerpc64-e6500-linux-gnu-)?gnatmake > > > > > > ${PREFIX}gnatls -v --version > > > > > > > > > Ada > > > > > > ${PREFIX}gcc -v > > > > > > > > > > > > \.\./lib/gcc(-lib)?/$TARGET/$gcc= _version/adalib/ > > > \.\./lib/gcc(-= lib)?/$TARGET/$gcc_version/ada_object_path > > > \.\./lib/gcc(-lib)?/$TARGET/$gcc_versi= on/rts-(.*)/adalib/ > > > \.\./$TARGET/lib/gnat/(.*)/adalib/ > > > > > > > > > ${PREFIX}gcc -dumpmachine > > > > > > > > > > > > > > >=20 > > > (not sure you need all of the section) and put this in > > > x-compilers.xml alongside the original compilers.xml (or locally, usi= ng > > > the gprbuild --db switch). > > >=20 > > > You'll still need to specify --target=3Dpowerpc64-e6500-linux-gnu on = the > > > command line, or for Target use "powerpc64-e6500-linux-gnu"; in your > > > GPR. > > >=20 > > > If this works, you'll probably want to add sections for C, C++, ASM. > >=20 > > Thanks, I was able to edit the existing GNAT line to support powerpc64-= linux as a target. Hopefully I will be able to get C and C++ building corr= ectly with gprbuild. >=20 > I seem to be having trouble getting my hello world C++ program to compile= with gprbuild. I think it is trying to use the x86_64 version of "ar". B= elow is my output from gprbuild with the "-v" flag. >=20 > gprbuild --target=3Dpowerpc64-e6500-linux-gnu -v -d -P/project/hello_worl= d_cpp/hello_world_cpp.gpr -XADA_DIALECT=3DAda_2012 -XARCHITECTURE=3DPowerPC= 64_Linux -XBUILD_FLAGS=3DOptimize -XELABORATION_CHECKS=3DStatic -XCOMPILER_= MULTIPROCESS=3D8 -XDEBUG_TARGET=3Dlocal hello_world.cpp -s -j6 > GPRBUILD GPL 2015 (20150428) (x86_64-pc-linux-gnu) > Copyright (C) 2004-2015, Free Software Foundation, Inc. > 18 lines: No errors > gprconfig --batch -o /project/hello_world_cpp/auto.cgpr --target=3Dpowerp= c64-e6500-linux-gnu --config=3Dc++,,,,powerpc64-e6500-linux-gnu-g++ --confi= g=3Dada,,,,powerpc64-e6500-linux-gnu-gnatmake > Creating configuration file: /project/hello_world_cpp/auto.cgpr > Checking configuration /project/hello_world_cpp/auto.cgpr > Checking /project/hello_world_cpp/hello_world.cpp ... > -> object file /project/hello_world_cpp/hello_world.o does not exis= t > Changing to object directory of "hello_world_cpp": "/project/hello_world_= cpp/" > /tools/gnat/powerpc64-e6500-linux-gnu/bin/powerpc64-e6500-linux-gnu-g++ -= mtune=3De6500 -mlongcall -mpowerpc -maltivec /project/hello_world_cpp/hello= _world.cpp > Checking /project/common/dummy_common.adb ... > Checking binder generated files for hello_world.cpp... > -> up to date > Checking libhello_world_cpp.a ... > -> archive does not exist > /tools/gnat/x86_64_gpl/bin/ar cr libhello_world_cpp.a /project/hello_worl= d_cpp/hello_world.o > /tools/gnat/x86_64_gpl/bin/ar: /project/hello_world_cpp/hello_world.o: No= such file or directory > global archive for project hello_world_cpp could not be built > gprbuild: link of hello_world.cpp failed > [2016-03-06 19:04:50] process exited with status 4, 100% (2/2), elapsed t= ime: 00.42s >=20 > Below is the C++ compiler I defined in the compilers.xml file. > > > G++-PPC64 > (powerpc64-e6500-linux-gnu)-g\+\+ > > ${PREFIX}-g++ -v > > =20 > > C++ > > ${PREFIX}-g++ -dumpmachine > > > I have tried adding=20 PowerPC64_Linux_Archiver :=3D "powerpc64-e6500-linux-gnu-ar"; PowerPC64_Linux_Archive_Indexer :=3D "powerpc64-e6500-linux-gnu-ranlib"; for Archive_Builder use (PowerPC64_Linux_Archiver, "cr"); for Archive_Indexer use (PowerPC64_Linux_Archive_Indexer); but that does not resolve my issue. Does anyone have an idea what I am doi= ng wrong? Thanks, Zack