shithub: scc

Download patch

ref: 49dd90117de0e425438c060e8b492bbb6dbb5118
parent: 1cb0492560101400338e96c476202522a91873d4
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Aug 22 10:33:59 EDT 2018

[libc] Ignore the executable format

At this moment we are not mature enogh to think about the executable
format, and it is creating problems. It can be added back once
that the linker is ready and supporting different file formats.
For now, we are going to assume that every system only supports
one file format.

diff: cannot open a/lib/c/target/amd64-sysv-linux-elf//null: file does not exist: 'a/lib/c/target/amd64-sysv-linux-elf//null' diff: cannot open b/lib/c/target/amd64-sysv-linux//null: file does not exist: 'b/lib/c/target/amd64-sysv-linux//null' diff: cannot open a/lib/c/target/amd64-sysv-openbsd-elf//null: file does not exist: 'a/lib/c/target/amd64-sysv-openbsd-elf//null' diff: cannot open b/lib/c/target/amd64-sysv-openbsd//null: file does not exist: 'b/lib/c/target/amd64-sysv-openbsd//null' diff: cannot open a/lib/c/target/i386-sysv-linux-elf//null: file does not exist: 'a/lib/c/target/i386-sysv-linux-elf//null' diff: cannot open b/lib/c/target/i386-sysv-linux//null: file does not exist: 'b/lib/c/target/i386-sysv-linux//null' diff: cannot open a/lib/c/target/z80-scc-none-none//null: file does not exist: 'a/lib/c/target/z80-scc-none-none//null' diff: cannot open b/lib/c/target/z80-scc-none//null: file does not exist: 'b/lib/c/target/z80-scc-none//null'
--- a/lib/c/target/Makefile
+++ b/lib/c/target/Makefile
@@ -3,8 +3,8 @@
 
 include $(PROJECTDIR)/rules.mk
 
-DIRS = amd64-sysv-linux-elf \
-       amd64-sysv-openbsd-elf
+DIRS = amd64-sysv-linux \
+       amd64-sysv-openbsd
 
 #       i386-sysv-linux-elf \
 #       z80-scc-none-none
--- a/lib/c/target/amd64-sysv-linux-elf/.gitignore
+++ /dev/null
@@ -1,10 +1,0 @@
-_Exit.s
-_brk.s
-_close.s
-_getpid.s
-_kill.s
-_lseek.s
-_open.s
-_read.s
-_rt_sigaction.s
-_write.s
--- a/lib/c/target/amd64-sysv-linux-elf/Makefile
+++ /dev/null
@@ -1,13 +1,0 @@
-.POSIX:
-
-PROJECTDIR = ../../../..
-
-include $(PROJECTDIR)/rules.mk
-include ../script/objlst.mk
-include syscall.mk
-include ../script/common.mk
-
-SCC_CFLAGS = -nostdinc -I$(INCDIR) -I$(INCDIR)/bits/amd64-sysv/
-
-dep:
-	../script/syscall.sh
--- a/lib/c/target/amd64-sysv-linux-elf/syscall.lst
+++ /dev/null
@@ -1,11 +1,0 @@
-#number	name
-0	_read
-1	_write
-2	_open
-3	_close
-3	_lseek
-12	_brk
-13	_rt_sigaction
-38	_getpid
-60	_Exit
-32	_kill
--- a/lib/c/target/amd64-sysv-linux-elf/syscall.mk
+++ /dev/null
@@ -1,1 +1,0 @@
-SYS = _read.o _write.o _open.o _close.o _lseek.o _brk.o _rt_sigaction.o _getpid.o _Exit.o _kill.o 
--- /dev/null
+++ b/lib/c/target/amd64-sysv-linux/.gitignore
@@ -1,0 +1,10 @@
+_Exit.s
+_brk.s
+_close.s
+_getpid.s
+_kill.s
+_lseek.s
+_open.s
+_read.s
+_rt_sigaction.s
+_write.s
--- /dev/null
+++ b/lib/c/target/amd64-sysv-linux/Makefile
@@ -1,0 +1,14 @@
+.POSIX:
+
+PROJECTDIR = ../../../..
+SYSNAME    = amd64-sysv-linux
+
+include $(PROJECTDIR)/rules.mk
+include ../script/objlst.mk
+include syscall.mk
+include ../script/common.mk
+
+SCC_CFLAGS = -nostdinc -I$(INCDIR) -I$(INCDIR)/bits/amd64-sysv/
+
+dep:
+	../script/syscall.sh
--- /dev/null
+++ b/lib/c/target/amd64-sysv-linux/syscall.lst
@@ -1,0 +1,11 @@
+#number	name
+0	_read
+1	_write
+2	_open
+3	_close
+3	_lseek
+12	_brk
+13	_rt_sigaction
+38	_getpid
+60	_Exit
+32	_kill
--- /dev/null
+++ b/lib/c/target/amd64-sysv-linux/syscall.mk
@@ -1,0 +1,1 @@
+SYS = _read.o _write.o _open.o _close.o _lseek.o _brk.o _rt_sigaction.o _getpid.o _Exit.o _kill.o 
--- a/lib/c/target/amd64-sysv-openbsd-elf/Makefile
+++ /dev/null
@@ -1,9 +1,0 @@
-.POSIX:
-
-PROJECTDIR = ../../../..
-
-include $(PROJECTDIR)/rules.mk
-include ../script/objlst.mk
-include ../script/common.mk
-
-SCC_CFLAGS = -nostdinc -I$(INCDIR) -I$(INCDIR)/bits/amd64-sysv/
--- /dev/null
+++ b/lib/c/target/amd64-sysv-openbsd/Makefile
@@ -1,0 +1,10 @@
+.POSIX:
+
+PROJECTDIR = ../../../..
+SYSNAME    = amd64-sysv-openbsd
+
+include $(PROJECTDIR)/rules.mk
+include ../script/objlst.mk
+include ../script/common.mk
+
+SCC_CFLAGS = -nostdinc -I$(INCDIR) -I$(INCDIR)/bits/amd64-sysv/
--- a/lib/c/target/i386-sysv-linux-elf/Makefile
+++ /dev/null
@@ -1,9 +1,0 @@
-.POSIX:
-
-PROJECTDIR = ../../../..
-
-include $(PROJECTDIR)/rules.mk
-include ../objlst.mk
-include ../common.mk
-
-SCC_CFLAGS = -nostdinc -I../../include -I../../include/bits/i386-sysv/
--- /dev/null
+++ b/lib/c/target/i386-sysv-linux/Makefile
@@ -1,0 +1,9 @@
+.POSIX:
+
+PROJECTDIR = ../../../..
+
+include $(PROJECTDIR)/rules.mk
+include ../objlst.mk
+include ../common.mk
+
+SCC_CFLAGS = -nostdinc -I../../include -I../../include/bits/i386-sysv/
--- a/lib/c/target/script/common.mk
+++ b/lib/c/target/script/common.mk
@@ -1,8 +1,9 @@
 SYSASM = $(SYS:.o=.s)
+TARGET = $(LIBDIR)/$(SYSNAME)/libc.a
 
-all: libc.a
+all: $(TARGET)
 
-libc.a: $(OBJ) $(SYS)
+$(TARGET): $(OBJ) $(SYS)
 	$(AR) $(ARFLAGS) $@ $?
 	ranlib $@
 
--- a/lib/c/target/z80-scc-none-none/Makefile
+++ /dev/null
@@ -1,9 +1,0 @@
-.POSIX:
-
-PROJECTDIR = ../../../..
-
-include $(PROJECTDIR)/rules.mk
-include ../objlst.mk
-include ../common.mk
-
-SCC_CFLAGS = -nostdinc -I../../include -I../../include/bits/z80-none/
--- /dev/null
+++ b/lib/c/target/z80-scc-none/Makefile
@@ -1,0 +1,9 @@
+.POSIX:
+
+PROJECTDIR = ../../../..
+
+include $(PROJECTDIR)/rules.mk
+include ../objlst.mk
+include ../common.mk
+
+SCC_CFLAGS = -nostdinc -I../../include -I../../include/bits/z80-none/