AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

gprconfig does not find compilers - patch #77

Open bib1963 opened 4 years ago

bib1963 commented 4 years ago

Lots of people seem to have problems with gprconfig not finding compilers. Hopefully the small patch below is acceptable. This makes it work on all openuse installs on 32bit/64bit & the Pi4. Hardly worth asking for a pull...

index 9842d7c7..5ea6729f 100644
--- a/share/gprconfig/compilers.xml
+++ b/share/gprconfig/compilers.xml
@@ -181,7 +181,8 @@
       <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" >\.\./lib(64)?/gcc(-lib)?/$TARGET/[1-9]/adalib/</directory>
+       <directory group="default" >\.\./lib(64)?/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>
diff --git a/share/gprconfig/targetset.xml b/share/gprconfig/targetset.xml
index 96eb43ad..b736e382 100644
--- a/share/gprconfig/targetset.xml
+++ b/share/gprconfig/targetset.xml
@@ -38,6 +38,7 @@
   <targetset canonical="aarch64-linux">
     <target>aarch64-linux</target>
     <target>aarch64-linux-gnu</target>
+    <target>aarch64-.*linux.*</target>
   </targetset>

   <targetset canonical="arm-linux">
t-14 commented 4 years ago

Thank you for your contribution. The following part is a bit puzzling however:

+ <directory group="default" >\.\./lib(64)?/gcc(-lib)?/$TARGET/[1-9]/adalib/</directory>

what is the naming convention, exactly? is it really a random figure from 1 to 9?

bib1963 commented 4 years ago

On Friday, 27 March 2020 18:30:03 GMT Vasiliy Fofanov wrote:

Thank you for your contribution. The following part is a bit puzzling however:

+ <directory group="default" >\.\./lib(64)?/gcc(-lib)?/$TARGET/[1-9]/adalib/</directory>

what is the naming convention, exactly? is it really a random figure from 1 to 9?

b@eth7 $ ls -l /usr/lib64/gcc/x86_64-suse-linux/ total 16 drwxr-xr-x 8 root root 4096 Mar 9 19:34 7 drwxr-xr-x 8 root root 4096 Mar 9 19:34 8

This is on both opensuse & redhat. I assume it's on all linux distros. It's just the major version number.

As v10 and other will come out, I assume, you could change it to...

\.\./lib(64)?/gcc(-lib)?/$TARGET/[1-9][0-9]?/adalib/

I would have thought though you could extend it to cover such entries as 9.1 & 9.2.1.

Or you could just say sod it...

\.\./lib(64)?/gcc(-lib)?/$TARGET/*/adalib/
t-14 commented 4 years ago

It's just the major version number. ... Or you could just say sod it...

On the contrary, if it's a major version number, then that's what we should check rather than an arbitrary number. Otherwise, we may end up considering e.g. gcc-7's hierarchy while scanning gcc-8 toolchain. We will look into that.

qunying commented 4 years ago

It is not universally correct, as in Slackware, it is the exact version of the compiler:

ls -l /usr/lib64/gcc/x86_64-slackware-linux/
drwxr-xr-x 9 root root 4096 Apr  1 20:55 9.3.0/
bib1963 commented 4 years ago

On Monday, 25 May 2020 23:54:16 BST Zhu Qun-Ying wrote:

It is not universally correct, as in Slackware, it is the exact version of the compiler:


ls -l /usr/lib64/gcc/x86_64-slackware-linux/
drwxr-xr-x 9 root root 4096 Apr  1 20:55 9.3.0/

There's always one disto that's different...

B