This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc 3.4 - gnatmake has wrong gcc name


Jim Wilson wrote:

Joel Sherrill wrote:

The routines in question here are Find_Program_Name and Program_Name in ada/osint.adb.

Find_Program_Name gets the executable name, removes everything up to the last slash, which gives us a program name without any leading path components.

It then removes everything after the last dot. This is probably assuming that if there is a dot, then there must be some extension like .exe to be stripped off. This can be see in the above. Note the error message says sparc-rtems4, not sparc-rtems4.7-gnatmake because the supposed file name extension has been removed.

Program_name then removes everything after the last dash, which should be gnatmake, but in your case is rtems4. This leaves just sparc-. Then it appends gcc giving sparc-gcc.

The Program_Name ("gcc") call is in make.adb.

I haven't tried to verify any of this with a build or debugger.

I didn't do this because I remembered having submitted a patch for similar behvior in the gnattools years ago and wanted to find it to before doing the above.

I think your description of the behavior is correct.  I can fix it
but need to know what the real behavior should be.  Would the
Ada equivalent of name() in this shell script be the desired behavior?

--------------------------------------------------------------------
#! /bin/sh

name()
{
 # Equivalent of Find_Program_Name
 progname=`echo $1 | sed -e 's/\.exe$//'`
 # Equivalent of Program_Name
 target=`echo $progname | sed -e 's/-[a-zA-Z0-9]*$//'`
 echo ${target}-$2
}

name sparc-rtems-gnatmake gcc
name sparc-rtems4.7-gnatmake gcc
name sparc-rtems-gnatmake.exe gcc
name sparc-rtems4.7-gnatmake.exe gcc
---------------------------------------------------------------------

My impression is that Find_Program_Name is broken for
versioned target names with '.' in them and that it really
needs to be removing a known set of extensions.  Is there anything
other than .exe$ that needs to be taken off?

--joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]