AdaCore / gnat-llvm

LLVM based GNAT compiler
179 stars 18 forks source link

Issues while compiling #37

Closed GuillermoHazebrouck closed 8 months ago

GuillermoHazebrouck commented 8 months ago

I found some issues while compiling with LLVM 15 installed on my Debian:

PATH=/home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface/bin:$PATH \
gprbuild -v -n -p --target=llvm -j0 -P/home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface/lib/rts-native/adainclude/libada \
  -XCFLAGS="-O2 -g" \
  -XEXTRALIBFLAGS=" -gdwarf-aranges" \
  -XLIBRARY_KIND=static
object directory "/home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface/lib/rts-native/adainclude/../obj-static" created for project Libgnarl
Changing to object directory of "Libgnarl": "/home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface/lib/rts-native/obj-static/"
/usr/bin/clang -c -x c -O2 -g -I../include -DIN_RTS=1 -fexceptions -DSTANDALONE -gdwarf-aranges -I/home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface/lib/rts-native/adainclude /home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface/lib/rts-native/adainclude/thread.c

==============Messages for file: /home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface/lib/rts-native/adainclude/libgnarl.gpr
     3. library project Libgnarl is
                        |
        >>> unable to locate "/home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface/bin/llvm-gcc-14"
gprbuild: *** compilation phase failed
make[2]: *** [Makefile:251: quicklib] Error 7
make[2]: Leaving directory '/home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface'
make[1]: *** [Makefile:222: gnatlib-automated] Error 2
make[1]: Leaving directory '/home/guillermo/Toolchains/adawebpack/gnat-llvm/llvm-interface'
make: *** [Makefile:2: all] Error 2

llvm-interface/bin/llvm-gcc-14 does not exist indeed, but the fresh llvm-gcc does. Why is gprbuild looking for that specific version? I suspect this is related the the gprbuild knowledge base...?

ArnaudCharlet commented 8 months ago

Thank you for the report. Current GNAT LLVM requires LLVM version 16 as per the README, so you are trying a combination which is no longer supported. In addition, GNAT LLVM doesn't support alternative names (suffixes) for llvm tools, so you will probably need to rebuild LLVM yourself if you can't find a LLVM 16 package which works out of the box.

GuillermoHazebrouck commented 8 months ago

I tried building LLVM myself, but unfortunately my machine runs out of memory in the process and my OS crashes. I'll try to install the LLVM-16 packages then. And what about the last issue? I still dot see why version 14 of gnat-llvm is requested.

ArnaudCharlet commented 8 months ago

The last issue is linked to the non default name of the tools most likely.