This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Static initializer in shared libraries on Linux #3
- To: Marcel Ruff <ruff at swand dot lake dot de>
- Subject: Re: Static initializer in shared libraries on Linux #3
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Mon, 17 Sep 2001 11:32:54 -0700
- Cc: gcc <gcc at gcc dot gnu dot org>
- References: <3BA62A41.B42E883E@swand.lake.de>
On Mon, Sep 17, 2001 at 06:52:17PM +0200, Marcel Ruff wrote:
> > H . J . Lu wrote:
> > Please provide a small, complete testcase.
>
> Here it is (this time attached):
>
> If you run the simple shell script on Linux
>
> ./compile.sh
>
> it creates two shared libraries,
> an executable xy.exe (which runs fine)
> and compiles the java file (which fails on running).
Where do you get the idea to use
# ld -o libInitTest.so -shared -rpath . InitTest.o
# ld -o libxy.so -shared -rpath . xy.o
on Linux? It won't work on Linux. Please NEVER EVER use ld directly
for anything unless you know what you are doing. Please use
# gcc -o libInitTest.so -shared -rpath . InitTest.o
# gcc -o libxy.so -shared -rpath . xy.o
or
# g++ -o libInitTest.so -shared -rpath . InitTest.o
# g++ -o libxy.so -shared -rpath . xy.o
H.J.