Skip to content

Commit

Permalink
Merge branch 'beta10' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
afxgroup authored Sep 9, 2023
2 parents c1f278b + 4cde3e4 commit 034e938
Show file tree
Hide file tree
Showing 664 changed files with 20,757 additions and 11,875 deletions.
Empty file modified .github/workflows/purge_artifacts.sh
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ build/
clib2.lha
.idea/
clib2_1.0_amd64
*.deb
*.deb
clib2/
64 changes: 49 additions & 15 deletions GNUmakefile.os4
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ AR ?= ppc-amigaos-ar -q
LD ?= ppc-amigaos-ld
RANLIB ?= ppc-amigaos-ranlib
STRIP ?= ppc-amigaos-strip
RANLIB ?= ppc-amigaos-ranlib
HOST_CXX := g++

# On AmigaOS use native commands
ifeq ($(UNAME), AmigaOS)
Expand Down Expand Up @@ -58,10 +60,10 @@ DPKG_LIB = clib2_1.0_amd64

WARNINGS := \
-Wall -W -Wextra -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wmissing-declarations -Wunused -Wwrite-strings -Wno-unused-value -Wno-comment \
-Wno-deprecated-declarations -Wno-sign-compare -Wno-cast-function-type -Wno-unused-variable -Wno-parentheses -Wno-missing-prototypes \
-Wundef -Wmissing-declarations -Wunused -Wwrite-strings -Wno-unused-value -Wno-comment -Wno-missing-braces \
-Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-variable -Wno-parentheses -Wno-missing-prototypes \
-Wstrict-aliasing -Wno-shadow -Wno-discarded-qualifiers -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing \
-Wno-type-limits # -Werror -Wbad-function-cast -Wconversion -Wformat
-Wno-type-limits -Wno-cast-function-type -Werror # -Wbad-function-cast -Wconversion -Wformat

PIC := -fPIC -DPIC
INCLUDES := -I$(LIB_DIR)/include \
Expand All @@ -79,10 +81,12 @@ INCLUDES := -I$(LIB_DIR)/include \
-I$(LIB_DIR)/math \
-I$(LIB_DIR)/misc \
-I$(LIB_DIR)/mount \
-I$(LIB_DIR)/ndbm \
-I$(LIB_DIR)/posix \
-I$(LIB_DIR)/profile \
-I$(LIB_DIR)/usergroup \
-I$(LIB_DIR)/search \
-I$(LIB_DIR)/shared_library \
-I$(LIB_DIR)/socket \
-I$(LIB_DIR)/stat \
-I$(LIB_DIR)/stdio \
Expand All @@ -97,7 +101,7 @@ SHARED := $(if $(SHARED),$(SHARED),yes)
STATIC := $(if $(STATIC),$(STATIC),yes)

LARGEDATA :=
OPTIONS += $(LARGEDATA) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__CLIB2__ -Wa,-mregnames -fno-builtin -nostdlib -D_GNU_SOURCE -D_XOPEN_SOURCE -D_USE_GNU
OPTIONS += $(LARGEDATA) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__CLIB2__ -Wa,-mregnames -fno-builtin -nostdlib -D_GNU_SOURCE -D_XOPEN_SOURCE -D_USE_GNU -pipe
OPTIMIZE := -O3 -mregnames -mmultiple -mupdate -mstrict-align

STABS :=
Expand All @@ -112,10 +116,15 @@ endif

CFLAGS := $(WARNINGS) $(OPTIMIZE) $(OPTIONS) $(INCLUDES) -D__USE_INLINE__
CFLAGS_N := $(WARNINGS) $(OPTIMIZE) $(OPTIONS) $(INCLUDES)
AFLAGS := -Wa,-mregnames
AFLAGS := -Wa,-mregnames -mstrict-align

ifdef SPE
CFLAGS := $(CFLAGS) -DSPE
CC := ppc-amigaos-gcc-6.4.0
AS := ppc-amigaos-as-6.4.0
CMATH := -mfpu=dp_lite
CFLAGS := $(CFLAGS) -D__SPE__ -mspe -mtune=8540 -mcpu=8540 -mabi=spe -mfloat-gprs=double $(CMATH) -fno-inline-functions -fno-partial-inlining \
-fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels -fno-inline-small-functions -fno-indirect-inlining -Wno-overflow -Wno-unused-but-set-variable -Wno-uninitialized #-Wdouble-promotion
AFLAGS := $(AFLAGS) -mvrsave -D__SPE__ -mspe -mtune=8540 -mcpu=8540 -mfloat-gprs=double $(CMATH) -Wno-overflow
endif

VERBOSE ?= @
Expand Down Expand Up @@ -151,7 +160,7 @@ prepare:
-$(MAKEDIR) $(INSTALL_PREFIX)/lib
-$(MAKEDIR) $(INSTALL_PREFIX)/include

all-targets: \
ALL_TARGETS = \
$(OUTPUT_LIB)/crt0.o \
$(OUTPUT_LIB)/crtbegin.o \
$(OUTPUT_LIB)/crtend.o \
Expand All @@ -160,7 +169,12 @@ all-targets: \
$(OUT_SHARED_LIB)/shared_library/clib2.o \
$(OUT_SHARED_LIB)/shared_library/math.o \
$(MAIN_LIB)
#$(info $(OBJ_C_SRC))

ifdef SPE
ALL_TARGETS := PatchForSPE | $(ALL_TARGETS)
endif

all-targets: $(ALL_TARGETS)

all-libs: $(LIBS)

Expand All @@ -171,6 +185,7 @@ clean:
-$(DELETE) $(BUILD_DIR)/obj
-$(DELETE) $(BUILD_DIR)/obj.shared
-$(DELETE) $(BUILD_DIR)/shared
-$(DELETE) $(BUILD_DIR)/PatchForSPE
-$(DELETE) $(OUTPUT_LIB)
-$(DELETE) $(BUILD_DIR)/compiler.log
-$(DELETE) $(BUILD_DIR)/clib2.library*
Expand Down Expand Up @@ -251,14 +266,14 @@ endef

define COMPILE_INLINE
$(VERBOSE)@$(MAKEDIR) $(@D)
$(VERBOSE)echo -e "\rCompiling Static \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
$(VERBOSE)echo -e "\rCompiling Inline Static \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
$(VERBOSE)$(CC) $(CFLAGS_N) -Wno-missing-prototypes -Wno-missing-declarations -D__timespec_defined -o $@ -c $< $(LOG_COMMAND)
endef

define COMPILE_ASM
$(VERBOSE)@$(MAKEDIR) $(@D)
$(VERBOSE)echo -e "\rCompiling Static ASM \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
$(VERBOSE)$(CC) -o $@ -c $< $(LOG_COMMAND)
$(VERBOSE)$(CC) -o $@ -c $< $(LOG_COMMAND)
endef

define COMPILE_SHARED
Expand Down Expand Up @@ -291,16 +306,28 @@ $(VERBOSE)echo -e "\rAssembling altivec \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\
$(VERBOSE)$(CC) -maltivec -mabi=altivec -mvrsave -mregnames -DVRSAVE -o $@ -c $< $(LOG_COMMAND)
endef

define COMPILE_SPE_REG
$(VERBOSE)@$(MAKEDIR) $(@D)
$(VERBOSE)echo -e "\rAssembling SPE with regnames \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
$(VERBOSE)$(CC) $(AFLAGS) -mregnames -DVRSAVE -o $@ -c $< $(LOG_COMMAND)
endef

define COMPILE_SPE
$(VERBOSE)@$(MAKEDIR) $(@D)
$(VERBOSE)echo -e "\rCompiling SPE \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
$(VERBOSE)$(CC) -mspe -mcpu=8540 -mfloat-gprs=double -mabi=spe -o $@ -c $< $(LOG_COMMAND)
$(VERBOSE)echo -e "\rPreprocessing and compiling SPE \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
$(VERBOSE)$(CC) -c $(CFLAGS) -mno-regnames -S -o $@_in $< $(LOG_COMMAND)
$(VERBOSE)$(BUILD_DIR)/PatchForSPE $@_in $@.S >/dev/null
$(VERBOSE)$(CC) $(CFLAGS) -c $@.S -o $@ $(LOG_COMMAND)
$(VERBOSE)-$(DELETE) $@_in $@.S
endef

define COMPILE_SHARED_SPE
$(VERBOSE)@$(MAKEDIR) $(@D)
$(VERBOSE)echo -e "\rCompiling Shared SPE \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
$(VERBOSE)$(CC) -mspe -mcpu=8540 -mfloat-gprs=double -mabi=spe $(PIC) -o $@ -c $< $(LOG_COMMAND)
$(VERBOSE)echo -e "\rPreprocessing and compiling SPE \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\t\t\t\t \033[0;31m$(@F)\033[0m"
$(VERBOSE)$(CC) -c $(PIC) -mabi=spe $(CFLAGS) -mno-regnames -S -o $@_in $< $(LOG_COMMAND)
$(VERBOSE)$(BUILD_DIR)/PatchForSPE $@_in $@.S >/dev/null
$(VERBOSE)$(CC) $(PIC) -mabi=spe $(CFLAGS) -c $@.S -o $@ $(LOG_COMMAND)
$(VERBOSE)-$(DELETE) $@_in $@.S
endef

define MAKELIB
Expand All @@ -318,6 +345,13 @@ $(VERBOSE)echo -e "\rMaking Shared \033[0;31m$@\033[0m"
$(VERBOSE)$(CC) -nostdlib -mcrt=clib2 -shared -o $@ $(OUTPUT_LIB)/shcrtbegin.o $^ $(OUTPUT_LIB)/shcrtend.o $(LOG_COMMAND) -Wl,-soname,$(@F)
endef

PatchForSPE : $(LIB_ROOT)/misc/PatchForSPE.cpp
$(HOST_CXX) -o $(BUILD_DIR)/$@ $<

ifdef SPE
.NOTPARALLEL: PatchForSPE
endif

compile-tests:
+make -C $(LIB_ROOT)/test_programs; CC="$(CC)" CXX="$(CXX)" COPY="$(COPY)" DELETE="$(DELETE)" MAKEDIR="$(MAKEDIR)"

Expand All @@ -343,7 +377,7 @@ release:
-$(COPY) libs/libauto.a clib2/lib/
-$(COPY) $(OUTPUT_LIB)/* clib2/lib/
-$(COPY) $(LIB_ROOT)/library/include/* clib2/include/
jlha -aqo7i clib2.lha clib2 clib2.info
lha -ao5i clib2.lha clib2 clib2.info
-$(DELETE) clib2
-$(DELETE) clib2.info

Expand Down
10 changes: 5 additions & 5 deletions POSIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| <arpa/inet.h> | Functions for manipulating numeric IP addresses (part of Berkley sockets) | Complete |
| <assert.h> | Verify assumptions | Complete |
| <complex.h> | Complex Arithmetic | Complete |
| <cpio.h> | Magic numbers for the cpio archive format | Not present |
| <cpio.h> | Magic numbers for the cpio archive format | Complete |
| <ctype.h> | Character types | Complete | |
| <dirent.h> | Allows the opening and listing of directories | Complete |
| <dlfcn.h> | Dynamic linking | Complete |
Expand All @@ -27,7 +27,7 @@
| <math.h> | Mathematical declarations | Complete |
| <monetary.h> | String formatting of monetary units | Not present |
| <mqueue.h> | Message queue | Not present |
| <ndbm.h> | NDBM database operations | Not present |
| <ndbm.h> | NDBM database operations | Complete |
| <net/if.h> | Listing of local network interfaces | Complete |
| <netdb.h> | Translating protocol and host names into numeric addresses (part of Berkeley sockets | Complete |
| <netinet/in.h> | Defines Internet protocol and address family (part of Berkley sockets) | Complete |
Expand Down Expand Up @@ -66,11 +66,11 @@
| <sys/times.h> | File access and modification times | Complete |
| <sys/types.h> | Various data types used elsewhere | Complete |
| <sys/uio.h> | Vectored I/O operations | Complete |
| <sys/un.h> | Unix domain sockets | Present with missing functions |
| <sys/un.h> | Unix domain sockets | Complete |
| <sys/utsname.h> | Operating system information, including uname | Complete |
| <sys/wait.h> | Status of terminated child processes | Present with missing functions |
| <syslog.h> | System error logging | Not present |
| <tar.h> | Magic numbers for the tar archive format | Not present |
| <syslog.h> | System error logging | Complete |
| <tar.h> | Magic numbers for the tar archive format | Complete |
| <termios.h> | Allows terminal I/O interfaces | Complete |
| <tgmath.h> | Type-Generic Macros | Complete |
| <time.h> | Type-Generic Macros | Complete |
Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# clib2 – A C runtime library for AmigaOS4
C runtime library for AmigaOS4

[![Build Status](https://travis-ci.com/afxgroup/clib2.svg?branch=master)](https://travis-ci.org/afxgroup/clib2)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
Expand Down Expand Up @@ -88,9 +88,10 @@ problem).

### SYSV functions

Clib2 now contains **shm*** and **msg*** functions. It
needs <a href="http://www.os4depot.net/share/development/library/misc/sysvipc.lha">SYSV IPC</a> library. If you don't
install it those functions will not work and will return to you an **ENOSYS** error.
Clib2 now contains **shm***, **msg*** and **sem*** functions.
<a href="http://www.os4depot.net/share/development/library/misc/sysvipc.lha">SYSV IPC</a> library is now fully
integrated into clib2 library and
doesn't need any external resource

### Unix path support

Expand Down Expand Up @@ -135,7 +136,7 @@ Clib2 now contain also libauto with almost all OS4 components. We'll try to keep
### libpthread

Clib2 now contain a native pthread implementation with some functions are not present in the pthread.library.
However in the future mutex* function should be changed to use OS4 Mutexes instead of Semaphores
All mutex* function now use OS4 Mutexes instead of Semaphores

### librt

Expand All @@ -153,8 +154,9 @@ Added crypt library that implements crypt and crypt_r

### UNIX sockets (AF_UNIX)

clib2 now supports emulated UNIX sockets. Since roadshow and OS4 doesn't support them natively, UNIX sockets are emulated via
native sockets. The user doesn't need to change anything in the linux code. Everything will be transparent for him
clib2 now supports emulated UNIX sockets. Since roadshow and OS4 doesn't support them natively, UNIX sockets are
emulated via
native sockets. The user doesn't need to change anything in the linux code. Everything will be transparent for him

* ##### About salt

Expand Down Expand Up @@ -254,6 +256,12 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

### SYSV

Thanks to Peter Bengtsson for SYSV implementation

### Math library

> The PowerPC math library is based in part on work by Sun Microsystems:
>
>Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
Expand Down
Binary file modified installer/clib2.info
Binary file not shown.
11 changes: 8 additions & 3 deletions libamiga.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,22 @@ SOURCES_STATIC = $(addprefix $(OUT_STATIC)/, $(AMIGA_LIB))

# Dependencies to rebuild if the library version changes

$(OUT_STATIC)/amiga.lib_rev.o : $(LIB_DIR)/amiga/amiga.lib_rev.c $(LIB_DIR)/amiga/amiga.lib_rev.h
$(OUT_SHARED)/amiga.lib_rev.o : $(LIB_DIR)/amiga/amiga.lib_rev.c $(LIB_DIR)/amiga/amiga.lib_rev.h

$(OUT_STATIC)/%.o : CFLAGS += $(LARGEDATA)
$(OUT_SHARED)/%.o : CFLAGS += $(PIC) $(LARGEDATA)

ifdef SPE
$(OUT_STATIC)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE_SPE)

$(OUT_SHARED)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE_SHARED_SPE)
else
$(OUT_STATIC)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE)

$(OUT_SHARED)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE_SHARED)
endif

$(OUTPUT_LIB)/libamiga.a : $(SOURCES_STATIC)
$(VERBOSE)$(MAKELIB)
Expand Down
Loading

0 comments on commit 034e938

Please sign in to comment.