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.66.163.97 with SMTP id yh1mr15300584pab.11.1457309507559; Sun, 06 Mar 2016 16:11:47 -0800 (PST) X-Received: by 10.182.80.74 with SMTP id p10mr202778obx.8.1457309507514; Sun, 06 Mar 2016 16:11:47 -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!hb3no12033840igb.0!news-out.google.com!k1ni10921igd.0!nntp.google.com!hb3no12033833igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 6 Mar 2016 16:11:47 -0800 (PST) In-Reply-To: <71bce85e-b7d7-4bf5-8e08-c119fcf3b949@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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <59c56afe-faba-42eb-bcb9-49071b240b37@googlegroups.com> Subject: Re: Question about GNAT gprconfig From: Zack Boll Injection-Date: Mon, 07 Mar 2016 00:11:47 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:29690 Date: 2016-03-06T16:11:47-08:00 List-Id: 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 traced thi= s > > > 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 writing = a > > description just for your compiler, starting just from the GNAT section > > 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_v= ersion/adalib/ > > \.\./lib/gcc(-li= b)?/$TARGET/$gcc_version/ada_object_path > > \.\./lib/gcc(-lib)?/$TARGET/$gcc_version= /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, using > > the gprbuild --db switch). > >=20 > > You'll still need to specify --target=3Dpowerpc64-e6500-linux-gnu on th= e > > 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-li= nux as a target. Hopefully I will be able to get C and C++ building correc= tly with gprbuild. I seem to be having trouble getting my hello world C++ program to compile w= ith gprbuild. I think it is trying to use the x86_64 version of "ar". Bel= ow is my output from gprbuild with the "-v" flag. gprbuild --target=3Dpowerpc64-e6500-linux-gnu -v -d -P/project/hello_world_= cpp/hello_world_cpp.gpr -XADA_DIALECT=3DAda_2012 -XARCHITECTURE=3DPowerPC64= _Linux -XBUILD_FLAGS=3DOptimize -XELABORATION_CHECKS=3DStatic -XCOMPILER_MU= LTIPROCESS=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=3Dpowerpc6= 4-e6500-linux-gnu --config=3Dc++,,,,powerpc64-e6500-linux-gnu-g++ --config= =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_world_cp= p/" /tools/gnat/powerpc64-e6500-linux-gnu/bin/powerpc64-e6500-linux-gnu-g++ -mt= une=3De6500 -mlongcall -mpowerpc -maltivec /project/hello_world_cpp/hello_w= orld.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 s= uch 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 tim= e: 00.42s 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