From: Zack Boll <zackboll@gmail.com>
Subject: Re: Question about GNAT gprconfig
Date: Sun, 6 Mar 2016 16:11:47 -0800 (PST)
Date: 2016-03-06T16:11:47-08:00 [thread overview]
Message-ID: <59c56afe-faba-42eb-bcb9-49071b240b37@googlegroups.com> (raw)
In-Reply-To: <71bce85e-b7d7-4bf5-8e08-c119fcf3b949@googlegroups.com>
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 <zackboll@gmail.com> writes:
> >
> > > 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 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 compiler
> > > executable is in my path. Does anyone know what the issue might be?
> >
> > I think that gprconfig's compiler description file (at
> > $prefix/share/gprconfig/compilers.xml) doesn't recognise your target.
> >
> > 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,
> >
> > <?xml version="1.0" ?>
> > <gprconfig>
> > <compiler_description>
> > <name>GNAT-PPC64</name>
> > <executable prefix="1">(powerpc64-e6500-linux-gnu-)?gnatmake</executable>
> > <version>
> > <external>${PREFIX}gnatls -v --version</external>
> > <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
> > </version>
> > <languages>Ada</languages>
> > <variable name="gcc_version">
> > <external>${PREFIX}gcc -v</external>
> > <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
> > </variable>
> > <runtimes default="default,kernel,native">
> > <directory group="default" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/</directory>
> > <directory group="default" contents="^rts-">\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/ada_object_path</directory>
> > <directory group="2" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/rts-(.*)/adalib/</directory>
> > <directory group="1" >\.\./$TARGET/lib/gnat/(.*)/adalib/</directory>
> > </runtimes>
> > <target>
> > <external>${PREFIX}gcc -dumpmachine</external>
> > <grep regexp="[^\r\n]+"></grep>
> > </target>
> > </compiler_description>
> > </gprconfig>
> >
> > (not sure you need all of the <runtimes/> section) and put this in
> > x-compilers.xml alongside the original compilers.xml (or locally, using
> > the gprbuild --db switch).
> >
> > You'll still need to specify --target=powerpc64-e6500-linux-gnu on the
> > command line, or for Target use "powerpc64-e6500-linux-gnu"; in your
> > GPR.
> >
> > If this works, you'll probably want to add sections for C, C++, ASM.
>
> 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 correctly with gprbuild.
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". Below is my output from gprbuild with the "-v" flag.
gprbuild --target=powerpc64-e6500-linux-gnu -v -d -P/project/hello_world_cpp/hello_world_cpp.gpr -XADA_DIALECT=Ada_2012 -XARCHITECTURE=PowerPC64_Linux -XBUILD_FLAGS=Optimize -XELABORATION_CHECKS=Static -XCOMPILER_MULTIPROCESS=8 -XDEBUG_TARGET=local 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=powerpc64-e6500-linux-gnu --config=c++,,,,powerpc64-e6500-linux-gnu-g++ --config=ada,,,,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_cpp/"
/tools/gnat/powerpc64-e6500-linux-gnu/bin/powerpc64-e6500-linux-gnu-g++ -mtune=e6500 -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_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), elapsed time: 00.42s
Below is the C++ compiler I defined in the compilers.xml file.
<!-- G++ for GNU Linux -->
<compiler_description>
<name>G++-PPC64</name>
<executable prefix="1">(powerpc64-e6500-linux-gnu)-g\+\+</executable>
<version>
<external>${PREFIX}-g++ -v</external>
<nogrep regexp="for GNAT Pro"></nogrep>
<grep regexp="^gcc \S+ (\S+)" group="1"></grep>
</version>
<languages>C++</languages>
<target>
<external>${PREFIX}-g++ -dumpmachine</external>
<grep regexp="[^\r\n]+"></grep>
</target>
</compiler_description>
next prev parent reply other threads:[~2016-03-07 0:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-06 7:59 Question about GNAT gprconfig Zack Boll
2016-03-06 9:20 ` Dmitry A. Kazakov
2016-03-06 11:17 ` Simon Wright
2016-03-06 22:26 ` Zack Boll
2016-03-07 0:11 ` Zack Boll [this message]
2016-03-07 1:33 ` Zack Boll
2016-03-07 4:51 ` Zack Boll
2016-03-07 5:35 ` Zack Boll
2016-03-07 8:28 ` Dmitry A. Kazakov
2016-03-08 3:03 ` zackius
2016-03-08 8:43 ` Dmitry A. Kazakov
2016-03-13 3:00 ` Zack Boll
2016-03-07 8:31 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox