Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

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

Members: 0
Guests: 83

more...

Support us!

Headlines


Recent Replied Topics
Topic Replies Last Post  
Qt AmiQute Challenge 2025 [1][2] 22 (1444) nbache Yesterday 21:55
AmigaOS4 APT-OS4 for Clib4 18 (376) jabirulo Yesterday 21:20
AmigaOS4 A new Odyssey is in development [1][2][3] 53 (4832) white Yesterday 19:54
AmigaOS4 Browservice on X1000 and Sam460LE with Odyssey 1.23 [1][2][3][4] 65 (2525) K-L Yesterday 17:22
AmigaOS4 RadeonHD V.5 driver [1][2] ... [15][16][17][18] 344 (77726) skygecko Yesterday 15:15
AmigaOS4 SDK addon package 15 (1087) afxgroup Yesterday 9:44
AmigaOS4 My experience jumping from SAM460LE to X5040. [1][2] 24 (1233) white 8/24 16:35
AmigaOS4 Problems with X5000/040 and 2 graphic cards. [ SOLVED ] 17 (889) kikems 8/24 16:35
Amiga Emulation UAE BSDSocket support [1][2] 35 (2253) Lio 8/23 21:38
Amiga Emulation QEMU GPU vfio-pci pass through [1][2] ... [10][11][12][13] 259 (22263) white 8/23 17:05
AmigaOS4 infinite icons theme pack [1][2] ... [9][10][11][12] 220 (23488) DigitalDesigns 8/23 4:56
AmigaOS4 The Settlers II Gold Edition Comes to Amiga – October 18, 2025 [1][2] 35 (2005) Antique 8/22 21:44
Amiga General Forum Introducing the Rear Window blog [1][2] ... [12][13][14][15] 290 (81694) trixie 8/22 15:53
AmigaOS4 wget 1.25.0 for os4 [1][2] 24 (2075) LiveForIt 8/22 10:30
AmigaOS4 Doom64EX for AmigaOs4.1 [1][2] 25 (2654) Mr_byte 8/22 10:09
[ Free for all]  [ Too Hot To Handle]  [ Classifieds]       [View all Topics]  [View all Forums]  [Forum Settings]
Software News : clib2 1.205 Update
Posted by ssolie on 2010/8/23 18:39:02 (2499 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 22:21  Updated: 2010/8/23 22:22
Amigans Defender
Joined: 11/17/2006
From: England
Comments: 3446
 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 1:12  Updated: 2010/8/24 1:12
Home away from home
Joined: 12/01/2006
From: Germany
Comments: 2114
 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 18:40  Updated: 2010/8/24 18:40
Quite a regular
Joined: 02/27/2007
From: Gravity well
Comments: 746
 Re: clib2 1.205 Update
How would I tell newlib .so and clib2 .so files apart?
joerg
Published: 2010/8/24 22:01  Updated: 2010/8/24 22:05
Home away from home
Joined: 12/01/2006
From: Germany
Comments: 2114
 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 22:36  Updated: 2010/8/24 22:36
Just can't stay away
Joined: 11/26/2006
From:
Comments: 1494
 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/24 23:29  Updated: 2010/8/24 23:50
Home away from home
Joined: 12/01/2006
From: Germany
Comments: 2114
 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 17:32  Updated: 2010/8/25 17:32
Not too shy to talk
Joined: 03/30/2007
From:
Comments: 312
 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 5:57  Updated: 2010/8/26 5:57
Home away from home
Joined: 09/11/2007
From: Russia
Comments: 9280
 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 12:51  Updated: 2010/8/31 12: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
 
Contact us on discord to advertise here.

Site statistics
Registered members
  1757
Logged in last:
  24 hours, 68
  7 days, 122
  30 days, 173

Random Photo
A1200T Workbench backdrop-Sept1-15

New Articles List

New Members
_Pete_
_Pete_ 08/22/2025
ami-elvis
ami-elvis 08/12/2025
mschulz
mschulz 08/09/2025
ddacunha
ddacunha 07/19/2025
digitally
digitally 07/13/2025
Bifford
Bifford 07/01/2025
MarisaG1967
MarisaG1967 06/28/2025
rubach
rubach 06/25/2025
Shinji344
Shinji344 06/14/2025
emulajavi
emulajavi 06/06/2025


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project