shithub: scc

Download patch

ref: d53908d15cd69c4a34def3865062f6746b9bb4a9
parent: 7620707229d954e89c6462ee631b93e68a7ac7c1
author: Roberto E. Vargas Caballero <[email protected]>
date: Sat Jan 18 14:45:10 EST 2020

libc: Fix libc generation

Lorder was wrong after the patch that added new object
extensions. Also, sub directories had wrong rules to
write the list of objects.

--- a/scripts/lorder
+++ b/scripts/lorder
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 set -e
-trap 'r=$?;rm -f $$sym?ef; exit $r' EXIT HUP INT QUIT TERM
+trap 'rm -f $$sym?ef' EXIT HUP INT QUIT TERM
 
 case $# in
 0)
@@ -13,7 +13,7 @@
 
 (echo $1:
  ${NM:-nm} -g "$@") | sed -n '
-	/\.o:$/ {
+	/:$/ {
 		s/://
 		h
 		s/.*/& &/
--- a/src/libc/assert/Makefile
+++ b/src/libc/assert/Makefile
@@ -7,7 +7,10 @@
 	__assert.$O\
 	assert.$O\
 
-all: $(OBJS)
+all: $(LIBC)
+
+$(LIBCLST): $(OBJS)
+	$(MKLST)
 
 dep: inc-dep
 
--- a/src/libc/locale/Makefile
+++ b/src/libc/locale/Makefile
@@ -7,10 +7,10 @@
 	localeconv.$O\
 	setlocale.$O\
 
-all: $(OBJS)
+all: $(LIBC)
 
-$(LIBC): $(OBJS)
-	$(MKLIB)
+$(LIBCLST): $(OBJS)
+	$(MKLST)
 
 dep: inc-dep
 
--- a/src/libc/stdio/Makefile
+++ b/src/libc/stdio/Makefile
@@ -44,10 +44,10 @@
 	vprintf.$O\
 	_allocbuf.$O\
 
-all: $(OBJS)
+all: $(LIBC)
 
-$(LIBC): $(OBJS)
-	$(MKLIB)
+$(LIBCLST): $(OBJS)
+	$(MKLST)
 
 dep: inc-dep
 
--- a/src/libc/stdlib/Makefile
+++ b/src/libc/stdlib/Makefile
@@ -26,10 +26,10 @@
 	strtoul.$O\
 	strtoull.$O\
 
-all: $(OBJS)
+all: $(LIBC)
 
-$(LIBC): $(OBJS)
-	$(MKLIB)
+$(LIBCLST): $(OBJS)
+	$(MKLST)
 
 dep: inc-dep
 
--- a/src/libc/string/Makefile
+++ b/src/libc/string/Makefile
@@ -30,8 +30,8 @@
 
 all: $(LIBC)
 
-$(LIBC): $(OBJS)
-	$(MKLIB)
+$(LIBCLST): $(OBJS)
+	$(MKLST)
 
 dep: inc-dep