Welcome, Guest. Please login or register.

Author Topic: Compiling shared libraries  (Read 2797 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Compiling shared libraries
« on: November 30, 2003, 03:02:08 AM »
Hi all,

I'm working on some normal amiga '.library' files from (virtually pure) C. Now, for historical reasons beyond my control I am forced to use storm, at least for some of it...

Unfortunately storm has its gripes and what seems to be an intractable bug in the code generator has waylaid me. I am still seeing exactly what is wrong there but it doesnt look like its the code (having tested that part in another compiler).

Now, can the bulk of the library - as defined as those functions not part of the fd - be compiled in another compiler (I am thinking vbcc uses same object format IIRC) and then linked with stormc ?

Anybody tried this?

On the same note, I need to compile a WarpOS PPC version of the same library but don't have StormC PPC. Assuming that the code could be compiled in vbcc-wos, again, any chance of getting stormlink to make a .library from it?

Cheers,

K
int p; // A
 

Offline ncafferkey

  • Sr. Member
  • ****
  • Join Date: Feb 2003
  • Posts: 387
    • Show only replies by ncafferkey
Re: Compiling shared libraries
« Reply #1 on: December 02, 2003, 02:13:41 PM »
Karlos wrote:
Quote

Now, can the bulk of the library - as defined as those functions not part of the fd - be compiled in another compiler (I am thinking vbcc uses same object format IIRC) and then linked with stormc ?

Anybody tried this?


It should work, but I haven't tried it.

Quote

On the same note, I need to compile a WarpOS PPC version of the same library but don't have StormC PPC. Assuming that the code could be compiled in vbcc-wos, again, any chance of getting stormlink to make a .library from it?


Sorry, I don't know.
 

Offline Phx_

  • Newbie
  • *
  • Join Date: Nov 2003
  • Posts: 7
    • Show only replies by Phx_
    • http://home.owl.de/~frank/
Re: Compiling shared libraries
« Reply #2 on: December 02, 2003, 02:56:10 PM »
Yes, vbcc uses the same object file format, which all Amiga compilers do (besides gcc).

Why do you need to link with StormLink at all? Have you tried to compile and link everything with vbcc?

To answer your question: Yes, although StormC is using other module and section names than vbcc it might be possible to link them together, although I didn't try it.
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Compiling shared libraries
« Reply #3 on: December 02, 2003, 03:02:26 PM »
Well, object formats aside, the last time I checked, vbcc couldn't directly create shared libraries and neither could gcc (unless you write the library header stuff yourself by hand).

-edit-

I appreciate this info may be out of date. Feel free to correct me here :-)

-/edit-

OTOH, storm c can create shared libraries fairly easily, just add the fd file and tell it to link as a shared library.

Anyhow, thanks for the replies :-)
int p; // A
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: Compiling shared libraries
« Reply #4 on: December 02, 2003, 03:57:13 PM »
Creating shared libraries is fairly simple. There are quite many
comprehensive  examples available...
My Amigas: A500, Mac Mini and PowerBook
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Compiling shared libraries
« Reply #5 on: December 02, 2003, 04:17:09 PM »
@itix

Well, I was hoping for idiot proof simplicity and convenience, but creating the library by hand isn't likely to hurt me too much.

What about warpos ppc native shared libraries? Any good examples out there?
int p; // A
 

Offline RobinC

  • Newbie
  • *
  • Join Date: Nov 2003
  • Posts: 17
    • Show only replies by RobinC
    • http://www.rycochet.com/
Re: Compiling shared libraries
« Reply #6 on: December 02, 2003, 06:25:28 PM »
I've only compiled them in gcc, but as stormc is using a slightly altered version of that for it's compiler - try grabbing one of my amirc plugins from aminet (the source archives obviously) and seeing if you can get that to compile ok - they have all needed non-system includes, and use SDI_compiler.h etc.

The order of files for compiling (and linking) is libinit.c then xxx.c,  with no start code. If it works, just rip out whatever you need... ;-)

Robin

ps. to find them just search for "amirc plugin" on aminet...
...
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Compiling shared libraries
« Reply #7 on: December 02, 2003, 06:29:19 PM »
Cheers, I will give that a bash later :-)

I actually got around the stupid bug that was the cause of my main gripe so I can use storm ok now. However, its just one of e depressingly long list of storm c v3 codegenerator problems (admittedly the first non C++ one I encountered)...
int p; // A