AdaCore / gnat-llvm

LLVM based GNAT compiler
179 stars 18 forks source link

issue rebuilding gnat-llvm #27

Closed gcalliet closed 2 years ago

gcalliet commented 2 years ago

Very sorry for such a beotian question I'm rebuilding gnat-llvm on an up-to-date debian (gcc 11, llvm 13, clang 13). I have also built on it a community GNAT (it is on /opt/GNAT/2021). I cannot go ahead constructing libgnat: ""gprlib: could not copy ALI files to library directory gprbuild: could not build library for project libgnat"" and it seems however the .ali Are copied. Where am'I wrong?

ArnaudCharlet commented 2 years ago

Strange, seems to be the same unexplained error from #26. Which gprbuild are you using? Perhaps the version of gprbuild you are using has a bug?

gcalliet commented 2 years ago

yes same thing as #26 , no preceding error (and doing the build as root, It seems it is not an access issue)

My gprbuild version : root@big:~# which gprbuild /opt/GNAT/2021/bin//gprbuild root@big:~# root@big:~# root@big:~# gprbuild --version GPRBUILD Community 2021 (20210519) (x86_64-pc-linux-gnu) Copyright (C) 2004-2021, AdaCore

if this grpbuild / gprlib has got a bug how can we change the situation?

ArnaudCharlet commented 2 years ago

Can you try doing the build as a regular user? Perhaps this is actually the trigger (doing the build as root).

ArnaudCharlet commented 2 years ago

and if this doesn't make a difference, can you run make -C llvm-interface gnatlib GPRBUILD="gprbuild -vh -n" |& tee lib.out and send the file lib.out?

mgarcp13 commented 2 years ago

Hi,

I have the same problem under (almost) the same environment:

Debian 11, gcc (GCC) 12.0.1, llvm 13, clang 13, GNAT Community 2021 (20210519-103). The gprbuild used is the one on GNAT Community 2021.

The sources were downloaded recently, at april 19th.

I ran the command with the following output: lib.out.txt

Thank you in advance.

ArnaudCharlet commented 2 years ago

Very strange, the copy is actually proceeding correctly and the an error pops up at the end, perhaps the OS or filesystem is generating an unexpected error code to gprbuild. The good news is that the build actually proceeded, so you should be able to simply ignore the error and use GNAT LLVM: your build succeeded as far as I can tell.

mgarcp13 commented 2 years ago

Let me say that not all ALI files were copied:

mario@DESKTOP-H1D5MQS:~$ llvm-gnatbind -x p_test.ali llvm-gnatbind: Cannot find: s-stalib.ali mario@DESKTOP-H1D5MQS:~$

s-stalib.ali is located in ./gnat-llvm/llvm-interface/lib/rts-native/obj-static/s-stalib.ali so I copied all ALI files in that directory into adalalib directory:

cp ./gnat-llvm/llvm-interface/lib/rts-native/obj-static/*.ali ./gnat-llvm/llvm-interface/lib/rts-native/adalib/

Now gnat-llvm works properly:

mario@DESKTOP-H1D5MQS:~$ llvm-gnatbind -x p_test.ali mario@DESKTOP-H1D5MQS:~$