Skip to content

Commit 1e4d165

Browse files
authored
Merge pull request #214 from AmigaLabs/development
Preparing release of the v1.4.0
2 parents a5ee4e6 + d99ab22 commit 1e4d165

File tree

360 files changed

+13896
-3976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

360 files changed

+13896
-3976
lines changed

GNUmakefile.os4

+6-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ WARNINGS := \
7272
-Wundef -Wmissing-declarations -Wunused -Wwrite-strings -Wno-unused-value -Wno-comment -Wno-missing-braces \
7373
-Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-variable -Wno-parentheses -Wno-missing-prototypes \
7474
-Wstrict-aliasing -Wno-shadow -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing \
75-
-Wno-type-limits -Wno-cast-function-type -Wno-frame-address -Werror \
75+
-Wno-type-limits -Wno-cast-function-type -Wno-frame-address -Wno-error=unused-but-set-variable -Werror \
7676
# -Wbad-function-cast -Wconversion -Wformat
7777

7878
PIC := -fPIC -DPIC
@@ -106,7 +106,8 @@ INCLUDES := -I$(LIB_DIR)/include \
106106
-I$(LIB_DIR)/termios \
107107
-I$(LIB_DIR)/time \
108108
-I$(LIB_DIR)/unistd \
109-
-I$(LIB_DIR)/wchar
109+
-I$(LIB_DIR)/wchar \
110+
-I$(LIB_DIR)/wmem
110111

111112
SHARED := $(if $(SHARED),$(SHARED),yes)
112113
STATIC := $(if $(STATIC),$(STATIC),yes)
@@ -139,6 +140,8 @@ ifdef SPE
139140
-fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels -fno-inline-small-functions \
140141
-fno-indirect-inlining -Wno-overflow -Wno-unused-but-set-variable -Wno-uninitialized #-Wdouble-promotion
141142
AFLAGS := $(AFLAGS) -mvrsave -D__SPE__ -mspe -mtune=8540 -mcpu=8540 -mfloat-gprs=double $(CMATH) -Wno-overflow
143+
CFLAGS := $(filter-out -Wno-cast-function-type, $(CFLAGS))
144+
CFLAGS_N := $(filter-out -Wno-cast-function-type, $(CFLAGS_N))
142145
endif
143146

144147
ifdef PROFILE
@@ -362,7 +365,7 @@ endef
362365
define COMPILE_ALTIVEC_REG
363366
$(VERBOSE)@$(MAKEDIR) $(@D)
364367
$(VERBOSE)echo -e "\rAssembling altivec \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
365-
$(VERBOSE)$(CC) -maltivec -mabi=altivec -mvrsave -mregnames -DVRSAVE -o $@ -c $< $(LOG_COMMAND)
368+
$(VERBOSE)$(CC) -maltivec -mabi=altivec -mcpu=7450 -mtune=7450 -falign-loops=16 -falign-functions=16 -falign-labels=16 -falign-jumps=16 -mvrsave -mregnames -DVRSAVE -o $@ -c $< $(LOG_COMMAND)
366369
endef
367370

368371
define COMPILE_SPE_REG

README.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,19 @@ have problems running existent software!
5353

5454
### New memory allocator
5555

56-
Clib4 now use `Wheel Of Fortune` allocator that is faster than previous one, and it seems more robust and with a cleaner
57-
and portable code
56+
Clib4 now use `wmem` allocator from WireShark that is faster than previous one, and it seems more robust and with a cleaner
57+
and portable code.
58+
You can choose at runtime (for test purpose) which kind of allocators want to use setting `CLIB4_MEMORY_ALLOCATOR` env variable.
59+
At moment you can use:
60+
61+
| Value | Allocator |
62+
|-------|---------------------------|
63+
| 1 | WMEM_ALLOCATOR_SIMPLE |
64+
| 2 | WMEM_ALLOCATOR_BLOCK |
65+
| 3 | WMEM_ALLOCATOR_STRICT |
66+
| 4 | WMEM_ALLOCATOR_BLOCK_FAST |
67+
68+
The default one is `WMEM_ALLOCATOR_BLOCK_STRICT`. `WMEM_ALLOCATOR_BLOCK_FAST` can crash on some situation. Please refer to `wmem/wmem_core.h` for all details.
5869

5970
### Optimized AMCC functions
6071

@@ -219,6 +230,13 @@ constructors/destructors executions
219230
- Try to use some functions/headers from https://github.com/attractivechaos/klib to improve speed
220231
- Use a good locale implementation
221232

233+
### Libraries repository
234+
235+
A repository with pre packaged libraries is present and ready to use for debian like systems.
236+
You can find all informations to the following <a href="https://github.com/AmigaLabs/clib4/wiki/Clib4-apt-packages-repository">wiki page</a>.
237+
238+
A list of packages can be found into public <a href="https://clib4pkg.amigasoft.net/ubuntu/dists/focal/main/binary-amd64/Packages">Packages</a> file.
239+
222240
## Legal status
223241

224242
Because this library is in part based upon free software it would be uncourteous not to make it free software itself.

libc.gmk

+34-5
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ C_LOCALE := \
112112
locale/setlocale.o
113113

114114
C_MISC := \
115+
misc/children.o \
115116
misc/map.o \
116117
misc/uuid.o
117118

@@ -159,7 +160,6 @@ C_POSIX := \
159160
posix/getrlimit.o \
160161
posix/setrlimit.o \
161162
posix/getrusage.o \
162-
posix/checkabort.o \
163163
posix/kill.o \
164164
posix/raise.o \
165165
posix/sigaction.o \
@@ -171,8 +171,11 @@ C_POSIX := \
171171
posix/sigismember.o \
172172
posix/sigmask.o \
173173
posix/signal.o \
174+
posix/sigpause.o \
174175
posix/sigprocmask.o \
176+
posix/sigsuspend.o \
175177
posix/sigsetmask.o \
178+
posix/sigwait.o \
176179
posix/statvfs.o \
177180
posix/sysinfo.o \
178181
posix/sysv_ftok.o \
@@ -195,6 +198,9 @@ C_POSIX := \
195198
posix/sysv_shmids.o \
196199
posix/ulimit.o \
197200
posix/readv.o \
201+
wait/wait.o \
202+
wait/waitpid.o \
203+
posix/waitpoll.o \
198204
posix/writev.o \
199205
posix/uname.o
200206

@@ -420,7 +426,6 @@ C_STDIO := \
420426
stdio/iobhookentry.o \
421427
stdio/lock.o \
422428
stdio/openiob.o \
423-
stdio/parent_of_fh.o \
424429
stdio/perror.o \
425430
stdio/popen.o \
426431
stdio/printf.o \
@@ -544,8 +549,7 @@ C_STDLIB := \
544549
stdlib/udivsi4.o \
545550
stdlib/umodsi3.o \
546551
stdlib/unsetenv.o \
547-
stdlib/valloc.o \
548-
stdlib/wof_allocator.o
552+
stdlib/valloc.o
549553

550554
C_STRING := \
551555
string/strings_ffs.o \
@@ -576,12 +580,15 @@ C_STRING := \
576580
cpu/4xx/strlen440.o \
577581
cpu/4xx/strncmp440.o \
578582
cpu/4xx/strrchr440.o \
583+
cpu/altivec/vec_memchr.o \
579584
cpu/altivec/vec_memcmp.o \
580585
cpu/altivec/vec_memcpy.o \
581586
cpu/altivec/vec_memset.o \
587+
cpu/altivec/vec_strchr.o \
582588
cpu/altivec/vec_strcpy.o \
583589
cpu/generic/bcopy.o \
584590
cpu/generic/strcat.o \
591+
cpu/generic/strchr.o \
585592
cpu/generic/strcpy.o \
586593
cpu/generic/strlen.o \
587594
string/rindex.o \
@@ -620,6 +627,7 @@ C_STRING := \
620627
string/strxfrm.o
621628

622629
C_TERMCAP := \
630+
termcap/tcstubs.o \
623631
termcap/termcap.o \
624632
termcap/tparam.o
625633

@@ -754,7 +762,9 @@ C_UNISTD := \
754762
unistd/setlogin.o \
755763
unistd/sleep.o \
756764
unistd/spawnv.o \
765+
unistd/spawnve.o \
757766
unistd/spawnvp.o \
767+
unistd/spawnvpe.o \
758768
unistd/strip_double_slash.o \
759769
unistd/symlink.o \
760770
unistd/sync_fd.o \
@@ -764,6 +774,7 @@ C_UNISTD := \
764774
unistd/translatea2u.o \
765775
unistd/translaterel.o \
766776
unistd/translateu2a.o \
777+
unistd/search_command_path.o \
767778
unistd/truncate.o \
768779
unistd/truncate64.o \
769780
unistd/ttyname.o \
@@ -911,6 +922,23 @@ C_WCHAR := \
911922
wchar/wctrans.o \
912923
wchar/wctype.o
913924

925+
C_WMEM := \
926+
wmem/wmem_allocator_block.o \
927+
wmem/wmem_allocator_block_fast.o \
928+
wmem/wmem_allocator_simple.o \
929+
wmem/wmem_allocator_strict.o \
930+
wmem/wmem_array.o \
931+
wmem/wmem_core.o \
932+
wmem/wmem_interval_tree.o \
933+
wmem/wmem_list.o \
934+
wmem/wmem_map.o \
935+
wmem/wmem_miscutl.o \
936+
wmem/wmem_multimap.o \
937+
wmem/wmem_stack.o \
938+
wmem/wmem_strutl.o \
939+
wmem/wmem_tree.o \
940+
wmem/wmem_user_cb.o
941+
914942
ifdef SPE
915943
$(info Adding SPE objects)
916944
C_STRING := $(C_STRING) \
@@ -957,7 +985,8 @@ C_LIBRARY := \
957985
$(C_TIME) \
958986
$(C_UNISTD) \
959987
$(C_USERGROUP) \
960-
$(C_WCHAR)
988+
$(C_WCHAR) \
989+
$(C_WMEM)
961990

962991
C_LIB := \
963992
c.lib_rev.o \

library/argz/create.c

+5-9
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,30 @@
99
#include <argz.h>
1010

1111
error_t
12-
argz_create(char *const argv[], char **argz, size_t *argz_len)
13-
{
12+
argz_create(char *const argv[], char **argz, size_t *argz_len) {
1413
int argc = 0;
1514
int i = 0;
1615
size_t len = 0;
1716
char *iter;
1817

1918
*argz_len = 0;
2019

21-
if (*argv == NULL)
22-
{
20+
if (*argv == NULL) {
2321
*argz = NULL;
2422
return 0;
2523
}
2624

27-
while (argv[argc])
28-
{
25+
while (argv[argc]) {
2926
*argz_len += (strlen(argv[argc]) + 1);
3027
argc++;
3128
}
3229

3330
/* There are argc strings to copy into argz. */
34-
if (!(*argz = (char *)malloc(*argz_len)))
31+
if (!(*argz = (char *) malloc(*argz_len)))
3532
return ENOMEM;
3633

3734
iter = *argz;
38-
for (i = 0; i < argc; i++)
39-
{
35+
for (i = 0; i < argc; i++) {
4036
len = strlen(argv[i]) + 1;
4137
memcpy(iter, argv[i], len);
4238
iter += len;

library/argz/create_sep.c

+12-18
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,34 @@
99
#include <argz.h>
1010

1111
error_t
12-
argz_create_sep(const char *string, int sep, char **argz, size_t *argz_len)
13-
{
14-
size_t len = 0;
15-
int i = 0;
12+
argz_create_sep(const char *string, int sep, char **argz, size_t *argz_len) {
13+
size_t len;
14+
int i;
1615
int num_strings = 0;
1716
char delim[2];
18-
char *running = 0;
19-
char *old_running = 0;
20-
char *token = 0;
21-
char *iter = 0;
17+
char *running;
18+
char *old_running;
19+
char *token;
20+
char *iter;
2221

2322
delim[0] = (char) sep;
2423
delim[1] = '\0';
2524

2625
running = strdup(string);
2726

28-
if(!running)
29-
{
27+
if (!running) {
3028
return ENOMEM;
3129
}
3230

3331
old_running = running;
3432

35-
while ((token = strsep(&running, delim)))
36-
{
33+
while ((token = strsep(&running, delim))) {
3734
len = strlen(token);
3835
*argz_len += (len + 1);
3936
num_strings++;
4037
}
4138

42-
if (!(*argz = (char *)malloc(*argz_len)))
43-
{
39+
if (!(*argz = (char *) malloc(*argz_len))) {
4440
free(old_running);
4541
return ENOMEM;
4642
}
@@ -49,17 +45,15 @@ argz_create_sep(const char *string, int sep, char **argz, size_t *argz_len)
4945

5046
running = strdup(string);
5147

52-
if(!running)
53-
{
48+
if (!running) {
5449
free(*argz);
5550
return ENOMEM;
5651
}
5752

5853
old_running = running;
5954

6055
iter = *argz;
61-
for (i = 0; i < num_strings; i++)
62-
{
56+
for (i = 0; i < num_strings; i++) {
6357
token = strsep(&running, delim);
6458
len = strlen(token) + 1;
6559
memcpy(iter, token, len);

library/argz/delete.c

+5-8
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,22 @@
99
#include <argz.h>
1010

1111
error_t
12-
argz_delete(char **argz, size_t *argz_len, char *entry)
13-
{
12+
argz_delete(char **argz, size_t *argz_len, char *entry) {
1413
size_t len = 0;
1514
char *moveto = entry;
1615

17-
if (entry)
18-
{
16+
if (entry) {
1917
len = strlen(entry) + 1;
2018
entry += len;
2119

22-
memmove(moveto, entry, (size_t) (*argz + *argz_len - entry));
20+
memmove(moveto, entry, (size_t)(*argz + *argz_len - entry));
2321

2422
*argz_len -= len;
2523

26-
if (!(*argz = (char *)realloc(*argz, *argz_len)))
24+
if (!(*argz = (char *) realloc(*argz, *argz_len)))
2725
return ENOMEM;
2826

29-
if (*argz_len <= 0)
30-
{
27+
if (*argz_len <= 0) {
3128
free(*argz);
3229
*argz = NULL;
3330
}

0 commit comments

Comments
 (0)