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.28.41 with SMTP id y9mr15517708obg.14.1457326299538; Sun, 06 Mar 2016 20:51:39 -0800 (PST) X-Received: by 10.182.125.37 with SMTP id mn5mr207376obb.10.1457326299506; Sun, 06 Mar 2016 20:51:39 -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!hb3no12081380igb.0!news-out.google.com!k1ni11108igd.0!nntp.google.com!hb3no12081377igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 6 Mar 2016 20:51:39 -0800 (PST) In-Reply-To: <8e6e0f41-5855-46da-b3c7-7d63140e4303@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> <8e6e0f41-5855-46da-b3c7-7d63140e4303@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <480c58db-e2d8-4b08-abad-d5c4dd86e3d7@googlegroups.com> Subject: Re: Question about GNAT gprconfig From: Zack Boll Injection-Date: Mon, 07 Mar 2016 04:51:39 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:29692 Date: 2016-03-06T20:51:39-08:00 List-Id: On Sunday, March 6, 2016 at 8:33:22 PM UTC-5, Zack Boll wrote: > 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 f= ine > > > > > using powerpc64-e6500-linux-gnu-gnatmake but I have been unable t= o > > > > > build with gprbuild and appropriate project files. I have traced= this > > > > > 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 compile= r > > > > > 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 targe= t. > > > >=20 > > > > You could edit that file directly; might be better to start by writ= ing a > > > > description just for your compiler, starting just from the GNAT sec= tion > > > > at about line 687, > > > >=20 > > > > > > > > > > > > > > > > GNAT-PPC64 > > > > (powerpc64-e6500-linux-gnu-)?gnatmake<= /executable> > > > > > > > > ${PREFIX}gnatls -v --version > > > > > > > > > > > > Ada > > > > > > > > ${PREFIX}gcc -v > > > > > > > > > > > > > > > > \.\./lib/gcc(-lib)?/$TARGET/$g= cc_version/adalib/ > > > > \.\./lib/gcc= (-lib)?/$TARGET/$gcc_version/ada_object_path > > > > \.\./lib/gcc(-lib)?/$TARGET/$gcc_ver= sion/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, u= sing > > > > the gprbuild --db switch). > > > >=20 > > > > You'll still need to specify --target=3Dpowerpc64-e6500-linux-gnu o= n the > > > > command line, or for Target use "powerpc64-e6500-linux-gnu"; in you= r > > > > 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 powerpc6= 4-linux as a target. Hopefully I will be able to get C and C++ building co= rrectly with gprbuild. > >=20 > > I seem to be having trouble getting my hello world C++ program to compi= le with gprbuild. I think it is trying to use the x86_64 version of "ar". = Below is my output from gprbuild with the "-v" flag. > >=20 > > gprbuild --target=3Dpowerpc64-e6500-linux-gnu -v -d -P/project/hello_wo= rld_cpp/hello_world_cpp.gpr -XADA_DIALECT=3DAda_2012 -XARCHITECTURE=3DPower= PC64_Linux -XBUILD_FLAGS=3DOptimize -XELABORATION_CHECKS=3DStatic -XCOMPILE= R_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=3Dpowe= rpc64-e6500-linux-gnu --config=3Dc++,,,,powerpc64-e6500-linux-gnu-g++ --con= fig=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 ex= ist > > Changing to object directory of "hello_world_cpp": "/project/hello_worl= d_cpp/" > > /tools/gnat/powerpc64-e6500-linux-gnu/bin/powerpc64-e6500-linux-gnu-g++= -mtune=3De6500 -mlongcall -mpowerpc -maltivec /project/hello_world_cpp/hel= lo_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_wo= rld_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= time: 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 > > > > > > >=20 > I have tried adding=20 >=20 > PowerPC64_Linux_Archiver :=3D "powerpc64-e6500-linux-gnu-ar"; > PowerPC64_Linux_Archive_Indexer :=3D "powerpc64-e6500-linux-gnu-ranlib"= ; >=20 > for Archive_Builder use (PowerPC64_Linux_Archiver, "cr"); > for Archive_Indexer use (PowerPC64_Linux_Archive_Indexer); >=20 > but that does not resolve my issue. Does anyone have an idea what I am d= oing wrong? >=20 > Thanks, > Zack I confirmed what the issue is, but I am not sure how to fix it. Basically,= the wrong "ar" and "ranlib" executables are being called by gprbuild. I a= m a little stumped how to fix this one (I already tried Archive_Builder and= Archive_Indexer attributes, but if I run the 3 commands on the command lin= e with the correct ar and ranlib, I get a correct executable. 1.) powerpc64-e6500-linux-gnu-ar cr libhello_world_cpp.a /project/hello_wor= ld_cpp/hello_world.o 2.) powerpc64-e6500-linux-gnu-ar cr libhello_world_cpp.a /project/hello_wor= ld_cpp/hello_world.o 3.) powerpc64-e6500-linux-gnu-g++ hello_world.o b__hello_world.o /project/c= ommon/dummy_common.o libhello_world_cpp.a -L/project/common/ -L/project/hel= lo_world_cpp/ -L/project/common/ -L/tools/gnat/powerpc64-e6500-linux-gnu/li= b/gcc/powerpc64-e6500-linux-gnu/5.3.0/adalib/ /tools/gnat/powerpc64-e6500-l= inux-gnu/lib/gcc/powerpc64-e6500-linux-gnu/5.3.0/adalib/libgnat.a -shared-l= ibgcc -Wl,-z,origin,-rpath,$ORIGIN/../../../tools/gnat/powerpc64-e6500-linu= x-gnu/lib -o hello_world