[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] A bit more informed
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] A bit more informed |
Date: |
Sat, 10 Oct 2009 10:37:19 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Martin Kalbfuß <address@hidden> writes:
> My further studies has shown that -fshared and -shared are the same.
> Both have no effect when used together with the -c option. They are only
> useful without the -c option and if the object files are already
> compiled. This is a different behavior then gcc has. If there are no
> object files, gcc creates them out of the sources. gm2 needs the
> -fmakeall option to behave like this.
>
> So to create a shared library, the right command line is
>
> ################################################
> gm2 -fshared -fPIC -fmakeall *.mod -o libname.so
> ################################################
Hi Martin,
wouldn't the correct command line be:
#########################################################
gm2 -fshared -fPIC -fmakeall modulename.mod -o libname.so
#########################################################
as -fmakeall creates a Makefile to build modulename and all its
dependents..
>
> or
>
> ################################
> gm2 -c -fPIC *.mod
> gm2 -fshared *.mod -o libname.so
> ################################
>
> And when Each module should be a separate shared object then the way to
> create them is
>
> ########################################################
> for i in *.mod ; do
> do gm2 -fshared -fPIC -fmakeall $i -o ${i%.*}.so
> done
> ########################################################
I agree
> or
>
> #####################################
> gm2 -c -fPIC *.mod
> for i in *.mod ; do
> gm2 -fshared $i -o ${i%.*}.so
> done
> #####################################
using wildcards to specify sources in gm2 do not yet work. I'll look
into how much restructuring the front end driver would require to allow:
gm2 -c -fPIC *.mod
> I think the result of this is what should be in the SO directories.
> Not the relocatables.
you will need to specify this:
for i in *.mod ; do
gm2 -c -fPIC ${i}.mod -o SO/`basename ${i} .mod`.o
done
> Finally I THINK I understand the process of creating shared libraries.
> Hopefully :-)
excellent and thanks for the feedback,
regards,
Gaius