@Corto I am sure Andrea will answer better as it he who do all the work, but from my POV reassons are:
1). get rid of all os3 code, as it only make things be worse for us 2). implement all the missing posix stuff to make easy porting 3). implement all the other stuff like wchars, shared objects and all what we may have or may not have with newlib 4). as it opensource, we will have no issues as with newlib waiting years for releases.
And so on.
At some point it should replace clib2 in our SDK if everything will be well, and if there will be wish from SDK mantainers. But in meantime it can be the same independent C library, which you can replace in your SDK yourself if you want. I already use Afxgroup's version to build few projects, so its matured enough. At least things like SDL2, few games, and co works well with already.
Checking for ppc-amigaos-strings... yes
tmp_find_type_with_size.cpp: In function 'int main()':
tmp_find_type_with_size.cpp:3:88: error: narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 1)];
| ^
tmp_find_type_with_size.cpp:3:34: warning: size of array 'test_array' is not an integral constant-expression [-Wpedantic]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 1)];
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmp_find_type_with_size.cpp:3:34: error: size '-1' of array 'test_array' is negative
tmp_find_type_with_size.cpp: In function 'int main()':
tmp_find_type_with_size.cpp:3:88: error: narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 1)];
| ^
tmp_find_type_with_size.cpp:3:34: warning: size of array 'test_array' is not an integral constant-expression [-Wpedantic]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 1)];
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmp_find_type_with_size.cpp:3:34: error: size '-1' of array 'test_array' is negative
tmp_find_type_with_size.cpp: In function 'int main()':
tmp_find_type_with_size.cpp:3:88: error: narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 2)];
| ^
tmp_find_type_with_size.cpp:3:34: warning: size of array 'test_array' is not an integral constant-expression [-Wpedantic]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 2)];
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmp_find_type_with_size.cpp:3:34: error: size '-1' of array 'test_array' is negative
tmp_find_type_with_size.cpp: In function 'int main()':
tmp_find_type_with_size.cpp:3:88: error: narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 8)];
| ^
tmp_find_type_with_size.cpp:3:34: warning: size of array 'test_array' is not an integral constant-expression [-Wpedantic]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 8)];
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmp_find_type_with_size.cpp:3:34: error: size '-1' of array 'test_array' is negative
tmp_find_type_with_size.cpp: In function 'int main()':
tmp_find_type_with_size.cpp:3:88: error: narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 8)];
| ^
tmp_find_type_with_size.cpp:3:34: warning: size of array 'test_array' is not an integral constant-expression [-Wpedantic]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 8)];
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmp_find_type_with_size.cpp:3:34: error: size '-1' of array 'test_array' is negative
tmp_find_type_with_size.cpp: In function 'int main()':
tmp_find_type_with_size.cpp:3:88: error: narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 8)];
| ^
tmp_find_type_with_size.cpp:3:34: warning: size of array 'test_array' is not an integral constant-expression [-Wpedantic]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 8)];
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmp_find_type_with_size.cpp:3:34: error: size '-1' of array 'test_array' is negative
tmp_find_type_with_size.cpp: In function 'int main()':
tmp_find_type_with_size.cpp:3:88: error: narrowing conversion of '-1' from 'int' to 'unsigned int' [-Wnarrowing]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 8)];
| ^
tmp_find_type_with_size.cpp:3:34: warning: size of array 'test_array' is not an integral constant-expression [-Wpedantic]
3 | static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == 8)];
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tmp_find_type_with_size.cpp:3:34: error: size '-1' of array 'test_array' is negative
Something missing? Or did i forget to add some stuff?
The only thing i changed (compared to newlib) was to add
-mcrt=clib2
to CXXFLAGS, so it gets picked up instead of newlib.
However regard clib2. The purpose is to have a C library that doesn't require ages to be updated like newlib. If we find bugs or we want to implement some new stuff we can do it. And read well "WE". I mean. We are in 2022 not in 1990 where closed source was the rule. Today the open source is the solution but no one in Amiga Land understand this (Even Microsoft has learn the lesson). I hope that all of you will help the project. I'm pretty sure there are bugs because i've made really a lot of changes. So this is the purpose. I cannot rely anymore on newlib for my projects because Hyperion/Aeon/God/Satana are not reliable. Not anymore.
@All Just want to point out that new clib2 is pretty advanced already in compare with old one: i already have working builds for clib2 of those "big" libs : Irrliht Engine, SDL1/SDL2 and GL4ES. Also have build some heavy os3/68k game over new clib2 as well.
So step by step it start to be pretty good in compare with newlib with only differene that is not shared amiga library at the moment. But from other side it's open for everyone, so everyone can fix/update things in.
It also do support all that wchars/wctype/etc stuff, out of box, as well as have dummies for ipv6 defines/structs (yes, while they not works of course because of roadshow, you have no needs to worry about as all compiles out of box).
It also looks like that in end, many 3d party libs on os4depot do have clib2 versions of libs, but not all the time. For example old SDL_Mixer/Mikmod/Modplug for SDL1 miss the clib2 versions, or libbz2, or flac. But all of them of course can be recompiled too.
Question...does the clib2 dir go into SDK: (root) or to SDK:local/clib2?
As afxgroup mentioned, it is better to have it in SDK:clib2. In local folder you usually install libs and include files that are comming from third party packages, and they are not deleted/overwritten in case you do an update of the SDK in the same folder. But the SDK:clib2 will be deleted with an SDK update, and will be replaced with the SDK version.
@afxgroup Great work. I will test it today with my projects, but I am sure that Kas1e's projects are much better to test things like that. And I am glad that they work so good.
Quote:
...is not shared amiga library at the moment.
That would be good to have, but not a show stopper, in my opinion.
@Javier Dunno about elf.library, but sysvpic.library is added for sysv functions. Without sysvpic.library new clib2 will of course still work, just when one will try to use sysv functions clib2 will return ENOSYS, but when library in place they will work as expected.
all vbcc libc functions are already integrated into clib2 (i think also the original version). In my version there are a lot of new functions that should cover some posix requirement. Of course it is not 100% posix compatible (and most probably will never be..) My goal is to try to compile linux stuff easily without too many changes and a lot of software can be compiled. I need help to improve it. But at moment no one has send even a small issue or patch. So I doubt someone is using (will use) it
Also, you of course can't expect anyone will use it, until it's not in mature enough form and _everything_ is better or the same as in newlib.
If you have time, we can continue diggint into minetest issues with threads , while probably they not issues with clib2/newlib per se, but with semaphores implementation or even gcc-threads-amigaos4 patch itself.
I tried to port a Linux project and switch to your clib2 implementation, which gave way longer flow than newlib/old clib2.
Now i stumble over missing <err.h> include file. During a google search found out that isn't part of the POSIX standard. But nevertheless often encounter in Linux project and part of Linux.
So I'm wondering if you plan to even include common encounters Linux stuff into your clib2 project, to ease porting even further. And if not planing by yourself, would integrate contributions going that way?
are you in need for a os4 computer? i have a sam460ex fully operational going very cheap for you. kind of waited for someone that need it for development
Sam460ex 2GB 120Gb SSD&1Tb HD7750 Envy24HT A-Eon Drv 2.10+Warp3D New Uboot Apollo v4 Standalone