Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
43 user(s) are online (6 user(s) are browsing News)

Members: 1
Guests: 42

BSzili, more...

Headlines


Recent Replied Topics
Software News : clib2 1.205 Update
Posted by ssolie on 2010/8/23 19:39:02 (2125 reads) News by the same author
Software News

The clib2 static link library has just been updated to 1.205 and includes some bug fixes and new features including Amiga shared object support.

Download it from SourceForge.

Taken from the change log:

- Added support for ELF shared objects and libraries. This is implemented through constructor/destructor functions, which means that you can use this functionality even in Amiga Exec style shared libraries, with the proper library initialization code to invoke the constructor/destructor functions for you.

- Updated uname() to recognize AmigaOS 4.1.

- The translation from Unix to Amiga path names did not properly process multiple occurences of "/./" in the path name. Thanks go to Steven Solie for finding the issue.

- The detection of "/./" and "/../" patterns in Unix path names to be translated into Amiga path names did not test if it was overrunning the end of the string.

- If strcmp(), strncmp() and memcmp() detect a pair of different characters, then the function result must be calculated as if the characters were of type "unsigned char". This is a requirement according to the ISO 'C' (1994) standard. Thanks go to Georg Steger for finding the issue.

- The definitions for INT_MIN, INT_MAX and UINT_MAX in no longer use long integer types, as prompted by Steven Solie.

- Added dlclose(), dlerror(), dlopen() and dlsym() functions, which are available only under OS4. There is a variant of dlopen() in libunix.a which will perform a path name conversion. Note that these functions will not work in the thread-safe variant of the library because it would be unwise to tinker with the currently running program's binary.


Printer friendly page Send this story to a friend
The comments are owned by the author. We aren't responsible for their content.
Author Thread
Chris
Published: 2010/8/23 23:21  Updated: 2010/8/23 23:22
Amigans Defender
Joined: 11/17/2006
From: England
Comments: 3280
 Re: clib2 1.205 Update
Quote:
- Added support for ELF shared objects and libraries. This is implemented through constructor/destructor functions, which means that you can use this functionality even in Amiga Exec style shared libraries, with the proper library initialization code to invoke the constructor/destructor functions for you.


OK... so this means we can dynamically link clib2 programs to shared objects built with newlib? I thought that was impossible.

Can anybody divulge what the "proper library initialization code to invoke the constructor/destructor functions" is if we want to call shared objects from shared libraries? Never had any luck with this with newlib, maybe it is the same issue, or maybe using clib2 with this code will work instead.
joerg
Published: 2010/8/24 2:12  Updated: 2010/8/24 2:12
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1022
 Re: clib2 1.205 Update
Quote:
OK... so this means we can dynamically link clib2 programs to shared objects built with newlib?
No.

Quote:
Can anybody divulge what the "proper library initialization code to invoke the constructor/destructor functions" is if we want to call shared objects from shared libraries?
IElf->InitSHLibs()
Thematic
Published: 2010/8/24 19:40  Updated: 2010/8/24 19:40
Quite a regular
Joined: 02/27/2007
From: Gravity well
Comments: 731
 Re: clib2 1.205 Update
How would I tell newlib .so and clib2 .so files apart?
joerg
Published: 2010/8/24 23:01  Updated: 2010/8/24 23:05
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1022
 Re: clib2 1.205 Update
Quote:
How would I tell newlib .so and clib2 .so files apart?
If the "readelf -d libfoobar.so" output includes "(NEEDED) Shared library: [libc.so]" it's using newlib.

No idea what the soname of the shared clib2 libc is, the archive on sourceforge.net seems to be incomplete. It doesn't include any shared objects at all and the shcrtbegin.o and shcrtend.o required for building shared objects are missing as well.
spotUP
Published: 2010/8/24 23:36  Updated: 2010/8/24 23:36
Just can't stay away
Joined: 11/26/2006
From:
Comments: 1439
 Re: clib2 1.205 Update
i smell trouble.

what if a game needs libsdl.so for clib2, and i already have libsdl.so for newlib in sobjs? are they all stored in sobjs: ?
joerg
Published: 2010/8/25 0:29  Updated: 2010/8/25 0:50
Just can't stay away
Joined: 12/01/2006
From: Germany
Comments: 1022
 Re: clib2 1.205 Update
Quote:
what if a game needs libsdl.so for clib2, and i already have libsdl.so for newlib in sobjs?
The incompatible clib2 version will of course have to use a different name, for example it could be linked using "gcc -mcrt=clib2 -shared -Wl,-soname,libSDL-1.2-clib2.so -o SDK:local/clib2/lib/libSDL.so {object files}" and a soft link from libSDL-1.2-clib2.so to libSDL.so created in SDK:local/clib2/lib (the soft link is required if you link with another shared object which uses the shared clib2 libSDL since the other shared objects need it with it's soname).
You can link programs using libSDL with -mcrt=clib2 -lSDL as usual, the linker loads libSDL.so from the SDK clib2 directory, but the created executables using it load it using it's soname from SOBJS: instead. In SOBJS: the shared objects have to be stored with their soname anyway (and there never should have been any soft links in SOBJS:), in this example SOBJS:libSDL-1.2-clib2.so.
corto
Published: 2010/8/25 18:32  Updated: 2010/8/25 18:32
Not too shy to talk
Joined: 03/30/2007
From:
Comments: 287
 Re: clib2 1.205 Update
I was recently wondering why we still keep clib2.

The new support for shared object is certainly nice but does it worth having it knowing that the default switched to newlib ?

We've seen recently how it is hard to hard full libs with static libs and shared object in a same package. I personaly don't think there will be many clib2 shared objects. My fear is that will add more confusion.

Is there an interest in pushing up clib2 shared objects ?
kas1e
Published: 2010/8/26 6:57  Updated: 2010/8/26 6:57
Home away from home
Joined: 09/11/2007
From: Russia
Comments: 7054
 Re: clib2 1.205 Update
Corto, i have the same questions. Dunno for what we need clib2 at all for now ? (i am not expert, so just curios). Did it have any advantages in compare with newlib ?
centaurz
Published: 2010/8/31 13:51  Updated: 2010/8/31 13:51
Just popping in
Joined: 09/03/2007
From: France
Comments: 144
 Re: clib2 1.205 Update
@kas1e

We still need a minimum support on clib2 for programs which sticked to it (and also if you don't want to rely on a shared library for C runtime).
I can remember several libs that did not compile out of the box when linked with newlib (was a while ago, maybe it has changed since then).
Adding support for shared objs is another question, it could add confusion.
General
Site sponsors
Advertise Here

Site statistics
Registered members
  1535
Logged in last:
  24 hours, 41
  7 days, 96
  30 days, 135

Top Posters
1 kas1e
kas1e 7054
2 Raziel
Raziel 4262
3 ChrisH
ChrisH 3555
4 samo79
samo79 3433
5 Chris
Chris 3280
6 orgin
orgin 3226
7 LiveForIt
LiveForIt 2987
8 328gts
328gts 2531
9 Antique
Antique 2502
10 Hans
Hans 2310

New Members
astuermer
astuermer 10/17/2021
adil
adil 09/18/2021
phipslk
phipslk 07/24/2021
trgswe
trgswe 07/23/2021
DJ_Nest
DJ_Nest 07/10/2021
Primax
Primax 06/30/2021
JaixBly
JaixBly 06/14/2021
Azvareth
Azvareth 06/14/2021
CleaningUp
CleaningUp 06/14/2021
mci
mci 06/11/2021


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project