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.31.11.75 with SMTP id 72mr15461855vkl.2.1457328943426; Sun, 06 Mar 2016 21:35:43 -0800 (PST) X-Received: by 10.182.144.226 with SMTP id sp2mr207933obb.13.1457328943379; Sun, 06 Mar 2016 21:35:43 -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!w104no5318751qge.1!news-out.google.com!k1ni11157igd.0!nntp.google.com!hb3no12088204igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 6 Mar 2016 21:35:43 -0800 (PST) In-Reply-To: <480c58db-e2d8-4b08-abad-d5c4dd86e3d7@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> <480c58db-e2d8-4b08-abad-d5c4dd86e3d7@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Question about GNAT gprconfig From: Zack Boll Injection-Date: Mon, 07 Mar 2016 05:35:43 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:29693 Date: 2016-03-06T21:35:43-08:00 List-Id: On Sunday, March 6, 2016 at 11:51:42 PM UTC-5, Zack Boll wrote: > 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= fine > > > > > > using powerpc64-e6500-linux-gnu-gnatmake but I have been unable= to > > > > > > build with gprbuild and appropriate project files. I have trac= ed 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 fr= om > > > > > > Adacores website) > > > > > > x86_64-linux-gnu > > > > > > > > > > > > But I don't see powerpc64-e6500-linux-gnu even though the compi= ler > > > > > > executable is in my path. Does anyone know what the issue migh= t be? > > > > >=20 > > > > > I think that gprconfig's compiler description file (at > > > > > $prefix/share/gprconfig/compilers.xml) doesn't recognise your tar= get. > > > > >=20 > > > > > You could edit that file directly; might be better to start by wr= iting a > > > > > description just for your compiler, starting just from the GNAT s= ection > > > > > at about line 687, > > > > >=20 > > > > > > > > > > > > > > > > > > > > GNAT-PPC64 > > > > > (powerpc64-e6500-linux-gnu-)?gnatmak= e > > > > > > > > > > ${PREFIX}gnatls -v --version > > > > > > > > > > > > > > > Ada > > > > > > > > > > ${PREFIX}gcc -v > > > > > > > > > > > > > > > > > > > > \.\./lib/gcc(-lib)?/$TARGET/= $gcc_version/adalib/ > > > > > \.\./lib/g= cc(-lib)?/$TARGET/$gcc_version/ada_object_path > > > > > \.\./lib/gcc(-lib)?/$TARGET/$gcc_v= ersion/rts-(.*)/adalib/ > > > > > \.\./$TARGET/lib/gnat/(.*)/adalib/= > > > > > > > > > > > > > > > ${PREFIX}gcc -dumpmachine > > > > > > > > > > > > > > > > > > > > > > > > >=20 > > > > > (not sure you need all of the section) and put this i= n > > > > > x-compilers.xml alongside the original compilers.xml (or locally,= using > > > > > 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 y= our > > > > > GPR. > > > > >=20 > > > > > If this works, you'll probably want to add sections for C, C++, A= SM. > > > >=20 > > > > Thanks, I was able to edit the existing GNAT line to support powerp= c64-linux as a target. Hopefully I will be able to get C and C++ building = correctly with gprbuild. > > >=20 > > > I seem to be having trouble getting my hello world C++ program to com= pile 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_= world_cpp/hello_world_cpp.gpr -XADA_DIALECT=3DAda_2012 -XARCHITECTURE=3DPow= erPC64_Linux -XBUILD_FLAGS=3DOptimize -XELABORATION_CHECKS=3DStatic -XCOMPI= LER_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=3Dpo= werpc64-e6500-linux-gnu --config=3Dc++,,,,powerpc64-e6500-linux-gnu-g++ --c= onfig=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 = exist > > > Changing to object directory of "hello_world_cpp": "/project/hello_wo= rld_cpp/" > > > /tools/gnat/powerpc64-e6500-linux-gnu/bin/powerpc64-e6500-linux-gnu-g= ++ -mtune=3De6500 -mlongcall -mpowerpc -maltivec /project/hello_world_cpp/h= ello_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_= world_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), elaps= ed 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-ranli= b"; > >=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= doing wrong? > >=20 > > Thanks, > > Zack >=20 > I confirmed what the issue is, but I am not sure how to fix it. Basicall= y, the wrong "ar" and "ranlib" executables are being called by gprbuild. I= am a little stumped how to fix this one (I already tried Archive_Builder a= nd Archive_Indexer attributes, but if I run the 3 commands on the command l= ine with the correct ar and ranlib, I get a correct executable. >=20 > 1.) powerpc64-e6500-linux-gnu-ar cr libhello_world_cpp.a /project/hello_w= orld_cpp/hello_world.o > 2.) powerpc64-e6500-linux-gnu-ar cr libhello_world_cpp.a /project/hello_w= orld_cpp/hello_world.o > 3.) powerpc64-e6500-linux-gnu-g++ hello_world.o b__hello_world.o /project= /common/dummy_common.o libhello_world_cpp.a -L/project/common/ -L/project/h= ello_world_cpp/ -L/project/common/ -L/tools/gnat/powerpc64-e6500-linux-gnu/= lib/gcc/powerpc64-e6500-linux-gnu/5.3.0/adalib/ /tools/gnat/powerpc64-e6500= -linux-gnu/lib/gcc/powerpc64-e6500-linux-gnu/5.3.0/adalib/libgnat.a -shared= -libgcc -Wl,-z,origin,-rpath,$ORIGIN/../../../tools/gnat/powerpc64-e6500-li= nux-gnu/lib -o hello_world Ok, I finally got it working, I needed to edit linker.xml in shared/gprconf= ig directory.