From 4272779706c53c635a3fa5431a4e8791402183b4 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Mon, 7 Mar 2005 07:04:46 +0100 Subject: [PATCH] [PATCH] klibc: version 0.214 --- klibc/MCONFIG | 2 +- klibc/Makefile | 2 +- klibc/include/klibc/compiler.h | 6 +++--- klibc/klcc.in | 16 ++++++++++++++-- klibc/klibc/arch/sparc/MCONFIG | 2 +- klibc/klibc/arch/sparc/Makefile.inc | 7 ++++++- klibc/klibc/arch/sparc/crt0.S | 2 +- klibc/version | 2 +- 8 files changed, 28 insertions(+), 11 deletions(-) diff --git a/klibc/MCONFIG b/klibc/MCONFIG index c8334994..7a24b821 100644 --- a/klibc/MCONFIG +++ b/klibc/MCONFIG @@ -59,7 +59,7 @@ HOST_LIBS = # Static library paths CRT0 = $(KLIBOBJ)/crt0.o KLIBC = $(KLIBOBJ)/libc.a -LIBGCC = $(shell $(CC) --print-libgcc) +LIBGCC = $(shell $(CC) $(REQFLAGS) $(OPTFLAGS) --print-libgcc) # Shared library paths CRTSHARED = $(KLIBOBJ)/interp.o diff --git a/klibc/Makefile b/klibc/Makefile index 812ea92f..a512aa30 100644 --- a/klibc/Makefile +++ b/klibc/Makefile @@ -54,7 +54,7 @@ local-install: $(CROSS)klcc mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin - set -xe ; for d in linux asm-$(ARCH) asm-generic $(ASMARCH); do \ + set -xe ; for d in linux scsi asm-$(ARCH) asm-generic $(ASMARCH); do \ mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)include/$$d ; \ for r in $(KRNLSRC)/include $(KRNLOBJ)/include $(KRNLOBJ)/include2 ; do \ [ ! -d $$r/$$d ] || \ diff --git a/klibc/include/klibc/compiler.h b/klibc/include/klibc/compiler.h index 823996e7..ee697adf 100644 --- a/klibc/include/klibc/compiler.h +++ b/klibc/include/klibc/compiler.h @@ -22,7 +22,7 @@ /* How to declare a function that *must* be inlined */ #ifdef __GNUC__ -# if __GNUC_MAJOR__ >= 3 +# if __GNUC__ >= 3 # define __must_inline static __inline__ __attribute__((always_inline)) # else # define __must_inline extern __inline__ @@ -84,14 +84,14 @@ #endif /* malloc() function (returns unaliased pointer) */ -#if defined(__GNUC__) && (__GNUC_MAJOR__ >= 3) +#if defined(__GNUC__) && (__GNUC__ >= 3) # define __mallocfunc __attribute__((malloc)) #else # define __mallocfunc #endif /* likely/unlikely */ -#if defined(__GNUC__) && (__GNUC_MAJOR__ > 2 || (__GNUC_MAJOR__ == 2 && __GNUC_MINOR__ >= 95)) +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) # define __likely(x) __builtin_expect((x), 1) # define __unlikely(x) __builtin_expect((x), 0) #else diff --git a/klibc/klcc.in b/klibc/klcc.in index bdd03e73..d8721c9a 100644 --- a/klibc/klcc.in +++ b/klibc/klcc.in @@ -77,6 +77,11 @@ sub mysystem(@) { return system(@_); } +# +# Initialization +# +open(NULL, '+<', '/dev/null') or die "$0: cannot open /dev/null\n"; + # # Begin parsing options. # @@ -191,10 +196,17 @@ if ( $operation ne '' ) { } } + # Get the libgcc pathname for the *current* gcc + open(LIBGCC, '-|', $CC, @ccopt, '-print-libgcc-file-name') + or die "$0: cannot get libgcc filename\n"; + $libgcc = ; + chomp $libgcc; + close(LIBGCC); + if ( $shared ) { - $rv = mysystem($LD, @LDFLAGS, @sharedopt, @ldopt, @outopt, @objs, @sharedlib); + $rv = mysystem($LD, @LDFLAGS, @sharedopt, @ldopt, @outopt, @objs, @sharedlib, $libgcc); } else { - $rv = mysystem($LD, @LDFLAGS, @staticopt, @ldopt, @outopt, @objs, @staticlib); + $rv = mysystem($LD, @LDFLAGS, @staticopt, @ldopt, @outopt, @objs, @staticlib, $libgcc); } unlink(@rmobjs); diff --git a/klibc/klibc/arch/sparc/MCONFIG b/klibc/klibc/arch/sparc/MCONFIG index 55f8b198..3a5cbaa2 100644 --- a/klibc/klibc/arch/sparc/MCONFIG +++ b/klibc/klibc/arch/sparc/MCONFIG @@ -7,7 +7,7 @@ # accordingly. # -OPTFLAGS = -Os +OPTFLAGS = -Os -m32 -mptr32 BITSIZE = 32 # Extra linkflags when building the shared version of the library diff --git a/klibc/klibc/arch/sparc/Makefile.inc b/klibc/klibc/arch/sparc/Makefile.inc index 6ea66114..bea1dbc9 100644 --- a/klibc/klibc/arch/sparc/Makefile.inc +++ b/klibc/klibc/arch/sparc/Makefile.inc @@ -16,7 +16,12 @@ ARCHOBJS = \ arch/$(ARCH)/umul.o \ arch/$(ARCH)/setjmp.o \ arch/$(ARCH)/syscall.o \ - arch/$(ARCH)/sysfork.o + arch/$(ARCH)/sysfork.o \ + libgcc/__divdi3.o \ + libgcc/__moddi3.o \ + libgcc/__udivdi3.o \ + libgcc/__umoddi3.o \ + libgcc/__udivmoddi4.o arch/$(ARCH)/sdiv.S: arch/$(ARCH)/divrem.m4 @echo 'building $@ from $^' diff --git a/klibc/klibc/arch/sparc/crt0.S b/klibc/klibc/arch/sparc/crt0.S index 148cb4b4..63db1889 100644 --- a/klibc/klibc/arch/sparc/crt0.S +++ b/klibc/klibc/arch/sparc/crt0.S @@ -1,2 +1,2 @@ #define TARGET_PTR_SIZE 32 -#include "arch/sparc/crt0i.S" +#include "crt0i.S" diff --git a/klibc/version b/klibc/version index 1f397021..136a629e 100644 --- a/klibc/version +++ b/klibc/version @@ -1 +1 @@ -0.211 +0.214 -- 2.39.5