gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] building a shared object


From: jiverson2
Subject: Re: [Gm2] building a shared object
Date: Wed, 21 Apr 2010 20:12:03 -0400
User-agent: SquirrelMail/1.4.19

Hi Gaius,

Thanks for the info.

So the exported symbols are taken from a definition module.  Only for the
"main" module (how is that specified?) or all modules in the project?  
The shared object I'm trying to create has multiple modules.

I tried building the project (3 modules) with

gm2 -c -fiso -fshared -fPIC a.mod
gm2 -c -fiso -fshared -fPIC b.mod
gm2 -c -fiso -fshared -fPIC fmakelist main.mod
gm2 -o mylib.so -fiso -fshared -fPIC -shared -fuselist main.mod

which produces the following error:

*** glibc detected *** free(): invalid next size (normal):
0x000000000052f470 ***
Aborted

I can send the files if necessary, but maybe I've made a simple mistake.

Thanks,
Scott



> SiTex Graphics <address@hidden> writes:
>
>> Is there a simple example of how to build a shared object with gm2?  I
>> assume I can just use -fshared to produce a .so, but how do I specify
>> which functions or symbols are exported?
>>
>> I failed to find any info in the manual but I may well have overlooked
>> something...
>>
>> Thanks,
>> Scott
>
> Hi Scott,
>
> there is a section:  How to produce swig interface files
> in the documentation - which describes the process.  I need to write
> another section just describing the shared library, rather than the
> combination of swig and shared libraries..
>
> Also there are a few examples under:
>
> gcc-4.1.2/gcc/gm2/examples/swig
>
> I've recently modified the examples so that most of them build from
> the build directory:
>
> so:
>
> $ cd build-4.1.2/gcc/gm2/examples/swig/tiny
> $ make pre-install
>
> should yield:
>
> rm -f -f *.o *.so a.out *.pyc *~ *_wrap* tiny.py *.i *.lst *_m2.cpp
> ../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fshared
> -fswig
> -I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny:../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs-iso
> -c -fPIC -g -fswig
> ../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
> swig -c++ -python tiny.i
> ../../../../g++ -c -fPIC tiny_wrap.cxx -I/usr/include/python2.5
> ../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fshared -c
> -fPIC -g -fmakelist
> -I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny:../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs-iso
> ../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
> ../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fuselist
> -fobject-path=.:../../../gm2-libs/SO:../../../gm2-libs-pim/SO:../../../gm2-libs-iso/SO
> -fPIC -g -shared -fshared
> -I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny
> ../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
> tiny_wrap.o -o _tiny.so
> PYTHONPATH=.:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny
> python
> ../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/testtiny.py
> starting Modula-2 tiny
> inside Python
> calling out
> finishing Python
> finishing Modula-2 tiny
>
> regards,
> Gaius
>






reply via email to

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