Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1563003
Latest stdio destructor changes was creating a bad problem subtractin…
afxgroup Jan 14, 2025
d0ce9f2
Duplicate IO handles on CreateNewProc
afxgroup Jan 14, 2025
ceeeecb
Merge branch 'development' of github.com:AmigaLabs/clib4 into develop…
afxgroup Jan 14, 2025
5827b22
Merge branch 'development' of github.com:AmigaLabs/clib4 into develop…
afxgroup Jan 19, 2025
b6f9bdd
More WINDOWS to LINUX file ending conversion
afxgroup Jan 21, 2025
107cfed
Wrong Printf version requirement printing
afxgroup Jan 28, 2025
bd6b295
Merge branch 'development' of github.com:AmigaLabs/clib4 into line_en…
afxgroup Jan 28, 2025
2f80f55
Get DOSIFace in pthread_create from extern _IDOS
afxgroup Jan 30, 2025
7676191
Merge branch 'afxgroup' of github.com:AmigaLabs/clib4 into afxgroup
afxgroup Jan 30, 2025
989e54f
Added %b format type in printf
afxgroup Feb 8, 2025
ebd6998
Fix on dcngettext was crashing on bindtextdomain and on destructor
afxgroup Feb 9, 2025
03053e5
Added Amiga-1251 charset to iconv
afxgroup Feb 9, 2025
39f9de7
Removed __set_errno from librt since it isn't exported and undefined …
afxgroup Feb 12, 2025
6f9e9d7
Added dlopen example to test shared objects alog rpath and soname
afxgroup Feb 23, 2025
0894c8c
Removed some quirks from dlopen examples
afxgroup Feb 23, 2025
e9e190c
Added static_assert in assert.h
afxgroup Feb 28, 2025
2a0ea0f
Reverted back flock.c changes
afxgroup Feb 28, 2025
11e4d31
Merge branch 'development' of github.com:AmigaLabs/clib4 into afxgroup
afxgroup Feb 28, 2025
52259e3
Changed back (again..) flock.c
afxgroup Feb 28, 2025
4853e6b
Merge branch 'development' of github.com:AmigaLabs/clib4 into afxgroup
afxgroup Feb 28, 2025
06216df
implemented NETBSD getvfsstat function and added an example to test i…
afxgroup Mar 2, 2025
4ed6ea5
Merge branch 'development' of github.com:AmigaLabs/clib4 into afxgroup
afxgroup Mar 2, 2025
c29dac5
__time_delay was not working if wasn't in main thread
afxgroup Mar 6, 2025
1fad70a
Merge branch 'development' of github.com:AmigaLabs/clib4 into afxgroup
afxgroup Mar 6, 2025
c332fbd
Reworked tzset() function. Now parsing of POSIX time zones works corr…
afxgroup Mar 8, 2025
c5b3418
Merge branch 'development' of github.com:AmigaLabs/clib4 into afxgroup
afxgroup Mar 8, 2025
d3d3942
Added baserel support
afxgroup Mar 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions GNUmakefile.os4
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ STRIP := ppc-amigaos-strip
RANLIB := ppc-amigaos-ranlib
HOST_CXX := g++
SDK_INCLUDE ?= $(abspath $(addsuffix ../ppc-amigaos/SDK/include/,$(dir $(shell which $(word 1,$(CC))))))
MAKELINK := ln -s

# On AmigaOS use native commands
ifeq ($(UNAME), AmigaOS)
Expand Down Expand Up @@ -200,6 +201,7 @@ include libprofile.gmk
prepare:
-$(MAKEDIR) $(BUILD_DIR)/shared
-$(MAKEDIR) $(INSTALL_PREFIX)/lib
-$(MAKEDIR) $(INSTALL_PREFIX)/lib/baserel
-$(MAKEDIR) $(INSTALL_PREFIX)/include
# It may be the case that this makefile is invoked with an explicit CC
# assingment such as: "gcc -B /someDir/". In fact, this pattern is used within
Expand All @@ -219,6 +221,7 @@ prepare:
ALL_TARGETS = \
$(OUTPUT_LIB)/crt0.o \
$(OUTPUT_LIB)/crtbegin.o \
$(OUTPUT_LIB)/baserel/crtbegin.o \
$(OUTPUT_LIB)/crtend.o \
$(OUTPUT_LIB)/shcrtbegin.o \
$(OUTPUT_LIB)/shcrtend.o \
Expand Down Expand Up @@ -303,6 +306,11 @@ $(OUTPUT_LIB)/crtbegin.o : $(LIB_DIR)/crtbegin.c
$(VERBOSE)$(COMPILE)
-$(COPY) $(OUTPUT_LIB)/crtbegin.o $(INSTALL_PREFIX)/lib/

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

$(OUTPUT_LIB)/crtend.o : CFLAGS = -O0 $(OPTIONS) $(INCLUDES) -fno-aggressive-loop-optimizations
$(OUTPUT_LIB)/crtend.o : $(LIB_DIR)/crtend.c
$(VERBOSE)$(COMPILE)
Expand All @@ -326,6 +334,12 @@ $(VERBOSE)echo -e "\rCompiling Static \033[0;33m[$(@D)]\033[0m \r\t\t\t\t\t\t\t\
$(VERBOSE)$(CC) $(CFLAGS) -o $@ -c $< $(LOG_COMMAND)
endef

define COMPILE_BASEREL
$(VERBOSE)@$(MAKEDIR) $(@D)
$(VERBOSE)echo -e "\rCompiling Static Baserel \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) -DCLIB4_MBASEREL -o $@ -c $< $(LOG_COMMAND)
endef

define COMPILE_INLINE
$(VERBOSE)@$(MAKEDIR) $(@D)
$(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"
Expand Down Expand Up @@ -422,6 +436,16 @@ install:
$(DELETE) $(INSTALL_PREFIX)/lib/*
$(DELETE) $(INSTALL_PREFIX)/clib4.library*
$(COPY) $(OUTPUT_LIB)/* $(INSTALL_PREFIX)/lib/
$(MAKELINK) $(INSTALL_PREFIX)/lib/libamiga.a $(INSTALL_PREFIX)/lib/baserel/libamiga.a
$(MAKELINK) $(INSTALL_PREFIX)/lib/libauto.a $(INSTALL_PREFIX)/lib/baserel/libauto.a
$(MAKELINK) $(INSTALL_PREFIX)/lib/libc.a $(INSTALL_PREFIX)/lib/baserel/libc.a
$(MAKELINK) $(INSTALL_PREFIX)/lib/libcrypt.a $(INSTALL_PREFIX)/lib/baserel/libcrypt.a
$(MAKELINK) $(INSTALL_PREFIX)/lib/libdebug.a $(INSTALL_PREFIX)/lib/baserel/libdebug.a
$(MAKELINK) $(INSTALL_PREFIX)/lib/libm.a $(INSTALL_PREFIX)/lib/baserel/libm.a
$(MAKELINK) $(INSTALL_PREFIX)/lib/libprofile.a $(INSTALL_PREFIX)/lib/baserel/libprofile.a
$(MAKELINK) $(INSTALL_PREFIX)/lib/librt.a $(INSTALL_PREFIX)/lib/baserel/librt.a
$(MAKELINK) $(INSTALL_PREFIX)/lib/crt0.o $(INSTALL_PREFIX)/lib/baserel/crt0.o
$(MAKELINK) $(INSTALL_PREFIX)/lib/crtend.o $(INSTALL_PREFIX)/lib/baserel/crtend.o
$(COPY) libs/libauto.a $(INSTALL_PREFIX)/lib/
$(COPY) $(BUILD_DIR)/clib4.library* $(INSTALL_PREFIX)
$(COPY) $(LIB_ROOT)/library/include/* $(INSTALL_PREFIX)/include/
Expand All @@ -431,6 +455,7 @@ release:
-$(DELETE) clib4.info
-$(MAKEDIR) clib4/include
-$(MAKEDIR) clib4/lib
-$(MAKEDIR) clib4/lib/baserel
-$(COPY) *.md clib4/
-$(COPY) LICENSE* clib4/
-$(COPY) installer/Install* clib4/
Expand All @@ -441,6 +466,7 @@ release:
-$(COPY) misc clib4/
-$(COPY) libs/libauto.a clib4/lib/
-$(COPY) $(OUTPUT_LIB)/* clib4/lib/
-$(COPY) $(OUTPUT_LIB)/baserel/* clib4/lib/baserel/
-$(COPY) $(LIB_ROOT)/library/include/* clib4/include/
@lha -ao5i clib4.lha clib4 clib4.info
-$(DELETE) clib4
Expand Down
19 changes: 18 additions & 1 deletion library/crtbegin.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ const struct Clib4IFace *IClib4 = NULL;
register void *r13 __asm("r13");
extern void *_SDA_BASE_ __attribute__((force_no_baserel));

#ifdef CLIB4_MBASEREL
extern void *_DATA_BASE_ __attribute__((force_no_baserel));
register void *r2 __asm("r2");
#endif

extern int main(int, char **);
int clib4_start(char *args, int32 arglen, struct Library *sysbase);
int _start(char *args, int32 arglen, struct Library *sysbase);
Expand Down Expand Up @@ -155,5 +160,17 @@ clib4_start(char *args, int32 arglen, struct Library *sysbase) {

int
_start(STRPTR argstring, int32 arglen, struct Library *sysbase) {
return clib4_start(argstring, arglen, sysbase);

#ifdef CLIB4_MBASEREL
void *old_r2 = r2;
r2 = &_DATA_BASE_;
#endif

int result = clib4_start(argstring, arglen, sysbase);

#ifdef CLIB4_MBASEREL
r2 = old_r2;
#endif

return result;
}