add klibc

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@2746 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one
2010-11-21 19:15:34 +00:00
parent 3f0578579f
commit 73c5e3dfcb
13 changed files with 884 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
diff -Naurp klibc-1.1.orig/MCONFIG klibc-1.1/MCONFIG
--- klibc-1.1.orig/MCONFIG 2005-09-20 02:16:17 -0400
+++ klibc-1.1/MCONFIG 2005-09-20 02:16:57 -0400
@@ -33,7 +33,7 @@ KRNLOBJ = $(SRCROOT)/linux
KLIBCVER = -D__KLIBC__=$(shell cut -d. -f1 < $(SRCROOT)/version) \
-D__KLIBC_MINOR__=$(shell cut -d. -f2 < $(SRCROOT)/version)
-ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/parisc.*/parisc/)
+ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/parisc.*/parisc/ -e s/mips64/mips/)
CC = $(CROSS)gcc
LD = $(CROSS)ld
KLIBSRC = $(SRCROOT)/klibc

View File

@@ -0,0 +1,13 @@
diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild
index c2bfd2f..8066bda 100644
--- a/usr/klibc/Kbuild
+++ b/usr/klibc/Kbuild
@@ -152,7 +152,7 @@ # build interp.o
targets += interp.o
quiet_cmd_interp = BUILD $@
- cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \
+ cmd_interp = $(KLIBCCC) $(klibccflags) $(EXTRA_KLIBCAFLAGS) -D__ASSEMBLY__ \
-DLIBDIR=\"$(SHLIBDIR)\" \
-DSOHASH=\"$(SOLIBHASH)\" \
-c -o $@ $<

View File

@@ -0,0 +1,25 @@
--- a/scripts/Kbuild.install 2007-03-04 02:52:10.000000000 +0100
+++ b/scripts/Kbuild.install 2007-11-04 15:43:28.000000000 +0100
@@ -84,6 +84,13 @@
# 1) Create directories, install headers and man pages
# 2) Tell that we now install binaries
# 3) Install binaries by descending
+
+# Arch specific definitions for klibc
+include $(KLIBCSRC)/arch/$(KLIBCARCHDIR)/MCONFIG
+
+# include/asm-* architecture
+KLIBCASMARCH ?= $(KLIBCARCH)
+
.PHONY: header footer descend
header:
$(Q)echo " INSTALL headers + man pages to $(INSTALLROOT)$(INSTALLDIR)"
@@ -95,7 +102,7 @@
$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
- $(Q)set -e ; for d in linux scsi asm-$(KLIBCARCH) asm-generic $(ASMKLIBCARCH); do \
+ $(Q)set -e ; for d in linux scsi asm-$(KLIBCASMARCH) asm-generic $(ASMKLIBCARCH); do \
mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)include/$$d ; \
for r in $(KLIBCKERNELSRC)/include $(KLIBCKERNELOBJ)/include \
$(KLIBCKERNELOBJ)/include2 ; do \

View File

@@ -0,0 +1,37 @@
---
usr/include/arch/ppc/klibc/archsignal.h | 6 ++++++
usr/include/arch/sparc/klibc/archsignal.h | 7 -------
2 files changed, 6 insertions(+), 7 deletions(-)
--- a/usr/include/arch/ppc/klibc/archsignal.h
+++ b/usr/include/arch/ppc/klibc/archsignal.h
@@ -8,7 +8,13 @@
#ifndef _KLIBC_ARCHSIGNAL_H
#define _KLIBC_ARCHSIGNAL_H
+#ifdef _SIGNAL_H
+#undef _SIGNAL_H
#include <asm/signal.h>
+#define _SIGNAL_H
+#else
+#include <asm/signal.h>
+#endif
/* No special stuff for this architecture */
#endif
--- a/usr/include/arch/sparc/klibc/archsignal.h
+++ b/usr/include/arch/sparc/klibc/archsignal.h
@@ -11,13 +11,6 @@
#define __WANT_POSIX1B_SIGNALS__
#include <asm/signal.h>
-struct sigaction {
- __sighandler_t sa_handler;
- unsigned long sa_flags;
- void (*sa_restorer)(void); /* Not used by Linux/SPARC */
- sigset_t sa_mask;
-};
-
/* Not actually used by the kernel... */
#define SA_RESTORER 0x80000000

View File

@@ -0,0 +1,26 @@
diff -Nuar --exclude '*.orig' --exclude '*.rej' klibc-1.5.11.orig/scripts/Kbuild.install klibc-1.5.11/scripts/Kbuild.install
--- klibc-1.5.11.orig/scripts/Kbuild.install 2008-06-15 17:28:23.000000000 -0700
+++ klibc-1.5.11/scripts/Kbuild.install 2008-06-26 10:14:05.365949576 -0700
@@ -84,6 +84,13 @@
# 1) Create directories, install headers and man pages
# 2) Tell that we now install binaries
# 3) Install binaries by descending
+
+# Arch specific definitions for klibc
+include $(KLIBCSRC)/arch/$(KLIBCARCHDIR)/MCONFIG
+
+# include/asm-* architecture
+KLIBCASMARCH ?= $(KLIBCARCH)
+
.PHONY: header footer descend
header:
$(Q)echo " INSTALL headers + man pages to $(INSTALLROOT)$(INSTALLDIR)"
@@ -95,7 +102,7 @@
$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
- $(Q)set -e ; for d in linux asm asm-$(KLIBCARCH) asm-generic $(ASMKLIBCARCH); do \
+ $(Q)set -e ; for d in linux scsi asm-$(KLIBCASMARCH) asm-generic $(ASMKLIBCARCH); do \
for r in $(KLIBCKERNELSRC)/include $(KLIBCKERNELOBJ)/include \
$(KLIBCKERNELOBJ)/include2 ; do \
[ ! -d $$r/$$d ] && continue; \

View File

@@ -0,0 +1,28 @@
diff -Naur klibc-1.5.8.orig/usr/include/arch/x86_64/sys/io.h klibc-1.5.8/usr/include/arch/x86_64/sys/io.h
--- klibc-1.5.8.orig/usr/include/arch/x86_64/sys/io.h 2007-12-11 18:20:29.000000000 +0100
+++ klibc-1.5.8/usr/include/arch/x86_64/sys/io.h 2008-06-26 12:04:22.760046895 +0200
@@ -60,21 +60,21 @@
{
unsigned char __v;
asm volatile ("inb %1,%0" : "=a" (__v) : "dN"(__p));
- return v;
+ return __v;
}
static __inline__ unsigned short inw(unsigned short __p)
{
unsigned short __v;
asm volatile ("inw %1,%0" : "=a" (__v) : "dN"(__p));
- return v;
+ return __v;
}
static __inline__ unsigned int inl(unsigned short __p)
{
unsigned int __v;
asm volatile ("inl %1,%0" : "=a" (__v) : "dN"(__p));
- return v;
+ return __v;
}
/* String I/O macros */

View File

@@ -0,0 +1,12 @@
diff -Naurp klibc-1.5.7-orig/klcc/klcc.in klibc-1.5.7/klcc/klcc.in
--- klibc-1.5.7-orig/klcc/klcc.in 2007-12-03 01:17:26.000000000 +0100
+++ klibc-1.5.7/klcc/klcc.in 2007-12-03 01:18:39.000000000 +0100
@@ -259,7 +259,7 @@ if ( $operation ne '' ) {
unlink(@rmobjs);
if ( $strip && !$rv ) {
- $rv = mysystem($STRIP, @STRIPFLAGS, $output);
+ $rv = mysystem($STRIP, @STRIPFLAGS, $output || 'a.out');
}
}

View File

@@ -0,0 +1,94 @@
# klibc.m4 serial 99
## Copyright (C) 1995-2003 Free Software Foundation, Inc.
## This file is free software, distributed under the terms of the GNU
## General Public License. As a special exception to the GNU General
## Public License, this file may be distributed as part of a program
## that contains a configuration script generated by Autoconf, under
## the same distribution terms as the rest of that program.
##
## This file can can be used in projects which are not available under
## the GNU General Public License or the GNU Library General Public
## License but which still want to provide support for the GNU gettext
## functionality.
## Please note that the actual code of the KLIBC Library is partly covered
## by the GNU Library General Public License, and party copyrighted by the
## Regents of The University of California, and the rest is covered by a
## MIT style license.
# Authors:
# Martin Schlemmer <azarah@nosferatu.za.org>, 2005.
# AC_CHECK_KLIBC
# --------------
# Check if the user wants KLIBC support enabled. If so, set KLIBC=yes and
# fill in KLIBC_PREFIX, KLIBC_BINDIR, KLIBC_SBINDIR, KLIBC_LIBDIR and
# KLIBC_INCLUDEDIR. CC is also set to the proper klcc executable.
# NOTE: This should be called before AC_PROG_CC, and before header, function
# or type checks.
AC_DEFUN([AC_CHECK_KLIBC],
[AC_BEFORE([$0], [AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_ENABLE([klibc],
[AS_HELP_STRING([--enable-klibc],
[Enable linking to klibc [no]. You need at
least klibc-1.0 or later for this. Set KLCC
to the absolute file name of klcc if not in
the PATH])],
[KLIBC=$enableval], [KLIBC=no])
AC_ARG_ENABLE([klibc-layout],
[AS_HELP_STRING([--enable-klibc-layout],
[Enable installing binaries, libraries and
headers into the klibc prefix [yes] ])],
[if test "X$KLIBC" != Xno; then
KLIBC_LAYOUT=$enableval
else
KLIBC_LAYOUT=no
fi],
[if test "X$KLIBC" != Xno; then
KLIBC_LAYOUT=yes
else
KLIBC_LAYOUT=no
fi])
if test "X$KLIBC" != Xno; then
# Basic cross compiling support. I do not think it is wise to use
# AC_CHECK_TOOL, because if we are cross compiling, we do not want
# just 'klcc' to be returned ...
if test "${host_alias}" != "${build_alias}"; then
AC_CHECK_PROGS([KLCC], [${host_alias}-klcc], [no])
else
AC_CHECK_PROGS([KLCC], [klcc], [no])
fi
if test "X$KLCC" = Xno; then
AC_MSG_ERROR([cannot find klibc frontend 'klcc'!])
fi
CC="$KLCC"
CFLAGS="-Os"
KLIBC_KCROSS="$($KLCC -print-klibc-kcross 2>/dev/null)"
KLIBC_PREFIX="$($KLCC -print-klibc-prefix 2>/dev/null)"
KLIBC_BIN_DIR="$($KLCC -print-klibc-bindir 2>/dev/null)"
KLIBC_SBIN_DIR="${KLIBC_PREFIX}/${KLIBC_KCROSS}sbin"
KLIBC_LIB_DIR="$($KLCC -print-klibc-libdir 2>/dev/null)"
KLIBC_INCLUDE_DIR="$($KLCC -print-klibc-includedir 2>/dev/null)"
if test "X$KLIBC_LAYOUT" != Xno; then
prefix="$KLIBC_PREFIX"
bindir="$KLIBC_BIN_DIR"
sbindir="$KLIBC_SBIN_DIR"
libdir="$KLIBC_LIB_DIR"
includedir="$KLIBC_INCLUDE_DIR"
fi
# At least KLIBC_LIB_DIR should be valid, else klibc is too old or
# something went wrong
if test ! -d "$KLIBC_LIB_DIR"; then
AC_MSG_ERROR([your klibc installation is too old or not functional!])
fi
fi
AC_SUBST(KLIBC)
])# AC_CHECK_KLIBC