Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who's Online
2 user(s) are online (1 user(s) are browsing Forum)

Members: 1
Guests: 1

elwis, more...

Browsing this Thread:   1 Anonymous Users





Compile a shared library

Joined:
2010/1/1 6:14
Group:
Member
Posts: 43
Offline
Hello,
I am the author of Nano VM, it is a virtual machine.
I found out that an older version is included in the current Icaros Desktop Distribution. :)

Now I am working to port the current version of Nano VM.
My VM can load shared libraries (.so) on Linux and Windows.
And this is my question: how can I compile a shared library with AROS gcc?

I tried this on Icaros Desktop gcc compiler:

gcc -Wall -fpic -c *.c
gcc -Wl,-soname,libtest.so.1 -o libtest.so.1.0 *.o

I got this message:

There are undefined symbols in 'libtest.so.1.0'
load_page
main
_GLOBAL_OFFSET_TABLE_
ThreadBase
save_page

Ok, load_page and save_page are the virtual memory functions in my VM. They are called by the shared library.

How can I tell the linker that it should build a shared library like on say Linux (.so)?

Posted on: 8/2 0:27
Transfer the post to other applications Transfer


Re: Compile a shared library

Joined:
2004/10/24 23:58
Group:
Member
Posts: 145
Offline
Amiga/Aros styles libraries are very different than windows and linux libs.

See documentation

http://aros.sourceforge.net/documenta ... ers/sys-dev/libraries.php

And if you used c++, there is not yet c++ support on our shared library system. I have been asking it as I'm not that good coder to implement it, but those who know how has little interest to do it.

Posted on: 8/2 1:46
Transfer the post to other applications Transfer


Re: Compile a shared library

Joined:
2009/9/27 22:09
Group:
Member
Posts: 1029
Offline
Sorry I don't know much about Aros .so files, but this link to Aros dll stuff from BSzili may help.

https://github.com/BSzili/aros-stuff/tree/master/dll

Posted on: 8/5 19:43
Transfer the post to other applications Transfer


Re: Compile a shared library

Joined:
2016/8/16 0:09
Group:
Member
Posts: 301
Offline
In addition to what was already written, you could perhaps take a look at how ALB42 made some (simple) shared test example libraries (here). Originally they were made for testing with Free Pascal but since they are shared libraries they can be used from whatever programming language.

Required information is detailed in the readme, and makefiles are present (to build a library 'outside' the normal build-system).

Posted on: 8/5 22:23
Transfer the post to other applications Transfer


Re: Compile a shared library

Joined:
2009/9/27 22:09
Group:
Member
Posts: 1029
Offline
Also if possible, try to avoid -fPIC. Since AROS gcc does not normally create shared libs, fPIC may not be fully supported. And the _GLOBAL_OFFSET_TABLE_ symbol is probably coming from -fPIC.

Posted on: 8/6 19:05
Transfer the post to other applications Transfer


Re: Compile a shared library

Joined:
2005/8/17 16:00
From Germany
Group:
Member
Posts: 2214
Offline
.so/dll libraries are foreign to any Amiga-like OS (except AmigaOS4 which AFAIK has some support for .so).

Can't you just use Amiga-style libraries? The easiest way would be to use the AROS build system as shown in the posting from slicer.

OTOH, the libraries can be created manually. You have to create a ROMTAG structure and some header files.

Posted on: 8/9 13:43
_________________
AROS - Make code, not war
Transfer the post to other applications Transfer






You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4347
2 magorium
magorium
4095
3 phoenixkonsole
phoenixkonsole
3891
4 nikolaos
nikolaos
3677
5 deadwood
deadwood
2923
6 ncafferkey
ncafferkey
2633
7 mazze
mazze
2214
8 clusteruk
clusteruk
2103
9 Kalamatee
Kalamatee
2024
10 damocles
damocles
1789
© 2004-2017 AROS Exec