diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-10-30 01:14:23 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-10-30 01:14:23 +0000 |
commit | 6e46869a9c0c9f5e31378247e5835cd0b3301c96 (patch) | |
tree | dad4ede474ab46f074fd8381965d160f6a2ac92c | |
parent | ca798b3b1e0937336dc382b6f3fe7453a219fd2f (diff) | |
download | uClibc-alpine-6e46869a9c0c9f5e31378247e5835cd0b3301c96.tar.bz2 uClibc-alpine-6e46869a9c0c9f5e31378247e5835cd0b3301c96.tar.xz |
Merge from trunk.
77 files changed, 700 insertions, 1728 deletions
diff --git a/debian/config b/debian/config index a26f997c4..8ec73e231 100644 --- a/debian/config +++ b/debian/config @@ -64,7 +64,6 @@ DOPIC=y # HAVE_NO_SHARED is not set HAVE_SHARED=y # ARCH_HAS_NO_LDSO is not set -BUILD_UCLIBC_LDSO=y # FORCE_SHAREABLE_TEXT_SEGMENTS is not set LDSO_LDD_SUPPORT=y LDSO_CACHE_SUPPORT=y diff --git a/docs/uclibc.org/FAQ.html b/docs/uclibc.org/FAQ.html index c3505a785..631944fd9 100644 --- a/docs/uclibc.org/FAQ.html +++ b/docs/uclibc.org/FAQ.html @@ -26,6 +26,8 @@ have additions to this FAQ document, we would love to add them, <li><a href="#bugs">I think I found a bug in uClibc! What should I do?!</a> <li><a href="#miscompile">My package builds fine but link fails with errors like "undefined reference to __fputc_unlocked", who do I blame?!</a> +<li><a href="#gnu_malloc">My package builds fine but link fails with errors like "undefined reference + to rpl_realloc / rpl_malloc", who do I blame?!</a> <li><a href="#job_control">Why do I keep getting "sh: can't access tty; job control turned off" errors? Why doesn't Control-C work within my shell?</a> <li><a href="#autoconf">How do I make autoconf and automake behave?</a> @@ -260,7 +262,7 @@ How could it be smaller and not suck?</a></h2> <hr /> <p> -<h2><a name="toolchain">Do I really need to build a uClibc toolchain?</h2> +<h2><a name="toolchain">Do I really need to build a uClibc toolchain?</a></h2> <p> Yes, you really do need to build a toolchain to produce uClibc binaries. @@ -281,7 +283,7 @@ How could it be smaller and not suck?</a></h2> <hr /> <p> -<h2><a name="wrapper">What happened to the old toolchain wrapper?</h2> +<h2><a name="wrapper">What happened to the old toolchain wrapper?</a></h2> <p> It is possible in some limited cases to re-use an existing glibc toolchain @@ -364,7 +366,7 @@ How could it be smaller and not suck?</a></h2> <hr /> <p> -<h2><a name="bugs">I think I found a bug in uClibc! What should I do?</h2> +<h2><a name="bugs">I think I found a bug in uClibc! What should I do?</a></h2> <p> If you find a problem with uClibc, please submit a detailed bug report to @@ -385,7 +387,7 @@ How could it be smaller and not suck?</a></h2> <hr /> <p> <h2><a name="miscompile">My package builds fine but link fails with errors like - "undefined reference to __fputc_unlocked", who do I blame?!</h2> + "undefined reference to __fputc_unlocked", who do I blame?!</a></h2> <p> This error crops up when a build system mixes system headers (say glibc) @@ -398,6 +400,24 @@ How could it be smaller and not suck?</a></h2> <hr /> <p> +<h2><a name="gnu_malloc">My package builds fine but link fails with errors like "undefined reference + to rpl_realloc / rpl_malloc", who do I blame?!</a></h2> +<p> + + This error crops up because you didn't enable MALLOC_GLIBC_COMPAT support. + Configure scripts detect whether your libc supports "GNU malloc" features by + seeing whether malloc(0) returns NULL (glibc malloc(0) will return a non NULL + pointer). uClibc defaults to malloc(0) returning NULL so autoconf will assume + malloc from your libc sucks and procede to try and compile the malloc replacement + version in the gnulib addon. However, since not many packages include gnulib, + they will fail to link with rpl_realloc / rpl_malloc errors. You could force + configure to assume working behavior by exporting the variables 'jm_cv_func_working_malloc' + (older autoconf) and 'ac_cv_func_malloc_0_nonnull' (newer autoconf) to 'yes' + before running `./configure`. + + +<hr /> +<p> <h2><a name="job_control">Why do I keep getting "sh: can't access tty; job control turned off" errors? Why doesn't Control-C work within my shell?</a></h2> <p> diff --git a/docs/uclibc.org/header.html b/docs/uclibc.org/header.html index 48b602383..294bafdbe 100644 --- a/docs/uclibc.org/header.html +++ b/docs/uclibc.org/header.html @@ -1,8 +1,8 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" -"http://www.w3.org/TR/REC-html40/loose.dtd"> +<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'> <html> <head> + <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> <title>uClibc</title> <style type="text/css"> body { diff --git a/docs/uclibc.org/products.html b/docs/uclibc.org/products.html index 58ce0b028..3aad0a3b2 100644 --- a/docs/uclibc.org/products.html +++ b/docs/uclibc.org/products.html @@ -11,20 +11,15 @@ listed in the order I happen to add them to the web page: <ul> - -<li><a href="/cgi-bin/viewcvs.cgi/trunk/buildroot/">buildroot</a> a configurable -means for building your own busybox/uClibc based system systems. - -</li><li><a href="http://leaf.sourceforge.net/mod.php?mod=userpage&menu=910&page_id=36">LEAF Bering-uClibc</a> -<br>the sucessor of the Linux Router Project, supporting all sorts of - gateways, routers, wireless routers, and firewalls. -</li><li><a href="http://tuxscreen.net">Tuxscreen Linux Phone</a> -</li><li><a href="http://www.linksys.com/products/product.asp?prid=508">Linksys WRT54G - Wireless-G Broadband Router</a> -</li><li><a href="http://www.netgear.com/products/prod_details.asp?prodID=170">NetGear WG602 wireless router</a> -</li><li><a href="http://www.axis.com/">Almost all the Axis network cameras use uClibc</a> +<li><a href="/cgi-bin/viewcvs.cgi/trunk/buildroot/">buildroot</a> a configurable means for building your own busybox/uClibc based system systems.</li> +<li><a href="http://leaf.sourceforge.net/mod.php?mod=userpage&menu=910&page_id=36">LEAF Bering-uClibc</a> + <br>the sucessor of the Linux Router Project, supporting all sorts of gateways, routers, wireless routers, and firewalls.</li> +<li><a href="http://tuxscreen.net">Tuxscreen Linux Phone</a></li> +<li><a href="http://www.linksys.com/products/product.asp?prid=508">Linksys WRT54G - Wireless-G Broadband Router</a></li> +<li><a href="http://www.netgear.com/products/prod_details.asp?prodID=170">NetGear WG602 wireless router</a></li> +<li><a href="http://www.axis.com/">Almost all the Axis network cameras use uClibc</a></li> +<li><a href="http://embedded.gentoo.org/">Embedded Gentoo</a></li> </ul> - <!--#include file="footer.html" --> - diff --git a/extra/Configs/Config.alpha b/extra/Configs/Config.alpha index 64c2ad1d8..8604620a9 100644 --- a/extra/Configs/Config.alpha +++ b/extra/Configs/Config.alpha @@ -5,7 +5,6 @@ config HAVE_ELF select ARCH_HAS_MMU - select HAVE_NO_SHARED select ARCH_HAS_NO_LDSO select HAS_NO_THREADS select UCLIBC_HAS_LFS diff --git a/extra/Configs/Config.bfin b/extra/Configs/Config.bfin index c4258e36b..48134889f 100644 --- a/extra/Configs/Config.bfin +++ b/extra/Configs/Config.bfin @@ -10,8 +10,6 @@ config HAVE_ELF bool select ARCH_HAS_NO_MMU select ARCH_LITTLE_ENDIAN - select HAVE_NO_SHARED - select ARCH_HAS_NO_LDSO default y config ARCH_CFLAGS diff --git a/extra/Configs/Config.e1 b/extra/Configs/Config.e1 index e26998311..9f4bce92b 100644 --- a/extra/Configs/Config.e1 +++ b/extra/Configs/Config.e1 @@ -7,7 +7,6 @@ config HAVE_ELF select ARCH_HAS_NO_MMU select HAVE_NO_SHARED - select ARCH_HAS_NO_LDSO bool default n diff --git a/extra/Configs/Config.frv.default b/extra/Configs/Config.frv.default index 780f865bb..55503e489 100644 --- a/extra/Configs/Config.frv.default +++ b/extra/Configs/Config.frv.default @@ -46,7 +46,6 @@ DOPIC=y # HAVE_NO_SHARED is not set HAVE_SHARED=y # ARCH_HAS_NO_LDSO is not set -BUILD_UCLIBC_LDSO=y FORCE_SHAREABLE_TEXT_SEGMENTS=y UCLIBC_BUILD_PIE=y LDSO_LDD_SUPPORT=y diff --git a/extra/Configs/Config.h8300 b/extra/Configs/Config.h8300 index d94646494..da5280055 100644 --- a/extra/Configs/Config.h8300 +++ b/extra/Configs/Config.h8300 @@ -7,8 +7,6 @@ config HAVE_ELF bool select ARCH_HAS_NO_MMU select ARCH_HAS_C_SYMBOL_PREFIX - select HAVE_NO_SHARED - select ARCH_HAS_NO_LDSO default y config ARCH_SUPPORTS_BIG_ENDIAN diff --git a/extra/Configs/Config.i960 b/extra/Configs/Config.i960 index 19171c590..e2e7526d6 100644 --- a/extra/Configs/Config.i960 +++ b/extra/Configs/Config.i960 @@ -9,8 +9,6 @@ config TARGET_ARCH config HAVE_ELF bool select ARCH_HAS_NO_MMU - select HAVE_NO_SHARED - select ARCH_HAS_NO_LDSO select HAS_NO_THREADS default n diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 1b409cba4..b9db40966 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -181,7 +181,7 @@ config HAVE_NO_SHARED config HAVE_SHARED bool "Enable support for shared libraries" - depends on DOPIC && !HAVE_NO_SHARED + depends on !HAVE_NO_SHARED default y help If you wish to build uClibc with support for shared libraries then @@ -190,36 +190,28 @@ config HAVE_SHARED config ARCH_HAS_NO_LDSO bool + select HAVE_NO_SHARED default n -config BUILD_UCLIBC_LDSO - bool "Compile native shared library loader" - depends on HAVE_SHARED && !ARCH_HAS_NO_LDSO - default y - help - uClibc has a native shared library loader for some architectures. - If you answer Y here, the uClibc native shared library loader will - be built for your target architecture. If this option is available, - to you, then you almost certainly want to answer Y. - config FORCE_SHAREABLE_TEXT_SEGMENTS bool "Only load shared libraries which can share their text segment" - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED + select DOPIC default n help If you answer Y here, the uClibc native shared library loader will only load shared libraries, which do not need to modify any non-writable segments. These libraries haven't set the DT_TEXTREL tag in the dynamic - section (==> objdump). So all your libraries must be compiled with + section (==> objdump). All your libraries must be compiled with -fPIC or -fpic, and all assembler function must be written as position independent code (PIC). - Enabling this option will makes uClibc's shared library loader a + Enabling this option will make uClibc's shared library loader a little bit smaller and guarantee that no memory will be wasted by badly coded shared libraries. config LDSO_LDD_SUPPORT bool "Native shared library loader 'ldd' support" - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default y help Enable this to enable all the code needed to support traditional ldd, @@ -230,7 +222,7 @@ config LDSO_LDD_SUPPORT config LDSO_CACHE_SUPPORT bool "Enable shared library loader cache" - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default y help Enable this to make use of /etc/ld.so.conf, the shared library loader @@ -240,7 +232,7 @@ config LDSO_CACHE_SUPPORT config LDSO_PRELOAD_FILE_SUPPORT bool "Enable shared library loader preload file support" - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default n help Enable this to make use of /etc/ld.so.preload. This file contains a @@ -249,7 +241,7 @@ config LDSO_PRELOAD_FILE_SUPPORT config LDSO_BASE_FILENAME string "Shared library loader naming prefix" - depends on BUILD_UCLIBC_LDSO && (LDSO_CACHE_SUPPORT || LDSO_PRELOAD_FILE_SUPPORT) + depends on HAVE_SHARED && (LDSO_CACHE_SUPPORT || LDSO_PRELOAD_FILE_SUPPORT) default "ld.so" help If you wish to support both uClibc and glibc on the same system, it @@ -266,7 +258,7 @@ config LDSO_BASE_FILENAME config LDSO_RUNPATH bool "Enable ELF RUNPATH tag support" - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default y help ELF's may have dynamic RPATH/RUNPATH tags. These tags list paths @@ -440,6 +432,12 @@ config UCLIBC_DYNAMIC_ATEXIT Unless you use uClibc with C++, you should probably answer N. +config COMPAT_ATEXIT + bool "Old (visible) atexit Support" + default n + help + Enable this option if you want to update from 0.9.28 to svn/0.9.29, else + you will be missing atexit() until you rebuild all apps. config HAS_SHADOW bool "Shadow Password Support" @@ -1096,7 +1094,7 @@ menu "Library Installation Options" config SHARED_LIB_LOADER_PREFIX string "Shared library loader path" - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default "$(DEVEL_PREFIX)/lib" help When using shared libraries, this path is the location where the @@ -1159,7 +1157,7 @@ config UCLIBC_BUILD_PIE depends on UCLIBC_SECURITY depends on HAVE_SHARED depends on TARGET_arm || TARGET_frv || TARGET_i386 || TARGET_mips || TARGET_powerpc - select FORCE_SHAREABLE_TEXT_SEGMENTS if BUILD_UCLIBC_LDSO + select FORCE_SHAREABLE_TEXT_SEGMENTS default y help If you answer Y here, ldd and iconv are built as ET_DYN/PIE executables. @@ -1175,9 +1173,10 @@ config UCLIBC_HAS_SSP default n help Add propolice smashing stack protector to the library. - This requires a patched version of GCC, supporting the + This requires a patched version of GCC or GCC 4.1, supporting the -fstack-protector[-all] options, with the __guard and - __stack_smash_handler functions removed from libgcc. + __stack_smash_handler, respectively __stack_chk_guard and + __stack_chk_fail functions removed from libgcc. These functions are added to libc instead. More information at: <http://www.research.ibm.com/trl/projects/security/ssp/> @@ -1194,17 +1193,6 @@ config SSP_QUICK_CANARY attacks. Most people will answer N. -config SSP_USE_ERANDOM - bool "Use erandom for setting guard value if /dev/urandom fails" - depends on UCLIBC_HAS_SSP && !SSP_QUICK_CANARY - default n - help - Use /dev/erandom to define the guard if /dev/urandom fails (chroot). - This requires a modified kernel. - More information at: - <http://frandom.sourceforge.net/> - Most people will answer N. - choice prompt "Propolice protection blocking signal" depends on UCLIBC_HAS_SSP @@ -1237,7 +1225,7 @@ config UCLIBC_BUILD_SSP config UCLIBC_BUILD_RELRO bool "Build uClibc with RELRO" depends on UCLIBC_SECURITY - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default y help Build all libraries and executables with -z relro. @@ -1245,7 +1233,7 @@ config UCLIBC_BUILD_RELRO config UCLIBC_BUILD_NOW bool "Build uClibc with NOW" depends on UCLIBC_SECURITY - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default y help Build all libraries and executables with -z now. @@ -1305,7 +1293,7 @@ config DOASSERTS config SUPPORT_LD_DEBUG bool "Build the shared library loader with debugging support" - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default n help Answer Y here to enable all the extra code needed to debug the uClibc @@ -1339,7 +1327,7 @@ config SUPPORT_LD_DEBUG config SUPPORT_LD_DEBUG_EARLY bool "Build the shared library loader with early debugging support" - depends on BUILD_UCLIBC_LDSO + depends on HAVE_SHARED default n help Answer Y here to if you find the uClibc shared library loader is @@ -1376,6 +1364,12 @@ config WARNINGS help Set this to the set of gcc warnings you wish to see while compiling. +config DOMULTI + bool "Compile all sources at once into an object" + default n + help + Set this to compile all sources at once into an object (IMA). + config UCLIBC_MJN3_ONLY bool "Manuel's hidden warnings" default n diff --git a/extra/Configs/Config.microblaze b/extra/Configs/Config.microblaze index b322b6661..9a80230e2 100644 --- a/extra/Configs/Config.microblaze +++ b/extra/Configs/Config.microblaze @@ -10,8 +10,6 @@ config HAVE_ELF bool select ARCH_HAS_NO_MMU select ARCH_HAS_C_SYMBOL_PREFIX - select HAVE_NO_SHARED - select ARCH_HAS_NO_LDSO default y config ARCH_SUPPORTS_BIG_ENDIAN diff --git a/extra/Configs/Config.nios b/extra/Configs/Config.nios index 10a5f0a20..ef5f27dc7 100644 --- a/extra/Configs/Config.nios +++ b/extra/Configs/Config.nios @@ -11,8 +11,6 @@ config HAVE_ELF select ARCH_HAS_NO_MMU select ARCH_LITTLE_ENDIAN select HAVE_NO_PIC - select HAVE_NO_SHARED - select ARCH_HAS_NO_LDSO default y config ARCH_CFLAGS diff --git a/extra/Configs/Config.nios2 b/extra/Configs/Config.nios2 index cc7caf17d..cb8f1e941 100644 --- a/extra/Configs/Config.nios2 +++ b/extra/Configs/Config.nios2 @@ -11,8 +11,6 @@ config HAVE_ELF select ARCH_HAS_NO_MMU select ARCH_LITTLE_ENDIAN select HAVE_NO_PIC - select HAVE_NO_SHARED - select ARCH_HAS_NO_LDSO default y config ARCH_CFLAGS diff --git a/extra/Configs/Config.sh b/extra/Configs/Config.sh index 8dd54209e..25e5dc283 100644 --- a/extra/Configs/Config.sh +++ b/extra/Configs/Config.sh @@ -48,13 +48,11 @@ choice config CONFIG_SH2A select ARCH_HAS_NO_MMU - select ARCH_HAS_NO_LDSO select HAVE_NO_PIC bool "SH2A" config CONFIG_SH2 select ARCH_HAS_NO_MMU - select ARCH_HAS_NO_LDSO bool "SH2" config CONFIG_SH3 diff --git a/extra/Configs/Config.v850 b/extra/Configs/Config.v850 index 894cb24ac..84f5002f9 100644 --- a/extra/Configs/Config.v850 +++ b/extra/Configs/Config.v850 @@ -11,8 +11,6 @@ config HAVE_ELF select ARCH_HAS_NO_MMU select ARCH_HAS_C_SYMBOL_PREFIX select HAVE_NO_PIC - select HAVE_NO_SHARED - select ARCH_HAS_NO_LDSO default y config ARCH_SUPPORTS_LITTLE_ENDIAN diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 30af9757d..fe3373b88 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -71,7 +71,7 @@ extern __const char *inet_ntop (int __af, __const void *__restrict __cp, #ifdef __USE_MISC /* Convert Internet host address from numbers-and-dots notation in CP into binary data and store the result in the structure INP. */ -extern in_addr_t inet_aton (__const char *__cp, struct in_addr *__inp) __THROW; +extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW; /* Format a network number NET into presentation format and place result in buffer starting at BUF with length of LEN bytes. */ diff --git a/include/fcntl.h b/include/fcntl.h index 2f2fb99dd..444b359c0 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1991,1992,1994-2001,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -56,13 +56,15 @@ __BEGIN_DECLS #endif /* XPG */ /* Do the file control operation described by CMD on FD. - The remaining arguments are interpreted depending on CMD. */ + The remaining arguments are interpreted depending on CMD. + + This function is a cancellation point and therefore not marked with + __THROW. */ #ifndef __USE_FILE_OFFSET64 -extern int fcntl (int __fd, int __cmd, ...) __THROW; +extern int fcntl (int __fd, int __cmd, ...); #else # ifdef __REDIRECT -extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...) __THROW, - fcntl64); +extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64); # else # define fcntl fcntl64 # endif @@ -70,36 +72,41 @@ extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...) __THROW, /* Open FILE and return a new file descriptor for it, or -1 on error. OFLAG determines the type of access used. If O_CREAT is on OFLAG, - the third argument is taken as a `mode_t', the mode of the created file. */ + the third argument is taken as a `mode_t', the mode of the created file. + + This function is a cancellation point and therefore not marked with + __THROW. */ #ifndef __USE_FILE_OFFSET64 -extern int open (__const char *__file, int __oflag, ...) __THROW; +extern int open (__const char *__file, int __oflag, ...) __nonnull ((1)); #else # ifdef __REDIRECT -extern int __REDIRECT (open, (__const char *__file, int __oflag, ...) __THROW, - open64); +extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64) + __nonnull ((1)); # else # define open open64 # endif #endif #ifdef __USE_LARGEFILE64 -extern int open64 (__const char *__file, int __oflag, ...) __THROW; +extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1)); #endif -/* Create and open FILE, with mode MODE. - This takes an `int' MODE argument because that is - what `mode_t' will be widened to. */ +/* Create and open FILE, with mode MODE. This takes an `int' MODE + argument because that is what `mode_t' will be widened to. + + This function is a cancellation point and therefore not marked with + __THROW. */ #ifndef __USE_FILE_OFFSET64 -extern int creat (__const char *__file, __mode_t __mode) __THROW; +extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1)); #else # ifdef __REDIRECT -extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode) __THROW, - creat64); +extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode), + creat64) __nonnull ((1)); # else # define creat creat64 # endif #endif #ifdef __USE_LARGEFILE64 -extern int creat64 (__const char *__file, __mode_t __mode) __THROW; +extern int creat64 (__const char *__file, __mode_t __mode) __nonnull ((1)); #endif #if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ @@ -118,64 +125,64 @@ extern int creat64 (__const char *__file, __mode_t __mode) __THROW; # define F_TEST 3 /* Test a region for other processes locks. */ # ifndef __USE_FILE_OFFSET64 -extern int lockf (int __fd, int __cmd, __off_t __len) __THROW; +extern int lockf (int __fd, int __cmd, __off_t __len); # else # ifdef __REDIRECT -extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len) __THROW, - lockf64); +extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64); # else # define lockf lockf64 # endif # endif # ifdef __USE_LARGEFILE64 -extern int lockf64 (int __fd, int __cmd, __off64_t __len) __THROW; +extern int lockf64 (int __fd, int __cmd, __off64_t __len); # endif #endif - -#if 0 - -/* FIXME -- uClibc should probably implement these... */ - #ifdef __USE_XOPEN2K /* Advice the system about the expected behaviour of the application with respect to the file associated with FD. */ # ifndef __USE_FILE_OFFSET64 -extern int posix_fadvise (int __fd, __off_t __offset, size_t __len, +extern int posix_fadvise (int __fd, __off_t __offset, __off_t __len, int __advise) __THROW; # else # ifdef __REDIRECT extern int __REDIRECT (posix_fadvise, (int __fd, __off64_t __offset, - size_t __len, int __advise) __THROW, + __off64_t __len, int __advise), posix_fadvise64); # else # define posix_fadvise posix_fadvise64 # endif # endif # ifdef __USE_LARGEFILE64 -extern int posix_fadvise64 (int __fd, __off64_t __offset, size_t __len, +extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len, int __advise) __THROW; # endif +#endif + +#if 0 -/* Reserve storage for the data of the file associated with FD. */ +/* FIXME -- uClibc should probably implement these... */ + +/* Reserve storage for the data of the file associated with FD. + + This function is a possible cancellation points and therefore not + marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 -extern int posix_fallocate (int __fd, __off_t __offset, size_t __len) __THROW; +extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset, - size_t __len) __THROW, + __off64_t __len), posix_fallocate64); # else # define posix_fallocate posix_fallocate64 # endif # endif # ifdef __USE_LARGEFILE64 -extern int posix_fallocate64 (int __fd, __off64_t __offset, size_t __len) - __THROW; +extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len); # endif #endif -#endif __END_DECLS diff --git a/include/features.h b/include/features.h index 07680a09e..0f4921b9f 100644 --- a/include/features.h +++ b/include/features.h @@ -266,7 +266,7 @@ # define __USE_REENTRANT 1 #endif -#if _FORTIFY_SOURCE > 0 && __GNUC_PREREQ (4, 1) && __OPTIMIZE__ > 0 +#if _FORTIFY_SOURCE > 0 && __GNUC_PREREQ (4, 1) && defined(__OPTIMIZE__) # if _FORTIFY_SOURCE == 1 # define __USE_FORTIFY_LEVEL 1 # elif _FORTIFY_SOURCE > 1 diff --git a/include/libc-internal.h b/include/libc-internal.h index f5bc9bb0c..b00a8775c 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -70,6 +70,10 @@ # define internal_function /* empty */ #endif +#ifndef NOT_IN_libc +# define IS_IN_libc 1 +#endif + /* Prepare for the case that `__builtin_expect' is not available. */ #if __GNUC__ == 2 && __GNUC_MINOR__ < 96 #define __builtin_expect(x, expected_value) (x) diff --git a/include/ssp-internal.h b/include/ssp-internal.h index c82debbd5..81a83f70c 100644 --- a/include/ssp-internal.h +++ b/include/ssp-internal.h @@ -21,21 +21,10 @@ #include <signal.h> #include <linux/unistd.h> -#ifdef __SSP_USE_ERANDOM__ -# include <sys/sysctl.h> -#if 1 -# define SYSCTL __sysctl -#else -#define __NR__kernel_sysctl __NR_sysctl -static __always_inline _syscall6(int,__kernel_sysctl,int *,name,int,nlen,void *,oldval,size_t *,oldlenp,void *,newval,size_t,newlen); -#define SYSCTL(name,nlen,oldval,oldlenp,newval,newlen) __kernel_sysctl(name,nlen,oldval,oldlenp,newval,newlen) -#endif -#endif - #ifndef __SSP_QUICK_CANARY__ #define __NR___kernel_open __NR_open -static __always_inline _syscall2(int,__kernel_open,const char *,path,int,flags); -#define OPEN(path, flags) __kernel_open(path, flags) +static __always_inline _syscall3(int,__kernel_open,const char *,path,int,flags,__kernel_mode_t,mode); +#define OPEN(path, flags, mode) __kernel_open(path, flags, mode) /* void * = __ptr_t */ #define __NR___kernel_read __NR_read diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h index d4348afc0..70b79f6cf 100644 --- a/ldso/include/dl-syscall.h +++ b/ldso/include/dl-syscall.h @@ -105,6 +105,12 @@ static inline _syscall0(gid_t, _dl_getpid); #define __NR__dl_readlink __NR_readlink static inline _syscall3(int, _dl_readlink, const char *, path, char *, buf, size_t, bufsiz); +#ifdef __UCLIBC_HAS_SSP__ +#include <sys/time.h> +#define __NR__dl_gettimeofday __NR_gettimeofday +static inline _syscall2(int, _dl_gettimeofday, struct timeval *, tv, struct timezone *, tz); +#endif + #ifdef __NR_mmap #ifdef MMAP_HAS_6_ARGS #define __NR__dl_mmap __NR_mmap diff --git a/ldso/include/unsecvars.h b/ldso/include/unsecvars.h index 0d996a91f..3555934e3 100644 --- a/ldso/include/unsecvars.h +++ b/ldso/include/unsecvars.h @@ -5,22 +5,21 @@ */ #define UNSECURE_ENVVARS \ - "LD_AOUT_PRELOAD\0" \ - "LD_AOUT_LIBRARY_PATH\0" \ "LD_PRELOAD\0" \ "LD_LIBRARY_PATH\0" \ "LD_DEBUG\0" \ "LD_DEBUG_OUTPUT\0" \ "LD_TRACE_LOADED_OBJECTS\0" \ - "HOSTALIASES\0" \ - "LOCALDOMAIN\0" \ - "RES_OPTIONS\0" \ "TMPDIR\0" /* + * LD_TRACE_LOADED_OBJECTS is not in glibc-2.3.5's unsecvars.h + * though used by ldd + * * These environment variables are defined by glibc but ignored in * uClibc, but may very well have an equivalent in uClibc. * - * MALLOC_TRACE, RESOLV_HOST_CONF, TZDIR, GCONV_PATH, LD_USE_LOAD_BIAS, - * LD_PROFILE, LD_ORIGIN_PATH, LOCPATH, NLSPATH + * LD_ORIGIN_PATH, LD_PROFILE, LD_USE_LOAD_BIAS, LD_DYNAMIC_WEAK, LD_SHOW_AUXV, + * GCONV_PATH, GETCONF_DIR, HOSTALIASES, LOCALDOMAIN, LOCPATH, MALLOC_TRACE, + * NLSPATH, RESOLV_HOST_CONF, RES_OPTIONS, TZDIR */ diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 6b1ccd047..ca7470fa3 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -729,7 +729,9 @@ int _dl_fixup(struct dyn_elf *rpnt, int now_flag) ElfW(Addr) reloc_addr; if (rpnt->next) - goof += _dl_fixup(rpnt->next, now_flag); + goof = _dl_fixup(rpnt->next, now_flag); + if (goof) + return goof; tpnt = rpnt->dyn; if(!(tpnt->init_flag & RELOCS_DONE)) diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index 197392a0e..43bbe675e 100644 --- a/ldso/ldso/ldso.c +++ b/ldso/ldso/ldso.c @@ -89,6 +89,16 @@ static struct elf_resolve **init_fini_list; static int nlist; /* # items in init_fini_list */ extern void _start(void); +#ifdef __UCLIBC_HAS_SSP__ +#include <dl-osinfo.h> +#ifndef THREAD_SET_STACK_GUARD +/* Only exported for architectures that don't store the stack guard canary + * in local thread area. */ +uintptr_t __stack_chk_guard attribute_relro; +strong_alias(__stack_chk_guard,__guard) +#endif +#endif + static void __attribute__ ((destructor)) __attribute_used__ _dl_fini(void) { int i; @@ -116,7 +126,7 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr, ElfW(Phdr) *ppnt; ElfW(Dyn) *dpnt; char *lpntstr; - int i, goof = 0, unlazy = 0, trace_loaded_objects = 0; + int i, unlazy = 0, trace_loaded_objects = 0; struct dyn_elf *rpnt; struct elf_resolve *tcurr; struct elf_resolve *tpnt1; @@ -201,9 +211,20 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr, } #if USE_TLS + _dl_error_catch_tsd = &_dl_initial_error_catch_tsd; _dl_init_static_tls = &_dl_nothread_init_static_tls; #endif +#ifdef __UCLIBC_HAS_SSP__ + /* Set up the stack checker's canary. */ + uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (); +# ifdef THREAD_SET_STACK_GUARD + THREAD_SET_STACK_GUARD (stack_chk_guard); +# else + __stack_chk_guard = stack_chk_guard; +# endif +#endif + /* At this point we are now free to examine the user application, * and figure out which libraries are supposed to be called. Until * we have this list, we will not be completely ready for dynamic @@ -775,7 +796,13 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr, * order so that COPY directives work correctly. */ if (_dl_symbol_tables) - goof += _dl_fixup(_dl_symbol_tables, unlazy); + if (_dl_fixup(_dl_symbol_tables, unlazy)) + _dl_exit(-1); + + for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) { + if (tpnt->relro_size) + _dl_protect_relro (tpnt); + } /* OK, at this point things are pretty much ready to run. Now we need * to touch up a few items that are required, and then we can let the @@ -828,11 +855,6 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr, } } - for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) { - if (tpnt->relro_size) - _dl_protect_relro (tpnt); - } - /* Find the real malloc function and make ldso functions use that from now on */ _dl_malloc_function = (void* (*)(size_t)) (intptr_t) _dl_find_hash("malloc", _dl_symbol_tables, NULL, ELF_RTYPE_CLASS_PLT); diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c index 4ec459854..3dd12f0ee 100644 --- a/ldso/ldso/powerpc/elfinterp.c +++ b/ldso/ldso/powerpc/elfinterp.c @@ -138,7 +138,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) finaladdr = (Elf32_Addr) _dl_find_hash(symname, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT); if (unlikely(!finaladdr)) { - _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname); + _dl_dprintf(2, "%s: can't resolve symbol '%s' in lib '%s'.\n", _dl_progname, symname, tpnt->libname); _dl_exit(1); }; finaladdr += this_reloc->r_addend; @@ -379,15 +379,15 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope, { int reloc_type = ELF32_R_TYPE(rpnt->r_info); #if defined (__SUPPORT_LD_DEBUG__) - _dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type)); + _dl_dprintf(2, "can't handle reloc type '%s' in lib '%s'\n", _dl_reltypes(reloc_type), tpnt->libname); #else - _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type); + _dl_dprintf(2, "can't handle reloc type %x in lib '%s'\n", reloc_type, tpnt->libname); #endif - _dl_exit(-res); + return res; } if (unlikely(res >0)) { - _dl_dprintf(2, "can't resolve symbol\n"); + _dl_dprintf(2, "can't resolve symbol in lib '%s'.\n", tpnt->libname); return res; } } diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 0c73fcab3..eab86c0e8 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -647,7 +647,7 @@ int __form_query(int id, const char *name, int type, unsigned char *packet, } #endif -#ifdef L_dnslookup +#if defined(L_dnslookup) || defined(L_gethostent) #ifdef __UCLIBC_HAS_THREADS__ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; @@ -657,6 +657,9 @@ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; # define LOCK # define UNLOCK #endif +#endif + +#ifdef L_dnslookup /* Just for the record, having to lock __dns_lookup() just for these two globals * is pretty lame. I think these two variables can probably be de-global-ized, @@ -1587,15 +1590,6 @@ int __read_etc_hosts_r(FILE * fp, const char * name, int type, #ifdef L_gethostent -#ifdef __UCLIBC_HAS_THREADS__ -static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; -# define LOCK __pthread_mutex_lock(&mylock) -# define UNLOCK __pthread_mutex_unlock(&mylock); -#else -# define LOCK -# define UNLOCK -#endif - static int __stay_open; static FILE * __gethostent_fp; diff --git a/libc/inet/rpc/rpc_thread.c b/libc/inet/rpc/rpc_thread.c index e3a1c40b2..374aac84c 100644 --- a/libc/inet/rpc/rpc_thread.c +++ b/libc/inet/rpc/rpc_thread.c @@ -2,11 +2,12 @@ #include <features.h> #include <stdio.h> #include <assert.h> -#include <bits/libc-tsd.h> #include "rpc_private.h" #ifdef __UCLIBC_HAS_THREADS__ +#include <bits/libc-tsd.h> + /* Variable used in non-threaded applications or for the first thread. */ static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem; #ifdef __UCLIBC_HAS_THREADS_NATIVE__ diff --git a/libc/misc/file/lockf64.c b/libc/misc/file/lockf64.c index 327707ac8..5638d6938 100644 --- a/libc/misc/file/lockf64.c +++ b/libc/misc/file/lockf64.c @@ -38,8 +38,10 @@ #include <fcntl.h> #include <errno.h> #include <string.h> +#include <sys/syscall.h> #ifdef __NR_fcntl64 +extern int fcntl64 (int fd, int cmd, ...); #define flock flock64 #define fcntl fcntl64 #define F_GETLK F_GETLK64 diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c index 605e07cd5..e58c3e6ca 100644 --- a/libc/misc/ftw/ftw.c +++ b/libc/misc/ftw/ftw.c @@ -23,7 +23,9 @@ #if defined (__UCLIBC_HAS_LFS__) && defined L_ftw64 +#ifndef L_ftw #define L_ftw +#endif /* If Large file support is enabled, transparently remap * things to use the 64-bit interfaces */ diff --git a/libc/misc/internals/Makefile b/libc/misc/internals/Makefile index 1df05a934..8978fb808 100644 --- a/libc/misc/internals/Makefile +++ b/libc/misc/internals/Makefile @@ -37,7 +37,7 @@ endif OBJ_LIST=../../obj.misc.internals -all: $(OBJ_LIST) interp.o static.o +all: $(OBJ_LIST) interp.o $(OBJ_LIST): $(OBJS) echo $(patsubst %, misc/internals/%, $(OBJS)) > $(OBJ_LIST) diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 9dad20efa..c3f8a548c 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -25,20 +25,30 @@ #include <fcntl.h> #include <sys/stat.h> #include <sys/sysmacros.h> + +#ifndef SHARED +void *__libc_stack_end=NULL; + +/* probably all the weak_*function stuff below should be in here */ + #ifdef __UCLIBC_HAS_SSP__ -#include <ssp-internal.h> +#include <dl-osinfo.h> +#ifndef THREAD_SET_STACK_GUARD +/* Only exported for architectures that don't store the stack guard canary + * in thread local area. */ #include <stdint.h> - -/* for gcc-3.x + Etoh ssp */ -uintptr_t __guard attribute_relro; /* for gcc-4.1 non-TLS */ uintptr_t __stack_chk_guard attribute_relro; +/* for gcc-3.x + Etoh ssp */ +strong_alias(__stack_chk_guard,__guard) #endif +#endif + +#endif /* !SHARED */ /* * Prototypes. */ -extern void *__libc_stack_end; extern void weak_function _stdio_init(void); extern int *weak_const_function __errno_location(void); extern int *weak_const_function __h_errno_location(void); @@ -49,10 +59,6 @@ extern void weak_function _locale_init(void); extern void weak_function __pthread_initialize_minimal(void); #endif - - - - /* * Declare the __environ global variable and create a weak alias environ. * Note: Apparently we must initialize __environ to ensure that the weak @@ -64,7 +70,6 @@ weak_alias(__environ, environ); size_t __pagesize = 0; const char *__progname = 0; - #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 #endif @@ -110,61 +115,6 @@ static int __check_suid(void) return 1; } -#ifdef __UCLIBC_HAS_SSP__ -static __always_inline uintptr_t _dl_guard_setup(void) -{ - uintptr_t ret; -#ifndef __SSP_QUICK_CANARY__ - - size_t size; - -# ifdef __SSP_USE_ERANDOM__ - { - int mib[3]; - /* Random is another depth in Linux, hence an array of 3. */ - mib[0] = CTL_KERN; - mib[1] = KERN_RANDOM; - mib[2] = RANDOM_ERANDOM; - - if (SYSCTL(mib, 3, &ret, &size, NULL, 0) != (-1)) - if (size == (size_t) sizeof(ret)) - return ret; - } -# endif /* ifdef __SSP_USE_ERANDOM__ */ - { - int fd; - -# ifdef __SSP_USE_ERANDOM__ - /* - * Attempt to open kernel pseudo random device if one exists before - * opening urandom to avoid system entropy depletion. - */ - if ((fd = OPEN("/dev/erandom", O_RDONLY)) == (-1)) -# endif - fd = OPEN("/dev/urandom", O_RDONLY); - if (fd >= 0) { - size = READ(fd, &ret, sizeof(ret)); - CLOSE(fd); - if (size == (size_t) sizeof(ret)) - return ret; - } - } -#endif /* ifndef __SSP_QUICK_CANARY__ */ - - /* Start with the "terminator canary". */ - ret = 0xFF0A0D00UL; - - /* Everything failed? Or we are using a weakened model of the - * terminator canary */ - { - struct timeval tv; - if (GETTIMEOFDAY(&tv, NULL) != (-1)) - ret ^= tv.tv_usec ^ tv.tv_sec; - } - return ret; -} -#endif /* __UCLIBC_HAS_SSP__ */ - /* __uClibc_init completely initialize uClibc so it is ready to use. * * On ELF systems (with a dynamic loader) this function must be called @@ -199,12 +149,16 @@ void __uClibc_init(void) __pthread_initialize_minimal(); #endif -#ifdef __UCLIBC_HAS_SSP__ - uintptr_t stack_chk_guard = _dl_guard_setup(); - /* for gcc-3.x + Etoh ssp */ - __guard = stack_chk_guard; - /* for gcc-4.1 non-TLS */ +#ifndef SHARED +# ifdef __UCLIBC_HAS_SSP__ + /* Set up the stack checker's canary. */ + uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard(); +# ifdef THREAD_SET_STACK_GUARD + THREAD_SET_STACK_GUARD (stack_chk_guard); +# else __stack_chk_guard = stack_chk_guard; +# endif +# endif #endif #ifdef __UCLIBC_HAS_LOCALE__ @@ -241,7 +195,10 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, unsigned long *aux_dat; ElfW(auxv_t) auxvt[AT_EGID + 1]; #endif + +#ifndef SHARED __libc_stack_end = stack_end; +#endif __rtld_fini = rtld_fini; diff --git a/libc/misc/internals/static.c b/libc/misc/internals/static.c deleted file mode 100644 index cd39ffdd7..000000000 --- a/libc/misc/internals/static.c +++ /dev/null @@ -1,4 +0,0 @@ -#include <stddef.h> - -/* Force static libraries to know about ... */ -void *__libc_stack_end=NULL; diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index 914277698..c315baddc 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -2005,7 +2005,7 @@ int utimes(const char *filename, register const struct timeval *tvp) /**********************************************************************/ #ifdef L__time_t2tm -static const uint16_t vals[] = { +static const uint16_t _vals[] = { 60, 60, 24, 7 /* special */, 36524, 1461, 365, 0 }; @@ -2037,7 +2037,7 @@ struct tm *_time_t2tm(const time_t *__restrict timer, t = *timer; p = (int *) result; p[7] = 0; - vp = vals; + vp = _vals; do { if ((v = *vp) == 7) { /* Overflow checking, assuming time_t is long int... */ @@ -2182,7 +2182,7 @@ time_t _time_mktime(struct tm *timeptr, int store_on_success) /**********************************************************************/ #ifdef L__time_mktime_tzi -static const unsigned char vals[] = { +static const unsigned char __vals[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, /* non-leap */ 29, }; @@ -2221,7 +2221,7 @@ time_t _time_mktime_tzi(struct tm *timeptr, int store_on_success, --p[5]; } - s = vals; + s = __vals; d = (p[5] += 1900); /* Correct year. Now between 1900 and 2300. */ if (__isleap(d)) { s += 11; diff --git a/libc/pwd_grp/pwd_grp.c b/libc/pwd_grp/pwd_grp.c index e56b545d6..0225c6c7e 100644 --- a/libc/pwd_grp/pwd_grp.c +++ b/libc/pwd_grp/pwd_grp.c @@ -1,18 +1,7 @@ -/* Copyright (C) 2003 Manuel Novoa III +/* + * Copyright (C) 2003 Manuel Novoa III * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details. */ /* Nov 6, 2003 Initial version. @@ -229,6 +218,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->pw_name, key)) #define DO_GETXXKEY_R_KEYTYPE const char *__restrict #define DO_GETXXKEY_R_PATHNAME _PATH_PASSWD +#include "pwd_grp_internal.c" #endif #ifdef L_getgrnam_r @@ -238,6 +228,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->gr_name, key)) #define DO_GETXXKEY_R_KEYTYPE const char *__restrict #define DO_GETXXKEY_R_PATHNAME _PATH_GROUP +#include "pwd_grp_internal.c" #endif #ifdef L_getspnam_r @@ -247,6 +238,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->sp_namp, key)) #define DO_GETXXKEY_R_KEYTYPE const char *__restrict #define DO_GETXXKEY_R_PATHNAME _PATH_SHADOW +#include "pwd_grp_internal.c" #endif #ifdef L_getpwuid_r @@ -256,6 +248,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) ((ENT)->pw_uid == key) #define DO_GETXXKEY_R_KEYTYPE uid_t #define DO_GETXXKEY_R_PATHNAME _PATH_PASSWD +#include "pwd_grp_internal.c" #endif #ifdef L_getgrgid_r @@ -265,48 +258,10 @@ int sgetspent_r(const char *string, struct spwd *result_buf, #define GETXXKEY_R_TEST(ENT) ((ENT)->gr_gid == key) #define DO_GETXXKEY_R_KEYTYPE gid_t #define DO_GETXXKEY_R_PATHNAME _PATH_GROUP +#include "pwd_grp_internal.c" #endif /**********************************************************************/ -#ifdef GETXXKEY_R_FUNC - -int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key, - GETXXKEY_R_ENTTYPE *__restrict resultbuf, - char *__restrict buffer, size_t buflen, - GETXXKEY_R_ENTTYPE **__restrict result) -{ - FILE *stream; - int rv; - - *result = NULL; - - if (!(stream = fopen(DO_GETXXKEY_R_PATHNAME, "r"))) { - rv = errno; - } else { - __STDIO_SET_USER_LOCKING(stream); - do { - if (!(rv = __pgsreader(GETXXKEY_R_PARSER, resultbuf, - buffer, buflen, stream)) - ) { - if (GETXXKEY_R_TEST(resultbuf)) { /* Found key? */ - *result = resultbuf; - break; - } - } else { - if (rv == ENOENT) { /* end-of-file encountered. */ - rv = 0; - } - break; - } - } while (1); - fclose(stream); - } - - return rv; -} - -#endif -/**********************************************************************/ #ifdef L_getpwuid struct passwd *getpwuid(uid_t uid) @@ -446,16 +401,19 @@ int getpw(uid_t uid, char *buf) #endif /**********************************************************************/ -#ifdef L_getpwent_r +#if defined(L_getpwent_r) || defined(L_getgrent_r) || defined(L_getspent_r) #ifdef __UCLIBC_HAS_THREADS__ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; # define LOCK __pthread_mutex_lock(&mylock) # define UNLOCK __pthread_mutex_unlock(&mylock); -#else +#else # define LOCK ((void) 0) # define UNLOCK ((void) 0) -#endif +#endif +#endif + +#ifdef L_getpwent_r static FILE *pwf /*= NULL*/; @@ -512,15 +470,6 @@ int getpwent_r(struct passwd *__restrict resultbuf, /**********************************************************************/ #ifdef L_getgrent_r -#ifdef __UCLIBC_HAS_THREADS__ -static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; -# define LOCK __pthread_mutex_lock(&mylock) -# define UNLOCK __pthread_mutex_unlock(&mylock); -#else -# define LOCK ((void) 0) -# define UNLOCK ((void) 0) -#endif - static FILE *grf /*= NULL*/; void setgrent(void) @@ -575,15 +524,6 @@ int getgrent_r(struct group *__restrict resultbuf, /**********************************************************************/ #ifdef L_getspent_r -#ifdef __UCLIBC_HAS_THREADS__ -static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER; -# define LOCK __pthread_mutex_lock(&mylock) -# define UNLOCK __pthread_mutex_unlock(&mylock); -#else -# define LOCK ((void) 0) -# define UNLOCK ((void) 0) -#endif - static FILE *spf /*= NULL*/; void setspent(void) @@ -695,7 +635,7 @@ struct spwd *sgetspent(const char *string) int initgroups(const char *user, gid_t gid) { - FILE *grf; + FILE *grfile; gid_t *group_list; int num_groups, rv; char **m; @@ -706,15 +646,15 @@ int initgroups(const char *user, gid_t gid) /* We alloc space for 8 gids at a time. */ if (((group_list = (gid_t *) malloc(8*sizeof(gid_t *))) != NULL) - && ((grf = fopen(_PATH_GROUP, "r")) != NULL) + && ((grfile = fopen(_PATH_GROUP, "r")) != NULL) ) { - __STDIO_SET_USER_LOCKING(grf); + __STDIO_SET_USER_LOCKING(grfile); *group_list = gid; num_groups = 1; - while (!__pgsreader(__parsegrent, &group, buff, sizeof(buff), grf)) { + while (!__pgsreader(__parsegrent, &group, buff, sizeof(buff), grfile)) { assert(group.gr_mem); /* Must have at least a NULL terminator. */ if (group.gr_gid != gid) { for (m=group.gr_mem ; *m ; m++) { @@ -738,7 +678,7 @@ int initgroups(const char *user, gid_t gid) rv = setgroups(num_groups, group_list); DO_CLOSE: - fclose(grf); + fclose(grfile); } /* group_list will be NULL if initial malloc failed, which may trigger @@ -825,7 +765,7 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f) /**********************************************************************/ #ifdef L_putspent -static const unsigned char sp_off[] = { +static const unsigned char _sp_off[] = { offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */ offsetof(struct spwd, sp_min), /* 3 - not a char ptr */ offsetof(struct spwd, sp_max), /* 4 - not a char ptr */ @@ -853,9 +793,9 @@ int putspent(const struct spwd *p, FILE *stream) goto DO_UNLOCK; } - for (i=0 ; i < sizeof(sp_off) ; i++) { + for (i=0 ; i < sizeof(_sp_off) ; i++) { f = ld_format; - if ((x = *(const long int *)(((const char *) p) + sp_off[i])) == -1) { + if ((x = *(const long int *)(((const char *) p) + _sp_off[i])) == -1) { f += 3; } if (fprintf(stream, f, x) < 0) { diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c index a749955e2..eab6db24a 100644 --- a/libc/stdlib/stdlib.c +++ b/libc/stdlib/stdlib.c @@ -396,8 +396,10 @@ __XL_ALIAS(strtoull) /**********************************************************************/ #if defined(L__stdlib_wcsto_l) || defined(L__stdlib_wcsto_l_l) +#ifndef L__stdlib_strto_l #define L__stdlib_strto_l #endif +#endif #if defined(L__stdlib_strto_l) || defined(L__stdlib_strto_l_l) @@ -538,8 +540,10 @@ unsigned long __XL_NPP(_stdlib_strto_l)(register const Wchar * __restrict str, #endif /**********************************************************************/ #if defined(L__stdlib_wcsto_ll) || defined(L__stdlib_wcsto_ll_l) +#ifndef L__stdlib_strto_ll #define L__stdlib_strto_ll #endif +#endif #if defined(L__stdlib_strto_ll) || defined(L__stdlib_strto_ll_l) diff --git a/libc/stdlib/strtod.c b/libc/stdlib/strtod.c index f7625c5ae..9c76a2347 100644 --- a/libc/stdlib/strtod.c +++ b/libc/stdlib/strtod.c @@ -1,21 +1,9 @@ -/* Copyright (C) 2000, 2003 Manuel Novoa III +/* + * Copyright (C) 2000-2005 Manuel Novoa III * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ - /* Notes: * * The primary objective of this implementation was minimal size and @@ -201,7 +189,7 @@ extern void __fp_range_check(__fpmax_t y, __fpmax_t x); #define ISSPACE(C) iswspace((C)) #endif -#else /* defined(L___wcstofpmax) || defined(L___wcstofpmax) */ +#else /* defined(L___wcstofpmax) || defined(L___wcstofpmax_l) */ #define Wchar char #ifdef __UCLIBC_DO_XLOCALE @@ -210,7 +198,7 @@ extern void __fp_range_check(__fpmax_t y, __fpmax_t x); #define ISSPACE(C) isspace((C)) #endif -#endif /* defined(L___wcstofpmax) || defined(L___wcstofpmax) */ +#endif /* defined(L___wcstofpmax) || defined(L___wcstofpmax_l) */ #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) @@ -238,10 +226,10 @@ __fpmax_t __XL_NPP(__strtofpmax)(const Wchar *str, Wchar **endptr, int exponent_ int num_digits; #endif #ifdef __UCLIBC_HAS_LOCALE__ - const char *decpt = __LOCALE_PTR->decimal_point; -#if defined(L___wcstofpmax) || defined(L___wcstofpmax) +#if defined(L___wcstofpmax) || defined(L___wcstofpmax_l) wchar_t decpt_wc = __LOCALE_PTR->decimal_point; #else + const char *decpt = __LOCALE_PTR->decimal_point; int decpt_len = __LOCALE_PTR->decimal_point_len; #endif #endif @@ -320,7 +308,7 @@ __fpmax_t __XL_NPP(__strtofpmax)(const Wchar *str, Wchar **endptr, int exponent_ } #ifdef __UCLIBC_HAS_LOCALE__ -#if defined(L___wcstofpmax) || defined(L___wcstofpmax) +#if defined(L___wcstofpmax) || defined(L___wcstofpmax_l) if (!pos0 && (*pos == decpt_wc)) { /* First decimal point? */ pos0 = ++pos; goto LOOP; diff --git a/libc/string/arm/Makefile b/libc/string/arm/Makefile index a874eb96d..a7cbf6fa1 100644 --- a/libc/string/arm/Makefile +++ b/libc/string/arm/Makefile @@ -1,39 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -SSRC= _memcpy.S bcopy.S bzero.S memcmp.S memcpy.S memmove.S memset.S \ - strcmp.S strlen.S strncmp.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) -OBJS=$(SOBJS) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/frv/Makefile b/libc/string/frv/Makefile index 36682c94c..a7cbf6fa1 100644 --- a/libc/string/frv/Makefile +++ b/libc/string/frv/Makefile @@ -1,38 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2004 Alexandre Oliva <aoliva@redhat.com> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -SSRC=memcpy.S memset.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) -OBJS=$(SOBJS) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/i386/Makefile b/libc/string/i386/Makefile index d2baa7dd8..a7cbf6fa1 100644 --- a/libc/string/i386/Makefile +++ b/libc/string/i386/Makefile @@ -1,44 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -MSRC= string.c -MOBJ= strcpy.o strncpy.o strcat.o strncat.o strcmp.o \ - strncmp.o strchr.o strrchr.o strlen.o strnlen.o \ - memcpy.o memmove.o memchr.o memset.o -OBJS=$(MOBJ) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(MOBJ): $(MSRC) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/powerpc/Makefile b/libc/string/powerpc/Makefile index c1b0ba184..a7cbf6fa1 100644 --- a/libc/string/powerpc/Makefile +++ b/libc/string/powerpc/Makefile @@ -1,42 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -MSRC= string.c -MOBJ= memcpy.o memmove.o memset.o bzero.o -OBJS=$(MOBJ) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(MOBJ): $(MSRC) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/sh64/Makefile b/libc/string/sh64/Makefile index 0a7ee0ba2..a7cbf6fa1 100644 --- a/libc/string/sh64/Makefile +++ b/libc/string/sh64/Makefile @@ -1,38 +1,15 @@ -# Makefile for uClibc's sh64 optimized string routines +# Makefile for uClibc # -# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -SSRC= memcpy.S memset.S strcpy.S strlen.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) -OBJS=$(SOBJS) - -OBJ_LIST=../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/sparc/Makefile b/libc/string/sparc/Makefile index 2215a6025..a7cbf6fa1 100644 --- a/libc/string/sparc/Makefile +++ b/libc/string/sparc/Makefile @@ -2,30 +2,14 @@ # # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# Licensed under the GNU Library General Public License version 2 or later. -# See the COPYING.LIB file in the toplevel for more information. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -CSRCS = $(wildcard *.c) -COBJS = $(patsubst %.c,%.o,$(CSRCS)) - -SSRCS = $(wildcard *.S) -SOBJS = $(patsubst %.S,%.o,$(SSRCS)) - -OBJS = $(COBJS) $(SOBJS) - -OBJ_LIST = ../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/string/x86_64/Makefile b/libc/string/x86_64/Makefile index 2215a6025..a7cbf6fa1 100644 --- a/libc/string/x86_64/Makefile +++ b/libc/string/x86_64/Makefile @@ -2,30 +2,14 @@ # # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# Licensed under the GNU Library General Public License version 2 or later. -# See the COPYING.LIB file in the toplevel for more information. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -CSRCS = $(wildcard *.c) -COBJS = $(patsubst %.c,%.o,$(CSRCS)) - -SSRCS = $(wildcard *.S) -SOBJS = $(patsubst %.S,%.o,$(SSRCS)) - -OBJS = $(COBJS) $(SOBJS) - -OBJ_LIST = ../../obj.string.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/alpha/Makefile b/libc/sysdeps/linux/alpha/Makefile index cee893a3b..ed354d3dc 100644 --- a/libc/sysdeps/linux/alpha/Makefile +++ b/libc/sysdeps/linux/alpha/Makefile @@ -19,61 +19,50 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt1.S +CRT_OBJ := crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=__longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \ - setjmp.S divl.S reml.S remq.S divq.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \ + setjmp.S divl.S reml.S remq.S divq.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=sysdep.c #brk.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := sysdep.c #brk.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ $(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/arm/Makefile b/libc/sysdeps/linux/arm/Makefile index 19701e1d9..b1bf1ef10 100644 --- a/libc/sysdeps/linux/arm/Makefile +++ b/libc/sysdeps/linux/arm/Makefile @@ -1,88 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ - bsd-_setjmp.S sigrestorer.S mmap64.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=brk.c syscall.c ioperm.c iopl.c sigaction.c __syscall_error.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/arm/fpu_control.h $(TOPDIR)/include/ -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/bfin/Makefile b/libc/sysdeps/linux/bfin/Makefile index b43209106..85f3cb910 100644 --- a/libc/sysdeps/linux/bfin/Makefile +++ b/libc/sysdeps/linux/bfin/Makefile @@ -19,62 +19,35 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o -#CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -CTOR_TARGETS= +CRT_SRC := crt0.S +CRT_OBJ := crt0.o -SSRC= __longjmp.S setjmp.S bsd-_setjmp.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S setjmp.S bsd-_setjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=brk.c bsdsetjmp.c clone.c syscall.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := brk.c bsdsetjmp.c clone.c syscall.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) all: $(OBJ_LIST) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif headers: diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index ab6a276bb..416ced4ea 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -26,7 +26,7 @@ #include <unistd.h> #include <sys/param.h> #include <sys/types.h> -#include <sysdep.h> +#include "sysdep.h" #include <sys/syscall.h> diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c index a37f5e514..1b4b0c368 100644 --- a/libc/sysdeps/linux/common/getdents64.c +++ b/libc/sysdeps/linux/common/getdents64.c @@ -25,7 +25,7 @@ #include <stdint.h> #include <string.h> #include <unistd.h> -#include <sysdep.h> +#include "sysdep.h" #include <sys/param.h> #include <sys/types.h> #include <sys/syscall.h> diff --git a/libc/sysdeps/linux/common/mmap64.c b/libc/sysdeps/linux/common/mmap64.c index eaf914432..969e1e227 100644 --- a/libc/sysdeps/linux/common/mmap64.c +++ b/libc/sysdeps/linux/common/mmap64.c @@ -22,7 +22,7 @@ #include <features.h> #include <errno.h> #include <unistd.h> -#include <sysdep.h> +#include "sysdep.h" #include <sys/mman.h> diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c index 7791a0104..2f3a28ba4 100644 --- a/libc/sysdeps/linux/common/ssp.c +++ b/libc/sysdeps/linux/common/ssp.c @@ -87,6 +87,7 @@ void __attribute__ ((noreturn)) __stack_chk_fail(void) terminate(); } +#if 0 void __attribute__ ((noreturn)) __chk_fail(void) { extern char *__progname; @@ -101,3 +102,4 @@ void __attribute__ ((noreturn)) __chk_fail(void) while(1) terminate(); } +#endif diff --git a/libc/sysdeps/linux/cris/Makefile b/libc/sysdeps/linux/cris/Makefile index 9063ff7cf..3c60e01ca 100644 --- a/libc/sysdeps/linux/cris/Makefile +++ b/libc/sysdeps/linux/cris/Makefile @@ -19,63 +19,52 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.c -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.c +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC= setjmp.S __longjmp.S clone.S sysdep.S syscall.S +SSRC = setjmp.S __longjmp.S clone.S sysdep.S syscall.S ifeq ($(UNIFIED_SYSCALL),y) - SSRC += __uClibc_syscall.S +SSRC += __uClibc_syscall.S endif -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC= __init_brk.c brk.c sbrk.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := __init_brk.c brk.c sbrk.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/e1/Makefile b/libc/sysdeps/linux/e1/Makefile index e02888ac4..4e37d329f 100644 --- a/libc/sysdeps/linux/e1/Makefile +++ b/libc/sysdeps/linux/e1/Makefile @@ -24,61 +24,42 @@ UCLIBC_CTOR_DTOR=n # If you're looking for vfork(), it is defined in include/unistd.h +CRT_SRC := crt0.S +CRT_OBJ := crt0.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -CRT0=crt0.S -CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +# why is crt1.c listed in CSRC ? +CSRC := crt1.c syscalls.c longjmp.c setjmp.c vfork.c +OBJS := $(patsubst %.c,%.o, $(CSRC)) -SSRC= -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -CSRC=crt1.c syscalls.c longjmp.c setjmp.c vfork.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +all: $(OBJ_LIST) $(CTOR_TARGETS) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) $(CRT0_OBJ) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/$(CRT0_OBJ) - -$(CRT0_OBJ): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(SOBJS): %.o : %.S +$(CRT_OBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(OBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/frv/Makefile b/libc/sysdeps/linux/frv/Makefile index bfb127af4..82d7ddf39 100644 --- a/libc/sysdeps/linux/frv/Makefile +++ b/libc/sysdeps/linux/frv/Makefile @@ -20,56 +20,51 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ)) -CRT0_DEPS=gmon-start.S +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +SCRT_OBJ := $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS = crti.o crtn.o +CTOR_TARGETS := crti.o crtn.o -SSRC=__longjmp.S setjmp.S clone.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S setjmp.S clone.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c -CSRC+=xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC = mmap.c sysdep.c syscall.c brk.c sbrk.c __init_brk.c dl-iterate-phdr.c +CSRC += xstatconv.c stat.c stat64.c fstat.c fstat64.c lstat.c lstat64.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) all: $(OBJ_LIST) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) crtreloc.o - $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $< crtreloc.o -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o +$(CRT_OBJ): $(CRT_SRC) crtreloc.o + $(CC) $(ASFLAGS) -DL_$* -r -nostdlib $^ -o $*.o crtreloc.o: crtreloc.c $(CC) $(CFLAGS) -c $< -o $@ -$(SCRT0_OBJ): $(CRT0_SRC) Scrtreloc.o - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $< Scrtreloc.o -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o +$(SCRT_OBJ): $(CRT_SRC) Scrtreloc.o + $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* -r -nostdlib $^ -o $*.o Scrtreloc.o: crtreloc.c $(CC) $(CFLAGS) $(PIEFLAG) -c $< -o $@ $(CTOR_TARGETS): %.o : %.S $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o headers: $(LN) -fs ../libc/sysdeps/linux/frv/link.h $(TOPDIR)/include/ diff --git a/libc/sysdeps/linux/h8300/Makefile b/libc/sysdeps/linux/h8300/Makefile index 5403feb01..ceb2c145e 100644 --- a/libc/sysdeps/linux/h8300/Makefile +++ b/libc/sysdeps/linux/h8300/Makefile @@ -19,66 +19,56 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak ifeq ($(DOPIC),y) +# is this not provided by gcc ? ASFLAGS+=-D__PIC__ endif #FIXME -- this arch should include its own crti.S and crtn.S UCLIBC_CTOR_DTOR=n -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=__longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=ptrace.c brk.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := ptrace.c brk.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile index e1795e0e5..b1bf1ef10 100644 --- a/libc/sysdeps/linux/i386/Makefile +++ b/libc/sysdeps/linux/i386/Makefile @@ -1,88 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ - bsd-_setjmp.S syscall.S mmap.S mmap64.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=brk.c sigaction.c __syscall_error.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/i386/fpu_control.h $(TOPDIR)include/ -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/i960/Makefile b/libc/sysdeps/linux/i960/Makefile index b4997b9db..7e6311280 100644 --- a/libc/sysdeps/linux/i960/Makefile +++ b/libc/sysdeps/linux/i960/Makefile @@ -22,60 +22,43 @@ include $(TOPDIR)Rules.mak #FIXME -- this arch should include its own crti.S and crtn.S UCLIBC_CTOR_DTOR=n -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=clone.S _mmap.S setjmp.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := clone.S _mmap.S setjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC= -COBJS=$(patsubst %.c,%.o, $(CSRC)) +OBJS := $(SOBJ) -OBJS=$(SOBJS) $(COBJS) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +all: $(OBJ_LIST) $(CTOR_TARGETS) -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/m68k/Makefile b/libc/sysdeps/linux/m68k/Makefile index 00ad88e6c..5173b2165 100644 --- a/libc/sysdeps/linux/m68k/Makefile +++ b/libc/sysdeps/linux/m68k/Makefile @@ -23,72 +23,60 @@ include $(TOPDIR)Rules.mak ifeq ($(ARCH_HAS_MMU),y) -CRT0_SRC = crt0.c +CRT_SRC := crt0.c else -CRT0_SRC = crt0.S +CRT_SRC := crt0.S endif -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC= __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=ptrace.c brk.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := ptrace.c brk.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) ifeq ($(ARCH_HAS_MMU),y) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o else $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o endif - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif - headers: -ifneq ($(strip $(HAVE_ELF)),y) +ifneq ($(HAVE_ELF),y) echo "Working around compiler bug in the m68k-pic-coff toolchain" $(LN) -fs ../libc/sysdeps/linux/m68k/float.h $(TOPDIR)/include/ endif @@ -96,6 +84,6 @@ endif clean: $(RM) *.o *~ core -ifneq ($(strip $(HAVE_ELF)),y) +ifneq ($(HAVE_ELF),y) $(RM) $(TOPDIR)/include/float.h endif diff --git a/libc/sysdeps/linux/microblaze/Makefile b/libc/sysdeps/linux/microblaze/Makefile index 01b91ef71..0c4baa9dc 100644 --- a/libc/sysdeps/linux/microblaze/Makefile +++ b/libc/sysdeps/linux/microblaze/Makefile @@ -23,65 +23,54 @@ include $(TOPDIR)Rules.mak #FIXME -- this arch should include its own crti.S and crtn.S UCLIBC_CTOR_DTOR=n -CFLAGS+=-I.. -ASFLAGS+=-I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl +CFLAGS += -I.. +ASFLAGS += -I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC = setjmp.S __longjmp.S vfork.S -SOBJS = $(patsubst %.S,%.o, $(SSRC)) +SSRC := setjmp.S __longjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC = mmap.c syscall.c clone.c -COBJS = $(patsubst %.c,%.o, $(CSRC)) +CSRC := mmap.c syscall.c clone.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS = $(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/nios/Makefile b/libc/sysdeps/linux/nios/Makefile index b2b622329..b1c558fee 100644 --- a/libc/sysdeps/linux/nios/Makefile +++ b/libc/sysdeps/linux/nios/Makefile @@ -19,61 +19,35 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS= +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o -SSRC= __longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC= brk.c crtbegin.c crtend.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := brk.c crtbegin.c crtend.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) all: $(OBJ_LIST) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif headers: $(LN) -fs ../libc/sysdeps/linux/nios/fpu_control.h $(TOPDIR)/include/ diff --git a/libc/sysdeps/linux/nios2/Makefile b/libc/sysdeps/linux/nios2/Makefile index 0292328f4..4202eb611 100644 --- a/libc/sysdeps/linux/nios2/Makefile +++ b/libc/sysdeps/linux/nios2/Makefile @@ -19,60 +19,49 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC= __longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S vfork.S clone.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S setjmp.S vfork.S clone.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC= brk.c syscall.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := brk.c syscall.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile index e0d5dcdd2..b1bf1ef10 100644 --- a/libc/sysdeps/linux/powerpc/Makefile +++ b/libc/sysdeps/linux/powerpc/Makefile @@ -1,89 +1,15 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \ - clone.S __uClibc_syscall.S syscall.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=mmap.c __syscall_error.c pread_write.c ioctl.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/powerpc/fpu_control.h $(TOPDIR)/include/ -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/sh/Makefile b/libc/sysdeps/linux/sh/Makefile index d986850ba..00ccb06af 100644 --- a/libc/sysdeps/linux/sh/Makefile +++ b/libc/sysdeps/linux/sh/Makefile @@ -20,65 +20,53 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt1.S +CRT_OBJ := crt1.o +SCRT_OBJ := Scrt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SSRC := setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=mmap.c longjmp.c pipe.c __init_brk.c brk.c sbrk.c syscall.c pread_write.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := mmap.c longjmp.c pipe.c __init_brk.c brk.c sbrk.c syscall.c pread_write.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ $(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o $(SCRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/sh64/Makefile b/libc/sysdeps/linux/sh64/Makefile index af49f5f1c..94486deee 100644 --- a/libc/sysdeps/linux/sh64/Makefile +++ b/libc/sysdeps/linux/sh64/Makefile @@ -21,64 +21,53 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak CFLAGS += -I.. -ASFLAGS+=-I.. -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl +ASFLAGS += -I.. -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC = setjmp.S longjmp.S -SOBJS = $(patsubst %.S,%.o, $(SSRC)) +SSRC := setjmp.S longjmp.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC = __init_brk.c brk.c sbrk.c syscall.c -COBJS = $(patsubst %.c,%.o, $(CSRC)) +CSRC := __init_brk.c brk.c sbrk.c syscall.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS = $(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/sparc/Makefile b/libc/sysdeps/linux/sparc/Makefile index de2fe0a4e..579140f08 100644 --- a/libc/sysdeps/linux/sparc/Makefile +++ b/libc/sysdeps/linux/sparc/Makefile @@ -19,61 +19,53 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt1.S +CRT_OBJ := crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC=__longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \ +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 -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC=brk.c __syscall_error.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := brk.c __syscall_error.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ $(CRT_OBJ): $(CRT_SRC) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ crtn.o: crtn.S $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/v850/Makefile b/libc/sysdeps/linux/v850/Makefile index d20bc89c6..2d54cc2e8 100644 --- a/libc/sysdeps/linux/v850/Makefile +++ b/libc/sysdeps/linux/v850/Makefile @@ -21,64 +21,53 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak CFLAGS += -I.. -ASFLAGS+=-I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl +ASFLAGS += -I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) -CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +CRT_SRC := crt0.S +CRT_OBJ := crt0.o crt1.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -SSRC = setjmp.S __longjmp.S vfork.S -SOBJS = $(patsubst %.S,%.o, $(SSRC)) +SSRC := setjmp.S __longjmp.S vfork.S +SOBJ := $(patsubst %.S,%.o, $(SSRC)) -CSRC = mmap.c syscall.c clone.c -COBJS = $(patsubst %.c,%.o, $(CSRC)) +CSRC := mmap.c syscall.c clone.c +COBJ := $(patsubst %.c,%.o, $(CSRC)) -OBJS = $(SOBJS) $(COBJS) +OBJS := $(SOBJ) $(COBJ) -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -all: $(OBJ_LIST) +all: $(OBJ_LIST) $(CTOR_TARGETS) -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/ + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(CRT0_OBJ): $(CRT0_SRC) +$(CRT_OBJ): $(CRT_SRC) $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(SOBJS): %.o : %.S +$(SOBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(COBJ): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: diff --git a/libc/sysdeps/linux/x86_64/Makefile b/libc/sysdeps/linux/x86_64/Makefile index c38204e4d..b1bf1ef10 100644 --- a/libc/sysdeps/linux/x86_64/Makefile +++ b/libc/sysdeps/linux/x86_64/Makefile @@ -2,86 +2,14 @@ # # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=__longjmp.S vfork.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S clone.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=brk.c sigaction.c __syscall_error.c mmap.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/x86_64/fpu_control.h $(TOPDIR)/include/ -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libm/Makefile b/libm/Makefile index ad080ecde..8230921bc 100644 --- a/libm/Makefile +++ b/libm/Makefile @@ -60,7 +60,7 @@ CSRC = e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c\ w_cosh.c w_drem.c w_exp.c w_fmod.c w_gamma.c w_gamma_r.c\ w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c\ w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c\ - w_sqrt.c fpmacros.c nan.c s_ceilf.c s_floorf.c + w_sqrt.c fpmacros.c nan.c FL_MOBJ = acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \ ceilf.o copysignf.o cosf.o coshf.o erfcf.o erff.o exp2f.o expf.o \ expm1f.o fabsf.o fdimf.o floorf.o fmaf.o fmaxf.o fminf.o fmodf.o \ diff --git a/libm/fpmacros.c b/libm/fpmacros.c index 78cc46e9a..57c6b5a7a 100644 --- a/libm/fpmacros.c +++ b/libm/fpmacros.c @@ -160,11 +160,13 @@ int __finitef ( float x ) } weak_alias (__finitef, finitef) +#if 0 /* use __finite in s_finite.c */ int __finite ( double x ) { return ( __fpclassify ( x ) >= FP_ZERO ); } weak_alias (__finite, finite) +#endif /*********************************************************************** diff --git a/libm/s_ceilf.c b/libm/s_ceilf.c deleted file mode 100644 index d43bede8c..000000000 --- a/libm/s_ceilf.c +++ /dev/null @@ -1,62 +0,0 @@ -/* s_ceilf.c -- float version of s_ceil.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: s_ceilf.c,v 1.4 1995/05/10 20:46:55 jtc Exp $"; -#endif - -#include "math.h" -#include "math_private.h" - -#ifdef __STDC__ -static const float huge = 1.0e30; -#else -static float huge = 1.0e30; -#endif - -#ifdef __STDC__ - float __ceilf(float x) -#else - float __ceilf(x) - float x; -#endif -{ - int32_t i0,j0; - u_int32_t i; - - GET_FLOAT_WORD(i0,x); - j0 = ((i0>>23)&0xff)-0x7f; - if(j0<23) { - if(j0<0) { /* raise inexact if x != 0 */ - if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */ - if(i0<0) {i0=0x80000000;} - else if(i0!=0) { i0=0x3f800000;} - } - } else { - i = (0x007fffff)>>j0; - if((i0&i)==0) return x; /* x is integral */ - if(huge+x>(float)0.0) { /* raise inexact flag */ - if(i0>0) i0 += (0x00800000)>>j0; - i0 &= (~i); - } - } - } else { - if(j0==0x80) return x+x; /* inf or NaN */ - else return x; /* x is integral */ - } - SET_FLOAT_WORD(x,i0); - return x; -} -weak_alias (__ceilf, ceilf) diff --git a/libm/s_finite.c b/libm/s_finite.c index 428570c14..a3385bcde 100644 --- a/libm/s_finite.c +++ b/libm/s_finite.c @@ -23,9 +23,9 @@ static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $"; #include "math_private.h" #ifdef __STDC__ - int finite(double x) + int __finite(double x) #else - int finite(x) + int __finite(x) double x; #endif { @@ -33,3 +33,4 @@ static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $"; GET_HIGH_WORD(hx,x); return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31); } +weak_alias(__finite,finite) diff --git a/libm/s_floorf.c b/libm/s_floorf.c deleted file mode 100644 index 1cdc792c6..000000000 --- a/libm/s_floorf.c +++ /dev/null @@ -1,71 +0,0 @@ -/* s_floorf.c -- float version of s_floor.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: s_floorf.c,v 1.4 1995/05/10 20:47:22 jtc Exp $"; -#endif - -/* - * floorf(x) - * Return x rounded toward -inf to integral value - * Method: - * Bit twiddling. - * Exception: - * Inexact flag raised if x not equal to floorf(x). - */ - -#include "math.h" -#include "math_private.h" - -#ifdef __STDC__ -static const float huge = 1.0e30; -#else -static float huge = 1.0e30; -#endif - -#ifdef __STDC__ - float __floorf(float x) -#else - float __floorf(x) - float x; -#endif -{ - int32_t i0,j0; - u_int32_t i; - GET_FLOAT_WORD(i0,x); - j0 = ((i0>>23)&0xff)-0x7f; - if(j0<23) { - if(j0<0) { /* raise inexact if x != 0 */ - if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */ - if(i0>=0) {i0=0;} - else if((i0&0x7fffffff)!=0) - { i0=0xbf800000;} - } - } else { - i = (0x007fffff)>>j0; - if((i0&i)==0) return x; /* x is integral */ - if(huge+x>(float)0.0) { /* raise inexact flag */ - if(i0<0) i0 += (0x00800000)>>j0; - i0 &= (~i); - } - } - } else { - if(j0==0x80) return x+x; /* inf or NaN */ - else return x; /* x is integral */ - } - SET_FLOAT_WORD(x,i0); - return x; -} -weak_alias (__floorf, floorf) diff --git a/libm/w_cabs.c b/libm/w_cabs.c index 69188a0dd..6743146c6 100644 --- a/libm/w_cabs.c +++ b/libm/w_cabs.c @@ -5,14 +5,10 @@ * Placed into the Public Domain, 1994. */ +#include <complex.h> #include <math.h> -struct complex { - double x; - double y; -}; - -double cabs(struct complex z) +double cabs(double _Complex z) { - return hypot(z.x, z.y); + return hypot(__real__ z, __imag__ z); } diff --git a/libpthread/linuxthreads/Makefile b/libpthread/linuxthreads/Makefile index d5637eccf..f92f205a5 100644 --- a/libpthread/linuxthreads/Makefile +++ b/libpthread/linuxthreads/Makefile @@ -1,92 +1,15 @@ -# Makefile for uClibc's pthread library +# Makefile for uClibc # -# Copyright (C) 2002 Erik Andersen <andersen@uclibc.org> -# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../ -include $(TOPDIR)Rules.mak - -CFLAGS+=$(SSP_ALL_CFLAGS) - -# This stuff will not compile without at least -O1 -CFLAGS :=$(CFLAGS:-O0=-O1) - -# Get the thread include dependencies -CFLAGS += $(PTINC) - -ARCH_CFLAGS = $(CFLAGS) - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) - SHARED_START_FILES = $(TOPDIR)lib/crti.o $(LIBGCC_DIR)crtbeginS.o - SHARED_END_FILES = $(LIBGCC_DIR)crtendS.o $(TOPDIR)lib/crtn.o -endif - -LIB_NAME=libpthread -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so - -ARCH_CSRC=$(wildcard sysdeps/$(TARGET_ARCH)/*.c) -ARCH_OBJS=$(patsubst %.c,%.o, $(ARCH_CSRC)) --include sysdeps/$(TARGET_ARCH)/Makefile.in - -CSRC = $(wildcard *.c) -ifneq ($(strip $(UCLIBC_HAS_XLOCALE)),y) -CSRC := $(filter-out locale.c,$(CSRC)) -endif - -OBJS=$(patsubst %.c,%.o, $(CSRC)) - -ifeq ($(strip $(HAVE_SHARED)),y) -all: $(SO_LIB_NAME) -else -all: $(AR_LIB_NAME) -endif - -$(AR_LIB_NAME): $(OBJS) $(ARCH_OBJS) - $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(ARCH_OBJS) - -$(SO_LIB_NAME): $(AR_LIB_NAME) - $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $(SO_LIB_NAME) - $(LD) $(LDFLAGS_NOSTRIP) -soname=$(LIB_NAME).so.$(MAJOR_VERSION) \ - -o $(TOPDIR)lib/$(SO_FULL_NAME) $(SHARED_START_FILES) --whole-archive $(AR_LIB_NAME) \ - --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \ - -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC) $(SHARED_END_FILES) - $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) - $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME) - -$(OBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ -ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) - $(STRIPTOOL) -X --strip-debug -R .note -R .comment $*.o -else - $(STRIPTOOL) -x -R .note -R .comment $*.o -endif - -$(ARCH_OBJS): %.o : %.c - $(CC) $(ARCH_CFLAGS) -c $< -o $@ -ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) - $(STRIPTOOL) -X --strip-debug -R .note -R .comment $*.o -else - $(STRIPTOOL) -x -R .note -R .comment $*.o -endif -clean: - $(RM) *.o sysdeps/*/*.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../ +include $(top_builddir)Rules.mak +all: libs +include Makefile.in +include $(top_srcdir)Makerules diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h index 1f60caac3..a91682df1 100644 --- a/libpthread/linuxthreads/internals.h +++ b/libpthread/linuxthreads/internals.h @@ -31,10 +31,10 @@ #include <ucontext.h> #include <bits/sigcontextinfo.h> #include "semaphore.h" -#include "descr.h" #ifdef __UCLIBC_HAS_XLOCALE__ #include <bits/uClibc_locale.h> #endif /* __UCLIBC_HAS_XLOCALE__ */ +#include "descr.h" /* Use a funky version in a probably vein attempt at preventing gdb * from dlopen()'ing glibc's libthread_db library... */ diff --git a/libpthread/linuxthreads/sysdeps/sh64/Makefile.in b/libpthread/linuxthreads/sysdeps/sh64/Makefile.in deleted file mode 100644 index fed7a83b7..000000000 --- a/libpthread/linuxthreads/sysdeps/sh64/Makefile.in +++ /dev/null @@ -1,20 +0,0 @@ -# Makefile for uClibc's sh64 pthread backend -# -# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# We need to build as SHcompact for tas.. -ARCH_CFLAGS := $(subst 32media,compact,$(ARCH_CFLAGS)) diff --git a/libpthread/linuxthreads_db/Makefile b/libpthread/linuxthreads_db/Makefile index 3c7ee91a7..f92f205a5 100644 --- a/libpthread/linuxthreads_db/Makefile +++ b/libpthread/linuxthreads_db/Makefile @@ -1,64 +1,15 @@ -# Makefile for uClibc's pthread library +# Makefile for uClibc # -# Copyright (C) 2002 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA TOPDIR=../../ -include $(TOPDIR)Rules.mak - -#CFLAGS+=$(SSP_ALL_CFLAGS) - -LIB_NAME=libthread_db -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so - -# Get the thread include dependencies and shared object name -CFLAGS += $(PTINC) -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\"" - -# Remove any -z defs since this lib will have undefined symbols -LDFLAGS := $(subst -z defs,,$(LDFLAGS)) --warn-unresolved-symbols - -CSRC=$(wildcard *.c) - -OBJS=$(patsubst %.c,%.o, $(CSRC)) - -ifeq ($(strip $(HAVE_SHARED)),y) -all: $(SO_LIB_NAME) -else -all: $(AR_LIB_NAME) -endif - -$(AR_LIB_NAME): $(OBJS) - $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) - -$(SO_LIB_NAME): $(AR_LIB_NAME) - $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).1 $(SO_LIB_NAME) - $(LD) $(LDFLAGS) -soname=$(LIB_NAME).so.1 \ - -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $(AR_LIB_NAME) \ - --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \ - -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC) - $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).1 - $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME) - -$(OBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.o *~ core +top_srcdir=$(TOPDIR) +top_builddir=../../ +include $(top_builddir)Rules.mak +all: libs +include Makefile.in +include $(top_srcdir)Makerules |