adacore / gprconfig_kb Goto Github PK
View Code? Open in Web Editor NEWGPR configuration knowledge base
License: Other
GPR configuration knowledge base
License: Other
Hi, while bootstrapping gprbuild on arch linux I ran into "can't find a native toolchain for language 'ada'". Others have stumbled upon the same error: https://aur.archlinux.org/packages/xmlada/. The problem seems to be that the gcc version can not be found:
In /usr/share/cprconfig/compilers.xml, gcc -v
is called and then grepped with "^gcc \S+ (\S+)"
.
Output of gcc -v
(among other lines): gcc-Version 11.1.0 (GCC)
Output of gcc --version
(first line): gcc (GCC) 11.1.0
When replacing gcc -v with gcc --version, the toolchain works just fine. I don't know if this is a problem with recent gcc versions or just arch linux or what the best solution would be without breaking support on other systems.
This issue is a follow-up of the ticket raised here: AdaCore/gprbuild#60
I experience issues with the clang support, which (randomly) replaces gcc if both are installed in /usr/bin.
To reporoduce the problem, I removed gcc
and gnatgcc
from /usr/bin
in order to make sure that clang is triggered.
Create a simple project file:
$ cat foo.gpr
project Foo is
for Source_Dirs use (".", "include");
for Languages use ("C");
for Main use ("main.c");
end foo;
Add an include
folder and add a dummy "hello.h" file (it can be empty).
Create main.c:
$ cat main.c
#include "hello.h"
int main(void) { }
And run gprbuild to get the error:
$ gprbuild -v -P foo.gpr
Changing to object directory of "Foo": "/root/tmp/"
/usr/bin/clang -c -x c -specs=/tmp/GNAT-TEMP-000004.TMP /root/tmp/main.c
clang: warning: argument unused during compilation: '-specs=/tmp/GNAT-TEMP-000004.TMP' [-Wunused-command-line-argument]
/root/tmp/main.c:1:10: fatal error: 'hello.h' file not found
#include "hello.h"
^~~~~~~~~
If you put gcc or gnatgcc back, the build works.
The problem arises with gprbuild from debian buster:
$ gprbuild --version
GPRBUILD Community 2018 (20180524) (x86_64-pc-linux-gnu)
Copyright (C) 2004-2018, AdaCore
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The compilers.xml file searches in ../lib/ for adalib, however, many distros, on 64bit, it is in ../lib64. I am assuming that there are other options, but can it not search for ../lib* so that they can all be searched for properly.
This comes off the back of gcc-mirror/gcc@9467e73 which fixed a bug where TARGET defined in s-oscons.ads had '-gnu' appended to it compared to 'gcc -dumpmachine '. This caused gprbuild to fail in is search for an Ada runtime.
If the '(.+)?' fix can be made, then we can at last build software on 64bit system without going through hoops.
To reproduce on Ubuntu 20.04:
I think aarch64-linux-gnu-
could be changed to .*-linux-gnu-
in compilers.xml and cross.xml to fix most of the issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.