Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
38 user(s) are online (12 user(s) are browsing News)

Members: 0
Guests: 38

more...
Support us!
Recent OS4 Files
OS4Depot.net
Recent Replied Topics
Topic Replies Last Post
AmigaOS4 AmigaOne Micro vs SAM motherboards 19 (585) BobSacamano Today 19:27
AmigaOS4 Help! Need CoolerMaster HD rails 4 (178) Paul Today 17:14
AmigaOS4 Warp3DNova shader bugs thread 17 (632) kas1e Yesterday 20:34
AmigaOS4 Atomic Bomberman Fan Rewrite [1][2][3] 45 (3212) Breed Yesterday 14:04
Amiga General Forum The IRC Lockdown Re-union Event (Wednesday 27th of May) 9 (312) DBAlex 5/24 12:45
Amiga Classic Art Department Pro under OS4.1 FE 4 (277) walkero 5/24 10:59
AmigaOS4 Shaderjoy 1.7 [1][2] ... [6][7][8][9] 169 (6586) kas1e 5/24 10:08
AmigaOS4 GCC: pthread threading instead of native threading 1 (150) kas1e 5/24 7:41
AmiCygnix X11 Forwarding via AmiCygnix? 2 (241) cygnusEd 5/23 17:19
Odyssey Odyssey 1.23 progress: r5 beta07 [1][2] ... [60][61][62][63] 1257 (341982) walkero 5/23 15:15
Amigans feedback Amigans.net 2020 updates [1][2] 22 (1391) nbache 5/22 22:35
AmigaOS4 updating sgit [1][2][3] 59 (8161) Shadow 5/22 15:45
AmigaOS4 How to allocate TimeRequest 11 (354) Templario 5/22 10:46
AmigaOS4 Enhancer Bug thread [1][2] ... [22][23][24][25] 488 (114435) Raziel 5/22 9:44
Odyssey Anyone Tried Compiling the latest WebKit? [1][2] 27 (1778) Hans 5/22 5:22
[View all topics]  [Forum Settings]
Software News : clib2 1.205 Update
Posted by ssolie on 2010/8/23 19:39:02 (1994 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 Create a PDF from the article
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: 3237
 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: 684
 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: 1434
 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: 278
 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: 6269
 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
  1468
Logged in last:
  24 hours, 36
  7 days, 86
  30 days, 151
Top Posters
1 kas1e
kas1e
6269
2 Raziel
Raziel
3705
3 ChrisH
ChrisH
3553
4 samo79
samo79
3320
5 Chris
Chris
3237
6 orgin
orgin
3185
7 LiveForIt
LiveForIt
2787
8 Antique
Antique
2476
9 328gts
328gts
2386
10 Hans
Hans
2309
New Members
tlgrooms
tlgrooms
05/11/2020
NikJ
NikJ
05/10/2020
OffseT_
OffseT_
04/28/2020
marmotta
marmotta
04/24/2020
rob_d
rob_d
04/09/2020
d0uard
d0uard
04/05/2020
Gregor
Gregor
03/29/2020
RetroBones
RetroBones
03/17/2020
JoTo
JoTo
03/17/2020
BigSimmo74
BigSimmo74
03/02/2020
Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project