Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

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

Members: 1
Guests: 55

Raziel, more...

Headlines


Recent Replied Topics
Topic Replies Last Post  
AmigaOS4 Should I expect better video playback performance? (Southern Islands / X1000 Updates) [1][2][3][4] 72 (6025) Spectre660 Today 14:05
AmigaOS4 Enhancer Bug thread [1][2] ... [24][25][26][27] 526 (192945) Raziel Today 11:26
AmigaOS4 Radeon RX cards on X1000 5 (180) Raziel Today 9:48
AmigaOS4 Copy / Cut / Paste (SOLVED) 5 (133) rjd324 Today 9:20
AmigaOS4 Sam460LE 1.10 Ghz Pre-Order! 18 (2373) AmigaOldskooler Today 8:48
Competitions 2022 - August - Huenison Competition 6 (209) AmigaOldskooler Today 8:33
AmigaOS4 ScummVM and AmigaOS4.1 F.E. [1][2] ... [11][12][13][14] 261 (27016) Raziel Today 8:19
AmigaOS4 AmiDVD patching [1][2][3] 42 (5557) Raziel Today 8:17
AmigaOS4 EGL_Wrap SDL2-GL4ES GL-Cube run time issue 2 (168) HunoPPC Today 7:22
AmigaOS4 Enhancer Pack 2 is all you need!! [1][2][3] 43 (1950) SinanSam460 Today 6:51
AmigaOS4 Emotion 19 (605) khayoz Today 5:02
AmigaOS4 Shaderjoy 1.23 [1][2] ... [20][21][22][23] 449 (82938) khayoz Today 3:44
AmigaOS4 New verson of CLiB2 from Andrea (afxgroup) [1][2][3][4][5] 88 (5646) walkero Yesterday 17:19
AmigaOS4 MPlayer - Add hardware acceleration? 10 (356) MickJT Yesterday 11:54
AmigaOS4 AmiUpdate connection error [1][2] 28 (1458) Chris Yesterday 7:26
[View all Topics]  [View all Forums]  [Forum Settings]
Software News : clib2 1.205 Update
Posted by ssolie on 2010/8/23 19:39:02 (2201 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: 3314
 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: 1086
 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: 736
 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: 1086
 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: 1440
 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: 1086
 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: 303
 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: 7760
 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
  1564
Logged in last:
  24 hours, 58
  7 days, 108
  30 days, 154

Top Posters
1 kas1e
kas1e 7760
2 Raziel
Raziel 4745
3 ChrisH
ChrisH 3569
4 samo79
samo79 3511
5 Chris
Chris 3314
6 orgin
orgin 3239
7 LiveForIt
LiveForIt 3215
8 328gts
328gts 2724
9 Antique
Antique 2547
10 Hans
Hans 2318

New Members
AMIGASYSTEM
AMIGASYSTEM 07/28/2022
FirstNinja
FirstNinja 07/04/2022
vagappc
vagappc 07/04/2022
AmigaAndrew
AmigaAndrew 06/26/2022
SO-AmigaFan76
SO-AmigaFan76 06/21/2022
fastmancol
fastmancol 06/19/2022
christoff522
christoff522 06/19/2022
Wiesiek
Wiesiek 06/12/2022
Magic
Magic 05/17/2022
Goggles
Goggles 05/04/2022


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project