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]

Re: Static initializer in shared libraries on Linux #3


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.


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