diff options
44 files changed, 123 insertions, 250 deletions
diff --git a/Makefile.in b/Makefile.in index ef77f969d..7dd1a3c03 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,6 +57,7 @@ else export header_extra_args = -n endif headers: include/bits/uClibc_config.h +ifeq ($(wildcard include/headers_done),) @$(SHELL_SET_X); \ $(top_srcdir)extra/scripts/fix_includes.sh \ -k $(KERNEL_SOURCE) -t $(TARGET_ARCH) \ @@ -98,6 +99,8 @@ headers: include/bits/uClibc_config.h mv -f include/bits/sysnum.h.new include/bits/sysnum.h; \ fi $(MAKE) headers-y + touch include/headers_done +endif # Command used to download source code WGET:=wget --passive-ftp @@ -131,6 +134,7 @@ install_headers: fi ; \ tar -chf - include --exclude .svn $$extra_exclude \ | tar -xf - -C $(PREFIX)$(DEVEL_PREFIX) + $(RM) $(PREFIX)$(DEVEL_PREFIX)include/headers_done $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ssp-internal.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dl-osinfo.h ifneq ($(UCLIBC_HAS_FLOATS),y) @@ -327,8 +331,7 @@ clean: @$(RM) -r lib include/bits $(RM) lib*/*.a ldso/*/*.a libpthread/*/*.a $(RM) libc/misc/internals/interp.c - $(RM) libc/stdio/*64.c - $(RM) include/fpu_control.h include/dl-osinfo.h + $(RM) include/fpu_control.h include/dl-osinfo.h include/headers_done $(MAKE) -C extra/locale clean $(MAKE) headers_clean-y $(MAKE) -C test clean @@ -32,11 +32,11 @@ headers-y: $(headers-y) ld-uClibc-y: $(ld-uClibc-y) interp-y: $(interp) pre-y: interp-y ld-uClibc-y -libc-y: pre-y $(libc) crt-y -lib-a-y: headers_root crt-y $(lib-a-y) +libc-y: pre-y $(libc) crt-y $(top_builddir)lib/$(NONSHARED_LIBNAME) lib-so-y: libc-y $(lib-so-y) +lib-a-y: $(top_builddir)include/headers_done crt-y $(lib-a-y) -headers_root: +$(top_builddir)include/headers_done: @cd $(top_builddir); $(MAKE) headers ifneq ($(findstring s,$(MAKEFLAGS)),) diff --git a/include/malloc.h b/include/malloc.h index 6b8e1ad91..354f153d4 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -64,11 +64,13 @@ /* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. */ +#ifndef __THROW # if defined __cplusplus && (__GNUC__ >= 3 || __GNUC_MINOR__ >= 8) # define __THROW throw () # else # define __THROW # endif +#endif # define __MALLOC_P(args) args __THROW /* This macro will be used for functions which might take C++ callback functions. */ diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index 0a6d345bc..eb192cca4 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -42,7 +42,7 @@ gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ -# if 0 //!defined __cplusplus && __GNUC_PREREQ (3, 3) +# if !defined __cplusplus && __GNUC_PREREQ (3, 3) # define __THROW __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__)) fct # else @@ -164,8 +164,6 @@ #if defined __GNUC__ && __GNUC__ >= 2 # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) -# define __ASMNAME(cname) __C_SYMBOL_PREFIX__ cname -/* # ifdef __cplusplus # define __REDIRECT_NTH(name, proto, alias) \ name proto __THROW __asm__ (__ASMNAME (#alias)) @@ -175,7 +173,6 @@ # endif # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) # define __ASMNAME2(prefix, cname) __STRING (prefix) cname -*/ /* #elif __SOME_OTHER_COMPILER__ diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in index 0bf5c02ed..c01c7f066 100644 --- a/ldso/ldso/Makefile.in +++ b/ldso/ldso/Makefile.in @@ -5,12 +5,12 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-ldso := -DNOT_IN_libc #-DIS_IN_rtld +CFLAGS-ldso := -DNOT_IN_libc -DIS_IN_rtld $(SSP_DISABLE_FLAGS) # This stuff will not work with -fomit-frame-pointer CFLAGS-ldso += -fno-omit-frame-pointer -CFLAGS-ldso += -I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso $(SSP_DISABLE_FLAGS) +CFLAGS-ldso += -I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso CFLAGS-ldso += -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" ifeq ($(SUPPORT_LD_DEBUG),y) @@ -62,9 +62,8 @@ objclean-y += ld-uClibc_clean headers-$(HAVE_SHARED) += ldso_headers headers_clean-y += ldso_headers_clean -$(top_builddir)lib/$(patsubst %.$(MAJOR_VERSION),%,$(UCLIBC_LDSO)): $(ld-uClibc_OUT)/ld-uClibc_so.a headers_root +$(top_builddir)lib/$(patsubst %.$(MAJOR_VERSION),%,$(UCLIBC_LDSO)): $(ld-uClibc_OUT)/ld-uClibc_so.a $(top_builddir)include/headers_done $(call link.so,$(ldso_FULL_NAME),$(MAJOR_VERSION)) - #(RM) $@ $(ld-uClibc_OUT)/ld-uClibc_so.a: $(ld-uClibc-so-y) $(Q)$(RM) $@ diff --git a/ldso/libdl/Makefile.in b/ldso/libdl/Makefile.in index 6622226c5..77f18909c 100644 --- a/ldso/libdl/Makefile.in +++ b/ldso/libdl/Makefile.in @@ -6,9 +6,9 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-libdl := -DNOT_IN_libc +CFLAGS-libdl := -DNOT_IN_libc -DIS_IN_libdl $(SSP_ALL_CFLAGS) -CFLAGS-libdl +=-I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso $(SSP_ALL_CFLAGS) +CFLAGS-libdl +=-I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso CFLAGS-libdl += -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" diff --git a/libc/Makefile.in b/libc/Makefile.in index 50201d4fd..f65121c00 100644 --- a/libc/Makefile.in +++ b/libc/Makefile.in @@ -45,7 +45,7 @@ lib-a-y += $(top_builddir)lib/libc.a crt-y lib-so-y += libc-y $(top_builddir)lib/$(NONSHARED_LIBNAME) crt-y objclean-y += libc_clean -$(top_builddir)lib/libc.so: $(libc_OUT)/libc_so.a pre-y +$(top_builddir)lib/libc.so: $(libc_OUT)/libc_so.a $(top_builddir)include/headers_done $(interp) $(call link.so,$(libc_FULL_NAME),$(MAJOR_VERSION)) $(Q)$(RM) $@ $(Q)echo "/* GNU ld script" > $@ diff --git a/libc/misc/internals/Makefile.in b/libc/misc/internals/Makefile.in index bfae764e4..8863aba7b 100644 --- a/libc/misc/internals/Makefile.in +++ b/libc/misc/internals/Makefile.in @@ -16,7 +16,7 @@ MISC_INTERNALS_OUT:=$(top_builddir)libc/misc/internals MISC_INTERNALS_SRC:=$(patsubst %.c,$(MISC_INTERNALS_DIR)/%.c,$(CSRC)) MISC_INTERNALS_OBJ:=$(patsubst %.c,$(MISC_INTERNALS_OUT)/%.o,$(CSRC)) -$(MISC_INTERNALS_OUT)/interp.c: headers_root +$(MISC_INTERNALS_OUT)/interp.c: $(top_builddir)include/headers_done $(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@ $(Q)echo "#include <features.h>" >> $@ $(Q)echo "#ifdef __HAVE_ELF__" >> $@ diff --git a/libc/stdio/Makefile.in b/libc/stdio/Makefile.in index a928e0872..dfdf4ff14 100644 --- a/libc/stdio/Makefile.in +++ b/libc/stdio/Makefile.in @@ -7,10 +7,9 @@ # Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details. # -# Note: The *64.o objects are empty when compiled without large file support. - # SUSv3 functions -CSRC:= fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \ +CSRC := \ + fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \ fseeko.c fsetpos.c ftello.c getdelim.c getline.c gets.c getw.c \ perror.c puts.c putw.c remove.c rewind.c setbuf.c setbuffer.c \ setlinebuf.c setvbuf.c ungetc.c \ @@ -18,102 +17,102 @@ CSRC:= fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \ asprintf.c sprintf.c vasprintf.c vdprintf.c vsnprintf.c \ tmpfile.c tmpnam.c tmpnam_r.c popen.c tempnam.c ctermid.c +# Note: The *64.o objects are empty when compiled without large file support +CSRC += fgetpos64.c fopen64.c freopen64.c fseeko64.c fsetpos64.c ftello64.c + # getc -> alias for fgetc # putc -> alias for fputc # rename is a syscall # Implementation support functions -CSRC+= _READ.c _WRITE.c _adjust_pos.c _fopen.c _fwrite.c \ +CSRC += \ + _READ.c _WRITE.c _adjust_pos.c _fopen.c _fwrite.c \ _rfill.c _stdio.c _trans2r.c _trans2w.c _wcommit.c \ _cs_funcs.c _load_inttype.c _store_inttype.c _uintmaxtostr.c ifeq ($(UCLIBC_HAS_FLOATS),y) -CSRC+=_fpmaxtostr.c +CSRC += _fpmaxtostr.c endif # stdio_ext.h functions -CSRC+= __fbufsize.c __flbf.c __fpending.c __fpurge.c __freadable.c \ +CSRC += \ + __fbufsize.c __flbf.c __fpending.c __fpurge.c __freadable.c \ __freading.c __fsetlocking.c __fwritable.c __fwriting.c _flushlbf.c # Other glibc extensions ifeq ($(UCLIBC_HAS_GLIBC_CUSTOM_STREAMS),y) -CSRC+=fopencookie.c fmemopen.c open_memstream.c +CSRC += fopencookie.c fmemopen.c open_memstream.c endif # pthread functions -CSRC+=flockfile.c ftrylockfile.c funlockfile.c +CSRC += flockfile.c ftrylockfile.c funlockfile.c # Functions with unlocked versions -CUSRC:= clearerr.c feof.c ferror.c fflush.c fgetc.c fgets.c fileno.c \ +CUSRC := \ + clearerr.c feof.c ferror.c fflush.c fgetc.c fgets.c fileno.c \ fputc.c fputs.c fread.c fwrite.c getchar.c putchar.c # getc_unlocked -> alias for fgetc_unlocked # putc_unlocked -> alias for fputc_unlocked -# Largefile functions (%64.o) -CLSRC:= -ifeq ($(UCLIBC_HAS_LFS),y) -CLSRC:=fgetpos.c fopen.c freopen.c fseeko.c fsetpos.c ftello.c # tmpfile -endif - # vfprintf and support functions -MSRC1:=vfprintf.c +MSRC1 := vfprintf.c ifneq ($(USE_OLD_VFPRINTF),y) -MOBJ1:= vfprintf.o \ +MOBJ1 := \ + vfprintf.o \ _ppfs_init.o _ppfs_prepargs.o _ppfs_setargs.o _ppfs_parsespec.o \ register_printf_function.o parse_printf_format.o else -MOBJ1:= -CSRC+=old_vfprintf.c +MOBJ1 := +CSRC += old_vfprintf.c endif # vfscanf and support functions plus other *scanf funcs -MSRC2:=scanf.c -MOBJ2:= vfscanf.o __scan_cookie.o __psfs_parse_spec.o __psfs_do_numeric.o \ +MSRC2 := scanf.c +MOBJ2 := \ + vfscanf.o __scan_cookie.o __psfs_parse_spec.o __psfs_do_numeric.o \ scanf.o sscanf.o fscanf.o vscanf.o vsscanf.o -CWSRC:= +CWSRC := ifeq ($(UCLIBC_HAS_WCHAR),y) -CWSRC+=_wfwrite.c fwprintf.c swprintf.c vswprintf.c vwprintf.c wprintf.c \ +CWSRC += _wfwrite.c fwprintf.c swprintf.c vswprintf.c vwprintf.c wprintf.c \ fwide.c ungetwc.c -CUSRC+=fgetwc.c getwchar.c fgetws.c fputwc.c putwchar.c fputws.c +CUSRC += fgetwc.c getwchar.c fgetws.c fputwc.c putwchar.c fputws.c # getwc (fgetwc alias) getwc_unlocked (fgetwc_unlocked alias) # putwc (fputwc alias) putwc_unlocked (fputwc_unlocked alias) -MOBJ1+=vfwprintf.o -MOBJ2+=wscanf.o swscanf.o fwscanf.o vwscanf.o vswscanf.o vfwscanf.o +MOBJ1 += vfwprintf.o +MOBJ2 += wscanf.o swscanf.o fwscanf.o vwscanf.o vswscanf.o vfwscanf.o endif -CSRC+=$(CUSRC) $(CWSRC) +CSRC += $(CUSRC) $(CWSRC) ifneq ($(DOMULTI),n) -STDIO_CSRC_NO_MULTI:=fwrite.c fputc.c fputs.c fprintf.c _fpmaxtostr.c -CSRC:=$(filter-out $(STDIO_CSRC_NO_MULTI),$(CSRC)) +STDIO_CSRC_NO_MULTI := fwrite.c fputc.c fputs.c fprintf.c _fpmaxtostr.c +CSRC := $(filter-out $(STDIO_CSRC_NO_MULTI),$(CSRC)) endif -STDIO_MOBJ1_NO_MULTI:=vfprintf.o vfwprintf.o register_printf_function.o -STDIO_MOBJ2_NO_MULTI:=vfscanf.o vfwscanf.o fscanf.o -STDIO_MOBJ_NO_MULTI:=$(STDIO_MOBJ1_NO_MULTI) $(STDIO_MOBJ2_NO_MULTI) +STDIO_MOBJ1_NO_MULTI := vfprintf.o vfwprintf.o register_printf_function.o +STDIO_MOBJ2_NO_MULTI := vfscanf.o vfwscanf.o fscanf.o +STDIO_MOBJ_NO_MULTI := $(STDIO_MOBJ1_NO_MULTI) $(STDIO_MOBJ2_NO_MULTI) -STDIO_DIR:=$(top_srcdir)libc/stdio -STDIO_OUT:=$(top_builddir)libc/stdio +STDIO_DIR := $(top_srcdir)libc/stdio +STDIO_OUT := $(top_builddir)libc/stdio -STDIO_SRC:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(CSRC)) -STDIO_OBJ:=$(patsubst %.c,$(STDIO_OUT)/%.o,$(CSRC)) -STDIO_CUSRC:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(CUSRC)) -STDIO_CUOBJ:=$(patsubst %.c,$(STDIO_OUT)/%_unlocked.o,$(CUSRC)) -STDIO_CLSRC:=$(patsubst %.c,$(STDIO_OUT)/%64.c,$(CLSRC)) -STDIO_CLOBJ:=$(patsubst %.c,$(STDIO_OUT)/%64.o,$(CLSRC)) +STDIO_SRC := $(patsubst %.c,$(STDIO_DIR)/%.c,$(CSRC)) +STDIO_OBJ := $(patsubst %.c,$(STDIO_OUT)/%.o,$(CSRC)) +STDIO_CUSRC := $(patsubst %.c,$(STDIO_DIR)/%.c,$(CUSRC)) +STDIO_CUOBJ := $(patsubst %.c,$(STDIO_OUT)/%_unlocked.o,$(CUSRC)) -STDIO_MSRC1:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC1)) -STDIO_MSRC2:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC2)) -STDIO_MOBJ1:=$(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ1)) -STDIO_MOBJ2:=$(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ2)) +STDIO_MSRC1 := $(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC1)) +STDIO_MSRC2 := $(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC2)) +STDIO_MOBJ1 := $(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ1)) +STDIO_MOBJ2 := $(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ2)) -STDIO_MSRC:=$(STDIO_MSRC1) $(STDIO_MSRC2) -STDIO_MOBJ:=$(STDIO_MOBJ1) $(STDIO_MOBJ2) +STDIO_MSRC := $(STDIO_MSRC1) $(STDIO_MSRC2) +STDIO_MOBJ := $(STDIO_MOBJ1) $(STDIO_MOBJ2) -STDIO_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(filter-out $(STDIO_MOBJ_NO_MULTI),$(notdir $(STDIO_MOBJ))))) +STDIO_DEF := $(patsubst %,-DL_%,$(subst .o,,$(filter-out $(STDIO_MOBJ_NO_MULTI),$(notdir $(STDIO_MOBJ))))) -STDIO_OBJS:=$(STDIO_OBJ) $(STDIO_MOBJ) $(STDIO_CUOBJ) $(STDIO_CLOBJ) +STDIO_OBJS := $(STDIO_OBJ) $(STDIO_MOBJ) $(STDIO_CUOBJ) $(STDIO_CLOBJ) -STDIO_NO_MULTI:=$(STDIO_CUOBJ) $(STDIO_CLOBJ) +STDIO_NO_MULTI := $(STDIO_CUOBJ) $(STDIO_CLOBJ) # these need special handling or rewrite to support multi-build # CUOBJ @@ -123,16 +122,6 @@ STDIO_NO_MULTI:=$(STDIO_CUOBJ) $(STDIO_CLOBJ) %_unlocked.os: %.c $(compile.c) -D__DO_UNLOCKED -# need this, else the other %64 files will get false rules -$(STDIO_CLSRC): $(STDIO_OUT)/%64.c : $(STDIO_DIR)/%.c - @cp $< $@ - -$(STDIO_CLOBJ): %.o : %.c - $(compile.c) -D__DO_LARGEFILE - -$(STDIO_CLOBJ:.o=.os): %.os : %.c - $(compile.c) -D__DO_LARGEFILE - $(STDIO_MOBJ1): $(STDIO_MSRC1) $(compile.m) @@ -157,4 +146,4 @@ libc-nomulti-y+=$(patsubst %.o,$(STDIO_OUT)/%.o,$(STDIO_MOBJ_NO_MULTI)) objclean-y+=stdio_objclean stdio_objclean: - $(RM) $(STDIO_OUT)/*.{o,os} $(STDIO_OUT)/*64.c + $(RM) $(STDIO_OUT)/*.{o,os} diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h index 1ed349533..e900edac6 100644 --- a/libc/stdio/_stdio.h +++ b/libc/stdio/_stdio.h @@ -17,6 +17,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <features.h> #ifdef __UCLIBC_HAS_WCHAR__ #include <wchar.h> diff --git a/libc/stdio/fgetpos.c b/libc/stdio/fgetpos.c index 9c6c26297..84cf0b98c 100644 --- a/libc/stdio/fgetpos.c +++ b/libc/stdio/fgetpos.c @@ -7,16 +7,6 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define fgetpos fgetpos64 -# define fpos_t fpos64_t -# define ftell ftello64 -#endif - int fgetpos(FILE * __restrict stream, register fpos_t * __restrict pos) { #ifdef __STDIO_MBSTATE diff --git a/libc/stdio/fopen.c b/libc/stdio/fopen.c index 8303fa88c..244304acf 100644 --- a/libc/stdio/fopen.c +++ b/libc/stdio/fopen.c @@ -7,14 +7,7 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define fopen fopen64 -# define FILEDES_ARG (-2) -#else +#ifndef __DO_LARGEFILE # define FILEDES_ARG (-1) #endif diff --git a/libc/stdio/freopen.c b/libc/stdio/freopen.c index 0eccaac1f..7df035d48 100644 --- a/libc/stdio/freopen.c +++ b/libc/stdio/freopen.c @@ -7,14 +7,7 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define freopen freopen64 -# define FILEDES_ARG (-2) -#else +#ifndef __DO_LARGEFILE # define FILEDES_ARG (-1) #endif diff --git a/libc/stdio/fseeko.c b/libc/stdio/fseeko.c index 48979a06b..242292a43 100644 --- a/libc/stdio/fseeko.c +++ b/libc/stdio/fseeko.c @@ -11,22 +11,11 @@ # error Assumption violated -- values of SEEK_SET, SEEK_CUR, SEEK_END #endif -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define FSEEK __fseeko64 -# define OFFSET_TYPE __off64_t - -#else - +#ifndef __DO_LARGEFILE # define FSEEK fseek # define OFFSET_TYPE long int - #endif - int FSEEK(register FILE *stream, OFFSET_TYPE offset, int whence) { #if defined(__UCLIBC_HAS_LFS__) && !defined(__DO_LARGEFILE) diff --git a/libc/stdio/fsetpos.c b/libc/stdio/fsetpos.c index 44104b4df..2b02f25e0 100644 --- a/libc/stdio/fsetpos.c +++ b/libc/stdio/fsetpos.c @@ -7,16 +7,6 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define fsetpos fsetpos64 -# define fpos_t fpos64_t -# define fseek fseeko64 -#endif - int fsetpos(FILE *stream, register const fpos_t *pos) { #ifdef __STDIO_MBSTATE @@ -41,4 +31,3 @@ int fsetpos(FILE *stream, register const fpos_t *pos) #endif } - diff --git a/libc/stdio/ftello.c b/libc/stdio/ftello.c index 38517acbd..a28333efc 100644 --- a/libc/stdio/ftello.c +++ b/libc/stdio/ftello.c @@ -7,19 +7,9 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define FTELL __ftello64 -# define OFFSET_TYPE __off64_t - -#else - +#ifndef __DO_LARGEFILE # define FTELL ftell # define OFFSET_TYPE long int - #endif OFFSET_TYPE FTELL(register FILE *stream) diff --git a/libc/sysdeps/linux/Makefile.arch b/libc/sysdeps/linux/Makefile.arch deleted file mode 100644 index 5feffe8d6..000000000 --- a/libc/sysdeps/linux/Makefile.arch +++ /dev/null @@ -1,44 +0,0 @@ -# Makefile template to be included by sysdeps/linux/<ARCH>/Makefile.arch -# -# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -ARCH_DIR := $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH) -ARCH_OUT := $(top_builddir)libc/sysdeps/linux/$(TARGET_ARCH) - -ARCH_CSRC := $(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC)) -ARCH_COBJ := $(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC)) -ARCH_SSRC := $(patsubst %.s,$(ARCH_DIR)/%.s,$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))) -ARCH_SOBJ := $(patsubst %.s,$(ARCH_OUT)/%.o,$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))) - -ARCH_OBJS := $(ARCH_COBJ) $(ARCH_SOBJ) - -crt-y := create -libc-a-y += $(ARCH_OBJS) -libc-so-y += $(ARCH_OBJS:.o=.os) -libc-multi-y += $(ARCH_CSRC) -libc-nomulti-y += $(ARCH_SOBJ) -objclean-y += arch_objclean - -arch_objclean: - $(RM) $(ARCH_OUT)/*.{o,os} $(CTOR_TARGETS) $(CRTS) - -ifneq ($(ARCH_HEADERS),) - -ARCH_HEADERS_IN := $(patsubst %,../libc/sysdeps/linux/$(TARGET_ARCH)/%,$(ARCH_HEADERS)) -ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS)) - -headers-y += arch_headers -arch_headers: - $(SECHO) $(LN) -fs $(ARCH_HEADERS) $(top_builddir)include/ - @for h in $(ARCH_HEADERS_IN) ; do \ - $(LN) -fs $$h $(top_builddir)include/ ; \ - done - -headers_clean-y += arch_headers_clean -arch_headers_clean: - $(RM) $(ARCH_HEADERS_OUT) - -endif diff --git a/libc/sysdeps/linux/alpha/Makefile.arch b/libc/sysdeps/linux/alpha/Makefile.arch index aafb4a826..91636c71a 100644 --- a/libc/sysdeps/linux/alpha/Makefile.arch +++ b/libc/sysdeps/linux/alpha/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \ divl.S divq.S reml.S remq.S setjmp.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/arm/Makefile.arch b/libc/sysdeps/linux/arm/Makefile.arch index c6edc12a1..1ed4b6a6e 100644 --- a/libc/sysdeps/linux/arm/Makefile.arch +++ b/libc/sysdeps/linux/arm/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ bsd-_setjmp.S sigrestorer.S mmap64.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/common/bits/kernel_sigaction.h b/libc/sysdeps/linux/common/bits/kernel_sigaction.h index 6eaf61f1d..5baf1e224 100644 --- a/libc/sysdeps/linux/common/bits/kernel_sigaction.h +++ b/libc/sysdeps/linux/common/bits/kernel_sigaction.h @@ -4,36 +4,9 @@ /* This file provides whatever this particular arch's kernel thinks * the sigaction struct should look like... */ -#if defined(__alpha__) -#undef HAVE_SA_RESTORER -/* This is the sigaction struction from the Linux 2.1.20 kernel. */ -struct old_kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned long sa_mask; - unsigned int sa_flags; -}; -/* This is the sigaction structure from the Linux 2.1.68 kernel. */ -struct kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned int sa_flags; - sigset_t sa_mask; -}; -#elif defined(__hppa__) -#undef HAVE_SA_RESTORER -/* This is the sigaction struction from the Linux 2.1.20 kernel. */ -/* Blah. This is bogus. We don't ever use it. */ -struct old_kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned long sa_mask; - unsigned long sa_flags; -}; -/* This is the sigaction structure from the Linux 2.1.68 kernel. */ -struct kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned long sa_flags; - sigset_t sa_mask; -}; -#elif defined(__mips__) +#undef NO_OLD_SIGACTION + +#if defined(__mips__) #undef HAVE_SA_RESTORER /* This is the sigaction structure from the Linux 2.1.24 kernel. */ #include <sgidefs.h> @@ -58,6 +31,14 @@ struct kernel_sigaction { void (*sa_restorer)(void); int s_resv[1]; /* reserved */ }; +#elif defined(__ia64__) +#define NO_OLD_SIGACTION +#undef HAVE_SA_RESTORER +struct kernel_sigaction { + __sighandler_t k_sa_handler; + unsigned long sa_flags; + sigset_t sa_mask; +}; #else #define HAVE_SA_RESTORER /* This is the sigaction structure from the Linux 2.1.20 kernel. */ @@ -76,8 +57,10 @@ struct kernel_sigaction { }; #endif +#ifndef NO_OLD_SIGACTION extern int __syscall_sigaction (int, const struct old_kernel_sigaction *__unbounded, struct old_kernel_sigaction *__unbounded); +#endif extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded, struct kernel_sigaction *__unbounded, size_t); diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c index e37f8e804..0c8f50999 100644 --- a/libc/sysdeps/linux/common/create_module.c +++ b/libc/sysdeps/linux/common/create_module.c @@ -27,19 +27,17 @@ #include <sys/syscall.h> -//#define __NR_create_module 127 - #ifdef __NR_create_module #if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__thumb__) || defined(__cris__) || defined(__i960__) -#define __NR___create_module __NR_create_module -#ifdef __STR_NR_create_module -#define __STR_NR___create_module __STR_NR_create_module -#endif +# define __NR___create_module __NR_create_module +# ifdef __STR_NR_create_module +# define __STR_NR___create_module __STR_NR_create_module +# endif _syscall2(long, __create_module, const char *, name, size_t, size); /* By checking the value of errno, we know if we have been fooled * by the syscall2 macro making a very high address look like a - * negaitive, so we we fix it up here. */ + * negative, so we we fix it up here. */ unsigned long create_module(const char *name, size_t size) { long ret = __create_module(name, size); @@ -52,7 +50,7 @@ unsigned long create_module(const char *name, size_t size) return ret; } #elif defined(__alpha__) -#define __NR___create_module __NR_create_module +# define __NR___create_module __NR_create_module /* Alpha doesn't have the same problem, exactly, but a bug in older kernels fails to clear the error flag. Clear it here explicitly. */ _syscall4(unsigned long, __create_module, const char *, name, @@ -66,11 +64,10 @@ unsigned long create_module(const char *name, size_t size) _syscall2(unsigned long, create_module, const char *, name, size_t, size); #endif -#else -unsigned long create_module(const char *name, size_t size) +#else /* !__NR_create_module */ +caddr_t create_module(const char *name, size_t size) { __set_errno(ENOSYS); - return (unsigned long)-1; + return (caddr_t)-1; } #endif - diff --git a/libc/sysdeps/linux/common/get_kernel_syms.c b/libc/sysdeps/linux/common/get_kernel_syms.c index ae19cd2c7..92a105ebd 100644 --- a/libc/sysdeps/linux/common/get_kernel_syms.c +++ b/libc/sysdeps/linux/common/get_kernel_syms.c @@ -9,13 +9,13 @@ #include "syscalls.h" -#ifdef __NR_get_kernel_syms struct kernel_sym; +#ifdef __NR_get_kernel_syms _syscall1(int, get_kernel_syms, struct kernel_sym *, table); #else int get_kernel_syms(struct kernel_sym *table) { __set_errno(ENOSYS); - return (unsigned long)-1; + return -1; } #endif diff --git a/libc/sysdeps/linux/common/getrusage.c b/libc/sysdeps/linux/common/getrusage.c index f0476352c..c6aa5a95e 100644 --- a/libc/sysdeps/linux/common/getrusage.c +++ b/libc/sysdeps/linux/common/getrusage.c @@ -10,4 +10,4 @@ #include "syscalls.h" #include <unistd.h> #include <wait.h> -_syscall2(int, getrusage, int, who, struct rusage *, usage); +_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage); diff --git a/libc/sysdeps/linux/cris/Makefile.arch b/libc/sysdeps/linux/cris/Makefile.arch index ba2040f0d..850c83de5 100644 --- a/libc/sysdeps/linux/cris/Makefile.arch +++ b/libc/sysdeps/linux/cris/Makefile.arch @@ -12,4 +12,4 @@ ifeq ($(UNIFIED_SYSCALL),y) SSRC += __uClibc_syscall.S endif -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/hppa/Makefile.arch b/libc/sysdeps/linux/hppa/Makefile.arch index 047c01005..9739e74d7 100644 --- a/libc/sysdeps/linux/hppa/Makefile.arch +++ b/libc/sysdeps/linux/hppa/Makefile.arch @@ -10,4 +10,4 @@ CSRC := __syscall_error.c brk.c mmap.c syscall.c SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S \ add_n.s lshift.s rshift.s sub_n.s udiv_qrnnd.s -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/hppa/bits/syscalls.h b/libc/sysdeps/linux/hppa/bits/syscalls.h index 013c24095..d173aa389 100644 --- a/libc/sysdeps/linux/hppa/bits/syscalls.h +++ b/libc/sysdeps/linux/hppa/bits/syscalls.h @@ -163,4 +163,4 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 } #endif /* __ASSEMBLER__ */ -#endif /* _ASM_PARISC_UNISTD_H_ */ +#endif /* _BITS_SYSCALLS_H */ diff --git a/libc/sysdeps/linux/i386/Makefile.arch b/libc/sysdeps/linux/i386/Makefile.arch index c0f4f2f40..abd267445 100644 --- a/libc/sysdeps/linux/i386/Makefile.arch +++ b/libc/sysdeps/linux/i386/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ bsd-_setjmp.S syscall.S mmap.S mmap64.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/m68k/Makefile.arch b/libc/sysdeps/linux/m68k/Makefile.arch index 833d31ffe..81e5b27f7 100644 --- a/libc/sysdeps/linux/m68k/Makefile.arch +++ b/libc/sysdeps/linux/m68k/Makefile.arch @@ -15,4 +15,4 @@ else ARCH_HEADERS := fpu_control.h endif -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/m68k/bits/mman.h b/libc/sysdeps/linux/m68k/bits/mman.h index 34f14ee5b..7f644b99b 100644 --- a/libc/sysdeps/linux/m68k/bits/mman.h +++ b/libc/sysdeps/linux/m68k/bits/mman.h @@ -72,4 +72,5 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif diff --git a/libc/sysdeps/linux/mips/Makefile.arch b/libc/sysdeps/linux/mips/Makefile.arch index f88e99686..c79aee8ca 100644 --- a/libc/sysdeps/linux/mips/Makefile.arch +++ b/libc/sysdeps/linux/mips/Makefile.arch @@ -14,4 +14,4 @@ SSRC := bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S syscall.S pipe.S ARCH_HEADERS := sgidefs.h # regdef.h -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/powerpc/Makefile.arch b/libc/sysdeps/linux/powerpc/Makefile.arch index 125ebc397..eaa1cb7f8 100644 --- a/libc/sysdeps/linux/powerpc/Makefile.arch +++ b/libc/sysdeps/linux/powerpc/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \ clone.S __uClibc_syscall.S syscall.S vfork.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/sh/Makefile.arch b/libc/sysdeps/linux/sh/Makefile.arch index 33ea8a94f..fa1a49543 100644 --- a/libc/sysdeps/linux/sh/Makefile.arch +++ b/libc/sysdeps/linux/sh/Makefile.arch @@ -11,4 +11,4 @@ CSRC := \ SSRC := setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/sparc/Makefile.arch b/libc/sysdeps/linux/sparc/Makefile.arch index 6730206b4..a6f44f2f0 100644 --- a/libc/sysdeps/linux/sparc/Makefile.arch +++ b/libc/sysdeps/linux/sparc/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \ urem.S udiv.S umul.S sdiv.S rem.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/x86_64/Makefile.arch b/libc/sysdeps/linux/x86_64/Makefile.arch index 2cd9b2389..b6ad71cbd 100644 --- a/libc/sysdeps/linux/x86_64/Makefile.arch +++ b/libc/sysdeps/linux/x86_64/Makefile.arch @@ -10,4 +10,4 @@ CSRC := brk.c sigaction.c __syscall_error.c mmap.c SSRC := \ __longjmp.S vfork.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S clone.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libcrypt/Makefile.in b/libcrypt/Makefile.in index 6138ef51f..9aa0d014e 100644 --- a/libcrypt/Makefile.in +++ b/libcrypt/Makefile.in @@ -6,7 +6,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-libcrypt := -DNOT_IN_libc $(SSP_ALL_CFLAGS) +CFLAGS-libcrypt := -DNOT_IN_libc -DIS_IN_libcrypt $(SSP_ALL_CFLAGS) LDFLAGS-libcrypt.so := $(LDFLAGS) diff --git a/libintl/Makefile.in b/libintl/Makefile.in index 78bcc8d0d..3fa075994 100644 --- a/libintl/Makefile.in +++ b/libintl/Makefile.in @@ -6,7 +6,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-libintl := -DNOT_IN_libc $(SSP_ALL_CFLAGS) +CFLAGS-libintl := -DNOT_IN_libc -DIS_IN_libintl $(SSP_ALL_CFLAGS) LDFLAGS-libintl.so := $(LDFLAGS) diff --git a/libm/Makefile.in b/libm/Makefile.in index 4057203fa..4a021fccf 100644 --- a/libm/Makefile.in +++ b/libm/Makefile.in @@ -20,7 +20,7 @@ # by Erik Andersen <andersen@codepoet.org> # -CFLAGS-libm := -DNOT_IN_libc $(SSP_ALL_CFLAGS) +CFLAGS-libm := -DNOT_IN_libc -DIS_IN_libm $(SSP_ALL_CFLAGS) CFLAGS-libm += -D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE CFLAGS-libm/$(TARGET_ARCH)/ := $(CFLAGS-libm) diff --git a/libnsl/Makefile.in b/libnsl/Makefile.in index 765868e54..f3221f481 100644 --- a/libnsl/Makefile.in +++ b/libnsl/Makefile.in @@ -5,7 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-libnsl := -DNOT_IN_libc $(SSP_ALL_CFLAGS) +CFLAGS-libnsl := -DNOT_IN_libc -DIS_IN_libnsl $(SSP_ALL_CFLAGS) LDFLAGS-libnsl.so := $(LDFLAGS) diff --git a/libpthread/Makefile.in b/libpthread/Makefile.in index 4772cba32..bda935b5b 100644 --- a/libpthread/Makefile.in +++ b/libpthread/Makefile.in @@ -5,5 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # +ifneq ($(PTNAME),) include $(PTDIR)/Makefile.in include $(PTDIR)_db/Makefile.in +endif diff --git a/libpthread/linuxthreads.old/specific.c b/libpthread/linuxthreads.old/specific.c index d8b5bb0b3..ae836055d 100644 --- a/libpthread/linuxthreads.old/specific.c +++ b/libpthread/linuxthreads.old/specific.c @@ -200,5 +200,5 @@ libc_internal_tsd_address (enum __libc_tsd_key_t key) return &self->p_libc_specific[key]; } void **(*const __libc_internal_tsd_address) (enum __libc_tsd_key_t key) - __THROW __attribute__ ((__const__)) = libc_internal_tsd_address; + __attribute__ ((__const__)) = libc_internal_tsd_address; #endif diff --git a/libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h b/libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h index efd0c83be..c152fddba 100644 --- a/libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h +++ b/libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h @@ -40,11 +40,10 @@ enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0, #else -extern void *(*__libc_internal_tsd_get) (enum __libc_tsd_key_t) __THROW; -extern int (*__libc_internal_tsd_set) (enum __libc_tsd_key_t, - __const void *) __THROW; +extern void *(*__libc_internal_tsd_get) (enum __libc_tsd_key_t); +extern int (*__libc_internal_tsd_set) (enum __libc_tsd_key_t, __const void *); extern void **(*const __libc_internal_tsd_address) (enum __libc_tsd_key_t) - __THROW __attribute__ ((__const__)); + __attribute__ ((__const__)); #define __libc_tsd_address(KEY) \ (__libc_internal_tsd_address != NULL \ diff --git a/libresolv/Makefile.in b/libresolv/Makefile.in index d94a076f8..f7a474ad4 100644 --- a/libresolv/Makefile.in +++ b/libresolv/Makefile.in @@ -5,7 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-libresolv := -DNOT_IN_libc $(SSP_ALL_CFLAGS) +CFLAGS-libresolv := -DNOT_IN_libc -DIS_IN_libresolv $(SSP_ALL_CFLAGS) LDFLAGS-libresolv.so := $(LDFLAGS) diff --git a/librt/Makefile.in b/librt/Makefile.in index 7a2a44d03..20a22e26d 100644 --- a/librt/Makefile.in +++ b/librt/Makefile.in @@ -5,7 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-librt := -DNOT_IN_libc $(SSP_ALL_CFLAGS) +CFLAGS-librt := -DNOT_IN_libc -DIS_IN_librt $(SSP_ALL_CFLAGS) LDFLAGS-librt.so := $(LDFLAGS) diff --git a/libutil/Makefile.in b/libutil/Makefile.in index 79c329a33..f6396a627 100644 --- a/libutil/Makefile.in +++ b/libutil/Makefile.in @@ -5,7 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-libutil := -DNOT_IN_libc $(SSP_ALL_CFLAGS) +CFLAGS-libutil := -DNOT_IN_libc -DIS_IN_libutil $(SSP_ALL_CFLAGS) LDFLAGS-libutil.so := $(LDFLAGS) |