gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [Gm2] Confused about shared libraries


From: Martin Kalbfuß
Subject: Re: Re: [Gm2] Confused about shared libraries
Date: Fri, 02 Oct 2009 18:19:57 +0200

Thanks for your answer. It's a bit clearer now. But I still have
Questions. I hope I don't annoy you.

to create an object file from C I need to do

gcc -fPIC -c mod.c -o mod.o

for gm2

gm2 -fPIC -fshared -c mod.mod -o mod.o

Takes -fshared only care of some gm2 specials and the results of both
commands is the same kind of file?
Or are the objects something different.

I ask because I'm confused about the second piece of code

gm2 -g -fPIC -fshared -shared program.mod -o _program.so

This doesn't look like the command line to create a program linking to
some shared library. I looks like the command to create a shared library
out of the shared objects created with the command above.

So I assume the

gcc -fPIC -c mod.c -o mod.o

is equivalent to

gm2 -fPIC -fshared -c mod.mod

and

gm2 -g -fPIC -fshared -shared mod.mod -o mod.so

is equivalent to

gcc -shared mod.o -o mod.so


So the steps to produce a shared library for gm2 are the following ones?

gm2 -c -fshared -fPIC mod.mod
gm2 -I. -shared -fshared -fPIC mod.mod -o mod.so

I wondering that there aren't any so files in the SO directory of the
pim library but only o files. What they are now? shared libaries or
shared objects. I'm totally confused. Sorry.

Something confusing about the whole process is, that you have to pass
the name of the mod even if you link the object files. And the prefixing
of the objects is confusing to. I think I miss some knowledge about the
process of linking. 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]