shithub: scc

Download patch

ref: 76365130ccb3a770afab59bb45361a2cf21752f2
parent: a4fac35c95345ecbf5bd14d19a5e878e14b2b474
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu May 26 13:56:38 EDT 2022

libc: Isolate compilation from different systems

At this moment we were using the same object
for different systems and this can lead to errors
due to small differences in the included headers.

--- a/scripts/build/conf/amd64-dragonfly.mk
+++ b/scripts/build/conf/amd64-dragonfly.mk
@@ -2,3 +2,4 @@
 
 SYS = dragonfly
 FORMAT = elf
+O = 6f
--- a/scripts/build/conf/amd64-linux.mk
+++ b/scripts/build/conf/amd64-linux.mk
@@ -2,3 +2,4 @@
 
 SYS  = linux
 FORMAT = elf
+O = 6l
--- a/scripts/build/conf/amd64-netbsd.mk
+++ b/scripts/build/conf/amd64-netbsd.mk
@@ -2,3 +2,4 @@
 
 SYS = netbsd
 FORMAT = elf
+O = 6n
--- a/scripts/build/conf/amd64-openbsd.mk
+++ b/scripts/build/conf/amd64-openbsd.mk
@@ -2,3 +2,4 @@
 
 SYS = openbsd
 FORMAT = elf
+O = 6o
--- a/scripts/build/conf/amd64-posix.mk
+++ b/scripts/build/conf/amd64-posix.mk
@@ -1,3 +1,2 @@
 ARCH = amd64
 ABI  = sysv
-O    = 6
--- a/scripts/build/conf/arm32-linux.mk
+++ b/scripts/build/conf/arm32-linux.mk
@@ -2,3 +2,4 @@
 
 SYS = linux
 FORMAT = elf
+O = 5l
--- a/scripts/build/conf/arm32-posix.mk
+++ b/scripts/build/conf/arm32-posix.mk
@@ -1,3 +1,2 @@
 ABI = sysv
 ARCH = arm32
-O = 5
--- a/scripts/build/conf/arm64-linux.mk
+++ b/scripts/build/conf/arm64-linux.mk
@@ -2,3 +2,4 @@
 
 SYS = linux
 FORMAT = elf
+O = 7l
--- a/scripts/build/conf/arm64-posix.mk
+++ b/scripts/build/conf/arm64-posix.mk
@@ -1,3 +1,2 @@
 ARCH = arm64
 ABI = sysv
-O = 6
--- a/scripts/build/conf/ppc32-linux.mk
+++ b/scripts/build/conf/ppc32-linux.mk
@@ -2,3 +2,4 @@
 
 SYS = linux
 FORMAT = elf
+O = ql
--- a/scripts/build/conf/ppc32-posix.mk
+++ b/scripts/build/conf/ppc32-posix.mk
@@ -1,3 +1,2 @@
 ABI = sysv
 ARCH = ppc32
-O = q
--- a/src/libc/rules.mk
+++ b/src/libc/rules.mk
@@ -14,7 +14,7 @@
 
 # Rules
 
-.SUFFIXES: .6 .7 .8 .z .q .6d
+.SUFFIXES: .$O
 
 _sys_errlist.c: $(SYSERRNO)
 	../../mkerrstr $(SYSERRNO)
@@ -27,44 +27,8 @@
 clean-libc: FORCE
 	rm -f *.6d *.6 *.7 *.8 *.z *.q
 
-# amd64-posix objects
-.c.6:
+.c.$O:
 	$(CC) $(PROJ_CFLAGS) -o $@ -c $<
 
-.s.6:
-	$(AS) $(PROJ_ASFLAGS) $< -o $@
-
-# amd64-darwin objects
-.c.6d:
-	$(CC) $(PROJ_CFLAGS) -o $@ -c $<
-
-.s.6d:
-	$(AS) $(PROJ_ASFLAGS) $< -o $@
-
-# arm64-posix objects
-.c.7:
-	$(CC) $(PROJ_CFLAGS) -o $@ -c $<
-
-.s.7:
-	$(AS) $(PROJ_ASFLAGS) $< -o $@
-
-# 386-posix objects
-.c.8:
-	$(CC) $(PROJ_CFLAGS) -o $@ -c $<
-
-.s.8:
-	$(AS) $(PROJ_ASFLAGS) $< -o $@
-
-# z80 objects
-.c.z:
-	$(CC) $(PROJ_CFLAGS) -o $@ -c $<
-
-.s.z:
-	$(AS) $(PROJ_ASFLAGS) $< -o $@
-
-# ppc32 objects
-.c.q:
-	$(CC) $(PROJ_CFLAGS) -o $@ -c $<
-
-.s.q:
+.s.$O:
 	$(AS) $(PROJ_ASFLAGS) $< -o $@