Bug 15819 - support for alternate exec-prefix
Summary: support for alternate exec-prefix
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 3.4.0
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-04 10:25 UTC by Markus Schöpflin
Modified: 2005-10-02 18:05 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-10-02 18:05:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Schöpflin 2004-06-04 10:25:18 UTC
When installing gcc 3.4.0 from scratch using a non default prefix and exec 
prefix, the resulting ADA compiler cannot compile anything after installation.

The compiler has been configured as noted below, compiled with "make bootstrap 
&& make -C gcc gnatlib_and_tools" and installed with "make install".

After installation, the following ADA programm cannot be compiled: "procedure 
conftest is begin null; end conftest;". The command "gcc -c conftest.adb" 
results in the following error message:

fatal error, run-time library not installed correctly
cannot locate file system.ads
compilation abandoned

gcc -v -c conftest.adb gives the following output:

Reading specs from /net/camos/opt/exec/Linux-i686/lib/gcc/i686-pc-linux-
gnu/3.4.0/specs
Configured with: /home/schoepf/net/src/extern/gcc-3.4.0/configure --
prefix=/net/camos/opt --exec-prefix=/net/camos/opt/exec/Linux-i686 --enable-
languages=c,c++,ada
Thread model: posix
gcc version 3.4.0
 /net/camos/opt/exec/Linux-i686/libexec/gcc/i686-pc-linux-gnu/3.4.0/gnat1 -
quiet -dumpbase conftest.adb -mtune=pentiumpro conftest.adb -o /tmp/ccp9fm08.s
fatal error, run-time library not installed correctly
cannot locate file system.ads
compilation abandoned

"strace /net/camos/opt/exec/Linux-i686/libexec/gcc/i686-pc-linux-
gnu/3.4.0/gnat1 -quiet -dumpbase conftest.adb -mtune=pentiumpro conftest.adb -
o /tmp/ccp9fm08.s" gives the following results:

...
open("/net/camos/opt/exec/Linux-i686/exec/Linux-i686/lib/gcc/i686-pc-linux-
gnu/3.4.0/ada_source_path", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/net/camos/opt/exec/Linux-i686/exec/Linux-i686/lib/gcc/i686-pc-linux-
gnu/3.4.0/ada_object_path", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("system.ads", 0xbfffecd0)        = -1 ENOENT (No such file or directory)
stat64("/net/camos/opt/exec/Linux-i686/exec/Linux-i686/lib/gcc/i686-pc-linux-
gnu/3.4.0/adainclude/system.ads", 0xbfffec10) = -1 ENOENT (No such file or 
directory)
write(1, "fatal error, run-time library no"..., 54fatal error, run-time library 
not installed correctly
) = 54
write(1, "cannot locate file system.ads\n", 30cannot locate file system.ads
) = 30
write(2, "compilation abandoned\n", 22compilation abandoned
...

It looks like the compiler doubles the exec prefix in the path, therefore it 
doesn't find the file located here:

/net/camos/opt/exec/Linux-i686/lib/gcc/i686-pc-linux-
gnu/3.4.0/adainclude/system.ads
Comment 1 Andrew Pinski 2004-06-04 11:23:07 UTC
You did not follow the directions.
The directions say "cd gcc && make -C gnatlib_and_tools" not "make -C gcc gnatlib_and_tools"

Can you try that?
Comment 2 Markus Schöpflin 2004-06-04 12:44:24 UTC
Subject: RE:  ada compiler not working after installation

pinskia at gcc dot gnu dot org wrote:

> ------- Additional Comments From pinskia at gcc dot gnu dot org 
> 2004-06-04 11:23 ------- You did not follow the directions.
> The directions say "cd gcc && make -C gnatlib_and_tools" not "make -C
> gcc gnatlib_and_tools" 
> 
> Can you try that?

I did try this in a new directory and got the same results.
Comment 3 Andrew Pinski 2004-06-04 14:42:43 UTC
Are you sure that your orginal Ada compiler is working?
Comment 4 Markus Schöpflin 2004-06-04 16:08:20 UTC
Subject: RE:  ada compiler not working after installation

pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 
> 2004-06-04 14:42 ------- Are you sure that your orginal Ada compiler
> is working? 

Yes. I tried it with the following compilers:

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)

and

Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.1/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --disable-checking --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.1 (SuSE Linux)

Both are installed from the RPMs supplied by the respective vendors. And with both compilers the compilation log for gcc 3.4.0 looks ok. They are both able to compile the empty test program without errors.
Comment 5 Markus Schöpflin 2004-06-07 12:53:16 UTC
Subject: RE:  ada compiler not working after installation

One more thing to note. When I set GCC_ROOT to /net/camos/opt, the compiler works ok. (It is able to compile itself.)
Comment 6 Markus Schöpflin 2004-06-07 13:22:46 UTC
Subject: RE:  ada compiler not working after installation

Further debugging shows that the problem must be somewhere in Relocate_Path in the file osint.adb. It is called with Prefix=/net/camos/opt/ and Path=/net/camos/opt/exec/Linux-i686/lib/gcc/i686-pc-linux-gnu/3.4.0/.
Further down, Std_Prefix is initialized with /net/camos/opt/exec/Linux-i686/. Then a new path is constructed and returned as /net/camos/opt/exec/Linux-i686/exec/Linux-i686/lib/gcc/i686-pc-linux-gnu/3.4.0/ which is wrong.

As this code has been added for GCC 3.4.0 (file revision 1.13), it probably does not handle exec prefixes correctly.
Comment 7 Arnaud Charlet 2004-06-08 10:46:19 UTC
Right, alternate exec-prefix have never been supported by the Ada
front-end.

Suggestions/patches welcome to add this capability.

Arno
Comment 8 Arnaud Charlet 2005-03-17 10:38:48 UTC
Changing summary line.

Arno