public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1231: gcj compiled class will not run because of shared lib error!
@ 2000-12-20 12:22 mdejong
  0 siblings, 0 replies; only message in thread
From: mdejong @ 2000-12-20 12:22 UTC (permalink / raw)
  To: java-gnats

>Number:         1231
>Category:       java
>Synopsis:       gcj compiled class will not run because of shared lib error!
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    green
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:18:03 PST 2000
>Closed-Date:    Wed Aug 16 07:22:00 PDT 2000
>Last-Modified:  Wed Aug 16 07:30:00 PDT 2000
>Originator:     Mo
>Release:        EGCS from Sat Apr  8
>Organization:
>Environment:
Red Hat 5.2 box.
>Description:
I can not run an gcj compiled executable without
setting the LD_LIBRARY_PATH or passing a special
argument for the runtime linker.

% cat InnerInterface2.java
// File InnerInterface2.java

public class InnerInterface2 {
    interface Inter {
        public static final int NUM = 0;
    }

    public static void main(String[] args) {
        Inter i = new foo();
        System.out.println(i.NUM);
    }
}

class foo implements InnerInterface2.Inter {}



% gcj -o InnerInterface2 --main=InnerInterface2 InnerInterface2.java

% ./InnerInterface2
./InnerInterface2: error in loading shared libraries
libgcj.so.1: cannot open shared object file: No such file or directory

If I pass the the lib directory where libgcj is installed, it seems to
work just fine.

% gcj -o InnerInterface2 --main=InnerInterface2 InnerInterface2.java \
-Wl,-rpath,/mnt/image/install/lib

% ./InnerInterface2
0


I should not need to pass the location where libgcj is installed to
be able to just run an executable produced by gcj. The gcj executable
should do this for me.
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Formerly PR gcj/196


From: Tom Tromey <tromey@cygnus.com>
To: mdejong@cygnus.com
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/196: gcj compiled class will not run because of shared lib error!
Date: Sun, 9 Apr 2000 09:51:18 -0700 (PDT)

 We've talked about this one on the mailing list before.
 There is a reason not to do this, but I forget what it is.
 
 Tom

From: Mo DeJong <mdejong@cygnus.com>
To: Tom Tromey <tromey@cygnus.com>
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/196: gcj compiled class will not run because of shared lib error!
Date: Sun, 9 Apr 2000 14:58:19 -0700 (PDT)

 Is this one of those issues that will magically go away when libgcj
 becomes part of the main gcc toolchain? I would not expect a user
 to think that they needed to set the LD_LIBRARY_PATH to run
 code compiled like this:
 
 gcc -o run run.c
 
 Mo Dejong
 Red Hat Inc.
 
 On Sun, 9 Apr 2000, Tom Tromey wrote:
 
 > We've talked about this one on the mailing list before.
 > There is a reason not to do this, but I forget what it is.
 > 
 > Tom
 > 

From: Tom Tromey <tromey@cygnus.com>
To: Mo DeJong <mdejong@cygnus.com>
Cc: Tom Tromey <tromey@cygnus.com>, java-gnats@sourceware.cygnus.com
Subject: Re: gcj/196: gcj compiled class will not run because of shared lib error!
Date: Sun, 9 Apr 2000 16:25:28 -0700 (PDT)

 Mo> Is this one of those issues that will magically go away when
 Mo> libgcj becomes part of the main gcc toolchain?
 
 No.  It does go away once libgcj is installed as part of the overall
 system though.
 
 The last discussion on this was last month or so.  I should look up
 the answer, but I'm feeling lazy now.
 
 Tom

From: Bryce McKinlay <bryce@albatross.co.nz>
To: java-gnats@sourceware.cygnus.com
Cc:  
Subject: Re: gcj/196: gcj compiled class will not run because of shared lib 
 error!
Date: Mon, 10 Apr 2000 23:40:26 +1200

 Tom Tromey wrote:
 
 >  Mo> Is this one of those issues that will magically go away when
 >  Mo> libgcj becomes part of the main gcc toolchain?
 >
 >  No.  It does go away once libgcj is installed as part of the overall
 >  system though.
 >
 >  The last discussion on this was last month or so.  I should look up
 >  the answer, but I'm feeling lazy now.
 
 I searched through the list archives but couldn't find a reason why
 --rpath shouldn't
 be used, only more discussion along the lines of "hmm, isn't there a
 reason that we
 dont use rpath?"
 
 As long as LD_LIBRARY_PATH overrides the rpath setting, I think we
 should use it. If
 it turns out there is a problem with it then we can allways reverse the
 change.
 
 regards
 
   [ bryce ]
Responsible-Changed-From-To: apbianco->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Fri Jun 23 17:49:42 2000
Responsible-Changed-Why:
    This is mine.
    

From: tromey@cygnus.com
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com, mdejong@cygnus.com,
  tromey@cygnus.com
Cc:  
Subject: Re: gcj/196
Date: 24 Jun 2000 00:49:42 -0000

 Synopsis: gcj compiled class will not run because of shared lib error!
 
 Responsible-Changed-From-To: apbianco->tromey
 Responsible-Changed-By: tromey
 Responsible-Changed-When: Fri Jun 23 17:49:42 2000
 Responsible-Changed-Why:
     This is mine.
     
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=196&database=java

From: Anthony Green <green@cygnus.com>
To: "'java-gnats@sourceware.cygnus.com'"
	 <java-gnats@sourceware.cygnus.com>,
        "'mdejong@cygnus.com'"
	 <mdejong@cygnus.com>,
        "'tromey@cygnus.com'" <tromey@cygnus.com>,
        "'bryce@albatross.co.nz'" <bryce@albatross.co.nz>
Cc:  
Subject: re: gcj/196
Date: Sun, 13 Aug 2000 09:31:17 -0700

 I don't think the compiler should pass the rpath flag down to the linker.  My 
 reasons are:
 
 	- it's different than what we do for C++ and C
 
 	- do all linkers support -rpath?  This sounds like the kind of hairyness 
 libtool was invented for.
 
 	- we can only guess where the library will be - the compiler has no way to 
 know.
 
 I think this issue is really only a minor pain for us as we hack on the 
 tools.  This will ultimately be a non-issue for end users because everything 
 will be installed correctly.
 
 I will close this PR in a few days unless somebody objects.
 
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%26pr=196%26database  
 =java

From: Tom Tromey <tromey@cygnus.com>
To: "green@cygnus.com" <green@cygnus.com>
Cc: "'java-gnats@sourceware.cygnus.com'" <java-gnats@sourceware.cygnus.com>,
        "'mdejong@cygnus.com'" <mdejong@cygnus.com>,
        "'bryce@albatross.co.nz'" <bryce@albatross.co.nz>
Subject: Re: gcj/196
Date: 15 Aug 2000 14:20:18 -0600

 Anthony> I don't think the compiler should pass the rpath flag down to
 Anthony> the linker.  My reasons are:
 
 Anthony> 	- it's different than what we do for C++ and C
 
 That's fine for now.  Later we should change to follow whatever gcc
 decides to do for a shared libgcj.so.
 
 Anthony> - we can only guess where the library will be - the compiler
 Anthony> has no way to know.
 
 That's especially true given that people might build on one system for
 some system with a different layout.
 
 Anthony> I will close this PR in a few days unless somebody objects.
 
 Thanks.
 
 Tom
Responsible-Changed-From-To: tromey->green
Responsible-Changed-By: green
Responsible-Changed-When: Wed Aug 16 07:22:00 2000
Responsible-Changed-Why:
    I will close this.
State-Changed-From-To: open->closed
State-Changed-By: green
State-Changed-When: Wed Aug 16 07:22:00 2000
State-Changed-Why:
    This is expected behaviour.  See the discussion in the Audit-Trail for details.

From: green@cygnus.com
To: green@cygnus.com, java-gnats@sourceware.cygnus.com, mdejong@cygnus.com,
  tromey@cygnus.com
Cc:  
Subject: Re: gcj/196
Date: 16 Aug 2000 14:22:00 -0000

 Synopsis: gcj compiled class will not run because of shared lib error!
 
 Responsible-Changed-From-To: tromey->green
 Responsible-Changed-By: green
 Responsible-Changed-When: Wed Aug 16 07:22:00 2000
 Responsible-Changed-Why:
     I will close this.
 State-Changed-From-To: open->closed
 State-Changed-By: green
 State-Changed-When: Wed Aug 16 07:22:00 2000
 State-Changed-Why:
     This is expected behaviour.  See the discussion in the Audit-Trail for details.
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=196&database=java
>Unformatted:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:22 java/1231: gcj compiled class will not run because of shared lib error! mdejong

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).