Bug 14614 - Double target prefixed gcjh
Summary: Double target prefixed gcjh
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 17939 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-17 04:04 UTC by corsepiu
Modified: 2004-12-03 19:38 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.0.0
Known to fail: 3.4.0
Last reconfirmed: 2004-10-13 12:03:03


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description corsepiu 2004-03-17 04:04:02 UTC
Cross building gcc-3.4-branch (20040316) installs gcjh twice, once host-prefixed
and once double host-prefixed:

Example:
configure --target=sparc-rtems4.7 --prefix=/opt/rtems-4.7 ...
...
make install

Results into:
/opt/rtems-4.7/bin/sparc-rtems4.7-gcjh
/opt/rtems-4.7/bin/sparc-rtems4.7-sparc-rtems4.7-gcjh

I guess there should only be one sparc-rtems4.7-gcjh.
Comment 1 Andrew Pinski 2004-10-11 18:37:48 UTC
*** Bug 17939 has been marked as a duplicate of this bug. ***
Comment 2 Tom Tromey 2004-10-11 19:08:01 UTC
Do you get a double prefix for gcj as well?
Can you tell me how the Makefile variable program_transform_name
is set in <build>/gcc/Makefile?

I suspect the problem is that GCJH_TARGET_INSTALL_NAME
adds a second prefix.

Also, based on comparing Make-lang.in, I would say that
this bug probably exists on the trunk as well.
Comment 3 Eric Weddington 2004-10-11 19:14:29 UTC
Subject: Re:  Double target prefixed gcjh

tromey at gcc dot gnu dot org wrote:

>------- Additional Comments From tromey at gcc dot gnu dot org  2004-10-11 19:08 -------
>Do you get a double prefix for gcj as well?
>  
>
For the avr target, no.

>Can you tell me how the Makefile variable program_transform_name
>is set in <build>/gcc/Makefile?
>
>  
>
For the avr target:

# Sed command to transform gcc to installed name.
program_transform_name := s,^,avr-,;

Comment 4 Tom Tromey 2004-10-11 21:20:12 UTC
I suppose you could try this.
I made it by looking at what other install rules are
doing in this area.  I'm not at all sure it is correct.

Index: Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Make-lang.in,v
retrieving revision 1.145
diff -u -r1.145 Make-lang.in
--- Make-lang.in 22 Sep 2004 11:21:21 -0000 1.145
+++ Make-lang.in 11 Oct 2004 21:17:52 -0000
@@ -207,7 +207,9 @@
 	    rm -f $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
 	    $(INSTALL_PROGRAM) $$tool$(exeext)
$(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
 	    chmod a+x $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
-	    if [ $$tool = gcjh ]; then \
+	    if [ -f $(GCJ)-cross$(exeext) ]; then \
+	      true; \
+	    elif [ $$tool = gcjh ]; then \
 	      rm -f $(DESTDIR)$(bindir)/$(GCJH_TARGET_INSTALL_NAME)$(exeext); \
 	      ( cd $(DESTDIR)$(bindir) && \
 	        $(LN) $$tool_transformed_name$(exeext)
$(GCJH_TARGET_INSTALL_NAME)$(exeext) ); \
Comment 5 Eric Weddington 2004-10-11 22:18:11 UTC
Subject: Re:  Double target prefixed gcjh

tromey at gcc dot gnu dot org wrote:

>------- Additional Comments From tromey at gcc dot gnu dot org  2004-10-11 21:20 -------
>I suppose you could try this.
>I made it by looking at what other install rules are
>doing in this area.  I'm not at all sure it is correct.
>
>Index: Make-lang.in
>===================================================================
>RCS file: /cvs/gcc/gcc/gcc/java/Make-lang.in,v
>retrieving revision 1.145
>diff -u -r1.145 Make-lang.in
>--- Make-lang.in 22 Sep 2004 11:21:21 -0000 1.145
>+++ Make-lang.in 11 Oct 2004 21:17:52 -0000
>@@ -207,7 +207,9 @@
> 	    rm -f $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
> 	    $(INSTALL_PROGRAM) $$tool$(exeext)
>$(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
> 	    chmod a+x $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
>-	    if [ $$tool = gcjh ]; then \
>+	    if [ -f $(GCJ)-cross$(exeext) ]; then \
>+	      true; \
>+	    elif [ $$tool = gcjh ]; then \
> 	      rm -f $(DESTDIR)$(bindir)/$(GCJH_TARGET_INSTALL_NAME)$(exeext); \
> 	      ( cd $(DESTDIR)$(bindir) && \
> 	        $(LN) $$tool_transformed_name$(exeext)
>$(GCJH_TARGET_INSTALL_NAME)$(exeext) ); \
>
>
>  
>

Patch works for the avr target. Thanks!
Eric
Comment 6 Giovanni Bajo 2004-10-13 12:03:01 UTC
Confirmed.

Eric, do you happen to know when this bug first appeared? Did you build other 
older compilers which did not have this problem?

Tom, are you going to submit this patch then?
Comment 7 Eric Weddington 2004-10-13 13:45:40 UTC
Subject: Re:  Double target prefixed gcjh

On 13 Oct 2004 at 12:03, giovannibajo at libero dot it wrote:

> 
> ------- Additional Comments From giovannibajo at libero dot it  2004-10-13 12:03 -------
> Confirmed.
> 
> Eric, do you happen to know when this bug first appeared? Did you build other 
> older compilers which did not have this problem?
> 

Unfortunately no, I do not know when this bug first appeared. Only in the last week did I first try 
to build java for the avr target, and to my knowledge it's the first time anybody has tried it. You 
can see some messages about this on the java list. And, no, I did not build it with older 
compilers.

I can't speak for the original reporter of this bug though.

Eric
Comment 8 Ralf Corsepius 2004-10-13 14:41:19 UTC
(In reply to comment #7)

> > Eric, do you happen to know when this bug first appeared?
I noticed it for the first time shortly before submitting this PR (Opened:
2004-03-17; cf. above;).

I don't recall the corresponding gcc-release off hand but notes in my
build-scripts indicate this bug to have appeared before gcc-3.4.0.

As gcj doesn't build for most of my "usual targets" (embedded *rtems
cross-toolchiains) due to lack of the infrastructure it requires, I have
disabled building gcj since then and can't tell if this issue has re-appeared or
if had been persistent since then.

> I can't speak for the original reporter of this bug though.
I am the original reporter ;)
Comment 9 CVS Commits 2004-12-03 19:32:45 UTC
Subject: Bug 14614

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2004-12-03 19:32:39

Modified files:
	gcc/java       : ChangeLog Make-lang.in 

Log message:
	PR bootstrap/14614:
	* Make-lang.in (java.install-common): Only install transformed

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1514&r2=1.1515
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/Make-lang.in.diff?cvsroot=gcc&r1=1.149&r2=1.150

Comment 10 Tom Tromey 2004-12-03 19:33:49 UTC
Fix checked in