https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79724

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |charlet at adacore dot com,
                   |                            |derodat at adacore dot com,
                   |                            |fxcoudert at gcc dot gnu.org
            Summary|please respect calling gnat |GNAT tools do not respect
                   |tools configured with       |--program-suffix and
                   |--program-suffix and        |--program-prefix
                   |--program-prefix            |
   Last reconfirmed|                            |2021-12-23
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Confirmed. This is blocking Ada integration into Homebrew:
https://github.com/Homebrew/homebrew-core/pull/77641

We configure GCC with:
configure --prefix=/tmp/irun --enable-languages=all --program-suffix=-11

This leads to the installation of suffixed gnat tools:

meau /tmp/irun $ ls bin/gnat*
bin/gnat-11      bin/gnatchop-11  bin/gnatkr-11    bin/gnatls-11   
bin/gnatname-11
bin/gnatbind-11  bin/gnatclean-11 bin/gnatlink-11  bin/gnatmake-11 
bin/gnatprep-11

But they're not usable:

meau /tmp/irun $ gnatmake-11 hello.adb
gcc -c hello.adb
clang: error: unknown argument: '-gnatea'
clang: error: unknown argument: '-gnatez'
gnatmake-11: "hello.adb" compilation error

because gnatmake-11 is calling the unsuffixed `gcc`, which does not support
Ada.
(On macOS, this system compiler is a wrapper to clang.)

Even if I try to add some options to gnatmake, it will still somehow fail,
because the relevant options are not passed down to gnatlink:

meau /tmp/irun $ gnatmake-11 hello.adb --GCC=gcc-11 --GNATBIND=gnatbind-11
--GNATLINK=gnatlink-11
gcc-11 -c hello.adb
gnatbind-11 -x hello.ali
gnatlink-11 hello.ali
clang: error: unknown argument: '-gnatA'
clang: error: unknown argument: '-gnatWb'
clang: error: unknown argument: '-gnatiw'
clang: error: unknown argument: '-gnatws'
gnatmake-11: *** link failed.

Reply via email to