Skip to content

Commit

Permalink
Merge pull request #155 from afxgroup/beta10
Browse files Browse the repository at this point in the history
Merged Beta10 into master
  • Loading branch information
afxgroup authored Oct 22, 2023
2 parents 4ba1931 + 14bdf6b commit 4f67152
Show file tree
Hide file tree
Showing 26 changed files with 760 additions and 344 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/buildWithDocker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build with Docker
on:
push:
branches:
- master
- actions-cicd
pull_request:
workflow_dispatch:

jobs:
run:
name: Build latest code
runs-on: ubuntu-latest
container:
image: walkero/amigagccondocker:os4-gcc11-exp
volumes:
- '${{ github.workspace }}:/opt/code'
steps:
- name: Pull code
uses: actions/checkout@v2
- name: Compile clib4
run: |
cd /opt/code && \
make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no
- name: Create the release archive
run: make -f GNUmakefile.os4 release
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:

Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/makeRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Make a new release
on:
release:
types:
- published

jobs:
run:
name: Build latest code
runs-on: ubuntu-latest
container:
image: walkero/amigagccondocker:os4-gcc11-exp
volumes:
- '${{ github.workspace }}:/opt/code'
steps:
- name: Pull code
uses: actions/checkout@v2
- name: Compile clib4
run: |
cd /opt/code && \
make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no
- name: Create the release archive
run: |
make -f GNUmakefile.os4 release && \
mv clib4.lha clib4-${{ github.event.release.tag_name }}.lha
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}.lha
asset_name: clib4-${{ github.event.release.tag_name }}.lha
asset_content_type: application/x-lzh-compressed
# - name: Release on OS4Depot
# - name: Release on Aminet
# - name: Prepare Ubuntu apt packages
# - name: Release on Ubuntu apt server
13 changes: 5 additions & 8 deletions GNUmakefile.os4
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ WARNINGS := \
-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 -Wno-cast-function-type -Werror # -Wbad-function-cast -Wconversion -Wformat
-Wno-type-limits -Wno-cast-function-type -Wno-frame-address -Werror # -Wbad-function-cast -Wconversion -Wformat

PIC := -fPIC -DPIC
INCLUDES := -I$(LIB_DIR)/include \
Expand Down Expand Up @@ -101,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 -pipe
OPTIONS += $(LARGEDATA) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wa,-mregnames -fno-builtin -nostdlib -D_GNU_SOURCE -D_XOPEN_SOURCE -D_USE_GNU -pipe
OPTIMIZE := -O3 -mregnames -mmultiple -mupdate -ffp-contract=fast -mstrict-align

STABS :=
Expand Down Expand Up @@ -149,7 +149,6 @@ include libc.gmk
include libm.gmk
include libamiga.gmk
include libdebug.gmk
include libprofile.gmk
include libpthread.gmk
include libcrypt.gmk
include librt.gmk
Expand Down Expand Up @@ -200,13 +199,11 @@ clean:
# Update the version numbers bound to the individual libraries
version:
$(COPY) c.lib_rev.rev amiga/amiga.lib_rev.rev
$(COPY) c.lib_rev.rev profile/profile.lib_rev.rev
$(COPY) c.lib_rev.rev math/m.lib_rev.rev
$(COPY) c.lib_rev.rev math/crypt.lib_rev.rev
$(COPY) c.lib_rev.rev math/pthread.lib_rev.rev
bumprev amiga.lib
bumprev c.lib
bumprev profile.lib
bumprev m.lib
bumprev crypt.lib
bumprev pthread.lib
Expand Down Expand Up @@ -236,12 +233,12 @@ $(OUTPUT_LIB)/crt0.o : $(LIB_DIR)/crt0.S
$(VERBOSE)$(ASSEMBLE)
-$(COPY) $(OUTPUT_LIB)/crt0.o $(INSTALL_PREFIX)/lib/

$(OUTPUT_LIB)/crtbegin.o : CFLAGS = -mcrt=clib4 $(STABS) $(OPTIONS) $(INCLUDES) -O0 -fno-aggressive-loop-optimizations
$(OUTPUT_LIB)/crtbegin.o : CFLAGS = $(STABS) $(OPTIONS) $(INCLUDES) -O0 -fno-aggressive-loop-optimizations
$(OUTPUT_LIB)/crtbegin.o : $(LIB_DIR)/crtbegin.c
$(VERBOSE)$(COMPILE)
-$(COPY) $(OUTPUT_LIB)/crtbegin.o $(INSTALL_PREFIX)/lib/

$(OUTPUT_LIB)/crtend.o : CFLAGS = -mcrt=clib4 -O0 $(OPTIONS) $(INCLUDES) -fno-aggressive-loop-optimizations
$(OUTPUT_LIB)/crtend.o : CFLAGS = -O0 $(OPTIONS) $(INCLUDES) -fno-aggressive-loop-optimizations
$(OUTPUT_LIB)/crtend.o : $(LIB_DIR)/crtend.c
$(VERBOSE)$(COMPILE)
-$(COPY) $(OUTPUT_LIB)/crtend.o $(INSTALL_PREFIX)/lib/
Expand Down Expand Up @@ -342,7 +339,7 @@ define MAKESHARED
$(VERBOSE)@$(MAKEDIR) $(@D)
$(VERBOSE)@$(DELETE) $@
$(VERBOSE)echo -e "\rMaking Shared \033[0;31m$@\033[0m"
$(VERBOSE)$(CC) -nostdlib -mcrt=clib4 -shared -o $@ $(OUTPUT_LIB)/shcrtbegin.o $^ $(OUTPUT_LIB)/shcrtend.o $(LOG_COMMAND) -Wl,-soname,$(@F)
$(VERBOSE)$(CC) -nostdlib -shared -o $@ $(OUTPUT_LIB)/shcrtbegin.o $^ $(OUTPUT_LIB)/shcrtend.o $(LOG_COMMAND) -Wl,-soname,$(@F)
endef

PatchForSPE : $(LIB_ROOT)/misc/PatchForSPE.cpp
Expand Down
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ useless share code that most probably no one will use.
Te goal is to try to make it <a href="POSIX.md">POSIX</a> compliant and fix also all C++ problems we have with newer
compilers.
All warnings (except really few one) produced by GCC 10 and above are now gone.
All **deprecated** OS4 functions are replaced by modern one (except for StackSwap i don't find the replacement)
All **deprecated** OS4 functions are replaced by modern OS4 one

For the original README follow this <a href="https://github.com/adtools/clib2">link</a>

Expand Down Expand Up @@ -42,9 +42,9 @@ If you want to use `dlopen`/`dlsym` with shared objects:

The plain `libc.a` now contains also `libnet.a`, `libunix.a`. Socket support and floating point support are always
enabled.
Soft float version is no longer available.
Soft float version is not available (at moment).

Clib4 is thread safe
Clib4 is always thread safe

If you want to use the shared version of library remember to pack your OS4 software with all clib4 shared objects
otherwise the elf loader will try to load objects from SOBJS: and it will load newlib one.
Expand Down Expand Up @@ -79,7 +79,7 @@ is gcc8.
### Shared objects

Shared objects **are working** also with clib4 (there is an example under test_programs/dlopen folder).
However shared objects needs the beta elf.library not yet released to public
However, shared objects needs the beta elf.library not yet released to public

### Large file support

Expand All @@ -95,9 +95,8 @@ integrated into clib4 library and doesn't need any external resource
### Unix path support

`libunix` doesn't exists anymore but you can enable/disable unix support at any time. By default, unix support is
disabled. If you want to enable it at runtime you can create a `.unix` file inside the exe directory or use *
*enableUnixPaths()** function in your software.
You can also disable it at runtime using **disableUnixPaths()**. However is not recommended to enable and disable it at
disabled. If you want to enable it at runtime you can create a `.unix` file inside the exe directory or use **enableUnixPaths()** function in your software.
You can also disable it at runtime using **disableUnixPaths()**. However, is not recommended to enable and disable it at
runtime because you could have problems with internal structures.

### wchar / wctype
Expand Down Expand Up @@ -139,7 +138,7 @@ All mutex* function now use OS4 Mutexes instead of Semaphores

### librt

aio* functions are present and they are in librt (like on linux). Pthreads are needed to use all aio* functions
aio* functions are present, and they are in librt (like on linux). Pthreads are needed to use all aio* functions

### libresolv

Expand All @@ -151,12 +150,6 @@ And thanks to this library more functions have been added to socket library

Added crypt library that implements crypt and crypt_r

### UNIX sockets (AF_UNIX)

clib4 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

The characters that can be specified are [a-zA-Z0-9. /]. Lowercase alphabets, uppercase alphabets, numbers,'.' And'/'.
Expand Down Expand Up @@ -193,11 +186,17 @@ About the security of the hash algorithm DES<MD5<SHA-256<SHA-512 And, the larger

Use `-lcrypt` option when linking.

### UNIX sockets (AF_UNIX)

clib4 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.

### Debug

To use `debug` functions you have to explicitly pass `DEBUG=true` to GNUMakefile.os4 and
debug functions will be enabled
If you want to use `gstabs` to non debug version of library you can use the flag `STABS=-gstabs` to GNUMakefile
If you want to use `gstabs` to non debug version of library you can use the flag `STABS=-gstabs` to GNUMakefile.

### Misc

Expand Down
9 changes: 9 additions & 0 deletions libc.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,10 @@ C_LIBRARY := \

C_LIB := \
c.lib_rev.o \
profile/_mcount.o \
profile/profil.o \
profile/gmon.o \
profile/mcount.o \
shared_library/stubs.o \
unistd/getopt.o \
unistd/getopt_long.o
Expand Down Expand Up @@ -986,6 +990,11 @@ $(OUT_SHARED)/%.o : $(LIB_DIR)/%.c
$(VERBOSE)$(COMPILE_SHARED)
endif

$(OUT_STATIC)/profile/%.o : $(LIB_DIR)/profile/%.S
$(VERBOSE)$(COMPILE_REG)
$(OUT_SHARED)/profile/%.o : $(LIB_DIR)/profile/%.S
$(VERBOSE)$(COMPILE_REG)

$(OUTPUT_LIB)/libc.a : $(SOURCES_STATIC)
$(VERBOSE)@$(MAKELIB)
$(OUTPUT_LIB)/libc.so : $(SOURCES_SHARED)
Expand Down
57 changes: 0 additions & 57 deletions libprofile.gmk

This file was deleted.

2 changes: 1 addition & 1 deletion library/cpu/generic/bcopy.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

// Main entry points.

.align 5
.align 5
.global bcopy_g3

bcopy_g3: // void bcopy(const void *src, void *dst, size_t len)
Expand Down
Loading

0 comments on commit 4f67152

Please sign in to comment.