svn commit: trunk/uClibc: extra/Configs extra/scripts include

Carmelo Amoroso carmelo73 at gmail.com
Wed Dec 31 08:25:04 UTC 2008


kraj at uclibc.org wrote:
> Author: kraj
> Date: 2008-12-31 00:31:38 +0000 (Wed, 31 Dec 2008)
> New Revision: 24617
> 
> Log:
> Merge some pre-work from branch, needed by NPTL.
> 
> 
> Added:
>    trunk/uClibc/extra/scripts/gen-as-const.awk
>    trunk/uClibc/include/tls.h
> 
> Modified:
>    trunk/uClibc/extra/Configs/Config.in
>    trunk/uClibc/include/elf.h
>    trunk/uClibc/include/fcntl.h
>    trunk/uClibc/include/sched.h
>    trunk/uClibc/include/time.h
>    trunk/uClibc/include/unistd.h
> 
Hi Khem,
that's a good idea. Remember that, as discussed with Bernhard recently,
we should add a knob option for TLS, so USE_TLS should be in somehow
controlled.
I cannot currently actively contribute anyway. Just I can read sometime emails.

Carmelo
> 
> Changeset:
> Modified: trunk/uClibc/extra/Configs/Config.in
> ===================================================================
> --- trunk/uClibc/extra/Configs/Config.in	2008-12-30 19:15:22 UTC (rev 24616)
> +++ trunk/uClibc/extra/Configs/Config.in	2008-12-31 00:31:38 UTC (rev 24617)
> @@ -403,9 +403,30 @@
>  	  the latest code from glibc, so it may be the only choice for the
>  	  newer ports (like alpha/amd64/64bit arches and hppa).
>  
> +config UCLIBC_HAS_THREADS_NATIVE
> +	bool "Native POSIX Threading (NPTL) Support"
> +	depends on UCLIBC_HAS_THREADS
> +	default n
> +	help
> +	  If you want to compile uClibc with NPTL support, then answer Y.
> +
> +	  IMPORTANT NOTE!  NPTL requires a Linux 2.6 kernel, binutils
> +	  at least version 2.16 and GCC with at least version 4.1.0. NPTL
> +	  will not work with older versions of any above sources. If you
> +	  ignore any of these guidelines, you do so at your own risk. Do
> +	  not ask for help on any of the development mailing lists.
> +
> +	  !!!! WARNING !!!! BIG FAT WARNING !!!! REALLY BIG FAT WARNING !!!!
> +
> +	  This is experimental code and at times it may not even build and
> +	  even if it does it might decide to do random damage. This code is
> +	  potentially hazardous to your health and sanity. It will remain
> +	  that way until further notice at which point this notice will
> +	  disappear. Thank you for your support and for not smoking.
> +
>  config LINUXTHREADS_NEW
>  	def_bool y
> -	depends on UCLIBC_HAS_THREADS && !LINUXTHREADS_OLD
> +	depends on UCLIBC_HAS_THREADS && !LINUXTHREADS_OLD && !UCLIBC_HAS_THREADS_NATIVE
>  
>  config UCLIBC_HAS_SYSLOG
>  	bool "Syslog support"
> @@ -1602,6 +1623,14 @@
>  
>  	  Most people will answer Y.
>  
> +config UCLIBC_HAS_STDIO_FUTEXES
> +	bool "Use futexes for multithreaded I/O locking"
> +	default n
> +	depends on UCLIBC_HAS_THREADS_NATIVE
> +	help
> +	  If you want to compile uClibc to use futexes for low-level
> +	  I/O locking, answer Y.  Otherwise, answer N.
> +
>  config UCLIBC_HAS_GETOPT_LONG
>  	bool "Support getopt_long/getopt_long_only"
>  	depends on !UCLIBC_HAS_GNU_GETOPT
> 
> Added: trunk/uClibc/extra/scripts/gen-as-const.awk
> ===================================================================
> --- trunk/uClibc/extra/scripts/gen-as-const.awk	                        (rev 0)
> +++ trunk/uClibc/extra/scripts/gen-as-const.awk	2008-12-31 00:31:38 UTC (rev 24617)
> @@ -0,0 +1,33 @@
> +# Script used in producing headers of assembly constants from C expressions.
> +# The input to this script looks like:
> +#	#cpp-directive ...
> +#	NAME1
> +#	NAME2 expression ...
> +# The output of this script is C code to be run through gcc -S and then
> +# massaged to extract the integer constant values of the given C expressions.
> +# A line giving just a name implies an expression consisting of just that name.
> +
> +BEGIN { started = 0 }
> +
> +# cpp directives go straight through.
> +/^#/ { print; next }
> +
> +NF >= 1 && !started {
> +  printf "void dummy(void);\n";
> +  print "void dummy(void) {";
> +  started = 1;
> +}
> +
> +# Separator.
> +$1 == "--" { next }
> +
> +NF == 1 { sub(/^.*$/, "& &"); }
> +
> +NF > 1 {
> +  name = $1;
> +  sub(/^[^ 	]+[ 	]+/, "");
> +  printf "__asm__ (\"@@@name@@@%s@@@value@@@%%0@@@end@@@\" : : \"i\" (%s));\n",
> +    name, $0;
> +}
> +
> +END { if (started) print "}" }
> 
> Modified: trunk/uClibc/include/elf.h
> ===================================================================
> --- trunk/uClibc/include/elf.h	2008-12-30 19:15:22 UTC (rev 24616)
> +++ trunk/uClibc/include/elf.h	2008-12-31 00:31:38 UTC (rev 24617)
> @@ -2367,6 +2367,9 @@
>  #define R_ARM_THM_SWI8		14
>  #define R_ARM_XPC25		15
>  #define R_ARM_THM_XPC22		16
> +#define R_ARM_TLS_DTPMOD32	17
> +#define R_ARM_TLS_DTPOFF32	18
> +#define R_ARM_TLS_TPOFF32	19
>  #define R_ARM_COPY		20	/* Copy symbol at runtime */
>  #define R_ARM_GLOB_DAT		21	/* Create GOT entry */
>  #define R_ARM_JUMP_SLOT		22	/* Create PLT entry */
> @@ -2385,6 +2388,14 @@
>  #define R_ARM_GNU_VTINHERIT	101
>  #define R_ARM_THM_PC11		102	/* thumb unconditional branch */
>  #define R_ARM_THM_PC9		103	/* thumb conditional branch */
> +#define R_ARM_TLS_GD32		104
> +#define R_ARM_TLS_LDM32		105
> +#define R_ARM_TLS_LDO32		106
> +#define R_ARM_TLS_IE32		107
> +#define R_ARM_TLS_LE32		108
> +#define R_ARM_TLS_LDO12		109
> +#define R_ARM_TLS_LE12		110
> +#define R_ARM_TLS_IE12GP	111
>  #define R_ARM_RXPC25		249
>  #define R_ARM_RSBREL32		250
>  #define R_ARM_THM_RPC22		251
> 
> Modified: trunk/uClibc/include/fcntl.h
> ===================================================================
> --- trunk/uClibc/include/fcntl.h	2008-12-30 19:15:22 UTC (rev 24616)
> +++ trunk/uClibc/include/fcntl.h	2008-12-31 00:31:38 UTC (rev 24617)
> @@ -224,6 +224,11 @@
>  #  define posix_fallocate posix_fallocate64
>  # endif
>  # endif
> +
> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
> +extern int __fcntl_nocancel (int fd, int cmd, ...);
> +#endif
> +
>  # ifdef __USE_LARGEFILE64
>  extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
>  # endif
> 
> Modified: trunk/uClibc/include/sched.h
> ===================================================================
> --- trunk/uClibc/include/sched.h	2008-12-30 19:15:22 UTC (rev 24616)
> +++ trunk/uClibc/include/sched.h	2008-12-31 00:31:38 UTC (rev 24617)
> @@ -79,6 +79,12 @@
>  /* Get the CPU affinity for a task */
>  extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
>  			      cpu_set_t *__cpuset) __THROW;
> +
> +extern int __clone (int (*__fn) (void *__arg), void *__child_stack,
> +		    int __flags, void *__arg, ...);
> +extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
> +		     size_t __child_stack_size, int __flags, void *__arg, ...);
> +
>  #endif
>  
>  __END_DECLS
> 
> Modified: trunk/uClibc/include/time.h
> ===================================================================
> --- trunk/uClibc/include/time.h	2008-12-30 19:15:22 UTC (rev 24616)
> +++ trunk/uClibc/include/time.h	2008-12-31 00:31:38 UTC (rev 24617)
> @@ -195,6 +195,8 @@
>       __THROW __attribute__ ((__const__));
>  #endif /* __UCLIBC_HAS_FLOATS__ */
>  
> +#define CLOCK_IDFIELD_SIZE	3
> +
>  /* Return the `time_t' representation of TP and normalize TP.  */
>  extern time_t mktime (struct tm *__tp) __THROW;
>  
> 
> Added: trunk/uClibc/include/tls.h
> ===================================================================
> --- trunk/uClibc/include/tls.h	                        (rev 0)
> +++ trunk/uClibc/include/tls.h	2008-12-31 00:31:38 UTC (rev 24617)
> @@ -0,0 +1,19 @@
> +/* This file defines USE___THREAD to 1 or 0 to cut down on the #if mess.  */
> +
> +#ifndef _include_tls_h
> +#define _include_tls_h 1
> +
> +#include_next <tls.h>
> +
> +#if USE_TLS && HAVE___THREAD \
> +    && (!defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt)
> +
> +# define USE___THREAD 1
> +
> +#else
> +
> +# define USE___THREAD 0
> +
> +#endif
> +
> +#endif
> 
> Modified: trunk/uClibc/include/unistd.h
> ===================================================================
> --- trunk/uClibc/include/unistd.h	2008-12-30 19:15:22 UTC (rev 24616)
> +++ trunk/uClibc/include/unistd.h	2008-12-31 00:31:38 UTC (rev 24617)
> @@ -770,6 +770,8 @@
>  libc_hidden_proto(vfork)
>  #endif /* Use BSD. */
>  
> +/* Special exit function which only terminates the current thread.  */
> +extern void __exit_thread (int val) __attribute__ ((noreturn));
>  
>  /* Return the pathname of the terminal FD is open on, or NULL on errors.
>     The returned storage is good only until the next call to this function.  */
> 
> _______________________________________________
> uClibc-cvs mailing list
> uClibc-cvs at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc-cvs
> 



More information about the uClibc-cvs mailing list