public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/112352] New: Building gcc-12 ada fails with "error: cannot locate file system.ads"
@ 2023-11-02 17:02 rustamabd at gmail dot com
  2023-11-03  7:46 ` [Bug ada/112352] " rguenth at gcc dot gnu.org
  2023-11-03 11:23 ` rustamabd at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: rustamabd at gmail dot com @ 2023-11-02 17:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112352
           Summary: Building gcc-12 ada fails with "error: cannot locate
                    file system.ads"
           Product: gcc
           Version: 12.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rustamabd at gmail dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Trying to build GCC 12 with Ada enabled on CentOS 7.

Steps to reproduce:

GNAT requires GNAT to build. Get GNAT 2021 GPL version.

wget -O gnat-2021-20210519-x86_64-linux-bin
"https://community.download.adacore.com/v1/f3a99d283f7b3d07293b2e1d07de00e31e332325?filename=gnat-2021-20210519-x86_64-linux-bin&rand=191"
chmod +x gnat-2021-20210519-x86_64-linux-bin
sudo ./gnat-2021-20210519-x86_64-linux-bin
(install it to /usr/gnat)

Get some other GCC dependencies.

yum install glibc-devel gmp-devel mpfr-devel libmpc-devel

export
LD_LIBRARY_PATH=/usr/gnat/x86_64-pc-linux-gnu:/usr/gnat/lib64:/usr/gnat/lib:$LD_LIBRARY_PATH

export PATH=/usr/gnat/bin:$PATH

Now build it:

cd gcc-12.3.0
./configure --enable-languages=c,c++,ada,lto --disable-multilib
make -j$(nproc)

<skip>
<skip>
/root/gcc-12.3.0/host-x86_64-pc-linux-gnu/prev-gcc/xgcc
-B/root/gcc-12.3.0/host-x86_64-pc-linux-gnu/prev-gcc/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include   -fno-checking -c -g -O2
-fno-checking -gtoggle  -gnatpg  -W -Wall -I- -I. -Iada/generated -Iada
-I../.././gcc/ada ../.././gcc/ada/ali.adb -o ada/ali.o
fatal error, run-time library not installed correctly
cannot locate file system.ads


Trying to work around the issue by copying the missing files:
mkdir -p /usr/local/lib/gcc/x86_64-pc-linux-gnu/12.3.0
cp -rp /usr/gnat/lib/gcc/x86_64-pc-linux-gnu/10.3.1/rts-native/*
/usr/local/lib/gcc/x86_64-pc-linux-gnu/12.3.0/

Results in another error:

<skip>
<skip>
/root/gcc-12.3.0/host-x86_64-pc-linux-gnu/prev-gcc/xg++
-B/root/gcc-12.3.0/host-x86_64-pc-linux-gnu/prev-gcc/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/root/gcc-12.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/root/gcc-12.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs 
-I/root/gcc-12.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/root/gcc-12.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/include 
-I/root/gcc-12.3.0/libstdc++-v3/libsupc++
-L/root/gcc-12.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/root/gcc-12.3.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-no-pie -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H
-static-libstdc++ -static-libgcc  -o gnatbind -g -O2 -fno-checking -gtoggle
ada/b_gnatb.o ada/ali-util.o ada/ali.o ada/alloc.o ada/aspects.o ada/atree.o
ada/bcheck.o ada/binde.o ada/binderr.o ada/bindgen.o ada/bindo.o
ada/bindo-augmentors.o ada/bindo-builders.o ada/bindo-diagnostics.o
ada/bindo-elaborators.o ada/bindo-graphs.o ada/bindo-units.o
ada/bindo-validators.o ada/bindo-writers.o ada/bindusg.o ada/butil.o
ada/casing.o ada/csets.o ada/debug.o ada/einfo-entities.o ada/einfo-utils.o
ada/einfo.o ada/elists.o ada/err_vars.o ada/errout.o ada/erroutc.o ada/exit.o
ada/final.o ada/fmap.o ada/fname-uf.o ada/fname.o ada/gnatbind.o ada/gnatvsn.o
ada/hostparm.o ada/krunch.o ada/lib.o ada/link.o ada/namet.o ada/nlists.o
ada/opt.o ada/osint-b.o ada/osint.o ada/output.o ada/restrict.o ada/rident.o
ada/scans.o ada/scil_ll.o ada/scng.o ada/sdefault.o ada/seinfo.o ada/sem_aux.o
ada/sinfo.o ada/sinfo-nodes.o ada/sinfo-utils.o ada/sinput-c.o ada/sinput.o
ada/snames.o ada/stand.o ada/stringt.o ada/style.o ada/styleg.o ada/stylesw.o
ada/switch-b.o ada/switch.o ada/table.o ada/targext.o ada/targparm.o
ada/types.o ada/uintp.o ada/uname.o ada/urealp.o ada/widechar.o ada/gnat.o
ada/g-dynhta.o ada/g-lists.o ada/g-graphs.o ada/g-sets.o ada/s-resfil.o
ada/version.o ada/s-utf_32.o  ggc-none.o libcommon-target.a libcommon.a
../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  
/root/gcc-12.3.0/host-x86_64-pc-linux-gnu/prev-gcc/adalib/libgnat.so -ldl
/usr/gnat/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find
/root/gcc-12.3.0/host-x86_64-pc-linux-gnu/prev-gcc/adalib/libgnat.so: No such
file or directory
collect2: error: ld returned 1 exit status

Trying to fix that one with (a couple of times):
cp -rp /usr/gnat/lib/gcc/x86_64-pc-linux-gnu/10.3.1/rts-native/adalib
./host-x86_64-pc-linux-gnu/prev-gcc/

Results in the following error:
make[1]: Entering directory
`/root/gcc-12.3.0/host-x86_64-pc-linux-gnu/gnattools'
# gnattools1
make -C ../gcc/ada/tools -f ../Makefile \
  "CC=../../xgcc -B../../" "CXX=../../xg++ -B../../
-B../../../x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B../../../x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-L../../../x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L../../../x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs" "CFLAGS=-g -O2  
-W -Wall" "LDFLAGS=-static-libstdc++ -static-libgcc " "ADAFLAGS=-gnatpg -gnata"
"ADA_CFLAGS=" "INCLUDES=-iquote . -iquote .. -iquote ../.. -iquote
/root/gcc-12.3.0/gcc/ada -iquote /root/gcc-12.3.0/gcc/config -iquote
/root/gcc-12.3.0/gcc -I/root/gcc-12.3.0/include" "ADA_INCLUDES=-I- -I../rts -I.
-I/root/gcc-12.3.0/gcc/ada" "exeext=" "fsrcdir=/root/gcc-12.3.0/gcc"
"srcdir=/root/gcc-12.3.0/gcc" "GNATMAKE=../../gnatmake"
"GNATLINK=../../gnatlink" "GNATBIND=../../gnatbind" "TOOLSCASE=native" \
  ../../gnatmake ../../gnatlink
make[2]: Entering directory
`/root/gcc-12.3.0/host-x86_64-pc-linux-gnu/gcc/ada/tools'
../../xgcc -B../../ -c -g -O2   -W -Wall  -gnatpg -gnata -I- -I../rts -I.
-I/root/gcc-12.3.0/gcc/ada -gnatws -gnatyN \
    b_gnatm.adb -o b_gnatm.o
../../xg++ -B../../ -B../../../x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B../../../x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-L../../../x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L../../../x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -static-libstdc++
-static-libgcc -static-libstdc++ -static-libgcc  -DIN_GCC  -g -O2   -W -Wall -o
../../gnatmake b_gnatm.o a-except.o ali.o ali-util.o aspects.o s-casuti.o
alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o
errout.o erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o
gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o
make.o makeusg.o make_util.o namet.o nlists.o opt.o osint.o osint-m.o output.o
restrict.o rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o scans.o scng.o
sdefault.o sfn_scan.o s-purexc.o s-htable.o scil_ll.o sem_aux.o sinfo.o
sinput.o sinput-c.o snames.o stand.o stringt.o styleg.o stylesw.o system.o
validsw.o switch.o switch-m.o table.o targparm.o tempdir.o types.o uintp.o
uname.o urealp.o usage.o widechar.o seinfo.o einfo-entities.o einfo-utils.o
sinfo-nodes.o sinfo-utils.o  ../version.o ../link.o ../targext.o
../../ggc-none.o ../../libcommon-target.a ../../libcommon.a
../../../libcpp/libcpp.a ../rts/libgnat.a  
../../../libbacktrace/.libs/libbacktrace.a ../../../libiberty/libiberty.a  
-no-pie -ldl
/usr/gnat/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.3.1/ld: cannot find
-lstdc++

Trying to fix that one with:
cp -rp x86_64-pc-linux-gnu host-x86_64-pc-linux-gnu/

... Results in a successful build.

I shouldn't need to copy things over to temporary GCC locations, should I?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/112352] Building gcc-12 ada fails with "error: cannot locate file system.ads"
  2023-11-02 17:02 [Bug ada/112352] New: Building gcc-12 ada fails with "error: cannot locate file system.ads" rustamabd at gmail dot com
@ 2023-11-03  7:46 ` rguenth at gcc dot gnu.org
  2023-11-03 11:23 ` rustamabd at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-11-03  7:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
cd gcc-12.3.0
./configure --enable-languages=c,c++,ada,lto --disable-multilib
make -j$(nproc)

do not configure in source dir, use a separate directory:

cd gcc-12.3.0
mkdir obj
cd obj
./configure --enable-languages=c,c++,ada,lto --disable-multilib
make -j$(nproc)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/112352] Building gcc-12 ada fails with "error: cannot locate file system.ads"
  2023-11-02 17:02 [Bug ada/112352] New: Building gcc-12 ada fails with "error: cannot locate file system.ads" rustamabd at gmail dot com
  2023-11-03  7:46 ` [Bug ada/112352] " rguenth at gcc dot gnu.org
@ 2023-11-03 11:23 ` rustamabd at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rustamabd at gmail dot com @ 2023-11-03 11:23 UTC (permalink / raw)
  To: gcc-bugs

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

Rustam Abdullaev <rustamabd at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #2 from Rustam Abdullaev <rustamabd at gmail dot com> ---
It should probably be "../configure"

But otherwise building out-of-source solved the above mentioned issues, thank
you.

This ticket may be closed as I think it's overkill to try to make it work
in-source at this point.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-03 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02 17:02 [Bug ada/112352] New: Building gcc-12 ada fails with "error: cannot locate file system.ads" rustamabd at gmail dot com
2023-11-03  7:46 ` [Bug ada/112352] " rguenth at gcc dot gnu.org
2023-11-03 11:23 ` rustamabd at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).