From 2635038e5cade7b377e4d3693fce50d0bbc1ec55 Mon Sep 17 00:00:00 2001 From: Gianluca Guida Date: Tue, 15 Feb 2011 20:12:04 +0000 Subject: [PATCH] Fix NetBSD a.out bug in common/libc and port Makefile This patch includes the required modifications (summarized in common/lib/libc/minix-port.patch) to make the common part of the NetBSD libc to compile and work under Minix. --- common/lib/libc/Makefile.inc | 4 +++ common/lib/libc/arch/i386/string/strchr.S | 4 +++ common/lib/libc/arch/i386/string/strrchr.S | 4 +++ common/lib/libc/minix-port.patch | 39 ++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 common/lib/libc/minix-port.patch diff --git a/common/lib/libc/Makefile.inc b/common/lib/libc/Makefile.inc index 1370eddbc..4a63d6bfb 100644 --- a/common/lib/libc/Makefile.inc +++ b/common/lib/libc/Makefile.inc @@ -1,7 +1,11 @@ # $NetBSD: Makefile.inc,v 1.10 2008/10/26 07:22:50 mrg Exp $ COMMON_DIR:=${.PARSEDIR} +.if defined(__MINIX) +COMMON_CODEDIRS=atomic gen inet md net quad stdlib string +.else COMMON_CODEDIRS=atomic gen gmon inet md net quad stdlib string sys +.endif COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160 .if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \ diff --git a/common/lib/libc/arch/i386/string/strchr.S b/common/lib/libc/arch/i386/string/strchr.S index 400bcdad7..2ad317547 100644 --- a/common/lib/libc/arch/i386/string/strchr.S +++ b/common/lib/libc/arch/i386/string/strchr.S @@ -100,4 +100,8 @@ ENTRY(strchr) popl %esi ret +#ifdef __minix +STRONG_ALIAS(_C_LABEL(index),_C_LABEL(strchr)) +#else STRONG_ALIAS(index,strchr) +#endif diff --git a/common/lib/libc/arch/i386/string/strrchr.S b/common/lib/libc/arch/i386/string/strrchr.S index 26ef5441d..d7ef0b18a 100644 --- a/common/lib/libc/arch/i386/string/strrchr.S +++ b/common/lib/libc/arch/i386/string/strrchr.S @@ -93,4 +93,8 @@ ENTRY(strrchr) popl %esi ret +#ifdef __minix +STRONG_ALIAS(_C_LABEL(rindex),_C_LABEL(strrchr)) +#else STRONG_ALIAS(rindex,strrchr) +#endif diff --git a/common/lib/libc/minix-port.patch b/common/lib/libc/minix-port.patch new file mode 100644 index 000000000..cdccb5106 --- /dev/null +++ b/common/lib/libc/minix-port.patch @@ -0,0 +1,39 @@ +diff -ru /home/netbsd/src/common/lib/libc/Makefile.inc ./Makefile.inc +--- /home/netbsd/src/common/lib/libc/Makefile.inc 2008-10-27 03:01:48.000000000 +0000 ++++ ./Makefile.inc 2011-02-15 13:10:57.000000000 +0000 +@@ -1,7 +1,11 @@ + # $NetBSD: Makefile.inc,v 1.10 2008/10/26 07:22:50 mrg Exp $ + + COMMON_DIR:=${.PARSEDIR} ++.if defined(__MINIX) ++COMMON_CODEDIRS=atomic gen inet md net quad stdlib string ++.else + COMMON_CODEDIRS=atomic gen gmon inet md net quad stdlib string sys ++.endif + COMMON_CODEDIRS+=hash/sha1 hash/sha2 hash/rmd160 + + .if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \ +diff -ru /home/netbsd/src/common/lib/libc/arch/i386/string/strchr.S ./arch/i386/string/strchr.S +--- /home/netbsd/src/common/lib/libc/arch/i386/string/strchr.S 2009-07-18 03:01:04.000000000 +0000 ++++ ./arch/i386/string/strchr.S 2011-02-15 13:26:06.000000000 +0000 +@@ -100,4 +100,8 @@ + popl %esi + ret + ++#ifdef __minix ++STRONG_ALIAS(_C_LABEL(index),_C_LABEL(strchr)) ++#else + STRONG_ALIAS(index,strchr) ++#endif +diff -ru /home/netbsd/src/common/lib/libc/arch/i386/string/strrchr.S ./arch/i386/string/strrchr.S +--- /home/netbsd/src/common/lib/libc/arch/i386/string/strrchr.S 2009-07-18 03:01:04.000000000 +0000 ++++ ./arch/i386/string/strrchr.S 2011-02-15 13:27:15.000000000 +0000 +@@ -93,4 +93,8 @@ + popl %esi + ret + ++#ifdef __minix ++STRONG_ALIAS(_C_LABEL(rindex),_C_LABEL(strrchr)) ++#else + STRONG_ALIAS(rindex,strrchr) ++#endif -- 2.44.0