1 diff --git a/configure b/configure
2 index a2a792c..71ae623 100755
5 @@ -580,42 +580,6 @@ PACKAGE_STRING='GNU C Library (see version.h)'
6 PACKAGE_BUGREPORT='glibc'
8 ac_unique_file="include/features.h"
9 -# Factoring default headers for most tests.
10 -ac_includes_default="\
12 -#ifdef HAVE_SYS_TYPES_H
13 -# include <sys/types.h>
15 -#ifdef HAVE_SYS_STAT_H
16 -# include <sys/stat.h>
22 -# ifdef HAVE_STDLIB_H
27 -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
32 -#ifdef HAVE_STRINGS_H
33 -# include <strings.h>
35 -#ifdef HAVE_INTTYPES_H
36 -# include <inttypes.h>
48 @@ -735,8 +699,6 @@ LIBGD
55 libc_cv_gcc_unwind_find_fde
57 @@ -2621,7 +2583,7 @@ done
59 # Find what sysdep directories exist.
62 +sysnames="sysdeps/nacl "
64 for m0 in $mach ''; do
65 for v in /$vendor ''; do
66 @@ -7486,818 +7448,8 @@ _ACEOF
71 -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
72 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
73 -if test "${ac_cv_path_GREP+set}" = set; then
74 - echo $ECHO_N "(cached) $ECHO_C" >&6
76 - # Extract the first word of "grep ggrep" to use in msg output
77 -if test -z "$GREP"; then
78 -set dummy grep ggrep; ac_prog_name=$2
79 -if test "${ac_cv_path_GREP+set}" = set; then
80 - echo $ECHO_N "(cached) $ECHO_C" >&6
82 - ac_path_GREP_found=false
83 -# Loop through the user's path and test for each of PROGNAME-LIST
84 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
85 -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
88 - test -z "$as_dir" && as_dir=.
89 - for ac_prog in grep ggrep; do
90 - for ac_exec_ext in '' $ac_executable_extensions; do
91 - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
92 - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
93 - # Check for GNU ac_path_GREP and select it if it is found.
94 - # Check for GNU $ac_path_GREP
95 -case `"$ac_path_GREP" --version 2>&1` in
97 - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
100 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
103 - cat "conftest.in" "conftest.in" >"conftest.tmp"
104 - mv "conftest.tmp" "conftest.in"
105 - cp "conftest.in" "conftest.nl"
106 - echo 'GREP' >> "conftest.nl"
107 - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
108 - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
109 - ac_count=`expr $ac_count + 1`
110 - if test $ac_count -gt ${ac_path_GREP_max-0}; then
111 - # Best one so far, save it but keep looking for a better one
112 - ac_cv_path_GREP="$ac_path_GREP"
113 - ac_path_GREP_max=$ac_count
115 - # 10*(2^10) chars as input seems more than enough
116 - test $ac_count -gt 10 && break
118 - rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
122 - $ac_path_GREP_found && break 3
132 -GREP="$ac_cv_path_GREP"
133 -if test -z "$GREP"; then
134 - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
135 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
136 - { (exit 1); exit 1; }; }
140 - ac_cv_path_GREP=$GREP
145 -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
146 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
147 - GREP="$ac_cv_path_GREP"
150 -{ echo "$as_me:$LINENO: checking for egrep" >&5
151 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
152 -if test "${ac_cv_path_EGREP+set}" = set; then
153 - echo $ECHO_N "(cached) $ECHO_C" >&6
155 - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
156 - then ac_cv_path_EGREP="$GREP -E"
158 - # Extract the first word of "egrep" to use in msg output
159 -if test -z "$EGREP"; then
160 -set dummy egrep; ac_prog_name=$2
161 -if test "${ac_cv_path_EGREP+set}" = set; then
162 - echo $ECHO_N "(cached) $ECHO_C" >&6
164 - ac_path_EGREP_found=false
165 -# Loop through the user's path and test for each of PROGNAME-LIST
166 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
167 -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
170 - test -z "$as_dir" && as_dir=.
171 - for ac_prog in egrep; do
172 - for ac_exec_ext in '' $ac_executable_extensions; do
173 - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
174 - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
175 - # Check for GNU ac_path_EGREP and select it if it is found.
176 - # Check for GNU $ac_path_EGREP
177 -case `"$ac_path_EGREP" --version 2>&1` in
179 - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
182 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
185 - cat "conftest.in" "conftest.in" >"conftest.tmp"
186 - mv "conftest.tmp" "conftest.in"
187 - cp "conftest.in" "conftest.nl"
188 - echo 'EGREP' >> "conftest.nl"
189 - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
190 - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
191 - ac_count=`expr $ac_count + 1`
192 - if test $ac_count -gt ${ac_path_EGREP_max-0}; then
193 - # Best one so far, save it but keep looking for a better one
194 - ac_cv_path_EGREP="$ac_path_EGREP"
195 - ac_path_EGREP_max=$ac_count
197 - # 10*(2^10) chars as input seems more than enough
198 - test $ac_count -gt 10 && break
200 - rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
204 - $ac_path_EGREP_found && break 3
214 -EGREP="$ac_cv_path_EGREP"
215 -if test -z "$EGREP"; then
216 - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
217 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
218 - { (exit 1); exit 1; }; }
222 - ac_cv_path_EGREP=$EGREP
228 -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
229 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
230 - EGREP="$ac_cv_path_EGREP"
233 -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
234 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
235 -if test "${ac_cv_header_stdc+set}" = set; then
236 - echo $ECHO_N "(cached) $ECHO_C" >&6
238 - cat >conftest.$ac_ext <<_ACEOF
241 -cat confdefs.h >>conftest.$ac_ext
242 -cat >>conftest.$ac_ext <<_ACEOF
243 -/* end confdefs.h. */
257 -rm -f conftest.$ac_objext
258 -if { (ac_try="$ac_compile"
260 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
261 - *) ac_try_echo=$ac_try;;
263 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
264 - (eval "$ac_compile") 2>conftest.er1
266 - grep -v '^ *+' conftest.er1 >conftest.err
268 - cat conftest.err >&5
269 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
270 - (exit $ac_status); } && {
271 - test -z "$ac_c_werror_flag" ||
272 - test ! -s conftest.err
273 - } && test -s conftest.$ac_objext; then
274 - ac_cv_header_stdc=yes
276 - echo "$as_me: failed program was:" >&5
277 -sed 's/^/| /' conftest.$ac_ext >&5
279 - ac_cv_header_stdc=no
282 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
284 -if test $ac_cv_header_stdc = yes; then
285 - # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
286 - cat >conftest.$ac_ext <<_ACEOF
289 -cat confdefs.h >>conftest.$ac_ext
290 -cat >>conftest.$ac_ext <<_ACEOF
291 -/* end confdefs.h. */
295 -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
296 - $EGREP "memchr" >/dev/null 2>&1; then
299 - ac_cv_header_stdc=no
305 -if test $ac_cv_header_stdc = yes; then
306 - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
307 - cat >conftest.$ac_ext <<_ACEOF
310 -cat confdefs.h >>conftest.$ac_ext
311 -cat >>conftest.$ac_ext <<_ACEOF
312 -/* end confdefs.h. */
316 -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
317 - $EGREP "free" >/dev/null 2>&1; then
320 - ac_cv_header_stdc=no
326 -if test $ac_cv_header_stdc = yes; then
327 - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
328 - if test "$cross_compiling" = yes; then
331 - cat >conftest.$ac_ext <<_ACEOF
334 -cat confdefs.h >>conftest.$ac_ext
335 -cat >>conftest.$ac_ext <<_ACEOF
336 -/* end confdefs.h. */
339 -#if ((' ' & 0x0FF) == 0x020)
340 -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
341 -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
343 -# define ISLOWER(c) \
344 - (('a' <= (c) && (c) <= 'i') \
345 - || ('j' <= (c) && (c) <= 'r') \
346 - || ('s' <= (c) && (c) <= 'z'))
347 -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
350 -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
355 - for (i = 0; i < 256; i++)
356 - if (XOR (islower (i), ISLOWER (i))
357 - || toupper (i) != TOUPPER (i))
362 -rm -f conftest$ac_exeext
363 -if { (ac_try="$ac_link"
365 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
366 - *) ac_try_echo=$ac_try;;
368 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
369 - (eval "$ac_link") 2>&5
371 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
372 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
373 - { (case "(($ac_try" in
374 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
375 - *) ac_try_echo=$ac_try;;
377 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
378 - (eval "$ac_try") 2>&5
380 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
381 - (exit $ac_status); }; }; then
384 - echo "$as_me: program exited with status $ac_status" >&5
385 -echo "$as_me: failed program was:" >&5
386 -sed 's/^/| /' conftest.$ac_ext >&5
389 -ac_cv_header_stdc=no
391 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
397 -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
398 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
399 -if test $ac_cv_header_stdc = yes; then
401 -cat >>confdefs.h <<\_ACEOF
402 -#define STDC_HEADERS 1
407 -# On IRIX 5.3, sys/types and inttypes.h are conflicting.
417 -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
418 - inttypes.h stdint.h unistd.h
420 -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
421 -{ echo "$as_me:$LINENO: checking for $ac_header" >&5
422 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
423 -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
424 - echo $ECHO_N "(cached) $ECHO_C" >&6
426 - cat >conftest.$ac_ext <<_ACEOF
429 -cat confdefs.h >>conftest.$ac_ext
430 -cat >>conftest.$ac_ext <<_ACEOF
431 -/* end confdefs.h. */
432 -$ac_includes_default
434 -#include <$ac_header>
436 -rm -f conftest.$ac_objext
437 -if { (ac_try="$ac_compile"
439 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
440 - *) ac_try_echo=$ac_try;;
442 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
443 - (eval "$ac_compile") 2>conftest.er1
445 - grep -v '^ *+' conftest.er1 >conftest.err
447 - cat conftest.err >&5
448 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
449 - (exit $ac_status); } && {
450 - test -z "$ac_c_werror_flag" ||
451 - test ! -s conftest.err
452 - } && test -s conftest.$ac_objext; then
453 - eval "$as_ac_Header=yes"
455 - echo "$as_me: failed program was:" >&5
456 -sed 's/^/| /' conftest.$ac_ext >&5
458 - eval "$as_ac_Header=no"
461 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
463 -ac_res=`eval echo '${'$as_ac_Header'}'`
464 - { echo "$as_me:$LINENO: result: $ac_res" >&5
465 -echo "${ECHO_T}$ac_res" >&6; }
466 -if test `eval echo '${'$as_ac_Header'}'` = yes; then
467 - cat >>confdefs.h <<_ACEOF
468 -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
476 -{ echo "$as_me:$LINENO: checking for long double" >&5
477 -echo $ECHO_N "checking for long double... $ECHO_C" >&6; }
478 -if test "${ac_cv_type_long_double+set}" = set; then
479 - echo $ECHO_N "(cached) $ECHO_C" >&6
481 - cat >conftest.$ac_ext <<_ACEOF
484 -cat confdefs.h >>conftest.$ac_ext
485 -cat >>conftest.$ac_ext <<_ACEOF
486 -/* end confdefs.h. */
487 -$ac_includes_default
488 -typedef long double ac__type_new_;
492 -if ((ac__type_new_ *) 0)
494 -if (sizeof (ac__type_new_))
500 -rm -f conftest.$ac_objext
501 -if { (ac_try="$ac_compile"
503 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
504 - *) ac_try_echo=$ac_try;;
506 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
507 - (eval "$ac_compile") 2>conftest.er1
509 - grep -v '^ *+' conftest.er1 >conftest.err
511 - cat conftest.err >&5
512 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
513 - (exit $ac_status); } && {
514 - test -z "$ac_c_werror_flag" ||
515 - test ! -s conftest.err
516 - } && test -s conftest.$ac_objext; then
517 - ac_cv_type_long_double=yes
519 - echo "$as_me: failed program was:" >&5
520 -sed 's/^/| /' conftest.$ac_ext >&5
522 - ac_cv_type_long_double=no
525 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
527 -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5
528 -echo "${ECHO_T}$ac_cv_type_long_double" >&6; }
530 -# The cast to long int works around a bug in the HP C Compiler
531 -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
532 -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
533 -# This bug is HP SR number 8606223364.
534 -{ echo "$as_me:$LINENO: checking size of long double" >&5
535 -echo $ECHO_N "checking size of long double... $ECHO_C" >&6; }
536 -if test "${ac_cv_sizeof_long_double+set}" = set; then
537 - echo $ECHO_N "(cached) $ECHO_C" >&6
539 - if test "$cross_compiling" = yes; then
540 - # Depending upon the size, compute the lo and hi bounds.
541 -cat >conftest.$ac_ext <<_ACEOF
544 -cat confdefs.h >>conftest.$ac_ext
545 -cat >>conftest.$ac_ext <<_ACEOF
546 -/* end confdefs.h. */
547 -$ac_includes_default
548 - typedef long double ac__type_sizeof_;
552 -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
559 -rm -f conftest.$ac_objext
560 -if { (ac_try="$ac_compile"
562 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
563 - *) ac_try_echo=$ac_try;;
565 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
566 - (eval "$ac_compile") 2>conftest.er1
568 - grep -v '^ *+' conftest.er1 >conftest.err
570 - cat conftest.err >&5
571 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
572 - (exit $ac_status); } && {
573 - test -z "$ac_c_werror_flag" ||
574 - test ! -s conftest.err
575 - } && test -s conftest.$ac_objext; then
578 - cat >conftest.$ac_ext <<_ACEOF
581 -cat confdefs.h >>conftest.$ac_ext
582 -cat >>conftest.$ac_ext <<_ACEOF
583 -/* end confdefs.h. */
584 -$ac_includes_default
585 - typedef long double ac__type_sizeof_;
589 -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
596 -rm -f conftest.$ac_objext
597 -if { (ac_try="$ac_compile"
599 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
600 - *) ac_try_echo=$ac_try;;
602 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
603 - (eval "$ac_compile") 2>conftest.er1
605 - grep -v '^ *+' conftest.er1 >conftest.err
607 - cat conftest.err >&5
608 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
609 - (exit $ac_status); } && {
610 - test -z "$ac_c_werror_flag" ||
611 - test ! -s conftest.err
612 - } && test -s conftest.$ac_objext; then
613 - ac_hi=$ac_mid; break
615 - echo "$as_me: failed program was:" >&5
616 -sed 's/^/| /' conftest.$ac_ext >&5
618 - ac_lo=`expr $ac_mid + 1`
619 - if test $ac_lo -le $ac_mid; then
623 - ac_mid=`expr 2 '*' $ac_mid + 1`
626 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
629 - echo "$as_me: failed program was:" >&5
630 -sed 's/^/| /' conftest.$ac_ext >&5
632 - cat >conftest.$ac_ext <<_ACEOF
635 -cat confdefs.h >>conftest.$ac_ext
636 -cat >>conftest.$ac_ext <<_ACEOF
637 -/* end confdefs.h. */
638 -$ac_includes_default
639 - typedef long double ac__type_sizeof_;
643 -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
650 -rm -f conftest.$ac_objext
651 -if { (ac_try="$ac_compile"
653 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
654 - *) ac_try_echo=$ac_try;;
656 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
657 - (eval "$ac_compile") 2>conftest.er1
659 - grep -v '^ *+' conftest.er1 >conftest.err
661 - cat conftest.err >&5
662 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
663 - (exit $ac_status); } && {
664 - test -z "$ac_c_werror_flag" ||
665 - test ! -s conftest.err
666 - } && test -s conftest.$ac_objext; then
669 - cat >conftest.$ac_ext <<_ACEOF
672 -cat confdefs.h >>conftest.$ac_ext
673 -cat >>conftest.$ac_ext <<_ACEOF
674 -/* end confdefs.h. */
675 -$ac_includes_default
676 - typedef long double ac__type_sizeof_;
680 -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
687 -rm -f conftest.$ac_objext
688 -if { (ac_try="$ac_compile"
690 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
691 - *) ac_try_echo=$ac_try;;
693 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
694 - (eval "$ac_compile") 2>conftest.er1
696 - grep -v '^ *+' conftest.er1 >conftest.err
698 - cat conftest.err >&5
699 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
700 - (exit $ac_status); } && {
701 - test -z "$ac_c_werror_flag" ||
702 - test ! -s conftest.err
703 - } && test -s conftest.$ac_objext; then
704 - ac_lo=$ac_mid; break
706 - echo "$as_me: failed program was:" >&5
707 -sed 's/^/| /' conftest.$ac_ext >&5
709 - ac_hi=`expr '(' $ac_mid ')' - 1`
710 - if test $ac_mid -le $ac_hi; then
714 - ac_mid=`expr 2 '*' $ac_mid`
717 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
720 - echo "$as_me: failed program was:" >&5
721 -sed 's/^/| /' conftest.$ac_ext >&5
726 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
729 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
730 -# Binary search between lo and hi bounds.
731 -while test "x$ac_lo" != "x$ac_hi"; do
732 - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
733 - cat >conftest.$ac_ext <<_ACEOF
736 -cat confdefs.h >>conftest.$ac_ext
737 -cat >>conftest.$ac_ext <<_ACEOF
738 -/* end confdefs.h. */
739 -$ac_includes_default
740 - typedef long double ac__type_sizeof_;
744 -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
751 -rm -f conftest.$ac_objext
752 -if { (ac_try="$ac_compile"
754 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
755 - *) ac_try_echo=$ac_try;;
757 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
758 - (eval "$ac_compile") 2>conftest.er1
760 - grep -v '^ *+' conftest.er1 >conftest.err
762 - cat conftest.err >&5
763 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
764 - (exit $ac_status); } && {
765 - test -z "$ac_c_werror_flag" ||
766 - test ! -s conftest.err
767 - } && test -s conftest.$ac_objext; then
770 - echo "$as_me: failed program was:" >&5
771 -sed 's/^/| /' conftest.$ac_ext >&5
773 - ac_lo=`expr '(' $ac_mid ')' + 1`
776 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
779 -?*) ac_cv_sizeof_long_double=$ac_lo;;
780 -'') if test "$ac_cv_type_long_double" = yes; then
781 - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
782 -See \`config.log' for more details." >&5
783 -echo "$as_me: error: cannot compute sizeof (long double)
784 -See \`config.log' for more details." >&2;}
785 - { (exit 77); exit 77; }; }
787 - ac_cv_sizeof_long_double=0
791 - cat >conftest.$ac_ext <<_ACEOF
794 -cat confdefs.h >>conftest.$ac_ext
795 -cat >>conftest.$ac_ext <<_ACEOF
796 -/* end confdefs.h. */
797 -$ac_includes_default
798 - typedef long double ac__type_sizeof_;
799 -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
800 -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
807 - FILE *f = fopen ("conftest.val", "w");
810 - if (((long int) (sizeof (ac__type_sizeof_))) < 0)
812 - long int i = longval ();
813 - if (i != ((long int) (sizeof (ac__type_sizeof_))))
815 - fprintf (f, "%ld\n", i);
819 - unsigned long int i = ulongval ();
820 - if (i != ((long int) (sizeof (ac__type_sizeof_))))
822 - fprintf (f, "%lu\n", i);
824 - return ferror (f) || fclose (f) != 0;
830 -rm -f conftest$ac_exeext
831 -if { (ac_try="$ac_link"
833 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
834 - *) ac_try_echo=$ac_try;;
836 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
837 - (eval "$ac_link") 2>&5
839 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
840 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
841 - { (case "(($ac_try" in
842 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
843 - *) ac_try_echo=$ac_try;;
845 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
846 - (eval "$ac_try") 2>&5
848 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
849 - (exit $ac_status); }; }; then
850 - ac_cv_sizeof_long_double=`cat conftest.val`
852 - echo "$as_me: program exited with status $ac_status" >&5
853 -echo "$as_me: failed program was:" >&5
854 -sed 's/^/| /' conftest.$ac_ext >&5
857 -if test "$ac_cv_type_long_double" = yes; then
858 - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
859 -See \`config.log' for more details." >&5
860 -echo "$as_me: error: cannot compute sizeof (long double)
861 -See \`config.log' for more details." >&2;}
862 - { (exit 77); exit 77; }; }
864 - ac_cv_sizeof_long_double=0
867 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
871 -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5
872 -echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; }
876 -cat >>confdefs.h <<_ACEOF
877 -#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
881 -sizeof_long_double=$ac_cv_sizeof_long_double
882 +#AC_CHECK_SIZEOF(long double, 0)
883 +#sizeof_long_double=$ac_cv_sizeof_long_double
886 ### End of automated tests.
887 @@ -9301,8 +8453,6 @@ LIBGD!$LIBGD$ac_delim
888 have_libaudit!$have_libaudit$ac_delim
889 have_libcap!$have_libcap$ac_delim
890 have_selinux!$have_selinux$ac_delim
892 -EGREP!$EGREP$ac_delim
893 sizeof_long_double!$sizeof_long_double$ac_delim
894 libc_cv_gcc_unwind_find_fde!$libc_cv_gcc_unwind_find_fde$ac_delim
895 uname_sysname!$uname_sysname$ac_delim
896 @@ -9335,7 +8485,7 @@ LIBOBJS!$LIBOBJS$ac_delim
897 LTLIBOBJS!$LTLIBOBJS$ac_delim
900 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then
901 + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then
903 elif $ac_last_try; then
904 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
905 diff --git a/configure.in b/configure.in
906 index 4a2b546..a8da9ff 100644
909 @@ -602,7 +602,7 @@ changequote([,])dnl
911 # Find what sysdep directories exist.
914 +sysnames="sysdeps/nacl "
915 for b in $base ''; do
916 for m0 in $mach ''; do
917 for v in /$vendor ''; do
918 @@ -2055,8 +2055,8 @@ fi
919 AC_SUBST(have_selinux)
921 dnl check for the size of 'long double'.
922 -AC_CHECK_SIZEOF(long double, 0)
923 -sizeof_long_double=$ac_cv_sizeof_long_double
924 +#AC_CHECK_SIZEOF(long double, 0)
925 +#sizeof_long_double=$ac_cv_sizeof_long_double
926 AC_SUBST(sizeof_long_double)
928 ### End of automated tests.
929 diff --git a/csu/libc-start.c b/csu/libc-start.c
930 index a14ed71..7c046e3 100644
931 --- a/csu/libc-start.c
932 +++ b/csu/libc-start.c
933 @@ -125,6 +125,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
935 _dl_aux_init (auxvec);
938 # ifdef DL_SYSDEP_OSCHECK
939 if (!__libc_multiple_libcs)
941 @@ -133,6 +134,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
942 DL_SYSDEP_OSCHECK (__libc_fatal);
947 /* Initialize the thread library at least a bit since the libgcc
948 functions are using thread functions if these are available and
949 diff --git a/csu/libc-tls.c b/csu/libc-tls.c
950 index 0d240cc..8de3f8e 100644
953 @@ -106,6 +106,13 @@ init_static_tls (size_t memsz, size_t align)
954 GL(dl_tls_static_nelem) = GL(dl_tls_max_dtv_idx);
957 +void *__tls_template_start;
958 +void *__tls_template_tdata_end;
959 +void *__tls_template_end;
961 +__asm__(".global __gnacl_tls_init; __gnacl_tls_init = 0x1a40 ");
962 +int __gnacl_tls_init(void const *buf, size_t size);
965 __libc_setup_tls (size_t tcbsize, size_t tcbalign)
967 @@ -118,6 +125,7 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
972 /* Look through the TLS segment if there is any. */
973 if (_dl_phdr != NULL)
974 for (phdr = _dl_phdr; phdr < &_dl_phdr[_dl_phnum]; ++phdr)
975 @@ -132,6 +140,11 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
976 max_align = phdr->p_align;
980 + initimage = (void *) &__tls_template_start;
981 + memsz = (size_t) &__tls_template_end - (size_t) &__tls_template_start;
982 + filesz = (size_t) &__tls_template_tdata_end - (size_t) &__tls_template_start;
985 /* We have to set up the TCB block which also (possibly) contains
986 'errno'. Therefore we avoid 'malloc' which might touch 'errno'.
987 @@ -185,8 +198,14 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
989 INSTALL_DTV ((char *) tlsblock + tcb_offset, static_dtv);
991 - const char *lossage = TLS_INIT_TP ((char *) tlsblock + tcb_offset, 0);
992 + //const char *lossage = TLS_INIT_TP ((char *) tlsblock + tcb_offset, 0);
993 + __gnacl_tls_init (tlsblock + tcb_offset, 100);
994 + tcbhead_t *head = (void *) tlsblock + tcb_offset;
997 + const char *lossage = NULL;
999 +# error "not supported"
1000 INSTALL_DTV (tlsblock, static_dtv);
1001 const char *lossage = TLS_INIT_TP (tlsblock, 0);
1003 diff --git a/elf/dl-support.c b/elf/dl-support.c
1004 index 6bd573e..e278c1d 100644
1005 --- a/elf/dl-support.c
1006 +++ b/elf/dl-support.c
1007 @@ -289,6 +289,7 @@ _dl_non_dynamic_init (void)
1008 _dl_platformlen = strlen (_dl_platform);
1010 /* Scan for a program header telling us the stack is nonexecutable. */
1012 if (_dl_phdr != NULL)
1013 for (uint_fast16_t i = 0; i < _dl_phnum; ++i)
1014 if (_dl_phdr[i].p_type == PT_GNU_STACK)
1015 @@ -296,6 +297,7 @@ _dl_non_dynamic_init (void)
1016 _dl_stack_flags = _dl_phdr[i].p_flags;
1023 diff --git a/elf_i386.x b/elf_i386.x
1024 new file mode 100644
1025 index 0000000..1efd8a4
1029 +/* Default linker script, for normal executables */
1030 +OUTPUT_FORMAT("elf32-nacl", "elf32-nacl",
1032 +/* OUTPUT_FORMAT("elf32-i386", "elf32-i386", */
1033 +/* "elf32-i386") */
1036 +/* SEARCH_DIR("/usr/i486-linux-gnu/lib32"); SEARCH_DIR("/usr/local/lib32"); SEARCH_DIR("/lib32"); SEARCH_DIR("/usr/lib32"); SEARCH_DIR("/usr/i486-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); */
1039 + headers PT_PHDR FILEHDR PHDRS ; /* put the headers in a non-loadable seg */
1040 + segtext PT_LOAD FLAGS(5) ; /* read + execute */
1041 + segrodata PT_LOAD FLAGS(4) ; /* read */
1042 + segdata PT_LOAD FLAGS(6) ; /* read + write */
1043 + /* TODO: do we need a stack? */
1047 + /* Read-only sections, merged into text segment: */
1048 + PROVIDE (__executable_start = 0x10000); . = 0x10000;
1049 + .interp : { *(.interp) }
1050 + .note.gnu.build-id : { *(.note.gnu.build-id) }
1051 + .hash : { *(.hash) }
1052 + .gnu.hash : { *(.gnu.hash) }
1053 + .dynsym : { *(.dynsym) }
1054 + .dynstr : { *(.dynstr) }
1055 + .gnu.version : { *(.gnu.version) }
1056 + .gnu.version_d : { *(.gnu.version_d) }
1057 + .gnu.version_r : { *(.gnu.version_r) }
1058 + .rel.init : { *(.rel.init) }
1059 + .rela.init : { *(.rela.init) }
1060 + .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
1061 + .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
1062 + .rel.fini : { *(.rel.fini) }
1063 + .rela.fini : { *(.rela.fini) }
1064 + .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
1065 + .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
1066 + .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
1067 + .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
1068 + .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
1069 + .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
1070 + .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
1071 + .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
1072 + .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
1073 + .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
1074 + .rel.ctors : { *(.rel.ctors) }
1075 + .rela.ctors : { *(.rela.ctors) }
1076 + .rel.dtors : { *(.rel.dtors) }
1077 + .rela.dtors : { *(.rela.dtors) }
1078 + .rel.got : { *(.rel.got) }
1079 + .rela.got : { *(.rela.got) }
1080 + .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
1081 + .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
1082 + .rel.plt : { *(.rel.plt) }
1083 + .rela.plt : { *(.rela.plt) }
1087 + } :segtext =0x90909090
1088 + .plt : { *(.plt) }
1089 + .text : SUBALIGN(32)
1091 + *(.text .stub .text.* .gnu.linkonce.t.*)
1092 + KEEP (*(.text.*personality*))
1093 + /* .gnu.warning sections are handled specially by elf32.em. */
1096 + .fini : SUBALIGN(32)
1099 + KEEP (*(__libc_freeres_fn))
1101 + PROVIDE (__etext = .);
1102 + PROVIDE (_etext = .);
1103 + PROVIDE (etext = .);
1104 + . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */
1105 + .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } :segrodata
1106 + .rodata1 : { *(.rodata1) }
1107 + .eh_frame_hdr : { *(.eh_frame_hdr) }
1108 + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
1109 + .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
1110 + /* Adjust the address for the data segment. We want to adjust up to
1111 + the same address within the page on the next page up. */
1112 + . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
1113 + /* Exception handling */
1114 + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
1115 + .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
1116 + /* Thread Local Storage sections */
1118 + PROVIDE (__tls_template_start = .);
1119 + *(.tdata .tdata.* .gnu.linkonce.td.*)
1120 + PROVIDE (__tls_template_tdata_end = .);
1122 + .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
1123 + PROVIDE (__tls_template_end = .);
1126 + PROVIDE_HIDDEN (__preinit_array_start = .);
1127 + KEEP (*(.preinit_array))
1128 + PROVIDE_HIDDEN (__preinit_array_end = .);
1132 + PROVIDE_HIDDEN (__init_array_start = .);
1133 + KEEP (*(SORT(.init_array.*)))
1134 + KEEP (*(.init_array))
1135 + PROVIDE_HIDDEN (__init_array_end = .);
1139 + PROVIDE_HIDDEN (__fini_array_start = .);
1140 + KEEP (*(.fini_array))
1141 + KEEP (*(SORT(.fini_array.*)))
1142 + PROVIDE_HIDDEN (__fini_array_end = .);
1146 + /* gcc uses crtbegin.o to find the start of
1147 + the constructors, so we make sure it is
1148 + first. Because this is a wildcard, it
1149 + doesn't matter if the user does not
1150 + actually link against crtbegin.o; the
1151 + linker won't look for a file to match a
1152 + wildcard. The wildcard also means that it
1153 + doesn't matter which directory crtbegin.o
1155 + KEEP (*crtbegin.o(.ctors))
1156 + KEEP (*crtbegin?.o(.ctors))
1157 + /* We don't want to include the .ctor section from
1158 + the crtend.o file until after the sorted ctors.
1159 + The .ctor section from the crtend file contains the
1160 + end of ctors marker and it must be last */
1161 + KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
1162 + KEEP (*(SORT(.ctors.*)))
1167 + KEEP (*crtbegin.o(.dtors))
1168 + KEEP (*crtbegin?.o(.dtors))
1169 + KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
1170 + KEEP (*(SORT(.dtors.*)))
1173 + .jcr : { KEEP (*(.jcr)) }
1174 + .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
1175 + .dynamic : { *(.dynamic) }
1176 + .got : { *(.got) }
1177 + . = DATA_SEGMENT_RELRO_END (12, .);
1178 + .got.plt : { *(.got.plt) }
1179 + . = ALIGN(CONSTANT (MAXPAGESIZE)); /* nacl wants page alignment */
1182 + *(.data .data.* .gnu.linkonce.d.*)
1183 + KEEP (*(.gnu.linkonce.d.*personality*))
1184 + SORT(CONSTRUCTORS)
1186 + .data1 : { *(.data1) }
1187 + _edata = .; PROVIDE (edata = .);
1192 + *(.bss .bss.* .gnu.linkonce.b.*)
1194 + /* Align here to ensure that the .bss section occupies space up to
1195 + _end. Align after .bss to ensure correct alignment even if the
1196 + .bss section disappears because there are no input sections.
1197 + FIXME: Why do we need it? When there is no .bss section, we don't
1198 + pad the .data section. */
1199 + . = ALIGN(. != 0 ? 32 / 8 : 1);
1201 + . = ALIGN(32 / 8);
1202 + . = ALIGN(32 / 8);
1203 + _end = .; PROVIDE (end = .);
1204 + . = DATA_SEGMENT_END (.);
1205 + /* Stabs debugging sections. */
1206 + .stab 0 : { *(.stab) }
1207 + .stabstr 0 : { *(.stabstr) }
1208 + .stab.excl 0 : { *(.stab.excl) }
1209 + .stab.exclstr 0 : { *(.stab.exclstr) }
1210 + .stab.index 0 : { *(.stab.index) }
1211 + .stab.indexstr 0 : { *(.stab.indexstr) }
1212 + .comment 0 : { *(.comment) }
1213 + /* DWARF debug sections.
1214 + Symbols in the DWARF debugging sections are relative to the beginning
1215 + of the section so we begin them at 0. */
1217 + .debug 0 : { *(.debug) }
1218 + .line 0 : { *(.line) }
1219 + /* GNU DWARF 1 extensions */
1220 + .debug_srcinfo 0 : { *(.debug_srcinfo) }
1221 + .debug_sfnames 0 : { *(.debug_sfnames) }
1222 + /* DWARF 1.1 and DWARF 2 */
1223 + .debug_aranges 0 : { *(.debug_aranges) }
1224 + .debug_pubnames 0 : { *(.debug_pubnames) }
1226 + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
1227 + .debug_abbrev 0 : { *(.debug_abbrev) }
1228 + .debug_line 0 : { *(.debug_line) }
1229 + .debug_frame 0 : { *(.debug_frame) }
1230 + .debug_str 0 : { *(.debug_str) }
1231 + .debug_loc 0 : { *(.debug_loc) }
1232 + .debug_macinfo 0 : { *(.debug_macinfo) }
1233 + /* SGI/MIPS DWARF 2 extensions */
1234 + .debug_weaknames 0 : { *(.debug_weaknames) }
1235 + .debug_funcnames 0 : { *(.debug_funcnames) }
1236 + .debug_typenames 0 : { *(.debug_typenames) }
1237 + .debug_varnames 0 : { *(.debug_varnames) }
1239 + .debug_pubtypes 0 : { *(.debug_pubtypes) }
1240 + .debug_ranges 0 : { *(.debug_ranges) }
1241 + .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
1242 + /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
1243 + /DISCARD/ : { *(.note.ABI-tag) }
1245 diff --git a/hellow.c b/hellow.c
1246 new file mode 100644
1247 index 0000000..cc230a4
1256 + write(1, "Hello (via write())\n", 20);
1257 + printf("Hello world (%s)\n", "via printf()");
1260 diff --git a/libidn/idn-stub.c b/libidn/idn-stub.c
1261 index 3c69bbc..c2944b1 100644
1262 --- a/libidn/idn-stub.c
1263 +++ b/libidn/idn-stub.c
1268 -#include <gnu/lib-names.h>
1269 +//#include <gnu/lib-names.h>
1270 #include <bits/libc-lock.h>
1272 /* Get specification for idna_to_ascii_lz. */
1273 @@ -48,7 +48,7 @@ load_dso (void)
1274 /* Retest in case some other thread arrived here at the same time. */
1277 - h = __libc_dlopen (LIBCIDN_SO);
1278 + h = NULL; // __libc_dlopen (LIBCIDN_SO);
1282 diff --git a/make-example.sh b/make-example.sh
1283 new file mode 100755
1284 index 0000000..0bd9d06
1286 +++ b/make-example.sh
1291 +../tools_bin/linux/sdk/nacl-sdk/bin/nacl-gcc \
1292 + -B$BUILDDIR/csu/ -L$BUILDDIR -static -Wl,-T,elf_i386.x \
1293 + -g hellow.c -o hellow \
1294 + -Wl,-print-map > hellow.map
1295 diff --git a/misc/vm86.c b/misc/vm86.c
1296 new file mode 100644
1297 index 0000000..7bee874
1303 +#include <sys/vm86.h>
1305 +int vm86 (unsigned long int __subfunction,
1306 + struct vm86plus_struct *__info)
1311 diff --git a/myconfig.sh b/myconfig.sh
1312 new file mode 100755
1313 index 0000000..a7e3b2a
1323 +../configure --prefix=/usr --host=i486-linux-gnu \
1324 + CC="`pwd`/../../tools_bin/linux/sdk/nacl-sdk/bin/nacl-gcc" \
1325 + CFLAGS="-march=i486 -pipe -fstrict-aliasing -O2 -g -mno-tls-direct-seg-refs" \
1326 + --with-headers=`pwd`/../kernel-headers \
1328 diff --git a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
1329 index d53559c..3792b58 100644
1330 --- a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
1331 +++ b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
1332 @@ -236,7 +236,7 @@ LLL_STUB_UNWIND_INFO_END
1333 value is zero. In case the operation failed, the cmpxchg instruction
1334 has loaded the current value of the memory work which is guaranteed
1336 -#if defined NOT_IN_libc || defined UP
1337 +#if defined NOT_IN_libc || defined UP || 1
1338 # define __lll_trylock_asm LOCK_INSTR "cmpxchgl %2, %1"
1340 # define __lll_trylock_asm "cmpl $0, %%gs:%P5\n\t" \
1341 @@ -274,7 +274,7 @@ LLL_STUB_UNWIND_INFO_END
1345 -#if defined NOT_IN_libc || defined UP
1346 +#if defined NOT_IN_libc || defined UP || 1
1347 # define __lll_lock_asm_start LOCK_INSTR "cmpxchgl %1, %2\n\t"
1349 # define __lll_lock_asm_start "cmpl $0, %%gs:%P6\n\t" \
1350 @@ -443,7 +443,7 @@ LLL_STUB_UNWIND_INFO_END
1354 -#if defined NOT_IN_libc || defined UP
1355 +#if defined NOT_IN_libc || defined UP || 1
1356 # define __lll_unlock_asm LOCK_INSTR "subl $1, %0\n\t"
1358 # define __lll_unlock_asm "cmpl $0, %%gs:%P3\n\t" \
1359 diff --git a/sysdeps/i386/elf/start.S b/sysdeps/i386/elf/start.S
1360 index d2275a3..930a86f 100644
1361 --- a/sysdeps/i386/elf/start.S
1362 +++ b/sysdeps/i386/elf/start.S
1363 @@ -82,6 +82,7 @@ _start:
1364 which grow downwards). */
1368 pushl %edx /* Push address of the shared library
1369 termination function. */
1371 diff --git a/sysdeps/i386/i486/bits/atomic.h b/sysdeps/i386/i486/bits/atomic.h
1372 index 21eea71..e6c4696 100644
1373 --- a/sysdeps/i386/i486/bits/atomic.h
1374 +++ b/sysdeps/i386/i486/bits/atomic.h
1375 @@ -107,6 +107,14 @@ typedef uintmax_t uatomic_max_t;
1376 "i" (offsetof (tcbhead_t, multiple_threads))); \
1380 +#define __arch_c_compare_and_exchange_val_32_acq(mem, newval, oldval) \
1381 + ({ __typeof (*mem) ret; \
1382 + __asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \
1383 + : "=a" (ret), "=m" (*mem) \
1384 + : "r" (newval), "m" (*mem), "0" (oldval)); \
1387 #define __arch_c_compare_and_exchange_val_32_acq(mem, newval, oldval) \
1388 ({ __typeof (*mem) ret; \
1389 __asm __volatile ("cmpl $0, %%gs:%P5\n\t" \
1390 @@ -117,6 +125,7 @@ typedef uintmax_t uatomic_max_t;
1391 : "r" (newval), "m" (*mem), "0" (oldval), \
1392 "i" (offsetof (tcbhead_t, multiple_threads))); \
1396 /* XXX We do not really need 64-bit compare-and-exchange. At least
1397 not in the moment. Using it would mean causing portability
1398 @@ -255,8 +264,13 @@ typedef uintmax_t uatomic_max_t;
1399 __arch_exchange_and_add_body (LOCK_PREFIX, __arch, mem, value)
1403 +#define __arch_exchange_and_add_cprefix \
1406 #define __arch_exchange_and_add_cprefix \
1407 "cmpl $0, %%gs:%P4\n\tje 0f\n\tlock\n0:\t"
1410 #define catomic_exchange_and_add(mem, value) \
1411 __arch_exchange_and_add_body (__arch_exchange_and_add_cprefix, __arch_c, \
1412 @@ -300,8 +314,9 @@ typedef uintmax_t uatomic_max_t;
1413 #define atomic_add(mem, value) \
1414 __arch_add_body (LOCK_PREFIX, __arch, mem, value)
1416 -#define __arch_add_cprefix \
1417 - "cmpl $0, %%gs:%P3\n\tje 0f\n\tlock\n0:\t"
1418 +/* #define __arch_add_cprefix \ */
1419 +/* "cmpl $0, %%gs:%P3\n\tje 0f\n\tlock\n0:\t" */
1420 +#define __arch_add_cprefix LOCK_PREFIX
1422 #define catomic_add(mem, value) \
1423 __arch_add_body (__arch_add_cprefix, __arch_c, mem, value)
1424 @@ -376,8 +391,9 @@ typedef uintmax_t uatomic_max_t;
1426 #define atomic_increment(mem) __arch_increment_body (LOCK_PREFIX, __arch, mem)
1428 -#define __arch_increment_cprefix \
1429 - "cmpl $0, %%gs:%P2\n\tje 0f\n\tlock\n0:\t"
1430 +/* #define __arch_increment_cprefix \ */
1431 +/* "cmpl $0, %%gs:%P2\n\tje 0f\n\tlock\n0:\t" */
1432 +#define __arch_increment_cprefix LOCK_PREFIX
1434 #define catomic_increment(mem) \
1435 __arch_increment_body (__arch_increment_cprefix, __arch_c, mem)
1436 @@ -433,8 +449,9 @@ typedef uintmax_t uatomic_max_t;
1438 #define atomic_decrement(mem) __arch_decrement_body (LOCK_PREFIX, __arch, mem)
1440 -#define __arch_decrement_cprefix \
1441 - "cmpl $0, %%gs:%P2\n\tje 0f\n\tlock\n0:\t"
1442 +/* #define __arch_decrement_cprefix \ */
1443 +/* "cmpl $0, %%gs:%P2\n\tje 0f\n\tlock\n0:\t" */
1444 +#define __arch_decrement_cprefix LOCK_PREFIX
1446 #define catomic_decrement(mem) \
1447 __arch_decrement_body (__arch_decrement_cprefix, __arch_c, mem)
1448 @@ -542,7 +559,8 @@ typedef uintmax_t uatomic_max_t;
1450 #define atomic_or(mem, mask) __arch_or_body (LOCK_PREFIX, mem, mask)
1452 -#define __arch_or_cprefix \
1453 - "cmpl $0, %%gs:%P3\n\tje 0f\n\tlock\n0:\t"
1454 +/* #define __arch_or_cprefix \ */
1455 +/* "cmpl $0, %%gs:%P3\n\tje 0f\n\tlock\n0:\t" */
1456 +#define __arch_or_cprefix LOCK_PREFIX
1458 #define catomic_or(mem, mask) __arch_or_body (__arch_or_cprefix, mem, mask)
1459 diff --git a/sysdeps/nacl/brk.c b/sysdeps/nacl/brk.c
1460 new file mode 100644
1461 index 0000000..96437ee
1463 +++ b/sysdeps/nacl/brk.c
1467 +#include <unistd.h>
1468 +#include <sysdep.h>
1470 +void *__curbrk = 0;
1471 +weak_alias (__curbrk, ___brk_addr)
1473 +__asm__(".global __NaClSysBrk; __NaClSysBrk = 0x1280");
1475 +void *__NaClSysBrk(void *addr);
1477 +int __brk (void *addr)
1479 + __curbrk = __NaClSysBrk(addr);
1482 +weak_alias (__brk, brk)
1483 diff --git a/sysdeps/nacl/write.c b/sysdeps/nacl/write.c
1484 new file mode 100644
1485 index 0000000..3e7c894
1487 +++ b/sysdeps/nacl/write.c
1491 +#include <unistd.h>
1492 +#include <sysdep.h>
1494 +__asm__(".global __gnacl_write; __gnacl_write = 0x11a0 ");
1496 +int __gnacl_write(int desc, void const *buf, size_t count);
1498 +int __write(int desc, void const *buf, size_t count)
1500 + int result = __gnacl_write(desc, buf, count);
1505 +weak_alias (__write, write)
1506 +strong_alias (__write, __libc_write)
1507 +strong_alias (__write, __write_nocancel)
1508 diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list
1509 index 04ed63c..48ef960 100644
1510 --- a/sysdeps/unix/syscalls.list
1511 +++ b/sysdeps/unix/syscalls.list
1512 @@ -62,5 +62,4 @@ umask - umask Ei:i __umask umask
1513 uname - uname i:p __uname uname
1514 unlink - unlink i:s __unlink unlink
1515 utimes - utimes i:sp __utimes utimes
1516 -write - write Ci:ibn __libc_write __write write
1517 writev - writev Ci:ipi __writev writev
1518 diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
1519 index 08ae9aa..346d90c 100644
1520 --- a/sysdeps/unix/sysv/linux/dl-sysdep.c
1521 +++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
1522 @@ -65,6 +65,7 @@ int
1524 _dl_discover_osversion (void)
1527 #if (defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO) && defined SHARED
1528 if (GLRO(dl_sysinfo_map) != NULL)
1530 @@ -151,4 +152,6 @@ _dl_discover_osversion (void)
1531 version <<= 8 * (3 - parts);
1537 diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S
1538 index f73a4b5..812e85e 100644
1539 --- a/sysdeps/unix/sysv/linux/i386/clone.S
1540 +++ b/sysdeps/unix/sysv/linux/i386/clone.S
1541 @@ -50,19 +50,19 @@ ENTRY (BP_SYM (__clone))
1542 /* Sanity check arguments. */
1544 movl FUNC(%esp),%ecx /* no NULL function pointers */
1547 jecxz SYSCALL_ERROR_LABEL
1551 jz SYSCALL_ERROR_LABEL
1554 movl STACK(%esp),%ecx /* no NULL stack pointers */
1557 jecxz SYSCALL_ERROR_LABEL
1561 jz SYSCALL_ERROR_LABEL
1565 /* Insert the argument onto the new stack. Make sure the new
1566 thread is started with an alignment of (mod 16). */