Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2svn <>2013-06-07 12:43:02 +0400
committercvs2svn <>2013-06-07 12:43:02 +0400
commitdbd7b8d510db6798797e84163d4c38fb57fad890 (patch)
treec077d5668f02a2682059188b876735baa29bbcb9
parentc82eac05c783fa1cb82eac9216dab1ed8aa482ae (diff)
This commit was manufactured by cvs2svn to create tag 'cygwin-cygwin-1_7_20-release
1_7_20-release'. Sprout from cygwin-64bit-premerge-branch 2013-04-22 17:11:23 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch 'cygwin-64bit-' Cherrypick from master 2013-06-07 08:43:01 UTC Corinna Vinschen <corinna@vinschen.de> ' * posix.sgml (std-notes): Fix typo.': COPYING.NEWLIB ChangeLog config.guess config.sub config/ChangeLog config/bootstrap-asan.mk config/dfp.m4 config/picflag.m4 include/ChangeLog include/elf/ChangeLog include/elf/aarch64.h include/elf/common.h include/elf/mips.h include/elf/msp430.h include/opcode/ChangeLog include/opcode/avr.h include/opcode/mips.h include/opcode/msp430.h newlib/ChangeLog newlib/MAINTAINERS newlib/configure newlib/configure.host newlib/configure.in newlib/libc/configure newlib/libc/configure.in newlib/libc/ctype/ctype_.c newlib/libc/ctype/isalnum.c newlib/libc/ctype/isalpha.c newlib/libc/ctype/isblank.c newlib/libc/ctype/iscntrl.c newlib/libc/ctype/isdigit.c newlib/libc/ctype/islower.c newlib/libc/ctype/isprint.c newlib/libc/ctype/ispunct.c newlib/libc/ctype/isxdigit.c newlib/libc/include/machine/ieeefp.h newlib/libc/include/machine/setjmp.h newlib/libc/include/reent.h newlib/libc/include/sys/cdefs.h newlib/libc/include/sys/config.h newlib/libc/include/sys/features.h newlib/libc/include/sys/reent.h newlib/libc/include/sys/stat.h newlib/libc/libc.texinfo newlib/libc/machine/arm/Makefile.am newlib/libc/machine/arm/Makefile.in newlib/libc/machine/arm/memcpy-armv7a.S newlib/libc/machine/arm/memcpy-armv7m.S newlib/libc/machine/arm/memcpy-stub.c newlib/libc/machine/arm/memcpy.S newlib/libc/machine/arm/strcmp.S newlib/libc/machine/configure newlib/libc/machine/configure.in newlib/libc/machine/powerpc/Makefile.am newlib/libc/machine/powerpc/Makefile.in newlib/libc/reent/reent.c newlib/libc/stdio/fgetc.c newlib/libc/stdio/fgetwc.c newlib/libc/stdio/fgetws.c newlib/libc/stdio/findfp.c newlib/libc/stdio/fputc.c newlib/libc/stdio/fputwc.c newlib/libc/stdio/fputws.c newlib/libc/stdio/getc.c newlib/libc/stdio/getchar.c newlib/libc/stdio/local.h newlib/libc/stdio/putc.c newlib/libc/stdio/putchar.c newlib/libc/stdio/scanf.c newlib/libc/stdio/setvbuf.c newlib/libc/stdio/ungetwc.c newlib/libc/stdio/vfscanf.c newlib/libc/stdio/vfwscanf.c newlib/libc/stdio/viprintf.c newlib/libc/stdio/viscanf.c newlib/libc/stdio/vprintf.c newlib/libc/stdio/vscanf.c newlib/libc/stdio/vwprintf.c newlib/libc/stdio/vwscanf.c newlib/libc/stdio/wscanf.c newlib/libc/stdlib/Makefile.am newlib/libc/stdlib/Makefile.in newlib/libc/stdlib/__atexit.c newlib/libc/stdlib/__call_atexit.c newlib/libc/stdlib/ecvtbuf.c newlib/libc/stdlib/mblen.c newlib/libc/stdlib/mbrlen.c newlib/libc/stdlib/mbrtowc.c newlib/libc/stdlib/mbtowc.c newlib/libc/stdlib/nano-mallocr.c newlib/libc/stdlib/rand.c newlib/libc/stdlib/strtod.c newlib/libc/stdlib/wcrtomb.c newlib/libc/stdlib/wctob.c newlib/libc/stdlib/wctomb.c newlib/libc/string/strtok.c newlib/libc/time/asctime.c newlib/libc/time/gmtime.c newlib/libc/time/lcltime.c newlib/libm/libm.texinfo winsup/cygserver/ChangeLog winsup/cygserver/ChangeLog.64bit winsup/cygserver/Makefile.in winsup/cygserver/bsd_helper.cc winsup/cygserver/bsd_helper.h winsup/cygserver/bsd_log.cc winsup/cygserver/bsd_log.h winsup/cygserver/bsd_mutex.cc winsup/cygserver/client.cc winsup/cygserver/cygserver.cc winsup/cygserver/msg.cc winsup/cygserver/process.h winsup/cygserver/sem.cc winsup/cygserver/shm.cc winsup/cygserver/sysv_shm.cc winsup/cygserver/threaded_queue.h winsup/cygwin/ChangeLog winsup/cygwin/ChangeLog.64bit winsup/cygwin/Makefile.in winsup/cygwin/aclocal.m4 winsup/cygwin/advapi32.cc winsup/cygwin/autoload.cc winsup/cygwin/automode.c winsup/cygwin/binmode.c winsup/cygwin/child_info.h winsup/cygwin/common.din winsup/cygwin/configure winsup/cygwin/configure.ac winsup/cygwin/cpuid.h winsup/cygwin/cygerrno.h winsup/cygwin/cygheap.cc winsup/cygwin/cygheap.h winsup/cygwin/cygmagic winsup/cygwin/cygmalloc.h winsup/cygwin/cygserver.h winsup/cygwin/cygserver_ipc.h winsup/cygwin/cygthread.cc winsup/cygwin/cygtls.cc winsup/cygwin/cygtls.h winsup/cygwin/cygwin.sc.in winsup/cygwin/dcrt0.cc winsup/cygwin/debug.h winsup/cygwin/devices.cc winsup/cygwin/devices.h winsup/cygwin/devices.in winsup/cygwin/dir.cc winsup/cygwin/dlfcn.cc winsup/cygwin/dll_init.cc winsup/cygwin/dll_init.h winsup/cygwin/dtable.cc winsup/cygwin/environ.cc winsup/cygwin/environ.h winsup/cygwin/errno.cc winsup/cygwin/exception.h winsup/cygwin/exceptions.cc winsup/cygwin/external.cc winsup/cygwin/fcntl.cc winsup/cygwin/fenv.cc winsup/cygwin/fhandler.cc winsup/cygwin/fhandler.h winsup/cygwin/fhandler_clipboard.cc winsup/cygwin/fhandler_console.cc winsup/cygwin/fhandler_dev.cc winsup/cygwin/fhandler_disk_file.cc winsup/cygwin/fhandler_dsp.cc winsup/cygwin/fhandler_fifo.cc winsup/cygwin/fhandler_floppy.cc winsup/cygwin/fhandler_mailslot.cc winsup/cygwin/fhandler_mem.cc winsup/cygwin/fhandler_netdrive.cc winsup/cygwin/fhandler_proc.cc winsup/cygwin/fhandler_process.cc winsup/cygwin/fhandler_procnet.cc winsup/cygwin/fhandler_procsys.cc winsup/cygwin/fhandler_procsysvipc.cc winsup/cygwin/fhandler_random.cc winsup/cygwin/fhandler_raw.cc winsup/cygwin/fhandler_registry.cc winsup/cygwin/fhandler_serial.cc winsup/cygwin/fhandler_socket.cc winsup/cygwin/fhandler_tape.cc winsup/cygwin/fhandler_termios.cc winsup/cygwin/fhandler_tty.cc winsup/cygwin/fhandler_virtual.cc winsup/cygwin/fhandler_virtual.h winsup/cygwin/fhandler_windows.cc winsup/cygwin/fhandler_zero.cc winsup/cygwin/flock.cc winsup/cygwin/fork.cc winsup/cygwin/gendef winsup/cygwin/gentls_offsets winsup/cygwin/glob.cc winsup/cygwin/globals.cc winsup/cygwin/grp.cc winsup/cygwin/heap.cc winsup/cygwin/hookapi.cc winsup/cygwin/i686.din winsup/cygwin/include/a.out.h winsup/cygwin/include/asm/byteorder.h winsup/cygwin/include/bits/wordsize.h winsup/cygwin/include/cygwin/acl.h winsup/cygwin/include/cygwin/config.h winsup/cygwin/include/cygwin/cygwin_dll.h winsup/cygwin/include/cygwin/grp.h winsup/cygwin/include/cygwin/if.h winsup/cygwin/include/cygwin/ipc.h winsup/cygwin/include/cygwin/msg.h winsup/cygwin/include/cygwin/sem.h winsup/cygwin/include/cygwin/shm.h winsup/cygwin/include/cygwin/signal.h winsup/cygwin/include/cygwin/socket.h winsup/cygwin/include/cygwin/stat.h winsup/cygwin/include/cygwin/stdlib.h winsup/cygwin/include/cygwin/sysproto.h winsup/cygwin/include/cygwin/time.h winsup/cygwin/include/cygwin/types.h winsup/cygwin/include/cygwin/version.h winsup/cygwin/include/fcntl.h winsup/cygwin/include/fts.h winsup/cygwin/include/ftw.h winsup/cygwin/include/glob.h winsup/cygwin/include/inttypes.h winsup/cygwin/include/io.h winsup/cygwin/include/limits.h winsup/cygwin/include/mntent.h winsup/cygwin/include/stdint.h winsup/cygwin/include/sys/cygwin.h winsup/cygwin/include/sys/dirent.h winsup/cygwin/include/sys/resource.h winsup/cygwin/include/sys/socket.h winsup/cygwin/include/sys/strace.h winsup/cygwin/init.cc winsup/cygwin/ioctl.cc winsup/cygwin/ipc.cc winsup/cygwin/kernel32.cc winsup/cygwin/lc_msg.h winsup/cygwin/lib/_cygwin_crt0_common.cc winsup/cygwin/lib/crt0.h winsup/cygwin/lib/cygwin_attach_dll.c winsup/cygwin/lib/premain0.c winsup/cygwin/lib/premain1.c winsup/cygwin/lib/premain2.c winsup/cygwin/lib/premain3.c winsup/cygwin/libc/arc4random.cc winsup/cygwin/libc/base64.c winsup/cygwin/libc/bsdlib.cc winsup/cygwin/libc/fts.c winsup/cygwin/libc/ftw.c winsup/cygwin/libc/inet_network.c winsup/cygwin/libc/minires-os-if.c winsup/cygwin/libc/minires.c winsup/cygwin/libc/nftw.c winsup/cygwin/libc/rcmd.cc winsup/cygwin/libc/rexec.cc winsup/cygwin/libstdcxx_wrapper.cc winsup/cygwin/localtime.cc winsup/cygwin/malloc_wrapper.cc winsup/cygwin/miscfuncs.cc winsup/cygwin/mkimport winsup/cygwin/mktemp.cc winsup/cygwin/mmap.cc winsup/cygwin/mount.cc winsup/cygwin/mount.h winsup/cygwin/msg.cc winsup/cygwin/mtinfo.h winsup/cygwin/net.cc winsup/cygwin/netdb.cc winsup/cygwin/nfs.h winsup/cygwin/nlsfuncs.cc winsup/cygwin/ntdll.h winsup/cygwin/ntea.cc winsup/cygwin/passwd.cc winsup/cygwin/path.cc winsup/cygwin/path.h winsup/cygwin/perprocess.h winsup/cygwin/pinfo.cc winsup/cygwin/pinfo.h winsup/cygwin/pipe.cc winsup/cygwin/poll.cc winsup/cygwin/posix.sgml winsup/cygwin/posix_ipc.cc winsup/cygwin/profil.c winsup/cygwin/profil.h winsup/cygwin/pseudo-reloc.cc winsup/cygwin/pwdgrp.h winsup/cygwin/regex/engine.c winsup/cygwin/regex/regcomp.c winsup/cygwin/registry.cc winsup/cygwin/regparm.h winsup/cygwin/release/1.7.19 winsup/cygwin/release/1.7.20 winsup/cygwin/resource.cc winsup/cygwin/sched.cc winsup/cygwin/sec_acl.cc winsup/cygwin/sec_auth.cc winsup/cygwin/sec_helper.cc winsup/cygwin/security.cc winsup/cygwin/security.h winsup/cygwin/select.cc winsup/cygwin/select.h winsup/cygwin/sem.cc winsup/cygwin/shared.cc winsup/cygwin/shared_info.h winsup/cygwin/shm.cc winsup/cygwin/signal.cc winsup/cygwin/sigproc.cc winsup/cygwin/sigproc.h winsup/cygwin/smallprint.cc winsup/cygwin/spawn.cc winsup/cygwin/speclib winsup/cygwin/spinlock.h winsup/cygwin/strace.cc winsup/cygwin/strfuncs.cc winsup/cygwin/strsig.cc winsup/cygwin/sync.cc winsup/cygwin/sync.h winsup/cygwin/syscalls.cc winsup/cygwin/sysconf.cc winsup/cygwin/syslog.cc winsup/cygwin/termios.cc winsup/cygwin/textmode.c winsup/cygwin/textreadmode.c winsup/cygwin/thread.cc winsup/cygwin/thread.h winsup/cygwin/timer.cc winsup/cygwin/times.cc winsup/cygwin/tlsoffsets.h winsup/cygwin/tlsoffsets64.h winsup/cygwin/tty.cc winsup/cygwin/tty.h winsup/cygwin/uinfo.cc winsup/cygwin/wait.cc winsup/cygwin/winbase.h winsup/cygwin/wincap.cc winsup/cygwin/wincap.h winsup/cygwin/window.cc winsup/cygwin/winlean.h winsup/cygwin/winsup.h winsup/cygwin/wow64.cc winsup/cygwin/wow64.h winsup/cygwin/x86_64.din winsup/doc/.cvsignore winsup/doc/ChangeLog winsup/doc/Makefile.in winsup/doc/Wishlist winsup/doc/bodysnatcher.pl winsup/doc/configure winsup/doc/configure.ac winsup/doc/cygserver.xml winsup/doc/cygwin-api.in.xml winsup/doc/cygwin-ug-net.xml winsup/doc/cygwin.xsl winsup/doc/cygwinenv.xml winsup/doc/dll.xml winsup/doc/effectively.xml winsup/doc/faq-api.xml winsup/doc/faq-copyright.xml winsup/doc/faq-programming.xml winsup/doc/faq-resources.xml winsup/doc/faq-setup.xml winsup/doc/faq-using.xml winsup/doc/faq-what.xml winsup/doc/faq.xml winsup/doc/filemodes.xml winsup/doc/gcc.xml winsup/doc/gdb.xml winsup/doc/highlights.xml winsup/doc/legal.xml winsup/doc/new-features.xml winsup/doc/ntsec.xml winsup/doc/ov-ex-unix.xml winsup/doc/ov-ex-win.xml winsup/doc/overview.xml winsup/doc/pathnames.xml winsup/doc/programming.xml winsup/doc/setup-env.xml winsup/doc/setup-files.xml winsup/doc/setup-locale.xml winsup/doc/setup-maxmem.xml winsup/doc/setup-net.xml winsup/doc/specialnames.xml winsup/doc/textbinary.xml winsup/doc/ug-info.xml winsup/doc/using.xml winsup/doc/windres.xml winsup/doc/xidepend winsup/lsaauth/ChangeLog winsup/lsaauth/ChangeLog.64bit winsup/lsaauth/Makefile.in winsup/lsaauth/configure winsup/lsaauth/configure.ac winsup/utils/ChangeLog winsup/utils/ChangeLog.64bit winsup/utils/Makefile.in winsup/utils/aclocal.m4 winsup/utils/configure winsup/utils/cygcheck.cc winsup/utils/dumper.cc winsup/utils/dumper.h winsup/utils/kill.cc winsup/utils/ldd.cc winsup/utils/locale.cc winsup/utils/mkgroup.c winsup/utils/mkpasswd.c winsup/utils/module_info.cc winsup/utils/mount.cc winsup/utils/parse_pe.cc winsup/utils/passwd.c winsup/utils/path.cc winsup/utils/ps.cc winsup/utils/regtool.cc winsup/utils/ssp.c winsup/utils/strace.cc winsup/utils/tzset.c winsup/utils/utils.xml Delete: COPYING3 COPYING3.LIB config.rpath configure.ac ltgcc.m4 newlib/libc/machine/aarch64/Makefile.am newlib/libc/machine/aarch64/Makefile.in newlib/libc/machine/aarch64/aclocal.m4 newlib/libc/machine/aarch64/configure newlib/libc/machine/aarch64/configure.in newlib/libc/machine/aarch64/memcmp-stub.c newlib/libc/machine/aarch64/memcmp.S newlib/libc/machine/aarch64/memcpy-stub.c newlib/libc/machine/aarch64/memcpy.S newlib/libc/machine/aarch64/memmove-stub.c newlib/libc/machine/aarch64/memmove.S newlib/libc/machine/aarch64/memset-stub.c newlib/libc/machine/aarch64/memset.S newlib/libc/machine/aarch64/setjmp.S newlib/libc/machine/aarch64/strcmp-stub.c newlib/libc/machine/aarch64/strcmp.S newlib/libc/machine/aarch64/strlen-stub.c newlib/libc/machine/aarch64/strlen.S newlib/libc/machine/aarch64/strncmp-stub.c newlib/libc/machine/aarch64/strncmp.S newlib/libc/machine/aarch64/strnlen-stub.c newlib/libc/machine/aarch64/strnlen.S newlib/libc/machine/epiphany/Makefile.am newlib/libc/machine/epiphany/Makefile.in newlib/libc/machine/epiphany/aclocal.m4 newlib/libc/machine/epiphany/configure newlib/libc/machine/epiphany/configure.in newlib/libc/machine/epiphany/machine/stdlib.h newlib/libc/machine/epiphany/setjmp.S newlib/libc/machine/powerpc/times.c newlib/libc/sys/epiphany/Makefile.am newlib/libc/sys/epiphany/Makefile.in newlib/libc/sys/epiphany/aclocal.m4 newlib/libc/sys/epiphany/configure newlib/libc/sys/epiphany/configure.in newlib/libc/sys/epiphany/e_printf.c newlib/libm/machine/aarch64/Makefile.am newlib/libm/machine/aarch64/Makefile.in newlib/libm/machine/aarch64/aclocal.m4 newlib/libm/machine/aarch64/configure newlib/libm/machine/aarch64/configure.in newlib/libm/machine/aarch64/s_ceil.c newlib/libm/machine/aarch64/s_floor.c newlib/libm/machine/aarch64/s_fma.c newlib/libm/machine/aarch64/s_fmax.c newlib/libm/machine/aarch64/s_fmin.c newlib/libm/machine/aarch64/s_llrint.c newlib/libm/machine/aarch64/s_llround.c newlib/libm/machine/aarch64/s_lrint.c newlib/libm/machine/aarch64/s_lround.c newlib/libm/machine/aarch64/s_nearbyint.c newlib/libm/machine/aarch64/s_rint.c newlib/libm/machine/aarch64/s_round.c newlib/libm/machine/aarch64/s_trunc.c newlib/libm/machine/aarch64/sf_ceil.c newlib/libm/machine/aarch64/sf_floor.c newlib/libm/machine/aarch64/sf_fma.c newlib/libm/machine/aarch64/sf_fmax.c newlib/libm/machine/aarch64/sf_fmin.c newlib/libm/machine/aarch64/sf_llrint.c newlib/libm/machine/aarch64/sf_llround.c newlib/libm/machine/aarch64/sf_lrint.c newlib/libm/machine/aarch64/sf_lround.c newlib/libm/machine/aarch64/sf_nearbyint.c newlib/libm/machine/aarch64/sf_rint.c newlib/libm/machine/aarch64/sf_round.c newlib/libm/machine/aarch64/sf_trunc.c winsup/cygwin/cygwin.din winsup/cygwin/cygwin.sc winsup/doc/cygserver.sgml winsup/doc/cygwin-api.in.sgml winsup/doc/cygwin-ug-net.in.sgml winsup/doc/cygwin-ug.in.sgml winsup/doc/cygwin.dsl winsup/doc/cygwinenv.sgml winsup/doc/dll.sgml winsup/doc/effectively.sgml winsup/doc/faq-sections.xml winsup/doc/filemodes.sgml winsup/doc/gcc.sgml winsup/doc/gdb.sgml winsup/doc/legal.sgml winsup/doc/new-features.sgml winsup/doc/ntsec.sgml winsup/doc/overview.sgml winsup/doc/overview2.sgml winsup/doc/pathnames.sgml winsup/doc/programming.sgml winsup/doc/setup-net.sgml winsup/doc/setup.sgml winsup/doc/setup2.sgml winsup/doc/textbinary.sgml winsup/doc/using.sgml winsup/doc/windres.sgml winsup/utils/utils.sgml
-rw-r--r--COPYING.NEWLIB31
-rw-r--r--COPYING3674
-rw-r--r--COPYING3.LIB165
-rw-r--r--ChangeLog14
-rwxr-xr-xconfig.guess25
-rwxr-xr-xconfig.rpath543
-rwxr-xr-xconfig.sub23
-rw-r--r--config/ChangeLog10
-rw-r--r--config/bootstrap-asan.mk1
-rw-r--r--config/dfp.m42
-rw-r--r--config/picflag.m44
-rw-r--r--configure.ac3293
-rw-r--r--include/ChangeLog5
-rw-r--r--include/elf/ChangeLog29
-rw-r--r--include/elf/aarch64.h4
-rw-r--r--include/elf/common.h5
-rw-r--r--include/elf/mips.h11
-rw-r--r--include/elf/msp430.h47
-rw-r--r--include/opcode/ChangeLog17
-rw-r--r--include/opcode/avr.h13
-rw-r--r--include/opcode/mips.h19
-rw-r--r--include/opcode/msp430.h70
-rw-r--r--ltgcc.m460
-rw-r--r--newlib/ChangeLog199
-rw-r--r--newlib/MAINTAINERS2
-rwxr-xr-xnewlib/configure28
-rw-r--r--newlib/configure.host18
-rw-r--r--newlib/configure.in25
-rwxr-xr-xnewlib/libc/configure32
-rw-r--r--newlib/libc/configure.in10
-rw-r--r--newlib/libc/ctype/ctype_.c11
-rw-r--r--newlib/libc/ctype/isalnum.c2
-rw-r--r--newlib/libc/ctype/isalpha.c4
-rw-r--r--newlib/libc/ctype/isblank.c3
-rw-r--r--newlib/libc/ctype/iscntrl.c4
-rw-r--r--newlib/libc/ctype/isdigit.c4
-rw-r--r--newlib/libc/ctype/islower.c3
-rw-r--r--newlib/libc/ctype/isprint.c3
-rw-r--r--newlib/libc/ctype/ispunct.c4
-rw-r--r--newlib/libc/ctype/isxdigit.c4
-rw-r--r--newlib/libc/include/machine/ieeefp.h13
-rw-r--r--newlib/libc/include/machine/setjmp.h53
-rw-r--r--newlib/libc/include/reent.h12
-rw-r--r--newlib/libc/include/sys/cdefs.h4
-rw-r--r--newlib/libc/include/sys/config.h16
-rw-r--r--newlib/libc/include/sys/features.h12
-rw-r--r--newlib/libc/include/sys/reent.h94
-rw-r--r--newlib/libc/include/sys/stat.h2
-rw-r--r--newlib/libc/libc.texinfo4
-rw-r--r--newlib/libc/machine/aarch64/Makefile.am34
-rw-r--r--newlib/libc/machine/aarch64/Makefile.in553
-rw-r--r--newlib/libc/machine/aarch64/aclocal.m41012
-rwxr-xr-xnewlib/libc/machine/aarch64/configure4748
-rw-r--r--newlib/libc/machine/aarch64/configure.in14
-rw-r--r--newlib/libc/machine/aarch64/memcmp-stub.c31
-rw-r--r--newlib/libc/machine/aarch64/memcmp.S167
-rw-r--r--newlib/libc/machine/aarch64/memcpy-stub.c31
-rw-r--r--newlib/libc/machine/aarch64/memcpy.S195
-rw-r--r--newlib/libc/machine/aarch64/memmove-stub.c31
-rw-r--r--newlib/libc/machine/aarch64/memmove.S329
-rw-r--r--newlib/libc/machine/aarch64/memset-stub.c31
-rw-r--r--newlib/libc/machine/aarch64/memset.S246
-rw-r--r--newlib/libc/machine/aarch64/setjmp.S74
-rw-r--r--newlib/libc/machine/aarch64/strcmp-stub.c31
-rw-r--r--newlib/libc/machine/aarch64/strcmp.S173
-rw-r--r--newlib/libc/machine/aarch64/strlen-stub.c31
-rw-r--r--newlib/libc/machine/aarch64/strlen.S136
-rw-r--r--newlib/libc/machine/aarch64/strncmp-stub.c31
-rw-r--r--newlib/libc/machine/aarch64/strncmp.S228
-rw-r--r--newlib/libc/machine/aarch64/strnlen-stub.c31
-rw-r--r--newlib/libc/machine/aarch64/strnlen.S187
-rw-r--r--newlib/libc/machine/arm/Makefile.am6
-rw-r--r--newlib/libc/machine/arm/Makefile.in5
-rw-r--r--newlib/libc/machine/arm/memcpy-armv7a.S619
-rw-r--r--newlib/libc/machine/arm/memcpy-armv7m.S321
-rw-r--r--newlib/libc/machine/arm/memcpy-stub.c10
-rw-r--r--newlib/libc/machine/arm/memcpy.S650
-rw-r--r--newlib/libc/machine/arm/strcmp.S103
-rwxr-xr-xnewlib/libc/machine/configure10
-rw-r--r--newlib/libc/machine/configure.in2
-rw-r--r--newlib/libc/machine/epiphany/Makefile.am42
-rw-r--r--newlib/libc/machine/epiphany/Makefile.in440
-rw-r--r--newlib/libc/machine/epiphany/aclocal.m41012
-rwxr-xr-xnewlib/libc/machine/epiphany/configure4748
-rw-r--r--newlib/libc/machine/epiphany/configure.in41
-rw-r--r--newlib/libc/machine/epiphany/machine/stdlib.h15
-rw-r--r--newlib/libc/machine/epiphany/setjmp.S65
-rw-r--r--newlib/libc/machine/powerpc/Makefile.am2
-rw-r--r--newlib/libc/machine/powerpc/Makefile.in18
-rw-r--r--newlib/libc/machine/powerpc/times.c36
-rw-r--r--newlib/libc/reent/reent.c38
-rw-r--r--newlib/libc/stdio/fgetc.c6
-rw-r--r--newlib/libc/stdio/fgetwc.c6
-rw-r--r--newlib/libc/stdio/fgetws.c6
-rw-r--r--newlib/libc/stdio/findfp.c4
-rw-r--r--newlib/libc/stdio/fputc.c6
-rw-r--r--newlib/libc/stdio/fputwc.c6
-rw-r--r--newlib/libc/stdio/fputws.c6
-rw-r--r--newlib/libc/stdio/getc.c6
-rw-r--r--newlib/libc/stdio/getchar.c6
-rw-r--r--newlib/libc/stdio/local.h55
-rw-r--r--newlib/libc/stdio/putc.c6
-rw-r--r--newlib/libc/stdio/putchar.c6
-rw-r--r--newlib/libc/stdio/scanf.c5
-rw-r--r--newlib/libc/stdio/setvbuf.c9
-rw-r--r--newlib/libc/stdio/ungetwc.c6
-rw-r--r--newlib/libc/stdio/vfscanf.c6
-rw-r--r--newlib/libc/stdio/vfwscanf.c6
-rw-r--r--newlib/libc/stdio/viprintf.c6
-rw-r--r--newlib/libc/stdio/viscanf.c6
-rw-r--r--newlib/libc/stdio/vprintf.c6
-rw-r--r--newlib/libc/stdio/vscanf.c6
-rw-r--r--newlib/libc/stdio/vwprintf.c6
-rw-r--r--newlib/libc/stdio/vwscanf.c6
-rw-r--r--newlib/libc/stdio/wscanf.c5
-rw-r--r--newlib/libc/stdlib/Makefile.am98
-rw-r--r--newlib/libc/stdlib/Makefile.in94
-rw-r--r--newlib/libc/stdlib/__atexit.c20
-rw-r--r--newlib/libc/stdlib/__call_atexit.c10
-rw-r--r--newlib/libc/stdlib/ecvtbuf.c28
-rw-r--r--newlib/libc/stdlib/mblen.c7
-rw-r--r--newlib/libc/stdlib/mbrlen.c6
-rw-r--r--newlib/libc/stdlib/mbrtowc.c11
-rw-r--r--newlib/libc/stdlib/mbtowc.c7
-rw-r--r--newlib/libc/stdlib/nano-mallocr.c581
-rw-r--r--newlib/libc/stdlib/rand.c16
-rw-r--r--newlib/libc/stdlib/strtod.c155
-rw-r--r--newlib/libc/stdlib/wcrtomb.c11
-rw-r--r--newlib/libc/stdlib/wctob.c6
-rw-r--r--newlib/libc/stdlib/wctomb.c8
-rw-r--r--newlib/libc/string/strtok.c6
-rw-r--r--newlib/libc/sys/epiphany/Makefile.am43
-rw-r--r--newlib/libc/sys/epiphany/Makefile.in466
-rw-r--r--newlib/libc/sys/epiphany/aclocal.m41012
-rwxr-xr-xnewlib/libc/sys/epiphany/configure4748
-rw-r--r--newlib/libc/sys/epiphany/configure.in41
-rw-r--r--newlib/libc/sys/epiphany/e_printf.c150
-rw-r--r--newlib/libc/time/asctime.c6
-rw-r--r--newlib/libc/time/gmtime.c6
-rw-r--r--newlib/libc/time/lcltime.c6
-rw-r--r--newlib/libm/libm.texinfo8
-rw-r--r--newlib/libm/machine/aarch64/Makefile.am45
-rw-r--r--newlib/libm/machine/aarch64/Makefile.in640
-rw-r--r--newlib/libm/machine/aarch64/aclocal.m41012
-rwxr-xr-xnewlib/libm/machine/aarch64/configure4748
-rw-r--r--newlib/libm/machine/aarch64/configure.in14
-rw-r--r--newlib/libm/machine/aarch64/s_ceil.c35
-rw-r--r--newlib/libm/machine/aarch64/s_floor.c35
-rw-r--r--newlib/libm/machine/aarch64/s_fma.c35
-rw-r--r--newlib/libm/machine/aarch64/s_fmax.c35
-rw-r--r--newlib/libm/machine/aarch64/s_fmin.c35
-rw-r--r--newlib/libm/machine/aarch64/s_llrint.c38
-rw-r--r--newlib/libm/machine/aarch64/s_llround.c35
-rw-r--r--newlib/libm/machine/aarch64/s_lrint.c38
-rw-r--r--newlib/libm/machine/aarch64/s_lround.c35
-rw-r--r--newlib/libm/machine/aarch64/s_nearbyint.c35
-rw-r--r--newlib/libm/machine/aarch64/s_rint.c35
-rw-r--r--newlib/libm/machine/aarch64/s_round.c35
-rw-r--r--newlib/libm/machine/aarch64/s_trunc.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_ceil.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_floor.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_fma.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_fmax.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_fmin.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_llrint.c38
-rw-r--r--newlib/libm/machine/aarch64/sf_llround.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_lrint.c38
-rw-r--r--newlib/libm/machine/aarch64/sf_lround.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_nearbyint.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_rint.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_round.c35
-rw-r--r--newlib/libm/machine/aarch64/sf_trunc.c35
-rw-r--r--winsup/cygserver/ChangeLog4
-rw-r--r--winsup/cygserver/ChangeLog.64bit87
-rw-r--r--winsup/cygserver/Makefile.in2
-rw-r--r--winsup/cygserver/bsd_helper.cc2
-rw-r--r--winsup/cygserver/bsd_helper.h4
-rw-r--r--winsup/cygserver/bsd_log.cc4
-rw-r--r--winsup/cygserver/bsd_log.h4
-rw-r--r--winsup/cygserver/bsd_mutex.cc6
-rw-r--r--winsup/cygserver/client.cc8
-rw-r--r--winsup/cygserver/cygserver.cc51
-rw-r--r--winsup/cygserver/msg.cc2
-rw-r--r--winsup/cygserver/process.h4
-rw-r--r--winsup/cygserver/sem.cc2
-rw-r--r--winsup/cygserver/shm.cc2
-rw-r--r--winsup/cygserver/sysv_shm.cc6
-rw-r--r--winsup/cygserver/threaded_queue.h4
-rw-r--r--winsup/cygwin/ChangeLog362
-rw-r--r--winsup/cygwin/ChangeLog.64bit1877
-rw-r--r--winsup/cygwin/Makefile.in65
-rw-r--r--winsup/cygwin/aclocal.m46
-rw-r--r--winsup/cygwin/advapi32.cc2
-rw-r--r--winsup/cygwin/autoload.cc245
-rw-r--r--winsup/cygwin/automode.c6
-rw-r--r--winsup/cygwin/binmode.c6
-rw-r--r--winsup/cygwin/child_info.h8
-rw-r--r--winsup/cygwin/common.din (renamed from winsup/cygwin/cygwin.din)805
-rwxr-xr-xwinsup/cygwin/configure250
-rw-r--r--winsup/cygwin/configure.ac19
-rw-r--r--winsup/cygwin/cpuid.h26
-rw-r--r--winsup/cygwin/cygerrno.h11
-rw-r--r--winsup/cygwin/cygheap.cc126
-rw-r--r--winsup/cygwin/cygheap.h35
-rwxr-xr-xwinsup/cygwin/cygmagic4
-rw-r--r--winsup/cygwin/cygmalloc.h21
-rw-r--r--winsup/cygwin/cygserver.h8
-rw-r--r--winsup/cygwin/cygserver_ipc.h22
-rw-r--r--winsup/cygwin/cygthread.cc20
-rw-r--r--winsup/cygwin/cygtls.cc2
-rw-r--r--winsup/cygwin/cygtls.h38
-rw-r--r--winsup/cygwin/cygwin.sc.in (renamed from winsup/cygwin/cygwin.sc)55
-rw-r--r--winsup/cygwin/dcrt0.cc96
-rw-r--r--winsup/cygwin/debug.h6
-rw-r--r--winsup/cygwin/devices.cc6
-rw-r--r--winsup/cygwin/devices.h30
-rw-r--r--winsup/cygwin/devices.in6
-rw-r--r--winsup/cygwin/dir.cc6
-rw-r--r--winsup/cygwin/dlfcn.cc32
-rw-r--r--winsup/cygwin/dll_init.cc72
-rw-r--r--winsup/cygwin/dll_init.h14
-rw-r--r--winsup/cygwin/dtable.cc26
-rw-r--r--winsup/cygwin/environ.cc44
-rw-r--r--winsup/cygwin/environ.h8
-rw-r--r--winsup/cygwin/errno.cc8
-rw-r--r--winsup/cygwin/exception.h32
-rw-r--r--winsup/cygwin/exceptions.cc306
-rw-r--r--winsup/cygwin/external.cc28
-rw-r--r--winsup/cygwin/fcntl.cc49
-rwxr-xr-xwinsup/cygwin/fenv.cc3
-rw-r--r--winsup/cygwin/fhandler.cc172
-rw-r--r--winsup/cygwin/fhandler.h223
-rw-r--r--winsup/cygwin/fhandler_clipboard.cc12
-rw-r--r--winsup/cygwin/fhandler_console.cc24
-rw-r--r--winsup/cygwin/fhandler_dev.cc4
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc289
-rw-r--r--winsup/cygwin/fhandler_dsp.cc102
-rw-r--r--winsup/cygwin/fhandler_fifo.cc4
-rw-r--r--winsup/cygwin/fhandler_floppy.cc167
-rw-r--r--winsup/cygwin/fhandler_mailslot.cc6
-rw-r--r--winsup/cygwin/fhandler_mem.cc35
-rw-r--r--winsup/cygwin/fhandler_netdrive.cc8
-rw-r--r--winsup/cygwin/fhandler_proc.cc108
-rw-r--r--winsup/cygwin/fhandler_process.cc195
-rw-r--r--winsup/cygwin/fhandler_procnet.cc35
-rw-r--r--winsup/cygwin/fhandler_procsys.cc44
-rw-r--r--winsup/cygwin/fhandler_procsysvipc.cc48
-rw-r--r--winsup/cygwin/fhandler_random.cc12
-rw-r--r--winsup/cygwin/fhandler_raw.cc12
-rw-r--r--winsup/cygwin/fhandler_registry.cc16
-rw-r--r--winsup/cygwin/fhandler_serial.cc40
-rw-r--r--winsup/cygwin/fhandler_socket.cc301
-rw-r--r--winsup/cygwin/fhandler_tape.cc162
-rw-r--r--winsup/cygwin/fhandler_termios.cc7
-rw-r--r--winsup/cygwin/fhandler_tty.cc126
-rw-r--r--winsup/cygwin/fhandler_virtual.cc16
-rw-r--r--winsup/cygwin/fhandler_virtual.h2
-rw-r--r--winsup/cygwin/fhandler_windows.cc2
-rw-r--r--winsup/cygwin/fhandler_zero.cc6
-rw-r--r--winsup/cygwin/flock.cc291
-rw-r--r--winsup/cygwin/fork.cc49
-rwxr-xr-xwinsup/cygwin/gendef490
-rwxr-xr-xwinsup/cygwin/gentls_offsets17
-rw-r--r--winsup/cygwin/glob.cc10
-rw-r--r--winsup/cygwin/globals.cc142
-rw-r--r--winsup/cygwin/grp.cc169
-rw-r--r--winsup/cygwin/heap.cc91
-rw-r--r--winsup/cygwin/hookapi.cc264
-rw-r--r--winsup/cygwin/i686.din656
-rw-r--r--winsup/cygwin/include/a.out.h236
-rw-r--r--winsup/cygwin/include/asm/byteorder.h10
-rw-r--r--winsup/cygwin/include/bits/wordsize.h7
-rw-r--r--winsup/cygwin/include/cygwin/acl.h10
-rw-r--r--winsup/cygwin/include/cygwin/config.h22
-rw-r--r--winsup/cygwin/include/cygwin/cygwin_dll.h16
-rw-r--r--winsup/cygwin/include/cygwin/grp.h18
-rw-r--r--winsup/cygwin/include/cygwin/if.h4
-rw-r--r--winsup/cygwin/include/cygwin/ipc.h3
-rw-r--r--winsup/cygwin/include/cygwin/msg.h26
-rw-r--r--winsup/cygwin/include/cygwin/sem.h24
-rw-r--r--winsup/cygwin/include/cygwin/shm.h29
-rw-r--r--winsup/cygwin/include/cygwin/signal.h176
-rw-r--r--winsup/cygwin/include/cygwin/socket.h13
-rw-r--r--winsup/cygwin/include/cygwin/stat.h62
-rw-r--r--winsup/cygwin/include/cygwin/stdlib.h8
-rw-r--r--winsup/cygwin/include/cygwin/sysproto.h2
-rw-r--r--winsup/cygwin/include/cygwin/time.h4
-rw-r--r--winsup/cygwin/include/cygwin/types.h45
-rw-r--r--winsup/cygwin/include/cygwin/version.h10
-rw-r--r--winsup/cygwin/include/fcntl.h21
-rw-r--r--winsup/cygwin/include/fts.h10
-rw-r--r--winsup/cygwin/include/ftw.h6
-rw-r--r--winsup/cygwin/include/glob.h6
-rw-r--r--winsup/cygwin/include/inttypes.h5
-rw-r--r--winsup/cygwin/include/io.h7
-rw-r--r--winsup/cygwin/include/limits.h28
-rw-r--r--winsup/cygwin/include/mntent.h6
-rw-r--r--winsup/cygwin/include/stdint.h40
-rw-r--r--winsup/cygwin/include/sys/cygwin.h45
-rw-r--r--winsup/cygwin/include/sys/dirent.h23
-rw-r--r--winsup/cygwin/include/sys/resource.h2
-rw-r--r--winsup/cygwin/include/sys/socket.h9
-rw-r--r--winsup/cygwin/include/sys/strace.h5
-rw-r--r--winsup/cygwin/init.cc9
-rw-r--r--winsup/cygwin/ioctl.cc8
-rw-r--r--winsup/cygwin/ipc.cc2
-rw-r--r--winsup/cygwin/kernel32.cc2
-rw-r--r--winsup/cygwin/lc_msg.h17
-rw-r--r--winsup/cygwin/lib/_cygwin_crt0_common.cc51
-rw-r--r--winsup/cygwin/lib/crt0.h2
-rw-r--r--winsup/cygwin/lib/cygwin_attach_dll.c2
-rw-r--r--winsup/cygwin/lib/premain0.c5
-rw-r--r--winsup/cygwin/lib/premain1.c5
-rw-r--r--winsup/cygwin/lib/premain2.c5
-rw-r--r--winsup/cygwin/lib/premain3.c5
-rw-r--r--winsup/cygwin/libc/arc4random.cc363
-rw-r--r--winsup/cygwin/libc/base64.c316
-rw-r--r--winsup/cygwin/libc/bsdlib.cc4
-rw-r--r--winsup/cygwin/libc/fts.c18
-rw-r--r--winsup/cygwin/libc/ftw.c4
-rw-r--r--winsup/cygwin/libc/inet_network.c2
-rw-r--r--winsup/cygwin/libc/minires-os-if.c9
-rw-r--r--winsup/cygwin/libc/minires.c18
-rw-r--r--winsup/cygwin/libc/nftw.c4
-rw-r--r--winsup/cygwin/libc/rcmd.cc4
-rw-r--r--winsup/cygwin/libc/rexec.cc2
-rwxr-xr-xwinsup/cygwin/libstdcxx_wrapper.cc27
-rw-r--r--winsup/cygwin/localtime.cc1703
-rw-r--r--winsup/cygwin/malloc_wrapper.cc6
-rw-r--r--winsup/cygwin/miscfuncs.cc170
-rwxr-xr-xwinsup/cygwin/mkimport26
-rw-r--r--winsup/cygwin/mktemp.cc17
-rw-r--r--winsup/cygwin/mmap.cc293
-rw-r--r--winsup/cygwin/mount.cc80
-rw-r--r--winsup/cygwin/mount.h2
-rw-r--r--winsup/cygwin/msg.cc10
-rw-r--r--winsup/cygwin/mtinfo.h40
-rw-r--r--winsup/cygwin/net.cc371
-rw-r--r--winsup/cygwin/netdb.cc4
-rw-r--r--winsup/cygwin/nfs.h14
-rw-r--r--winsup/cygwin/nlsfuncs.cc17
-rw-r--r--winsup/cygwin/ntdll.h344
-rw-r--r--winsup/cygwin/ntea.cc4
-rw-r--r--winsup/cygwin/passwd.cc22
-rw-r--r--winsup/cygwin/path.cc434
-rw-r--r--winsup/cygwin/path.h33
-rw-r--r--winsup/cygwin/perprocess.h6
-rw-r--r--winsup/cygwin/pinfo.cc70
-rw-r--r--winsup/cygwin/pinfo.h19
-rw-r--r--winsup/cygwin/pipe.cc36
-rw-r--r--winsup/cygwin/poll.cc2
-rw-r--r--winsup/cygwin/posix.sgml33
-rw-r--r--winsup/cygwin/posix_ipc.cc84
-rw-r--r--winsup/cygwin/profil.c28
-rw-r--r--winsup/cygwin/profil.h14
-rw-r--r--winsup/cygwin/pseudo-reloc.cc12
-rw-r--r--winsup/cygwin/pwdgrp.h16
-rw-r--r--winsup/cygwin/regex/engine.c4
-rw-r--r--winsup/cygwin/regex/regcomp.c6
-rw-r--r--winsup/cygwin/registry.cc10
-rw-r--r--winsup/cygwin/regparm.h21
-rw-r--r--winsup/cygwin/release/1.7.1945
-rw-r--r--winsup/cygwin/release/1.7.209
-rw-r--r--winsup/cygwin/resource.cc21
-rw-r--r--winsup/cygwin/sched.cc127
-rw-r--r--winsup/cygwin/sec_acl.cc89
-rw-r--r--winsup/cygwin/sec_auth.cc51
-rw-r--r--winsup/cygwin/sec_helper.cc93
-rw-r--r--winsup/cygwin/security.cc68
-rw-r--r--winsup/cygwin/security.h101
-rw-r--r--winsup/cygwin/select.cc13
-rw-r--r--winsup/cygwin/select.h2
-rw-r--r--winsup/cygwin/sem.cc10
-rw-r--r--winsup/cygwin/shared.cc62
-rw-r--r--winsup/cygwin/shared_info.h3
-rw-r--r--winsup/cygwin/shm.cc15
-rw-r--r--winsup/cygwin/signal.cc10
-rw-r--r--winsup/cygwin/sigproc.cc98
-rw-r--r--winsup/cygwin/sigproc.h2
-rw-r--r--winsup/cygwin/smallprint.cc229
-rw-r--r--winsup/cygwin/spawn.cc122
-rwxr-xr-xwinsup/cygwin/speclib9
-rw-r--r--winsup/cygwin/spinlock.h2
-rw-r--r--winsup/cygwin/strace.cc4
-rw-r--r--winsup/cygwin/strfuncs.cc12
-rw-r--r--winsup/cygwin/strsig.cc55
-rw-r--r--winsup/cygwin/sync.cc3
-rw-r--r--winsup/cygwin/sync.h2
-rw-r--r--winsup/cygwin/syscalls.cc308
-rw-r--r--winsup/cygwin/sysconf.cc38
-rw-r--r--winsup/cygwin/syslog.cc10
-rw-r--r--winsup/cygwin/termios.cc6
-rw-r--r--winsup/cygwin/textmode.c6
-rw-r--r--winsup/cygwin/textreadmode.c6
-rw-r--r--winsup/cygwin/thread.cc69
-rw-r--r--winsup/cygwin/thread.h14
-rw-r--r--winsup/cygwin/timer.cc17
-rw-r--r--winsup/cygwin/times.cc16
-rw-r--r--winsup/cygwin/tlsoffsets.h216
-rw-r--r--winsup/cygwin/tlsoffsets64.h117
-rw-r--r--winsup/cygwin/tty.cc16
-rw-r--r--winsup/cygwin/tty.h31
-rw-r--r--winsup/cygwin/uinfo.cc46
-rw-r--r--winsup/cygwin/wait.cc4
-rw-r--r--winsup/cygwin/winbase.h24
-rw-r--r--winsup/cygwin/wincap.cc223
-rw-r--r--winsup/cygwin/wincap.h35
-rw-r--r--winsup/cygwin/window.cc4
-rw-r--r--winsup/cygwin/winlean.h21
-rw-r--r--winsup/cygwin/winsup.h73
-rw-r--r--winsup/cygwin/wow64.cc14
-rw-r--r--winsup/cygwin/wow64.h8
-rw-r--r--winsup/cygwin/x86_64.din20
-rw-r--r--winsup/doc/.cvsignore14
-rw-r--r--winsup/doc/ChangeLog173
-rw-r--r--winsup/doc/Makefile.in72
-rw-r--r--winsup/doc/Wishlist111
-rwxr-xr-xwinsup/doc/bodysnatcher.pl44
-rwxr-xr-xwinsup/doc/configure189
-rw-r--r--winsup/doc/configure.ac2
-rw-r--r--winsup/doc/cygserver.xml (renamed from winsup/doc/cygserver.sgml)4
-rw-r--r--winsup/doc/cygwin-api.in.xml (renamed from winsup/doc/cygwin-api.in.sgml)12
-rw-r--r--winsup/doc/cygwin-ug-net.in.sgml25
-rw-r--r--winsup/doc/cygwin-ug-net.xml16
-rw-r--r--winsup/doc/cygwin-ug.in.sgml64
-rw-r--r--winsup/doc/cygwin.xsl (renamed from winsup/doc/cygwin.dsl)0
-rw-r--r--winsup/doc/cygwinenv.xml (renamed from winsup/doc/cygwinenv.sgml)35
-rw-r--r--winsup/doc/dll.xml (renamed from winsup/doc/dll.sgml)4
-rw-r--r--winsup/doc/effectively.xml (renamed from winsup/doc/effectively.sgml)17
-rw-r--r--winsup/doc/faq-api.xml9
-rw-r--r--winsup/doc/faq-copyright.xml17
-rw-r--r--winsup/doc/faq-programming.xml333
-rw-r--r--winsup/doc/faq-resources.xml9
-rw-r--r--winsup/doc/faq-sections.xml75
-rw-r--r--winsup/doc/faq-setup.xml12
-rw-r--r--winsup/doc/faq-using.xml18
-rw-r--r--winsup/doc/faq-what.xml24
-rw-r--r--winsup/doc/faq.xml80
-rw-r--r--winsup/doc/filemodes.xml (renamed from winsup/doc/filemodes.sgml)4
-rw-r--r--winsup/doc/gcc.xml (renamed from winsup/doc/gcc.sgml)4
-rw-r--r--winsup/doc/gdb.xml (renamed from winsup/doc/gdb.sgml)3
-rw-r--r--winsup/doc/highlights.xml (renamed from winsup/doc/overview2.sgml)126
-rw-r--r--winsup/doc/legal.xml (renamed from winsup/doc/legal.sgml)4
-rw-r--r--winsup/doc/new-features.xml (renamed from winsup/doc/new-features.sgml)40
-rw-r--r--winsup/doc/ntsec.xml (renamed from winsup/doc/ntsec.sgml)12
-rw-r--r--winsup/doc/ov-ex-unix.xml54
-rw-r--r--winsup/doc/ov-ex-win.xml47
-rw-r--r--winsup/doc/overview.xml (renamed from winsup/doc/overview.sgml)23
-rw-r--r--winsup/doc/pathnames.xml (renamed from winsup/doc/pathnames.sgml)598
-rw-r--r--winsup/doc/programming.sgml11
-rw-r--r--winsup/doc/programming.xml12
-rw-r--r--winsup/doc/setup-env.xml129
-rw-r--r--winsup/doc/setup-files.xml85
-rw-r--r--winsup/doc/setup-locale.xml (renamed from winsup/doc/setup2.sgml)273
-rw-r--r--winsup/doc/setup-maxmem.xml66
-rw-r--r--winsup/doc/setup-net.xml (renamed from winsup/doc/setup-net.sgml)15
-rw-r--r--winsup/doc/setup.sgml47
-rw-r--r--winsup/doc/specialnames.xml517
-rw-r--r--winsup/doc/textbinary.xml (renamed from winsup/doc/textbinary.sgml)4
-rw-r--r--winsup/doc/ug-info.xml36
-rw-r--r--winsup/doc/using.sgml25
-rw-r--r--winsup/doc/using.xml21
-rw-r--r--winsup/doc/windres.xml (renamed from winsup/doc/windres.sgml)3
-rwxr-xr-xwinsup/doc/xidepend34
-rw-r--r--winsup/lsaauth/ChangeLog4
-rw-r--r--winsup/lsaauth/ChangeLog.64bit13
-rw-r--r--winsup/lsaauth/Makefile.in8
-rwxr-xr-xwinsup/lsaauth/configure10
-rw-r--r--winsup/lsaauth/configure.ac10
-rw-r--r--winsup/utils/ChangeLog18
-rw-r--r--winsup/utils/ChangeLog.64bit85
-rw-r--r--winsup/utils/Makefile.in4
-rw-r--r--winsup/utils/aclocal.m46
-rwxr-xr-xwinsup/utils/configure191
-rw-r--r--winsup/utils/cygcheck.cc65
-rw-r--r--winsup/utils/dumper.cc42
-rw-r--r--winsup/utils/dumper.h24
-rw-r--r--winsup/utils/kill.cc10
-rw-r--r--winsup/utils/ldd.cc18
-rw-r--r--winsup/utils/locale.cc4
-rw-r--r--winsup/utils/mkgroup.c44
-rw-r--r--winsup/utils/mkpasswd.c46
-rw-r--r--winsup/utils/module_info.cc6
-rw-r--r--winsup/utils/mount.cc7
-rw-r--r--winsup/utils/parse_pe.cc8
-rw-r--r--winsup/utils/passwd.c21
-rw-r--r--winsup/utils/path.cc10
-rw-r--r--winsup/utils/ps.cc5
-rw-r--r--winsup/utils/regtool.cc12
-rw-r--r--winsup/utils/ssp.c17
-rw-r--r--winsup/utils/strace.cc25
-rw-r--r--winsup/utils/tzset.c23
-rw-r--r--winsup/utils/utils.sgml2190
-rw-r--r--winsup/utils/utils.xml2091
494 files changed, 19180 insertions, 44382 deletions
diff --git a/COPYING.NEWLIB b/COPYING.NEWLIB
index 6849eb5b4..73379ffc3 100644
--- a/COPYING.NEWLIB
+++ b/COPYING.NEWLIB
@@ -894,3 +894,34 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(40) - Altera Corportion (nios2-* targets)
+
+Copyright (c) 2003 Altera Corporation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ o Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ o Neither the name of Altera Corporation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY ALTERA CORPORATION, THE COPYRIGHT HOLDER,
+AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/COPYING3 b/COPYING3
deleted file mode 100644
index 94a9ed024..000000000
--- a/COPYING3
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/COPYING3.LIB b/COPYING3.LIB
deleted file mode 100644
index fc8a5de7e..000000000
--- a/COPYING3.LIB
+++ /dev/null
@@ -1,165 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/ChangeLog b/ChangeLog
index 8f8e1fb58..ed3bc27d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-06-01 George Thomas <george.thomas@atmel.com>
+
+ * include/opcode/avr.h: Rename AVR_ISA_XCH to AVR_ISA_RMW. Remove
+ from AVR_ISA_XMEGA and add new AVR_ISA_XMEGAU
+
+2013-05-06 Sandra Loosemore <sandra@codesourcery.com>
+
+ * COPYING.NEWLIB: Add Altera Corporation copyright.
+
+2013-04-29 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+
+ * config.guess: Update from config repo.
+ * config.sub: Ditto.
+
2013-04-22 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* Makefile.def: Sync with GCC.
diff --git a/config.guess b/config.guess
index 0aee6044d..2055429b1 100755
--- a/config.guess
+++ b/config.guess
@@ -1,10 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012, 2013 Free Software Foundation, Inc.
+# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2012-12-30'
+timestamp='2013-04-24'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -52,9 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -887,6 +883,9 @@ EOF
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -925,6 +924,11 @@ EOF
#ifdef __dietlibc__
LIBC=dietlibc
#endif
+ #else
+ #include <features.h>
+ #ifdef __UCLIBC__
+ LIBC=uclibc
+ #endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
@@ -957,6 +961,9 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
or32:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
@@ -999,7 +1006,9 @@ EOF
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ LIBC=gnu
+ test -r /lib/libc.so && od -An -S13 /lib/libc.so | grep -q __uClibc_main && LIBC=uclibc
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
diff --git a/config.rpath b/config.rpath
deleted file mode 100755
index 4dea75957..000000000
--- a/config.rpath
+++ /dev/null
@@ -1,543 +0,0 @@
-#! /bin/sh
-# Output a system dependent set of variables, describing how to set the
-# run time search path of shared libraries in an executable.
-#
-# Copyright 1996-2003 Free Software Foundation, Inc.
-# Taken from GNU libtool, 2001
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU 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
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-#
-# The first argument passed to this file is the canonical host specification,
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
-# should be set by the caller.
-#
-# The set of defined variables is at the end of this script.
-
-# Known limitations:
-# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
-# than 256 bytes, otherwise the compiler driver will dump core. The only
-# known workaround is to choose shorter directory names for the build
-# directory and/or the installation directory.
-
-# All known linkers require a `.a' archive for static linking (except M$VC,
-# which needs '.lib').
-libext=a
-shrext=.so
-
-host="$1"
-host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
-
-wl=
-if test "$GCC" = yes; then
- wl='-Wl,'
-else
- case "$host_os" in
- aix*)
- wl='-Wl,'
- ;;
- mingw* | pw32* | os2*)
- ;;
- hpux9* | hpux10* | hpux11*)
- wl='-Wl,'
- ;;
- irix5* | irix6* | nonstopux*)
- wl='-Wl,'
- ;;
- newsos6)
- ;;
- linux*)
- case $CC in
- icc|ecc)
- wl='-Wl,'
- ;;
- ccc)
- wl='-Wl,'
- ;;
- esac
- ;;
- osf3* | osf4* | osf5*)
- wl='-Wl,'
- ;;
- sco3.2v5*)
- ;;
- solaris*)
- wl='-Wl,'
- ;;
- sunos4*)
- wl='-Qoption ld '
- ;;
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- wl='-Wl,'
- ;;
- sysv4*MP*)
- ;;
- uts4*)
- ;;
- esac
-fi
-
-# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
-
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-
-case "$host_os" in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
-esac
-
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
- case "$host_os" in
- aix[3-9]*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs=no
- fi
- ;;
- amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can use
- # them.
- ld_shlibs=no
- ;;
- beos*)
- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- cygwin* | mingw* | pw32*)
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- netbsd*)
- ;;
- solaris* | sysv5*)
- if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- sunos4*)
- hardcode_direct=yes
- ;;
- *)
- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- esac
- if test "$ld_shlibs" = yes; then
- # Unlike libtool, we use -rpath here, not --rpath, since the documented
- # option of GNU ld is called -rpath, not --rpath.
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- fi
-else
- case "$host_os" in
- aix3*)
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test "$GCC" = yes; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
- aix[4-9]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- else
- aix_use_runtimelinking=no
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- esac
- fi
- hardcode_direct=yes
- hardcode_libdir_separator=':'
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct=yes
- else
- # We have old collect2
- hardcode_direct=unsupported
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- esac
- fi
- # Begin _LT_AC_SYS_LIBPATH_AIX.
- echo 'int main () { return 0; }' > conftest.c
- ${CC} ${LDFLAGS} conftest.c -o conftest
- aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
- if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
- fi
- if test -z "$aix_libpath"; then
- aix_libpath="/usr/lib:/lib"
- fi
- rm -f conftest.c conftest
- # End _LT_AC_SYS_LIBPATH_AIX.
- if test "$aix_use_runtimelinking" = yes; then
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- else
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- fi
- fi
- ;;
- amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
- ;;
- bsdi4*)
- ;;
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- libext=lib
- ;;
- darwin* | rhapsody*)
- if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
- hardcode_direct=no
- fi
- ;;
- dgux*)
- hardcode_libdir_flag_spec='-L$libdir'
- ;;
- freebsd2.2*)
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- ;;
- freebsd2*)
- hardcode_direct=yes
- hardcode_minus_L=yes
- ;;
- freebsd*)
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- ;;
- hpux9*)
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- hpux10* | hpux11*)
- if test "$with_gnu_ld" = no; then
- case "$host_cpu" in
- hppa*64*)
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=no
- ;;
- ia64*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=no
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- *)
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
- irix5* | irix6* | nonstopux*)
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
- netbsd*)
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- ;;
- newsos6)
- hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
- openbsd*)
- hardcode_direct=yes
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- else
- case "$host_os" in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- osf3*)
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
- osf4* | osf5*)
- if test "$GCC" = yes; then
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- else
- # Both cc and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- hardcode_libdir_separator=:
- ;;
- sco3.2v5*)
- ;;
- solaris*)
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- sunos4*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- ;;
- sysv4)
- case $host_vendor in
- sni)
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- hardcode_direct=no
- ;;
- motorola)
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- ;;
- sysv4.3*)
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- ld_shlibs=yes
- fi
- ;;
- sysv4.2uw2*)
- hardcode_direct=yes
- hardcode_minus_L=no
- ;;
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
- ;;
- sysv5*)
- hardcode_libdir_flag_spec=
- ;;
- uts4*)
- hardcode_libdir_flag_spec='-L$libdir'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
-fi
-
-# Check dynamic linker characteristics
-# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
-libname_spec='lib$name'
-case "$host_os" in
- aix3*)
- ;;
- aix[4-9]*)
- ;;
- amigaos*)
- ;;
- beos*)
- ;;
- bsdi4*)
- ;;
- cygwin* | mingw* | pw32*)
- shrext=.dll
- ;;
- darwin* | rhapsody*)
- shrext=.dylib
- ;;
- dgux*)
- ;;
- freebsd*)
- ;;
- gnu*)
- ;;
- hpux9* | hpux10* | hpux11*)
- case "$host_cpu" in
- ia64*)
- shrext=.so
- ;;
- hppa*64*)
- shrext=.sl
- ;;
- *)
- shrext=.sl
- ;;
- esac
- ;;
- irix5* | irix6* | nonstopux*)
- case "$host_os" in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
- *) libsuff= shlibsuff= ;;
- esac
- ;;
- esac
- ;;
- linux*oldld* | linux*aout* | linux*coff*)
- ;;
- linux*)
- ;;
- netbsd*)
- ;;
- newsos6)
- ;;
- nto-qnx)
- ;;
- openbsd*)
- ;;
- os2*)
- libname_spec='$name'
- shrext=.dll
- ;;
- osf3* | osf4* | osf5*)
- ;;
- sco3.2v5*)
- ;;
- solaris*)
- ;;
- sunos4*)
- ;;
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- ;;
- sysv4*MP*)
- ;;
- uts4*)
- ;;
-esac
-
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
-shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
-escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-
-sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
-
-# How to pass a linker flag through the compiler.
-wl="$escaped_wl"
-
-# Static library suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally "so").
-shlibext="$shlibext"
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator="$hardcode_libdir_separator"
-
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct="$hardcode_direct"
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L="$hardcode_minus_L"
-
-EOF
diff --git a/config.sub b/config.sub
index 707e9e2ef..8b612ab89 100755
--- a/config.sub
+++ b/config.sub
@@ -1,10 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012, 2013 Free Software Foundation, Inc.
+# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2013-01-11'
+timestamp='2013-04-24'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -70,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -256,7 +252,7 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc \
+ | arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
@@ -297,10 +293,10 @@ case $basic_machine in
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
- | nios | nios2 \
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 \
- | or32 \
+ | or1k | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
@@ -370,7 +366,7 @@ case $basic_machine in
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
@@ -414,7 +410,7 @@ case $basic_machine in
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
@@ -1593,6 +1589,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
+ or1k-*)
+ os=-elf
+ ;;
or32-*)
os=-coff
;;
diff --git a/config/ChangeLog b/config/ChangeLog
index c6e8b256e..cdc733c70 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,13 @@
+2013-03-27 Kai Tietz <ktietz@redhat.com>
+
+ * dfp.m4: Add support for cygwin x64 target.
+ * picflag.m4: Likewise.
+
+2013-02-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * bootstrap-asan.mk (POSTSTAGE1_LDFLAGS): Add
+ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.
+
2013-01-15 Richard Biener <rguenther@suse.de>
PR other/55973
diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.mk
index d37a9da6b..e3f34f5ad 100644
--- a/config/bootstrap-asan.mk
+++ b/config/bootstrap-asan.mk
@@ -3,4 +3,5 @@
STAGE2_CFLAGS += -fsanitize=address
STAGE3_CFLAGS += -fsanitize=address
POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \
+ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/ \
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs
diff --git a/config/dfp.m4 b/config/dfp.m4
index e971db4dc..48683f0f9 100644
--- a/config/dfp.m4
+++ b/config/dfp.m4
@@ -23,7 +23,7 @@ Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
i?86*-*-gnu* | \
i?86*-*-mingw* | x86_64*-*-mingw* | \
- i?86*-*-cygwin*)
+ i?86*-*-cygwin* | x86_64*-*-cygwin*)
enable_decimal_float=yes
;;
*)
diff --git a/config/picflag.m4 b/config/picflag.m4
index bd818125a..2ee5cd078 100644
--- a/config/picflag.m4
+++ b/config/picflag.m4
@@ -17,7 +17,9 @@ case "${$2}" in
hppa*64*-*-hpux*)
# PIC is the default for 64-bit PA HP-UX.
;;
- i[[34567]]86-*-cygwin* | i[[34567]]86-*-mingw* | x86_64-*-mingw*)
+ i[[34567]]86-*-cygwin* | x86_64-*-cygwin*)
+ ;;
+ i[[34567]]86-*-mingw* | x86_64-*-mingw*)
;;
i[[34567]]86-*-interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index bec489fc3..000000000
--- a/configure.ac
+++ /dev/null
@@ -1,3293 +0,0 @@
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-# Free Software Foundation, Inc.
-#
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 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
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-##############################################################################
-### WARNING: this file contains embedded tabs. Do not run untabify on this file.
-
-m4_include(config/acx.m4)
-m4_include(config/override.m4)
-m4_include(config/proginstall.m4)
-m4_include(config/elf.m4)
-m4_include([libtool.m4])
-m4_include([ltoptions.m4])
-m4_include([ltsugar.m4])
-m4_include([ltversion.m4])
-m4_include([lt~obsolete.m4])
-m4_include([config/isl.m4])
-m4_include([config/cloog.m4])
-
-AC_INIT(move-if-change)
-AC_PREREQ(2.64)
-AC_DISABLE_OPTION_CHECKING
-
-progname=$0
-# if PWD already has a value, it is probably wrong.
-if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
-
-# Export original configure arguments for use by sub-configures.
-# Quote arguments with shell meta charatcers.
-TOPLEVEL_CONFIGURE_ARGUMENTS=
-set -- "$progname" "$@"
-for ac_arg
-do
- case "$ac_arg" in
- *" "*|*" "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
- # if the argument is of the form -foo=baz, quote the baz part only
- ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;;
- *) ;;
- esac
- # Add the quoted argument to the list.
- TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg"
-done
-if test "$silent" = yes; then
- TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS --silent"
-fi
-# Remove the initial space we just introduced and, as these will be
-# expanded by make, quote '$'.
-TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
-AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
-
-# Find the build, host, and target systems.
-ACX_NONCANONICAL_BUILD
-ACX_NONCANONICAL_HOST
-ACX_NONCANONICAL_TARGET
-
-dnl Autoconf 2.5x and later will set a default program prefix if
-dnl --target was used, even if it was the same as --host. Disable
-dnl that behavior. This must be done before AC_CANONICAL_SYSTEM
-dnl to take effect.
-test "$host_noncanonical" = "$target_noncanonical" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_transform_name=s,y,y,
-
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-
-m4_pattern_allow([^AS_FOR_TARGET$])dnl
-m4_pattern_allow([^AS_FOR_BUILD$])dnl
-
-# Get 'install' or 'install-sh' and its variants.
-AC_PROG_INSTALL
-ACX_PROG_LN
-AC_PROG_LN_S
-AC_PROG_SED
-AC_PROG_AWK
-
-srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
-
-# We pass INSTALL explicitly to sub-makes. Make sure that it is not
-# a relative path.
-if test "$INSTALL" = "${srcdir}/install-sh -c"; then
- INSTALL="${srcpwd}/install-sh -c"
-fi
-
-# Set srcdir to "." if that's what it is.
-# This is important for multilib support.
-pwd=`${PWDCMD-pwd}`
-if test "${pwd}" = "${srcpwd}" ; then
- srcdir=.
-fi
-
-topsrcdir=$srcpwd
-
-extra_host_args=
-
-### To add a new directory to the tree, first choose whether it is a target
-### or a host dependent tool. Then put it into the appropriate list
-### (library or tools, host or target), doing a dependency sort.
-
-# Subdirs will be configured in the order listed in build_configdirs,
-# configdirs, or target_configdirs; see the serialization section below.
-
-# Dependency sorting is only needed when *configuration* must be done in
-# a particular order. In all cases a dependency should be specified in
-# the Makefile, whether or not it's implicitly specified here.
-
-# Double entries in build_configdirs, configdirs, or target_configdirs may
-# cause circular dependencies and break everything horribly.
-
-# these library is used by various programs built for the build
-# environment
-#
-build_libs="build-libiberty"
-
-# these tools are built for the build environment
-build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
-
-# these libraries are used by various programs built for the host environment
-#
-host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libdecnumber gmp mpfr mpc isl cloog libelf libiconv"
-
-# these tools are built for the host environment
-# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
-# know that we are building the simulator.
-# binutils, gas and ld appear in that order because it makes sense to run
-# "make check" in that particular order.
-# If --enable-gold is used, "gold" may replace "ld".
-host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools"
-
-# libgcj represents the runtime libraries only used by gcj.
-libgcj="target-libffi \
- target-zlib \
- target-libjava"
-
-# these libraries are built for the target environment, and are built after
-# the host libraries and the host tools (which may be a cross compiler)
-# Note that libiberty is not a target library.
-target_libraries="target-libgcc \
- target-libbacktrace \
- target-libgloss \
- target-newlib \
- target-libgomp \
- target-libatomic \
- target-libitm \
- target-libstdc++-v3 \
- target-libmudflap \
- target-libsanitizer \
- target-libssp \
- target-libquadmath \
- target-libgfortran \
- target-boehm-gc \
- ${libgcj} \
- target-libobjc \
- target-libada \
- target-libgo"
-
-# these tools are built using the target libraries, and are intended to
-# run only in the target environment
-#
-# note: any program that *uses* libraries that are in the "target_libraries"
-# list belongs in this list.
-#
-target_tools="target-rda"
-
-################################################################################
-
-## All tools belong in one of the four categories, and are assigned above
-## We assign ${configdirs} this way to remove all embedded newlines. This
-## is important because configure will choke if they ever get through.
-## ${configdirs} is directories we build using the host tools.
-## ${target_configdirs} is directories we build using the target tools.
-configdirs=`echo ${host_libs} ${host_tools}`
-target_configdirs=`echo ${target_libraries} ${target_tools}`
-build_configdirs=`echo ${build_libs} ${build_tools}`
-
-m4_divert_text([PARSE_ARGS],
-[case $srcdir in
- *" "*)
-m4_pushdef([AS_MESSAGE_LOG_FD], [])dnl
- AC_MSG_ERROR([path to source, $srcdir, contains spaces])
-m4_popdef([AS_MESSAGE_LOG_FD])dnl
- ;;
-esac
-ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
-])
-
-################################################################################
-
-srcname="gnu development package"
-
-# This gets set non-empty for some net releases of packages.
-appdirs=""
-
-# Define is_cross_compiler to save on calls to 'test'.
-is_cross_compiler=
-if test x"${host}" = x"${target}" ; then
- is_cross_compiler=no
-else
- is_cross_compiler=yes
-fi
-
-# Find the build and target subdir names.
-GCC_TOPLEV_SUBDIRS
-# Be sure to cover against remnants of an in-tree build.
-if test $srcdir != . && test -d $srcdir/host-${host_noncanonical}; then
- AC_MSG_ERROR([building out of tree but $srcdir contains host-${host_noncanonical}.
-Use a pristine source tree when building in a separate tree])
-fi
-
-# Skipdirs are removed silently.
-skipdirs=
-# Noconfigdirs are removed loudly.
-noconfigdirs=""
-
-use_gnu_ld=
-# Make sure we don't let GNU ld be added if we didn't want it.
-if test x$with_gnu_ld = xno ; then
- use_gnu_ld=no
- noconfigdirs="$noconfigdirs ld gold"
-fi
-
-use_gnu_as=
-# Make sure we don't let GNU as be added if we didn't want it.
-if test x$with_gnu_as = xno ; then
- use_gnu_as=no
- noconfigdirs="$noconfigdirs gas"
-fi
-
-use_included_zlib=
-# Make sure we don't let ZLIB be added if we didn't want it.
-if test x$with_system_zlib = xyes ; then
- use_included_zlib=no
- noconfigdirs="$noconfigdirs zlib"
-fi
-
-# some tools are so dependent upon X11 that if we're not building with X,
-# it's not even worth trying to configure, much less build, that tool.
-
-case ${with_x} in
- yes | "") ;; # the default value for this tree is that X11 is available
- no)
- skipdirs="${skipdirs} tk itcl libgui"
- # We won't be able to build gdbtk without X.
- enable_gdbtk=no
- ;;
- *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
-esac
-
-# Some are only suitable for cross toolchains.
-# Remove these if host=target.
-cross_only="target-libgloss target-newlib target-opcodes"
-
-case $is_cross_compiler in
- no) skipdirs="${skipdirs} ${cross_only}" ;;
-esac
-
-# If both --with-headers and --with-libs are specified, default to
-# --without-newlib.
-if test x"${with_headers}" != x && test x"${with_headers}" != xno \
- && test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
- if test x"${with_newlib}" = x ; then
- with_newlib=no
- fi
-fi
-
-# Recognize --with-newlib/--without-newlib.
-case ${with_newlib} in
- no) skipdirs="${skipdirs} target-newlib" ;;
- yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;;
-esac
-
-# Handle --enable-gold, --enable-ld.
-# --disable-gold [--enable-ld]
-# Build only ld. Default option.
-# --enable-gold [--enable-ld]
-# Build both gold and ld. Install gold as "ld.gold", install ld
-# as "ld.bfd" and "ld".
-# --enable-gold=default [--enable-ld]
-# Build both gold and ld. Install gold as "ld.gold" and "ld",
-# install ld as "ld.bfd".
-# --enable-gold[=default] --disable-ld
-# Build only gold, which is then installed as both "ld.gold" and "ld".
-# --enable-gold --enable-ld=default
-# Build both gold (installed as "ld.gold") and ld (installed as "ld"
-# and ld.bfd).
-# In other words, ld is default
-# --enable-gold=default --enable-ld=default
-# Error.
-
-default_ld=
-AC_ARG_ENABLE(gold,
-[AS_HELP_STRING([[--enable-gold[=ARG]]],
- [build gold @<:@ARG={default,yes,no}@:>@])],
-ENABLE_GOLD=$enableval,
-ENABLE_GOLD=no)
-case "${ENABLE_GOLD}" in
- yes|default)
- # Check for ELF target.
- is_elf=no
- case "${target}" in
- *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
- | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
- | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
- | *-*-solaris2* | *-*-nto* | *-*-nacl*)
- case "${target}" in
- *-*-linux*aout* | *-*-linux*oldld*)
- ;;
- *)
- is_elf=yes
- ;;
- esac
- esac
-
- if test "$is_elf" = "yes"; then
- # Check for target supported by gold.
- case "${target}" in
- i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* | tilegx*-*-*)
- configdirs="$configdirs gold"
- if test x${ENABLE_GOLD} = xdefault; then
- default_ld=gold
- fi
- ENABLE_GOLD=yes
- ;;
- esac
- fi
- ;;
- no)
- ;;
- *)
- AC_MSG_ERROR([invalid --enable-gold argument])
- ;;
-esac
-
-AC_ARG_ENABLE(ld,
-[AS_HELP_STRING([[--enable-ld[=ARG]]],
- [build ld @<:@ARG={default,yes,no}@:>@])],
-ENABLE_LD=$enableval,
-ENABLE_LD=yes)
-
-case "${ENABLE_LD}" in
- default)
- if test x${default_ld} != x; then
- AC_MSG_ERROR([either gold or ld can be the default ld])
- fi
- ;;
- yes)
- ;;
- no)
- if test x${ENABLE_GOLD} != xyes; then
- AC_MSG_WARN([neither ld nor gold are enabled])
- fi
- configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'`
- ;;
- *)
- AC_MSG_ERROR([invalid --enable-ld argument])
- ;;
-esac
-
-# Configure extra directories which are host specific
-
-case "${host}" in
- *-cygwin*)
- configdirs="$configdirs libtermcap" ;;
-esac
-
-# A target can indicate whether a language isn't supported for some reason.
-# Only spaces may be used in this macro; not newlines or tabs.
-unsupported_languages=
-
-# Remove more programs from consideration, based on the host or
-# target this usually means that a port of the program doesn't
-# exist yet.
-
-case "${host}" in
- i[[3456789]]86-*-msdosdjgpp*)
- noconfigdirs="$noconfigdirs tcl tk itcl"
- ;;
-esac
-
-
-AC_ARG_ENABLE(libquadmath,
-AS_HELP_STRING([--disable-libquadmath],
- [do not build libquadmath directory]),
-ENABLE_LIBQUADMATH=$enableval,
-ENABLE_LIBQUADMATH=yes)
-if test "${ENABLE_LIBQUADMATH}" = "no" ; then
- noconfigdirs="$noconfigdirs target-libquadmath"
-fi
-
-
-AC_ARG_ENABLE(libquadmath-support,
-AS_HELP_STRING([--disable-libquadmath-support],
- [disable libquadmath support for Fortran]),
-ENABLE_LIBQUADMATH_SUPPORT=$enableval,
-ENABLE_LIBQUADMATH_SUPPORT=yes)
-enable_libquadmath_support=
-if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
- enable_libquadmath_support=no
-fi
-
-
-AC_ARG_ENABLE(libada,
-[AS_HELP_STRING([--enable-libada], [build libada directory])],
-ENABLE_LIBADA=$enableval,
-ENABLE_LIBADA=yes)
-if test "${ENABLE_LIBADA}" != "yes" ; then
- noconfigdirs="$noconfigdirs gnattools"
-fi
-
-AC_ARG_ENABLE(libssp,
-[AS_HELP_STRING([--enable-libssp], [build libssp directory])],
-ENABLE_LIBSSP=$enableval,
-ENABLE_LIBSSP=yes)
-
-AC_ARG_ENABLE(libstdcxx,
-AS_HELP_STRING([--disable-libstdcxx],
- [do not build libstdc++-v3 directory]),
-ENABLE_LIBSTDCXX=$enableval,
-ENABLE_LIBSTDCXX=default)
-[if test "${ENABLE_LIBSTDCXX}" = "no" ; then
- noconfigdirs="$noconfigdirs libstdc++-v3"
-fi]
-
-# Save it here so that, even in case of --enable-libgcj, if the Java
-# front-end isn't enabled, we still get libgcj disabled.
-libgcj_saved=$libgcj
-case $enable_libgcj in
-yes)
- # If we reset it here, it won't get added to noconfigdirs in the
- # target-specific build rules, so it will be forcibly enabled
- # (unless the Java language itself isn't enabled).
- libgcj=
- ;;
-no)
- # Make sure we get it printed in the list of not supported target libs.
- # Don't disable libffi, though, other languages use it.
- noconfigdirs="$noconfigdirs `echo ${libgcj} | sed -e 's/target-libffi//'`"
- # Clear libgcj_saved so that even if java is enabled libffi won't be
- # built.
- libgcj_saved=
- ;;
-esac
-
-AC_ARG_ENABLE(static-libjava,
-[AS_HELP_STRING([[--enable-static-libjava[=ARG]]],
- [build static libjava @<:@default=no@:>@])],
-ENABLE_STATIC_LIBJAVA=$enableval,
-ENABLE_STATIC_LIBJAVA=no)
-enable_static_libjava=
-if test "${ENABLE_STATIC_LIBJAVA}" = "yes" ; then
- enable_static_libjava=yes
-fi
-
-if test x$enable_static_libjava != xyes ; then
- EXTRA_CONFIGARGS_LIBJAVA=--disable-static
-fi
-AC_SUBST(EXTRA_CONFIGARGS_LIBJAVA)
-
-# Disable libmudflap on some systems.
-if test x$enable_libmudflap = x ; then
- case "${target}" in
- *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | bfin*-*-uclinux* | *-*-kopensolaris*-gnu)
- # Enable libmudflap by default in GNU and friends.
- ;;
- *-*-freebsd*)
- # Enable libmudflap by default in FreeBSD.
- ;;
- *)
- # Disable it by default everywhere else.
- noconfigdirs="$noconfigdirs target-libmudflap"
- ;;
- esac
-fi
-
-# Disable libgomp on non POSIX hosted systems.
-if test x$enable_libgomp = x ; then
- # Enable libgomp by default on hosted POSIX systems.
- case "${target}" in
- *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
- ;;
- *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
- ;;
- *-*-solaris2* | *-*-hpux11*)
- ;;
- *-*-darwin* | *-*-aix*)
- ;;
- *)
- noconfigdirs="$noconfigdirs target-libgomp"
- ;;
- esac
-fi
-
-# Disable libatomic on unsupported systems.
-if test -d ${srcdir}/libatomic; then
- if test x$enable_libatomic = x; then
- AC_MSG_CHECKING([for libatomic support])
- if (srcdir=${srcdir}/libatomic; \
- . ${srcdir}/configure.tgt; \
- test -n "$UNSUPPORTED")
- then
- AC_MSG_RESULT([no])
- noconfigdirs="$noconfigdirs target-libatomic"
- else
- AC_MSG_RESULT([yes])
- fi
- fi
-fi
-
-# Disable libitm on unsupported systems.
-if test -d ${srcdir}/libitm; then
- if test x$enable_libitm = x; then
- AC_MSG_CHECKING([for libitm support])
- if (srcdir=${srcdir}/libitm; \
- . ${srcdir}/configure.tgt; \
- test -n "$UNSUPPORTED")
- then
- AC_MSG_RESULT([no])
- noconfigdirs="$noconfigdirs target-libitm"
- else
- AC_MSG_RESULT([yes])
- fi
- fi
-fi
-
-# Disable libsanitizer on unsupported systems.
-if test -d ${srcdir}/libsanitizer; then
- if test x$enable_libsanitizer = x; then
- AC_MSG_CHECKING([for libsanitizer support])
- if (srcdir=${srcdir}/libsanitizer; \
- . ${srcdir}/configure.tgt; \
- test -n "$UNSUPPORTED")
- then
- AC_MSG_RESULT([no])
- noconfigdirs="$noconfigdirs target-libsanitizer"
- else
- AC_MSG_RESULT([yes])
- fi
- fi
-fi
-
-# Disable libquadmath for some systems.
-case "${target}" in
- avr-*-*)
- noconfigdirs="$noconfigdirs target-libquadmath"
- ;;
- # libquadmath is unused on AIX and libquadmath build process use of
- # LD_LIBRARY_PATH can break AIX bootstrap.
- powerpc-*-aix* | rs6000-*-aix*)
- noconfigdirs="$noconfigdirs target-libquadmath"
- ;;
-esac
-
-# Disable libssp for some systems.
-case "${target}" in
- avr-*-*)
- # No hosted I/O support.
- noconfigdirs="$noconfigdirs target-libssp"
- ;;
- powerpc-*-aix* | rs6000-*-aix*)
- noconfigdirs="$noconfigdirs target-libssp"
- ;;
- rl78-*-*)
- # libssp uses a misaligned load to trigger a fault, but the RL78
- # doesn't fault for those - instead, it gives a build-time error
- # for explicit misaligned loads.
- noconfigdirs="$noconfigdirs target-libssp"
- ;;
-esac
-
-# Disable libstdc++-v3 for some systems.
-# Allow user to override this if they pass --enable-libstdc++-v3
-if test "${ENABLE_LIBSTDCXX}" = "default" ; then
- case "${target}" in
- *-*-vxworks*)
- # VxWorks uses the Dinkumware C++ library.
- noconfigdirs="$noconfigdirs target-libstdc++-v3"
- ;;
- arm*-wince-pe*)
- # the C++ libraries don't build on top of CE's C libraries
- noconfigdirs="$noconfigdirs target-libstdc++-v3"
- ;;
- avr-*-*)
- noconfigdirs="$noconfigdirs target-libstdc++-v3"
- ;;
- esac
-fi
-
-# Disable Fortran for some systems.
-case "${target}" in
- mmix-*-*)
- # See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>.
- unsupported_languages="$unsupported_languages fortran"
- ;;
-esac
-
-# Disable Java if libffi is not supported.
-case "${target}" in
- aarch64-*-*)
- ;;
- alpha*-*-*)
- ;;
- arm*-*-*)
- ;;
- cris-*-*)
- ;;
- frv-*-*)
- ;;
- hppa*-*-linux*)
- ;;
- hppa*-*-hpux*)
- ;;
- i?86-*-*)
- ;;
- ia64*-*-*)
- ;;
- m32r*-*-*)
- ;;
- m68k-*-*)
- ;;
- mips*-*-rtems*)
- ;;
- mips*-*-linux*)
- ;;
- powerpc*-*-linux*)
- ;;
- powerpc-*-darwin*)
- ;;
- powerpc-*-aix* | rs6000-*-aix*)
- ;;
- powerpc-*-freebsd*)
- ;;
- powerpc64-*-freebsd*)
- ;;
- powerpc*-*-rtems*)
- ;;
- s390-*-* | s390x-*-*)
- ;;
- sh-*-* | sh[[34]]*-*-*)
- ;;
- sh64-*-* | sh5*-*-*)
- ;;
- sparc*-*-*)
- ;;
- x86_64-*-*)
- ;;
- *-*-*)
- unsupported_languages="$unsupported_languages java"
- ;;
-esac
-
-# Disable Java, libgcj or related libraries for some systems.
-case "${target}" in
- powerpc-*-darwin*)
- ;;
- i[[3456789]]86-*-darwin*)
- ;;
- x86_64-*-darwin[[912]]*)
- ;;
- *-*-darwin*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- *-*-netware*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- *-*-rtems*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- *-*-tpf*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- *-*-uclinux*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- *-*-vxworks*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- alpha*-*-*vms*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- arm-wince-pe)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- arm*-*-symbianelf*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- bfin-*-*)
- noconfigdirs="$noconfigdirs target-boehm-gc"
- ;;
- cris-*-* | crisv32-*-*)
- unsupported_languages="$unsupported_languages java"
- case "${target}" in
- *-*-linux*)
- ;;
- *) # See PR46792 regarding target-libffi.
- noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";;
- esac
- ;;
- hppa*64*-*-linux*)
- # In this case, it's because the hppa64-linux target is for
- # the kernel only at this point and has no libc, and thus no
- # headers, crt*.o, etc., all of which are needed by these.
- unsupported_languages="$unsupported_languages java"
- ;;
- hppa*64*-*-hpux*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- hppa*-hp-hpux11*)
- ;;
- hppa*-*-hpux*)
- # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
- # build on HP-UX 10.20.
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- ia64*-*-*vms*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- i[[3456789]]86-w64-mingw*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- i[[3456789]]86-*-mingw*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- x86_64-*-mingw*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- mmix-*-*)
- noconfigdirs="$noconfigdirs target-libffi target-boehm-gc"
- ;;
- powerpc-*-aix*)
- # copied from rs6000-*-* entry
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- rs6000-*-aix*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
- *-*-lynxos*)
- noconfigdirs="$noconfigdirs ${libgcj}"
- ;;
-esac
-
-# Disable libgo for some systems where it is known to not work.
-# For testing, you can easily override this with --enable-libgo.
-if test x$enable_libgo = x; then
- case "${target}" in
- *-*-darwin*)
- # PR 46986
- noconfigdirs="$noconfigdirs target-libgo"
- ;;
- *-*-cygwin* | *-*-mingw*)
- noconfigdirs="$noconfigdirs target-libgo"
- ;;
- *-*-aix*)
- noconfigdirs="$noconfigdirs target-libgo"
- ;;
- esac
-fi
-
-# Default libgloss CPU subdirectory.
-libgloss_dir="$target_cpu"
-
-case "${target}" in
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
- libgloss_dir=wince
- ;;
- aarch64*-*-* )
- libgloss_dir=aarch64
- ;;
- arm*-*-*)
- libgloss_dir=arm
- ;;
- cris-*-* | crisv32-*-*)
- libgloss_dir=cris
- ;;
- hppa*-*-*)
- libgloss_dir=pa
- ;;
- i[[3456789]]86-*-*)
- libgloss_dir=i386
- ;;
- m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
- libgloss_dir=m68hc11
- ;;
- m68*-*-* | fido-*-*)
- libgloss_dir=m68k
- ;;
- mips*-*-*)
- libgloss_dir=mips
- ;;
- powerpc*-*-*)
- libgloss_dir=rs6000
- ;;
- sparc*-*-*)
- libgloss_dir=sparc
- ;;
-esac
-
-# Disable newlib and libgloss for various target OSes.
-case "${target}" in
- alpha*-dec-osf*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- i[[3456789]]86-*-linux*)
- # This section makes it possible to build newlib natively on linux.
- # If we are using a cross compiler then don't configure newlib.
- if test x${is_cross_compiler} != xno ; then
- noconfigdirs="$noconfigdirs target-newlib"
- fi
- noconfigdirs="$noconfigdirs target-libgloss"
- # If we are not using a cross compiler, do configure newlib.
- # Note however, that newlib will only be configured in this situation
- # if the --with-newlib option has been given, because otherwise
- # 'target-newlib' will appear in skipdirs.
- ;;
- i[[3456789]]86-*-rdos*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|arm-wince-pe)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- sparc-*-sunos4*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-aix*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-beos*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-chorusos)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-dragonfly*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-freebsd*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-lynxos*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-mingw*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-netbsd*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-netware*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-tpf*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-uclinux*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- *-*-vxworks*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
-esac
-
-case "${target}" in
- *-*-chorusos)
- ;;
- powerpc-*-darwin*)
- noconfigdirs="$noconfigdirs ld gas gdb gprof"
- noconfigdirs="$noconfigdirs sim target-rda"
- ;;
- i[[3456789]]86-*-darwin*)
- noconfigdirs="$noconfigdirs ld gprof"
- noconfigdirs="$noconfigdirs sim target-rda"
- ;;
- x86_64-*-darwin[[912]]*)
- noconfigdirs="$noconfigdirs ld gas gprof"
- noconfigdirs="$noconfigdirs sim target-rda"
- ;;
- *-*-darwin*)
- noconfigdirs="$noconfigdirs ld gas gdb gprof"
- noconfigdirs="$noconfigdirs sim target-rda"
- ;;
- *-*-dragonfly*)
- ;;
- *-*-freebsd*)
- if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
- && test -f /usr/local/include/gmp.h; then
- with_gmp=/usr/local
- fi
- ;;
- *-*-kaos*)
- # Remove unsupported stuff on all kaOS configurations.
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- *-*-netbsd*)
- ;;
- *-*-netware*)
- ;;
- *-*-rtems*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- # The tpf target doesn't support gdb yet.
- *-*-tpf*)
- noconfigdirs="$noconfigdirs gdb tcl tk libgui itcl"
- ;;
- *-*-uclinux*)
- noconfigdirs="$noconfigdirs target-rda"
- ;;
- *-*-vxworks*)
- ;;
- alpha*-dec-osf*)
- # ld works, but does not support shared libraries.
- # gas doesn't generate exception information.
- noconfigdirs="$noconfigdirs gas ld"
- ;;
- alpha*-*-*vms*)
- noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
- ;;
- alpha*-*-*)
- # newlib is not 64 bit ready
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
- noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
- ;;
- arc-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- arm-*-pe*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- arm-*-riscix*)
- noconfigdirs="$noconfigdirs ld target-libgloss"
- ;;
- avr-*-rtems*)
- ;;
- avr-*-*)
- if test x${with_avrlibc} != xno; then
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- fi
- ;;
- c4x-*-* | tic4x-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- tic54x-*-*)
- noconfigdirs="$noconfigdirs target-libgloss gdb"
- ;;
- d10v-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- d30v-*-*)
- noconfigdirs="$noconfigdirs gdb"
- ;;
- fr30-*-elf*)
- noconfigdirs="$noconfigdirs gdb"
- ;;
- moxie-*-*)
- noconfigdirs="$noconfigdirs gprof"
- ;;
- h8300*-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- h8500-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- hppa1.1-*-osf* | hppa1.1-*-bsd* )
- ;;
- hppa*64*-*-linux*)
- ;;
- hppa*-*-linux*)
- ;;
- hppa*-*-*elf* | \
- hppa*-*-lites* | \
- hppa*-*-openbsd* | \
- hppa*64*-*-*)
- ;;
- hppa*-hp-hpux11*)
- noconfigdirs="$noconfigdirs ld"
- ;;
- hppa*-*-pro*)
- ;;
- hppa*-*-*)
- noconfigdirs="$noconfigdirs ld"
- ;;
- i960-*-*)
- noconfigdirs="$noconfigdirs gdb"
- ;;
- ia64*-*-elf*)
- # No gdb support yet.
- noconfigdirs="$noconfigdirs readline libgui itcl gdb"
- ;;
- ia64*-**-hpux*)
- # No ld support yet.
- noconfigdirs="$noconfigdirs libgui itcl ld"
- ;;
- ia64*-*-*vms*)
- # No ld support yet.
- noconfigdirs="$noconfigdirs libgui itcl ld"
- ;;
- i[[3456789]]86-w64-mingw*)
- ;;
- i[[3456789]]86-*-mingw*)
- target_configdirs="$target_configdirs target-winsup"
- ;;
- *-*-cygwin*)
- target_configdirs="$target_configdirs target-libtermcap target-winsup"
- noconfigdirs="$noconfigdirs target-libgloss"
- # always build newlib if winsup directory is present.
- if test -d "$srcdir/winsup/cygwin"; then
- skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
- elif test -d "$srcdir/newlib"; then
- echo "Warning: winsup/cygwin is missing so newlib can't be built."
- fi
- ;;
- i[[3456789]]86-*-pe)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- i[[3456789]]86-*-sco3.2v5*)
- # The linker does not yet know about weak symbols in COFF,
- # and is not configured to handle mixed ELF and COFF.
- noconfigdirs="$noconfigdirs ld target-libgloss"
- ;;
- i[[3456789]]86-*-sco*)
- noconfigdirs="$noconfigdirs gprof target-libgloss"
- ;;
- i[[3456789]]86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- i[[3456789]]86-*-sysv4*)
- noconfigdirs="$noconfigdirs target-libgloss"
- ;;
- i[[3456789]]86-*-beos*)
- noconfigdirs="$noconfigdirs gdb"
- ;;
- i[[3456789]]86-*-rdos*)
- noconfigdirs="$noconfigdirs gdb"
- ;;
- mmix-*-*)
- noconfigdirs="$noconfigdirs gdb"
- ;;
- mt-*-*)
- noconfigdirs="$noconfigdirs sim"
- ;;
- powerpc-*-aix*)
- # copied from rs6000-*-* entry
- noconfigdirs="$noconfigdirs gprof"
- ;;
- powerpc*-*-winnt* | powerpc*-*-pe*)
- target_configdirs="$target_configdirs target-winsup"
- noconfigdirs="$noconfigdirs gdb tcl tk target-libgloss itcl"
- # always build newlib.
- skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
- ;;
- # This is temporary until we can link against shared libraries
- powerpcle-*-solaris*)
- noconfigdirs="$noconfigdirs gdb sim tcl tk itcl"
- ;;
- powerpc-*-beos*)
- noconfigdirs="$noconfigdirs gdb"
- ;;
- rs6000-*-lynxos*)
- noconfigdirs="$noconfigdirs gprof"
- ;;
- rs6000-*-aix*)
- noconfigdirs="$noconfigdirs gprof"
- ;;
- rs6000-*-*)
- noconfigdirs="$noconfigdirs gprof"
- ;;
- m68k-apollo-*)
- noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
- ;;
- microblaze*)
- noconfigdirs="$noconfigdirs gprof"
- ;;
- mips*-sde-elf* | mips*-mti-elf*)
- if test x$with_newlib = xyes; then
- noconfigdirs="$noconfigdirs gprof"
- fi
- ;;
- mips*-*-irix5*)
- noconfigdirs="$noconfigdirs gprof target-libgloss"
- ;;
- mips*-*-irix6*)
- noconfigdirs="$noconfigdirs gprof target-libgloss"
- ;;
- mips*-*-bsd*)
- noconfigdirs="$noconfigdirs gprof target-libgloss"
- ;;
- mips*-*-linux*)
- ;;
- mips*-*-*)
- noconfigdirs="$noconfigdirs gprof"
- ;;
- sh-*-* | sh64-*-*)
- case "${target}" in
- sh*-*-elf)
- ;;
- *)
- noconfigdirs="$noconfigdirs target-libgloss" ;;
- esac
- ;;
- sparc-*-sunos4*)
- if test x${is_cross_compiler} = xno ; then
- use_gnu_ld=no
- fi
- ;;
- tic6x-*-*)
- noconfigdirs="$noconfigdirs sim"
- ;;
- tilepro-*-* | tilegx-*-*)
- noconfigdirs="$noconfigdirs sim"
- ;;
- v810-*-*)
- noconfigdirs="$noconfigdirs bfd binutils gas gdb ld opcodes target-libgloss"
- ;;
- vax-*-*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
-esac
-
-# If we aren't building newlib, then don't build libgloss, since libgloss
-# depends upon some newlib header files.
-case "${noconfigdirs}" in
- *target-libgloss*) ;;
- *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
-esac
-
-# Work in distributions that contain no compiler tools, like Autoconf.
-host_makefile_frag=/dev/null
-if test -d ${srcdir}/config ; then
-case "${host}" in
- i[[3456789]]86-*-msdosdjgpp*)
- host_makefile_frag="config/mh-djgpp"
- ;;
- *-cygwin*)
- ACX_CHECK_CYGWIN_CAT_WORKS
- host_makefile_frag="config/mh-cygwin"
- ;;
- *-mingw*)
- host_makefile_frag="config/mh-mingw"
- ;;
- hppa*-hp-hpux10*)
- host_makefile_frag="config/mh-pa-hpux10"
- ;;
- hppa*-hp-hpux*)
- host_makefile_frag="config/mh-pa"
- ;;
- hppa*-*)
- host_makefile_frag="config/mh-pa"
- ;;
- *-*-darwin*)
- host_makefile_frag="config/mh-darwin"
- ;;
- powerpc-*-aix*)
- host_makefile_frag="config/mh-ppc-aix"
- ;;
- rs6000-*-aix*)
- host_makefile_frag="config/mh-ppc-aix"
- ;;
-esac
-fi
-
-if test "${build}" != "${host}" ; then
- AR_FOR_BUILD=${AR_FOR_BUILD-ar}
- AS_FOR_BUILD=${AS_FOR_BUILD-as}
- CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
- CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
- GCJ_FOR_BUILD=${GCJ_FOR_BUILD-gcj}
- GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
- GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
- DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
- LD_FOR_BUILD=${LD_FOR_BUILD-ld}
- NM_FOR_BUILD=${NM_FOR_BUILD-nm}
- RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
- WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres}
- WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc}
-else
- AR_FOR_BUILD="\$(AR)"
- AS_FOR_BUILD="\$(AS)"
- CC_FOR_BUILD="\$(CC)"
- CXX_FOR_BUILD="\$(CXX)"
- GCJ_FOR_BUILD="\$(GCJ)"
- GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
- GOC_FOR_BUILD="\$(GOC)"
- DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
- LD_FOR_BUILD="\$(LD)"
- NM_FOR_BUILD="\$(NM)"
- RANLIB_FOR_BUILD="\$(RANLIB)"
- WINDRES_FOR_BUILD="\$(WINDRES)"
- WINDMC_FOR_BUILD="\$(WINDMC)"
-fi
-
-AC_PROG_CC
-AC_PROG_CXX
-
-# We must set the default linker to the linker used by gcc for the correct
-# operation of libtool. If LD is not defined and we are using gcc, try to
-# set the LD default to the ld used by gcc.
-if test -z "$LD"; then
- if test "$GCC" = yes; then
- case $build in
- *-*-mingw*)
- gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
- *)
- gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
- esac
- case $gcc_prog_ld in
- # Accept absolute paths.
- [[\\/]* | [A-Za-z]:[\\/]*)]
- LD="$gcc_prog_ld" ;;
- esac
- fi
-fi
-
-# Check whether -static-libstdc++ -static-libgcc is supported.
-have_static_libs=no
-if test "$GCC" = yes; then
- saved_LDFLAGS="$LDFLAGS"
-
- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
- AC_LANG_PUSH(C++)
- AC_LINK_IFELSE([
-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
-#error -static-libstdc++ not implemented
-#endif
-int main() {}],
- [AC_MSG_RESULT([yes]); have_static_libs=yes],
- [AC_MSG_RESULT([no])])
- AC_LANG_POP(C++)
-
- LDFLAGS="$saved_LDFLAGS"
-fi
-
-ACX_PROG_GNAT
-ACX_PROG_CMP_IGNORE_INITIAL
-
-AC_ARG_ENABLE([bootstrap],
-[AS_HELP_STRING([--enable-bootstrap],
- [enable bootstrapping @<:@yes if native build@:>@])],,
-enable_bootstrap=default)
-
-# Issue errors and warnings for invalid/strange bootstrap combinations.
-if test -r $srcdir/gcc/configure; then
- have_compiler=yes
-else
- have_compiler=no
-fi
-
-case "$have_compiler:$host:$target:$enable_bootstrap" in
- *:*:*:no) ;;
-
- # Default behavior. Enable bootstrap if we have a compiler
- # and we are in a native configuration.
- yes:$build:$build:default)
- enable_bootstrap=yes ;;
-
- *:*:*:default)
- enable_bootstrap=no ;;
-
- # We have a compiler and we are in a native configuration, bootstrap is ok
- yes:$build:$build:yes)
- ;;
-
- # Other configurations, but we have a compiler. Assume the user knows
- # what he's doing.
- yes:*:*:yes)
- AC_MSG_WARN([trying to bootstrap a cross compiler])
- ;;
-
- # No compiler: if they passed --enable-bootstrap explicitly, fail
- no:*:*:yes)
- AC_MSG_ERROR([cannot bootstrap without a compiler]) ;;
-
- # Fail if wrong command line
- *)
- AC_MSG_ERROR([invalid option for --enable-bootstrap])
- ;;
-esac
-
-# Used for setting $lt_cv_objdir
-_LT_CHECK_OBJDIR
-
-# Check for GMP, MPFR and MPC
-gmplibs="-lmpc -lmpfr -lgmp"
-gmpinc=
-have_gmp=no
-
-# Specify a location for mpc
-# check for this first so it ends up on the link line before mpfr.
-AC_ARG_WITH(mpc,
-[AS_HELP_STRING([--with-mpc=PATH],
- [specify prefix directory for installed MPC package.
- Equivalent to --with-mpc-include=PATH/include
- plus --with-mpc-lib=PATH/lib])])
-AC_ARG_WITH(mpc-include,
-[AS_HELP_STRING([--with-mpc-include=PATH],
- [specify directory for installed MPC include files])])
-AC_ARG_WITH(mpc-lib,
-[AS_HELP_STRING([--with-mpc-lib=PATH],
- [specify directory for the installed MPC library])])
-
-if test "x$with_mpc" != x; then
- gmplibs="-L$with_mpc/lib $gmplibs"
- gmpinc="-I$with_mpc/include $gmpinc"
-fi
-if test "x$with_mpc_include" != x; then
- gmpinc="-I$with_mpc_include $gmpinc"
-fi
-if test "x$with_mpc_lib" != x; then
- gmplibs="-L$with_mpc_lib $gmplibs"
-fi
-if test "x$with_mpc$with_mpc_include$with_mpc_lib" = x && test -d ${srcdir}/mpc; then
- gmplibs='-L$$r/$(HOST_SUBDIR)/mpc/src/'"$lt_cv_objdir $gmplibs"
- gmpinc='-I$$s/mpc/src '"$gmpinc"
- # Do not test the mpc version. Assume that it is sufficient, since
- # it is in the source tree, and the library has not been built yet
- # but it would be included on the link line in the version check below
- # hence making the test fail.
- have_gmp=yes
-fi
-
-# Specify a location for mpfr
-# check for this first so it ends up on the link line before gmp.
-AC_ARG_WITH(mpfr-dir,
-[AS_HELP_STRING([--with-mpfr-dir=PATH], [this option has been REMOVED])],
-[AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed.
-Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH])])
-
-AC_ARG_WITH(mpfr,
-[AS_HELP_STRING([--with-mpfr=PATH],
- [specify prefix directory for installed MPFR package.
- Equivalent to --with-mpfr-include=PATH/include
- plus --with-mpfr-lib=PATH/lib])])
-AC_ARG_WITH(mpfr-include,
-[AS_HELP_STRING([--with-mpfr-include=PATH],
- [specify directory for installed MPFR include files])])
-AC_ARG_WITH(mpfr-lib,
-[AS_HELP_STRING([--with-mpfr-lib=PATH],
- [specify directory for the installed MPFR library])])
-
-if test "x$with_mpfr" != x; then
- gmplibs="-L$with_mpfr/lib $gmplibs"
- gmpinc="-I$with_mpfr/include $gmpinc"
-fi
-if test "x$with_mpfr_include" != x; then
- gmpinc="-I$with_mpfr_include $gmpinc"
-fi
-if test "x$with_mpfr_lib" != x; then
- gmplibs="-L$with_mpfr_lib $gmplibs"
-fi
-if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
- # MPFR v3.1.0 moved the sources into a src sub-directory.
- if test -d ${srcdir}/mpfr/src; then
- gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir $gmplibs"
- gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src '"$gmpinc"
- extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/'"$lt_cv_objdir"
- else
- gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
- gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
- extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
- fi
- # Do not test the mpfr version. Assume that it is sufficient, since
- # it is in the source tree, and the library has not been built yet
- # but it would be included on the link line in the version check below
- # hence making the test fail.
- have_gmp=yes
-fi
-
-# Specify a location for gmp
-AC_ARG_WITH(gmp-dir,
-[AS_HELP_STRING([--with-gmp-dir=PATH], [this option has been REMOVED])],
-[AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed.
-Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH])])
-
-AC_ARG_WITH(gmp,
-[AS_HELP_STRING([--with-gmp=PATH],
- [specify prefix directory for the installed GMP package.
- Equivalent to --with-gmp-include=PATH/include
- plus --with-gmp-lib=PATH/lib])])
-AC_ARG_WITH(gmp-include,
-[AS_HELP_STRING([--with-gmp-include=PATH],
- [specify directory for installed GMP include files])])
-AC_ARG_WITH(gmp-lib,
-[AS_HELP_STRING([--with-gmp-lib=PATH],
- [specify directory for the installed GMP library])])
-
-
-if test "x$with_gmp" != x; then
- gmplibs="-L$with_gmp/lib $gmplibs"
- gmpinc="-I$with_gmp/include $gmpinc"
-fi
-if test "x$with_gmp_include" != x; then
- gmpinc="-I$with_gmp_include $gmpinc"
-fi
-if test "x$with_gmp_lib" != x; then
- gmplibs="-L$with_gmp_lib $gmplibs"
-fi
-if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
- gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs"
- gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
- extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
- extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir"
- extra_isl_gmp_configure_flags='--with-gmp-builddir=$$r/$(HOST_SUBDIR)/gmp'
- # Do not test the gmp version. Assume that it is sufficient, since
- # it is in the source tree, and the library has not been built yet
- # but it would be included on the link line in the version check below
- # hence making the test fail.
- have_gmp=yes
-fi
-
-if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
- have_gmp=yes
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $gmpinc"
- # Check for the recommended and required versions of GMP.
- AC_MSG_CHECKING([for the correct version of gmp.h])
- AC_TRY_COMPILE([#include "gmp.h"],[
- #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
- #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
- #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,2,3)
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include <gmp.h>],[
- #define GCC_GMP_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
- #define GCC_GMP_VERSION GCC_GMP_VERSION_NUM(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL)
- #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); have_gmp=no])
-
- # If we have GMP, check the MPFR version.
- if test x"$have_gmp" = xyes; then
- # Check for the recommended and required versions of MPFR.
- AC_MSG_CHECKING([for the correct version of mpfr.h])
- AC_TRY_COMPILE([#include <gmp.h>
- #include <mpfr.h>],[
- #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include <gmp.h>
- #include <mpfr.h>],[
- #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,2)
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); have_gmp=no])
- fi
-
- # Check for the MPC header version.
- if test x"$have_gmp" = xyes ; then
- # Check for the recommended and required versions of MPC.
- AC_MSG_CHECKING([for the correct version of mpc.h])
- AC_TRY_COMPILE([#include <mpc.h>],[
- #if MPC_VERSION < MPC_VERSION_NUM(0,8,0)
- choke me
- #endif
- ], [AC_TRY_COMPILE([#include <mpc.h>],[
- #if MPC_VERSION < MPC_VERSION_NUM(0,8,1)
- choke me
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])],
- [AC_MSG_RESULT([no]); have_gmp=no])
- fi
-
- # Now check the MPFR library.
- if test x"$have_gmp" = xyes; then
- saved_LIBS="$LIBS"
- LIBS="$LIBS $gmplibs"
- AC_MSG_CHECKING([for the correct version of the gmp/mpfr/mpc libraries])
- AC_TRY_LINK([#include <mpc.h>],[
- mpfr_t n;
- mpfr_t x;
- mpc_t c;
- int t;
- mpfr_init (n);
- mpfr_init (x);
- mpfr_atan2 (n, n, x, GMP_RNDN);
- mpfr_erfc (n, x, GMP_RNDN);
- mpfr_subnormalize (x, t, GMP_RNDN);
- mpfr_clear(n);
- mpfr_clear(x);
- mpc_init2 (c, 53);
- mpc_set_ui_ui (c, 1, 1, MPC_RNDNN);
- mpc_cosh (c, c, MPC_RNDNN);
- mpc_pow (c, c, c, MPC_RNDNN);
- mpc_acosh (c, c, MPC_RNDNN);
- mpc_clear (c);
- ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
- LIBS="$saved_LIBS"
- fi
-
- CFLAGS="$saved_CFLAGS"
-
-# The library versions listed in the error message below should match
-# the HARD-minimums enforced above.
- if test x$have_gmp != xyes; then
- AC_MSG_ERROR([Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
-Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
-their locations. Source code for these libraries can be found at
-their respective hosting sites as well as at
-ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
-http://gcc.gnu.org/install/prerequisites.html for additional info. If
-you obtained GMP, MPFR and/or MPC from a vendor distribution package,
-make sure that you have installed both the libraries and the header
-files. They may be located in separate packages.])
- fi
-fi
-
-# Flags needed for both GMP, MPFR and/or MPC.
-AC_SUBST(gmplibs)
-AC_SUBST(gmpinc)
-AC_SUBST(extra_mpfr_configure_flags)
-AC_SUBST(extra_mpc_gmp_configure_flags)
-AC_SUBST(extra_mpc_mpfr_configure_flags)
-AC_SUBST(extra_isl_gmp_configure_flags)
-
-# Allow host libstdc++ to be specified for static linking with PPL.
-AC_ARG_WITH(host-libstdcxx,
-[AS_HELP_STRING([--with-host-libstdcxx=L],
- [use linker arguments L to link with libstdc++
- when linking with PPL])])
-
-case $with_host_libstdcxx in
- no|yes)
- AC_MSG_ERROR([-with-host-libstdcxx needs an argument])
- ;;
-esac
-
-# Libraries to use for stage1 or when not bootstrapping.
-AC_ARG_WITH(stage1-libs,
-[AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])],
-[if test "$withval" = "no" -o "$withval" = "yes"; then
- stage1_libs=
- else
- stage1_libs=$withval
- fi],
-[stage1_libs=$with_host_libstdcxx])
-AC_SUBST(stage1_libs)
-
-# Linker flags to use for stage1 or when not bootstrapping.
-AC_ARG_WITH(stage1-ldflags,
-[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
-[if test "$withval" = "no" -o "$withval" = "yes"; then
- stage1_ldflags=
- else
- stage1_ldflags=$withval
- fi],
-[stage1_ldflags=
- # In stage 1, default to linking libstdc++ and libgcc statically with GCC
- # if supported. But if the user explicitly specified the libraries to use,
- # trust that they are doing what they want.
- if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
- stage1_ldflags="-static-libstdc++ -static-libgcc"
- fi])
-AC_SUBST(stage1_ldflags)
-
-# Libraries to use for stage2 and later builds. This defaults to the
-# argument passed to --with-host-libstdcxx.
-AC_ARG_WITH(boot-libs,
-[AS_HELP_STRING([--with-boot-libs=LIBS], [libraries for stage2 and later])],
-[if test "$withval" = "no" -o "$withval" = "yes"; then
- poststage1_libs=
- else
- poststage1_libs=$withval
- fi],
-[poststage1_libs=$with_host_libstdcxx])
-AC_SUBST(poststage1_libs)
-
-# Linker flags to use for stage2 and later builds.
-AC_ARG_WITH(boot-ldflags,
-[AS_HELP_STRING([--with-boot-ldflags=FLAGS],
- [linker flags for stage2 and later])],
-[if test "$withval" = "no" -o "$withval" = "yes"; then
- poststage1_ldflags=
- else
- poststage1_ldflags=$withval
- fi],
-[poststage1_ldflags=
- # In stages 2 and 3, default to linking libstdc++ and libgcc
- # statically. But if the user explicitly specified the libraries to
- # use, trust that they are doing what they want.
- if test "$poststage1_libs" = ""; then
- poststage1_ldflags="-static-libstdc++ -static-libgcc"
- fi])
-AC_SUBST(poststage1_ldflags)
-
-# GCC GRAPHITE dependences, ISL and CLOOG which in turn requires ISL.
-# Basic setup is inlined here, actual checks are in config/cloog.m4 and
-# config/isl.m4
-
-AC_ARG_WITH(cloog,
- [AS_HELP_STRING(
- [--with-cloog=PATH],
- [Specify prefix directory for the installed CLooG-ISL package.
- Equivalent to --with-cloog-include=PATH/include
- plus --with-cloog-lib=PATH/lib])])
-AC_ARG_WITH(isl,
- [AS_HELP_STRING(
- [--with-isl=PATH],
- [Specify prefix directory for the installed ISL package.
- Equivalent to --with-isl-include=PATH/include
- plus --with-isl-lib=PATH/lib])])
-
-# Treat either --without-cloog or --without-isl as a request to disable
-# GRAPHITE support and skip all following checks.
-if test "x$with_isl" != "xno" &&
- test "x$with_cloog" != "xno"; then
- # Check for ISL
- dnl Provide configure switches and initialize islinc & isllibs
- dnl with user input.
- ISL_INIT_FLAGS
- dnl The versions of ISL that work for Graphite
- ISL_CHECK_VERSION(0,10)
- if test "${gcc_cv_isl}" = no ; then
- ISL_CHECK_VERSION(0,11)
- fi
- dnl Only execute fail-action, if ISL has been requested.
- ISL_IF_FAILED([
- AC_MSG_ERROR([Unable to find a usable ISL. See config.log for details.])])
-
- if test "x$gcc_cv_isl" != "xno"; then
- # Check for CLOOG
- dnl Provide configure switches and initialize clooginc & clooglibs
- dnl with user input.
- CLOOG_INIT_FLAGS
- dnl The versions of CLooG that work for Graphite.
- CLOOG_CHECK_VERSION(0,17,0)
- if test "${gcc_cv_cloog}" = no ; then
- CLOOG_CHECK_VERSION(0,18,0)
- fi
-
- dnl Only execute fail-action, if CLooG has been requested.
- CLOOG_IF_FAILED([
- AC_MSG_ERROR([Unable to find a usable CLooG. See config.log for details.])])
- fi
-fi
-
-# If either the ISL or the CLooG check failed, disable builds of in-tree
-# variants of both
-if test "x$with_isl" = xno ||
- test "x$with_cloog" = xno ||
- test "x$gcc_cv_cloog" = xno ||
- test "x$gcc_cv_isl" = xno; then
- noconfigdirs="$noconfigdirs cloog isl"
- islinc=
- clooginc=
- clooglibs=
-fi
-
-AC_SUBST(islinc)
-AC_SUBST(clooglibs)
-AC_SUBST(clooginc)
-
-
-# Check for LTO support.
-AC_ARG_ENABLE(lto,
-[AS_HELP_STRING([--enable-lto], [enable link time optimization support])],
-enable_lto=$enableval,
-enable_lto=yes; default_enable_lto=yes)
-
-ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
- build_lto_plugin=yes
-],[if test x"$default_enable_lto" = x"yes" ; then
- case $target in
- *-apple-darwin9* | *-cygwin* | *-mingw*) ;;
- # On other non-ELF platforms, LTO has yet to be validated.
- *) enable_lto=no ;;
- esac
- else
- # Apart from ELF platforms, only Windows and Darwin support LTO so far.
- # It would also be nice to check the binutils support, but we don't
- # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just
- # warn during gcc/ subconfigure; unless you're bootstrapping with
- # -flto it won't be needed until after installation anyway.
- case $target in
- *-cygwin* | *-mingw* | *-apple-darwin*) ;;
- *) if test x"$enable_lto" = x"yes"; then
- AC_MSG_ERROR([LTO support is not enabled for this target.])
- fi
- ;;
- esac
- fi
- # Among non-ELF, only Windows platforms support the lto-plugin so far.
- # Build it unless LTO was explicitly disabled.
- case $target in
- *-cygwin* | *-mingw*) build_lto_plugin=$enable_lto ;;
- *) ;;
- esac
-])
-
-
-# By default, C and C++ are the only stage 1 languages.
-stage1_languages=,c,
-
-# Target libraries that we bootstrap.
-bootstrap_target_libs=,target-libgcc,
-
-# Figure out what language subdirectories are present.
-# Look if the user specified --enable-languages="..."; if not, use
-# the environment variable $LANGUAGES if defined. $LANGUAGES might
-# go away some day.
-# NB: embedded tabs in this IF block -- do not untabify
-if test -d ${srcdir}/gcc; then
- if test x"${enable_languages+set}" != xset; then
- if test x"${LANGUAGES+set}" = xset; then
- enable_languages="${LANGUAGES}"
- echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
- else
- enable_languages=all
- fi
- else
- if test x"${enable_languages}" = x ||
- test x"${enable_languages}" = xyes;
- then
- echo configure.in: --enable-languages needs at least one language argument 1>&2
- exit 1
- fi
- fi
- enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
-
- # 'f95' is the old name for the 'fortran' language. We issue a warning
- # and make the substitution.
- case ,${enable_languages}, in
- *,f95,*)
- echo configure.in: warning: 'f95' as language name is deprecated, use 'fortran' instead 1>&2
- enable_languages=`echo "${enable_languages}" | sed -e 's/f95/fortran/g'`
- ;;
- esac
-
- # If bootstrapping, C++ must be enabled.
- case ",$enable_languages,:$enable_bootstrap" in
- *,c++,*:*) ;;
- *:yes)
- if test -f ${srcdir}/gcc/cp/config-lang.in; then
- enable_languages="${enable_languages},c++"
- else
- AC_MSG_ERROR([bootstrapping requires c++ sources])
- fi
- ;;
- esac
-
- # First scan to see if an enabled language requires some other language.
- # We assume that a given config-lang.in will list all the language
- # front ends it requires, even if some are required indirectly.
- for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
- case ${lang_frag} in
- ..) ;;
- # The odd quoting in the next line works around
- # an apparent bug in bash 1.12 on linux.
- ${srcdir}/gcc/[[*]]/config-lang.in) ;;
- *)
- # From the config-lang.in, get $language, $lang_requires, and
- # $lang_requires_boot_languages.
- language=
- lang_requires=
- lang_requires_boot_languages=
- . ${lang_frag}
- for other in ${lang_requires} ${lang_requires_boot_languages}; do
- case ,${enable_languages}, in
- *,$other,*) ;;
- *,all,*) ;;
- *,$language,*)
- echo " \`$other' language required by \`$language'; enabling" 1>&2
- enable_languages="${enable_languages},${other}"
- ;;
- esac
- done
- for other in ${lang_requires_boot_languages} ; do
- if test "$other" != "c"; then
- case ,${enable_stage1_languages}, in
- *,$other,*) ;;
- *,all,*) ;;
- *)
- case ,${enable_languages}, in
- *,$language,*)
- echo " '$other' language required by '$language' in stage 1; enabling" 1>&2
- enable_stage1_languages="$enable_stage1_languages,${other}"
- ;;
- esac
- ;;
- esac
- fi
- done
- ;;
- esac
- done
-
- new_enable_languages=,c,
-
- # If LTO is enabled, add the LTO front end.
- extra_host_libiberty_configure_flags=
- if test "$enable_lto" = "yes" ; then
- case ,${enable_languages}, in
- *,lto,*) ;;
- *) enable_languages="${enable_languages},lto" ;;
- esac
- if test "${build_lto_plugin}" = "yes" ; then
- configdirs="$configdirs lto-plugin"
- extra_host_libiberty_configure_flags=--enable-shared
- fi
- fi
- AC_SUBST(extra_host_libiberty_configure_flags)
-
- missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
- potential_languages=,c,
-
- enabled_target_libs=
- disabled_target_libs=
-
- for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
- case ${lang_frag} in
- ..) ;;
- # The odd quoting in the next line works around
- # an apparent bug in bash 1.12 on linux.
- ${srcdir}/gcc/[[*]]/config-lang.in) ;;
- *)
- # From the config-lang.in, get $language, $target_libs,
- # $lang_dirs, $boot_language, and $build_by_default
- language=
- target_libs=
- lang_dirs=
- subdir_requires=
- boot_language=no
- build_by_default=yes
- . ${lang_frag}
- if test x${language} = x; then
- echo "${lang_frag} doesn't set \$language." 1>&2
- exit 1
- fi
-
- if test "$language" = "c++"; then
- boot_language=yes
- fi
-
- add_this_lang=no
- case ,${enable_languages}, in
- *,${language},*)
- # Language was explicitly selected; include it
- # unless it is C, which is enabled by default.
- if test "$language" != "c"; then
- add_this_lang=yes
- fi
- ;;
- *,all,*)
- # 'all' was selected, select it if it is a default language
- if test "$language" != "c"; then
- add_this_lang=${build_by_default}
- fi
- ;;
- esac
-
- # Disable languages that need other directories if these aren't available.
- for i in $subdir_requires; do
- test -f "$srcdir/gcc/$i/config-lang.in" && continue
- case ,${enable_languages}, in
- *,${language},*)
- # Specifically requested language; tell them.
- AC_MSG_ERROR([The gcc/$i directory contains parts of $language but is missing])
- ;;
- *)
- # Silently disable.
- add_this_lang=unsupported
- ;;
- esac
- done
-
- # Disable Ada if no preexisting GNAT is available.
- case ,${enable_languages},:${language}:${have_gnat} in
- *,${language},*:ada:no)
- # Specifically requested language; tell them.
- AC_MSG_ERROR([GNAT is required to build $language])
- ;;
- *:ada:no)
- # Silently disable.
- add_this_lang=unsupported
- ;;
- esac
-
- # Disable a language that is unsupported by the target.
- case " $unsupported_languages " in
- *" $language "*)
- add_this_lang=unsupported
- ;;
- esac
-
- case $add_this_lang in
- unsupported)
- # Remove language-dependent dirs.
- disabled_target_libs="$disabled_target_libs $target_libs"
- noconfigdirs="$noconfigdirs $lang_dirs"
- ;;
- no)
- # Remove language-dependent dirs; still show language as supported.
- disabled_target_libs="$disabled_target_libs $target_libs"
- noconfigdirs="$noconfigdirs $lang_dirs"
- potential_languages="${potential_languages}${language},"
- ;;
- yes)
- new_enable_languages="${new_enable_languages}${language},"
- potential_languages="${potential_languages}${language},"
- missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
- enabled_target_libs="$enabled_target_libs $target_libs"
- case "${boot_language}:,$enable_stage1_languages," in
- yes:* | *:*,$language,* | *:*,yes, | *:*,all,)
- # Add to (comma-separated) list of stage 1 languages.
- case ",$stage1_languages," in
- *,$language,* | ,yes, | ,all,) ;;
- *) stage1_languages="${stage1_languages}${language}," ;;
- esac
- # We need to bootstrap any supporting libraries.
- bootstrap_target_libs="${bootstrap_target_libs}${target_libs},"
- ;;
- esac
- ;;
- esac
- ;;
- esac
- done
-
- # Add target libraries which are only needed for disabled languages
- # to noconfigdirs.
- if test -n "$disabled_target_libs"; then
- for dir in $disabled_target_libs; do
- case " $enabled_target_libs " in
- *" ${dir} "*) ;;
- *) noconfigdirs="$noconfigdirs $dir" ;;
- esac
- done
- fi
-
- AC_ARG_ENABLE(stage1-languages,
- [AS_HELP_STRING([[--enable-stage1-languages[=all]]],
- [choose additional languages to build during
- stage1. Mostly useful for compiler development])],
- [case ,${enable_stage1_languages}, in
- ,no,|,,)
- # Set it to something that will have no effect in the loop below
- enable_stage1_languages=c ;;
- ,yes,)
- enable_stage1_languages=`echo $new_enable_languages | \
- sed -e "s/^,//" -e "s/,$//" ` ;;
- *,all,*)
- enable_stage1_languages=`echo ,$enable_stage1_languages, | \
- sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;;
- esac
-
- # Add "good" languages from enable_stage1_languages to stage1_languages,
- # while "bad" languages go in missing_languages. Leave no duplicates.
- for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do
- case $potential_languages in
- *,$i,*)
- case $stage1_languages in
- *,$i,*) ;;
- *) stage1_languages="$stage1_languages$i," ;;
- esac ;;
- *)
- case $missing_languages in
- *,$i,*) ;;
- *) missing_languages="$missing_languages$i," ;;
- esac ;;
- esac
- done])
-
- # Remove leading/trailing commas that were added for simplicity
- potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"`
- missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"`
- stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"`
- new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"`
-
- if test "x$missing_languages" != x; then
- AC_MSG_ERROR([
-The following requested languages could not be built: ${missing_languages}
-Supported languages are: ${potential_languages}])
- fi
- if test "x$new_enable_languages" != "x$enable_languages"; then
- echo The following languages will be built: ${new_enable_languages}
- enable_languages="$new_enable_languages"
- fi
-
- AC_SUBST(stage1_languages)
- ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[[^ ]]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" `
-fi
-
-# Handle --disable-<component> generically.
-for dir in $configdirs $build_configdirs $target_configdirs ; do
- dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
- varname=`echo $dirname | sed -e s/+/_/g`
- if eval test x\${enable_${varname}} "=" xno ; then
- noconfigdirs="$noconfigdirs $dir"
- fi
-done
-
-# Check for Boehm's garbage collector
-AC_ARG_ENABLE(objc-gc,
-[AS_HELP_STRING([--enable-objc-gc],
- [enable use of Boehm's garbage collector with the
- GNU Objective-C runtime])],
-[case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in
- *,objc,*:*:yes:*target-boehm-gc*)
- AC_MSG_ERROR([Boehm's garbage collector was requested yet not supported in this configuration])
- ;;
-esac])
-
-# Make sure we only build Boehm's garbage collector if required.
-case ,${enable_languages},:${enable_objc_gc} in
- *,objc,*:yes)
- # Keep target-boehm-gc if requested for Objective-C.
- ;;
- *)
- # Otherwise remove target-boehm-gc depending on target-libjava.
- if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then
- noconfigdirs="$noconfigdirs target-boehm-gc"
- fi
- ;;
-esac
-
-# Disable libitm and libsanitizer if we're not building C++
-case ,${enable_languages}, in
- *,c++,*) ;;
- *)
- noconfigdirs="$noconfigdirs target-libitm target-libsanitizer"
- ;;
-esac
-
-# Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
-# $build_configdirs and $target_configdirs.
-# If we have the source for $noconfigdirs entries, add them to $notsupp.
-
-notsupp=""
-for dir in . $skipdirs $noconfigdirs ; do
- dirname=`echo $dir | sed -e s/target-//g -e s/build-//g`
- if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
- configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
- if test -r $srcdir/$dirname/configure ; then
- if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
- true
- else
- notsupp="$notsupp $dir"
- fi
- fi
- fi
- if test $dir != . && echo " ${build_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
- build_configdirs=`echo " ${build_configdirs} " | sed -e "s/ ${dir} / /"`
- if test -r $srcdir/$dirname/configure ; then
- if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
- true
- else
- notsupp="$notsupp $dir"
- fi
- fi
- fi
- if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
- target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
- if test -r $srcdir/$dirname/configure ; then
- if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
- true
- else
- notsupp="$notsupp $dir"
- fi
- fi
- fi
-done
-
-# Quietly strip out all directories which aren't configurable in this tree.
-# This relies on all configurable subdirectories being autoconfiscated, which
-# is now the case.
-build_configdirs_all="$build_configdirs"
-build_configdirs=
-for i in ${build_configdirs_all} ; do
- j=`echo $i | sed -e s/build-//g`
- if test -f ${srcdir}/$j/configure ; then
- build_configdirs="${build_configdirs} $i"
- fi
-done
-
-configdirs_all="$configdirs"
-configdirs=
-for i in ${configdirs_all} ; do
- if test -f ${srcdir}/$i/configure ; then
- configdirs="${configdirs} $i"
- fi
-done
-
-target_configdirs_all="$target_configdirs"
-target_configdirs=
-for i in ${target_configdirs_all} ; do
- j=`echo $i | sed -e s/target-//g`
- if test -f ${srcdir}/$j/configure ; then
- target_configdirs="${target_configdirs} $i"
- fi
-done
-
-# Produce a warning message for the subdirs we can't configure.
-# This isn't especially interesting in the Cygnus tree, but in the individual
-# FSF releases, it's important to let people know when their machine isn't
-# supported by the one or two programs in a package.
-
-if test -n "${notsupp}" && test -z "${norecursion}" ; then
- # If $appdirs is non-empty, at least one of those directories must still
- # be configured, or we error out. (E.g., if the gas release supports a
- # specified target in some subdirs but not the gas subdir, we shouldn't
- # pretend that all is well.)
- if test -n "$appdirs" ; then
- for dir in $appdirs ; do
- if test -r $dir/Makefile.in ; then
- if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
- appdirs=""
- break
- fi
- if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
- appdirs=""
- break
- fi
- fi
- done
- if test -n "$appdirs" ; then
- echo "*** This configuration is not supported by this package." 1>&2
- exit 1
- fi
- fi
- # Okay, some application will build, or we don't care to check. Still
- # notify of subdirs not getting built.
- echo "*** This configuration is not supported in the following subdirectories:" 1>&2
- echo " ${notsupp}" 1>&2
- echo " (Any other directories should still work fine.)" 1>&2
-fi
-
-case "$host" in
- *msdosdjgpp*)
- enable_gdbtk=no ;;
-esac
-
-# To find our prefix, in gcc_cv_tool_prefix.
-ACX_TOOL_DIRS
-
-copy_dirs=
-
-AC_ARG_WITH([build-sysroot],
- [AS_HELP_STRING([--with-build-sysroot=SYSROOT],
- [use sysroot as the system root during the build])],
- [if test x"$withval" != x ; then
- SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
- fi],
- [SYSROOT_CFLAGS_FOR_TARGET=])
-AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
-
-AC_ARG_WITH([debug-prefix-map],
- [AS_HELP_STRING([--with-debug-prefix-map='A=B C=D ...'],
- [map A to B, C to D ... in debug information])],
- [if test x"$withval" != x; then
- DEBUG_PREFIX_CFLAGS_FOR_TARGET=
- for debug_map in $withval; do
- DEBUG_PREFIX_CFLAGS_FOR_TARGET="$DEBUG_PREFIX_CFLAGS_FOR_TARGET -fdebug-prefix-map=$debug_map"
- done
- fi],
- [DEBUG_PREFIX_CFLAGS_FOR_TARGET=])
-AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
-
-# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
-# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
-# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
-# We want to ensure that TARGET libraries (which we know are built with
-# gcc) are built with "-O2 -g", so include those options when setting
-# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
-if test "x$CFLAGS_FOR_TARGET" = x; then
- CFLAGS_FOR_TARGET=$CFLAGS
- case " $CFLAGS " in
- *" -O2 "*) ;;
- *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
- esac
- case " $CFLAGS " in
- *" -g "* | *" -g3 "*) ;;
- *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
- esac
-fi
-AC_SUBST(CFLAGS_FOR_TARGET)
-
-if test "x$CXXFLAGS_FOR_TARGET" = x; then
- CXXFLAGS_FOR_TARGET=$CXXFLAGS
- case " $CXXFLAGS " in
- *" -O2 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
- esac
- case " $CXXFLAGS " in
- *" -g "* | *" -g3 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
- esac
-fi
-AC_SUBST(CXXFLAGS_FOR_TARGET)
-
-AC_SUBST(LDFLAGS_FOR_TARGET)
-
-# Handle --with-headers=XXX. If the value is not "yes", the contents of
-# the named directory are copied to $(tooldir)/sys-include.
-if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
- if test x${is_cross_compiler} = xno ; then
- echo 1>&2 '***' --with-headers is only supported when cross compiling
- exit 1
- fi
- if test x"${with_headers}" != xyes ; then
- x=${gcc_cv_tool_prefix}
- copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include"
- fi
-fi
-
-# Handle --with-libs=XXX. If the value is not "yes", the contents of
-# the name directories are copied to $(tooldir)/lib. Multiple directories
-# are permitted.
-if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
- if test x${is_cross_compiler} = xno ; then
- echo 1>&2 '***' --with-libs is only supported when cross compiling
- exit 1
- fi
- if test x"${with_libs}" != xyes ; then
- # Copy the libraries in reverse order, so that files in the first named
- # library override files in subsequent libraries.
- x=${gcc_cv_tool_prefix}
- for l in ${with_libs}; do
- copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}"
- done
- fi
-fi
-
-# Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
-#
-# This is done by determining whether or not the appropriate directory
-# is available, and by checking whether or not specific configurations
-# have requested that this magic not happen.
-#
-# The command line options always override the explicit settings in
-# configure.in, and the settings in configure.in override this magic.
-#
-# If the default for a toolchain is to use GNU as and ld, and you don't
-# want to do that, then you should use the --without-gnu-as and
-# --without-gnu-ld options for the configure script. Similarly, if
-# the default is to use the included zlib and you don't want to do that,
-# you should use the --with-system-zlib option for the configure script.
-
-if test x${use_gnu_as} = x &&
- echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
- with_gnu_as=yes
- extra_host_args="$extra_host_args --with-gnu-as"
-fi
-
-if test x${use_gnu_ld} = x &&
- echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then
- with_gnu_ld=yes
- extra_host_args="$extra_host_args --with-gnu-ld"
-fi
-
-if test x${use_included_zlib} = x &&
- echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
- :
-else
- with_system_zlib=yes
- extra_host_args="$extra_host_args --with-system-zlib"
-fi
-
-# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
-# can detect this case.
-
-if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
- with_newlib=yes
- extra_host_args="$extra_host_args --with-newlib"
-fi
-
-# Handle ${copy_dirs}
-set fnord ${copy_dirs}
-shift
-while test $# != 0 ; do
- if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then
- :
- else
- echo Copying $1 to $2
-
- # Use the install script to create the directory and all required
- # parent directories.
- if test -d $2 ; then
- :
- else
- echo >config.temp
- ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
- fi
-
- # Copy the directory, assuming we have tar.
- # FIXME: Should we use B in the second tar? Not all systems support it.
- (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
-
- # It is the responsibility of the user to correctly adjust all
- # symlinks. If somebody can figure out how to handle them correctly
- # here, feel free to add the code.
-
- echo $1 > $2/COPIED
- fi
- shift; shift
-done
-
-# Determine a target-dependent exec_prefix that the installed
-# gcc will search in. Keep this list sorted by triplet, with
-# the *-*-osname triplets last.
-md_exec_prefix=
-case "${target}" in
- i[[34567]]86-pc-msdosdjgpp*)
- md_exec_prefix=/dev/env/DJDIR/bin
- ;;
- *-*-hpux* | \
- *-*-nto-qnx* | \
- *-*-solaris2*)
- md_exec_prefix=/usr/ccs/bin
- ;;
-esac
-
-extra_arflags_for_target=
-extra_nmflags_for_target=
-extra_ranlibflags_for_target=
-target_makefile_frag=/dev/null
-case "${target}" in
- spu-*-*)
- target_makefile_frag="config/mt-spu"
- ;;
- mips*-sde-elf* | mips*-mti-elf*)
- target_makefile_frag="config/mt-sde"
- ;;
- mipsisa*-*-elfoabi*)
- target_makefile_frag="config/mt-mips-elfoabi"
- ;;
- mips*-*-*linux* | mips*-*-gnu*)
- target_makefile_frag="config/mt-mips-gnu"
- ;;
- *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
- target_makefile_frag="config/mt-gnu"
- ;;
- *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
- # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
- # commands to handle both 32-bit and 64-bit objects. These flags are
- # harmless if we're using GNU nm or ar.
- extra_arflags_for_target=" -X32_64"
- extra_nmflags_for_target=" -B -X32_64"
- ;;
-esac
-
-alphaieee_frag=/dev/null
-case $target in
- alpha*-*-*)
- # This just makes sure to use the -mieee option to build target libs.
- # This should probably be set individually by each library.
- alphaieee_frag="config/mt-alphaieee"
- ;;
-esac
-
-# If --enable-target-optspace always use -Os instead of -O2 to build
-# the target libraries, similarly if it is not specified, use -Os
-# on selected platforms.
-ospace_frag=/dev/null
-case "${enable_target_optspace}:${target}" in
- yes:*)
- ospace_frag="config/mt-ospace"
- ;;
- :d30v-*)
- ospace_frag="config/mt-d30v"
- ;;
- :m32r-* | :d10v-* | :fr30-*)
- ospace_frag="config/mt-ospace"
- ;;
- no:* | :*)
- ;;
- *)
- echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
- ;;
-esac
-
-# Some systems (e.g., one of the i386-aix systems the gas testers are
-# using) don't handle "\$" correctly, so don't use it here.
-tooldir='${exec_prefix}'/${target_noncanonical}
-build_tooldir=${tooldir}
-
-# Create a .gdbinit file which runs the one in srcdir
-# and tells GDB to look there for source files.
-
-if test -r ${srcdir}/.gdbinit ; then
- case ${srcdir} in
- .) ;;
- *) cat > ./.gdbinit <<EOF
-# ${NO_EDIT}
-dir ${srcdir}
-dir .
-source ${srcdir}/.gdbinit
-EOF
- ;;
- esac
-fi
-
-# Make sure that the compiler is able to generate an executable. If it
-# can't, we are probably in trouble. We don't care whether we can run the
-# executable--we might be using a cross compiler--we only care whether it
-# can be created. At this point the main configure script has set CC.
-we_are_ok=no
-echo "int main () { return 0; }" > conftest.c
-${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
-if test $? = 0 ; then
- if test -s conftest || test -s conftest.exe ; then
- we_are_ok=yes
- fi
-fi
-case $we_are_ok in
- no)
- echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
- echo 1>&2 "*** You must set the environment variable CC to a working compiler."
- rm -f conftest*
- exit 1
- ;;
-esac
-rm -f conftest*
-
-# Decide which environment variable is used to find dynamic libraries.
-case "${host}" in
- *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
- *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;;
- *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
- *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
-esac
-
-# On systems where the dynamic library environment variable is PATH,
-# gcc/ will put dynamic libraries into a subdirectory to avoid adding
-# built executables to PATH.
-if test "$RPATH_ENVVAR" = PATH; then
- GCC_SHLIB_SUBDIR=/shlib
-else
- GCC_SHLIB_SUBDIR=
-fi
-
-# Record target_configdirs and the configure arguments for target and
-# build configuration in Makefile.
-target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
-build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
-
-# If we are building libgomp, bootstrap it.
-if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then
- bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
-fi
-
-# If we are building libsanitizer, bootstrap it.
-if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1 ; then
- bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
-fi
-
-# Determine whether gdb needs tk/tcl or not.
-# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
-# and in that case we want gdb to be built without tk. Ugh!
-# In fact I believe gdb is the *only* package directly dependent on tk,
-# so we should be able to put the 'maybe's in unconditionally and
-# leave out the maybe dependencies when enable_gdbtk is false. I'm not
-# 100% sure that that's safe though.
-
-gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-libgui"
-case "$enable_gdbtk" in
- no)
- GDB_TK="" ;;
- yes)
- GDB_TK="${gdb_tk}" ;;
- *)
- # Only add the dependency on gdbtk when GDBtk is part of the gdb
- # distro. Eventually someone will fix this and move Insight, nee
- # gdbtk to a separate directory.
- if test -d ${srcdir}/gdb/gdbtk ; then
- GDB_TK="${gdb_tk}"
- else
- GDB_TK=""
- fi
- ;;
-esac
-CONFIGURE_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-configure-/g`
-INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
-
-# Strip out unwanted targets.
-
-# While at that, we remove Makefiles if we were started for recursive
-# configuration, so that the top-level Makefile reconfigures them,
-# like we used to do when configure itself was recursive.
-
-# Loop over modules. We used to use the "$extrasub" feature from Autoconf
-# but now we're fixing up the Makefile ourselves with the additional
-# commands passed to AC_CONFIG_FILES. Use separate variables
-# extrasub-{build,host,target} not because there is any reason to split
-# the substitutions up that way, but only to remain below the limit of
-# 99 commands in a script, for HP-UX sed.
-# Do not nest @if/@endif pairs, because configure will not warn you at all.
-
-case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
- yes:yes:*\ gold\ *:*,c++,*) ;;
- yes:yes:*\ gold\ *:*)
- AC_MSG_ERROR([in a combined tree, bootstrapping with --enable-gold requires c++ in stage1_languages])
- ;;
-esac
-
-# Adjust the toplevel makefile according to whether bootstrap was selected.
-case $enable_bootstrap in
- yes)
- bootstrap_suffix=bootstrap
- BUILD_CONFIG=bootstrap-debug
- ;;
- no)
- bootstrap_suffix=no-bootstrap
- BUILD_CONFIG=
- ;;
-esac
-
-AC_MSG_CHECKING(for default BUILD_CONFIG)
-
-AC_ARG_WITH([build-config],
- [AS_HELP_STRING([--with-build-config='NAME NAME2...'],
- [use config/NAME.mk build configuration])],
- [case $with_build_config in
- yes) with_build_config= ;;
- no) with_build_config= BUILD_CONFIG= ;;
- esac])
-
-if test "x${with_build_config}" != x; then
- BUILD_CONFIG=$with_build_config
-else
- case $BUILD_CONFIG in
- bootstrap-debug)
- if echo "int f (void) { return 0; }" > conftest.c &&
- ${CC} -c conftest.c &&
- mv conftest.o conftest.o.g0 &&
- ${CC} -c -g conftest.c &&
- mv conftest.o conftest.o.g &&
- ${srcdir}/contrib/compare-debug conftest.o.g0 conftest.o.g > /dev/null 2>&1; then
- :
- else
- BUILD_CONFIG=
- fi
- rm -f conftest.c conftest.o conftest.o.g0 conftest.o.g
- ;;
- esac
-fi
-AC_MSG_RESULT($BUILD_CONFIG)
-AC_SUBST(BUILD_CONFIG)
-
-extrasub_build=
-for module in ${build_configdirs} ; do
- if test -z "${no_recursion}" \
- && test -f ${build_subdir}/${module}/Makefile; then
- echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
- rm -f ${build_subdir}/${module}/Makefile
- fi
- extrasub_build="$extrasub_build
-/^@if build-$module\$/d
-/^@endif build-$module\$/d
-/^@if build-$module-$bootstrap_suffix\$/d
-/^@endif build-$module-$bootstrap_suffix\$/d"
-done
-extrasub_host=
-for module in ${configdirs} ; do
- if test -z "${no_recursion}"; then
- for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do
- if test -f ${file}; then
- echo 1>&2 "*** removing ${file} to force reconfigure"
- rm -f ${file}
- fi
- done
- fi
- extrasub_host="$extrasub_host
-/^@if $module\$/d
-/^@endif $module\$/d
-/^@if $module-$bootstrap_suffix\$/d
-/^@endif $module-$bootstrap_suffix\$/d"
-done
-extrasub_target=
-for module in ${target_configdirs} ; do
- if test -z "${no_recursion}" \
- && test -f ${target_subdir}/${module}/Makefile; then
- echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
- rm -f ${target_subdir}/${module}/Makefile
- fi
-
- # We only bootstrap target libraries listed in bootstrap_target_libs.
- case $bootstrap_target_libs in
- *,target-$module,*) target_bootstrap_suffix=$bootstrap_suffix ;;
- *) target_bootstrap_suffix=no-bootstrap ;;
- esac
-
- extrasub_target="$extrasub_target
-/^@if target-$module\$/d
-/^@endif target-$module\$/d
-/^@if target-$module-$target_bootstrap_suffix\$/d
-/^@endif target-$module-$target_bootstrap_suffix\$/d"
-done
-
-# Do the final fixup along with target modules.
-extrasub_target="$extrasub_target
-/^@if /,/^@endif /d"
-
-# Create the serialization dependencies. This uses a temporary file.
-
-AC_ARG_ENABLE([serial-configure],
-[AS_HELP_STRING([[--enable-serial-[{host,target,build}-]configure]],
- [force sequential configuration of
- sub-packages for the host, target or build
- machine, or all sub-packages])])
-
-case ${enable_serial_configure} in
- yes)
- enable_serial_build_configure=yes
- enable_serial_host_configure=yes
- enable_serial_target_configure=yes
- ;;
-esac
-
-# These force 'configure's to be done one at a time, to avoid problems
-# with contention over a shared config.cache.
-rm -f serdep.tmp
-echo '# serdep.tmp' > serdep.tmp
-olditem=
-test "x${enable_serial_build_configure}" = xyes &&
-for item in ${build_configdirs} ; do
- case ${olditem} in
- "") ;;
- *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;;
- esac
- olditem=${item}
-done
-olditem=
-test "x${enable_serial_host_configure}" = xyes &&
-for item in ${configdirs} ; do
- case ${olditem} in
- "") ;;
- *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;;
- esac
- olditem=${item}
-done
-olditem=
-test "x${enable_serial_target_configure}" = xyes &&
-for item in ${target_configdirs} ; do
- case ${olditem} in
- "") ;;
- *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;;
- esac
- olditem=${item}
-done
-serialization_dependencies=serdep.tmp
-AC_SUBST_FILE(serialization_dependencies)
-
-# Base args. Strip norecursion, cache-file, srcdir, host, build,
-# target, nonopt, and variable assignments. These are the ones we
-# might not want to pass down to subconfigures. The exception being
-# --cache-file=/dev/null, which is used to turn off the use of cache
-# files altogether, and which should be passed on to subconfigures.
-# Also strip program-prefix, program-suffix, and program-transform-name,
-# so that we can pass down a consistent program-transform-name.
-baseargs=
-tbaseargs=
-keep_next=no
-skip_next=no
-eval "set -- $ac_configure_args"
-for ac_arg
-do
- if test X"$skip_next" = X"yes"; then
- skip_next=no
- continue
- fi
- if test X"$keep_next" = X"yes"; then
- case $ac_arg in
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- baseargs="$baseargs '$ac_arg'"
- tbaseargs="$tbaseargs '$ac_arg'"
- keep_next=no
- continue
- fi
-
- # Handle separated arguments. Based on the logic generated by
- # autoconf 2.59.
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- separate_arg=no
- ;;
- -*)
- separate_arg=yes
- ;;
- *)
- separate_arg=no
- ;;
- esac
-
- skip_targ=no
- case $ac_arg in
-changequote(,)
- --with-* | --without-*)
- libopt=`echo "$ac_arg" | sed -e 's,^--[^-_]*[-_],,' -e 's,=.*$,,'`
-
- case $libopt in
- *[-_]include)
- lib=`echo "$libopt" | sed 's,[-_]include$,,'`
- ;;
- *[-_]lib)
- lib=`echo "$libopt" | sed 's,[-_]lib$,,'`
- ;;
- *)
- lib=$libopt
- ;;
- esac
-changequote([,])
-
- case $lib in
- mpc | mpfr | gmp | cloog)
- # If we're processing --with-$lib, --with-$lib-include or
- # --with-$lib-lib, for one of the libs above, and target is
- # different from host, don't pass the current argument to any
- # target library's configure.
- if test x$is_cross_compiler = xyes; then
- skip_targ=yes
- fi
- ;;
- esac
- ;;
- esac
-
- case "$ac_arg" in
- --cache-file=/dev/null | \
- -cache-file=/dev/null )
- # Handled here to avoid the test to skip args below.
- baseargs="$baseargs '$ac_arg'"
- tbaseargs="$tbaseargs '$ac_arg'"
- # Assert: $separate_arg should always be no.
- keep_next=$separate_arg
- ;;
- --no*)
- continue
- ;;
- --c* | \
- --sr* | \
- --ho* | \
- --bu* | \
- --t* | \
- --program-* | \
- -cache_file* | \
- -srcdir* | \
- -host* | \
- -build* | \
- -target* | \
- -program-prefix* | \
- -program-suffix* | \
- -program-transform-name* )
- skip_next=$separate_arg
- continue
- ;;
- -*)
- # An option. Add it.
- case $ac_arg in
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- baseargs="$baseargs '$ac_arg'"
- if test X"$skip_targ" = Xno; then
- tbaseargs="$tbaseargs '$ac_arg'"
- fi
- keep_next=$separate_arg
- ;;
- *)
- # Either a variable assignment, or a nonopt (triplet). Don't
- # pass it down; let the Makefile handle this.
- continue
- ;;
- esac
-done
-# Remove the initial space we just introduced and, as these will be
-# expanded by make, quote '$'.
-baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
-
-# Add in --program-transform-name, after --program-prefix and
-# --program-suffix have been applied to it. Autoconf has already
-# doubled dollar signs and backslashes in program_transform_name; we want
-# the backslashes un-doubled, and then the entire thing wrapped in single
-# quotes, because this will be expanded first by make and then by the shell.
-# Also, because we want to override the logic in subdir configure scripts to
-# choose program_transform_name, replace any s,x,x, with s,y,y,.
-sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
-${program_transform_name}
-EOF_SED
-gcc_transform_name=`cat conftestsed.out`
-rm -f conftestsed.out
-baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
-tbaseargs="$tbaseargs --program-transform-name='${gcc_transform_name}'"
-if test "$silent" = yes; then
- baseargs="$baseargs --silent"
- tbaseargs="$tbaseargs --silent"
-fi
-baseargs="$baseargs --disable-option-checking"
-tbaseargs="$tbaseargs --disable-option-checking"
-
-# Record and document user additions to sub configure arguments.
-AC_ARG_VAR([build_configargs],
- [additional configure arguments for build directories])
-AC_ARG_VAR([host_configargs],
- [additional configure arguments for host directories])
-AC_ARG_VAR([target_configargs],
- [additional configure arguments for target directories])
-
-# For the build-side libraries, we just need to pretend we're native,
-# and not use the same cache file. Multilibs are neither needed nor
-# desired.
-build_configargs="$build_configargs --cache-file=../config.cache ${baseargs}"
-
-# For host modules, accept cache file option, or specification as blank.
-case "${cache_file}" in
-"") # empty
- cache_file_option="" ;;
-/* | [[A-Za-z]]:[[\\/]]* ) # absolute path
- cache_file_option="--cache-file=${cache_file}" ;;
-*) # relative path
- cache_file_option="--cache-file=../${cache_file}" ;;
-esac
-
-# Host dirs don't like to share a cache file either, horribly enough.
-# This seems to be due to autoconf 2.5x stupidity.
-host_configargs="$host_configargs --cache-file=./config.cache ${extra_host_args} ${baseargs}"
-
-target_configargs="$target_configargs ${tbaseargs}"
-
-# Passing a --with-cross-host argument lets the target libraries know
-# whether they are being built with a cross-compiler or being built
-# native. However, it would be better to use other mechanisms to make the
-# sorts of decisions they want to make on this basis. Please consider
-# this option to be deprecated. FIXME.
-if test x${is_cross_compiler} = xyes ; then
- target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
-fi
-
-# Default to --enable-multilib.
-if test x${enable_multilib} = x ; then
- target_configargs="--enable-multilib ${target_configargs}"
-fi
-
-# Pass --with-newlib if appropriate. Note that target_configdirs has
-# changed from the earlier setting of with_newlib.
-if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then
- target_configargs="--with-newlib ${target_configargs}"
-fi
-
-# Different target subdirs use different values of certain variables
-# (notably CXX). Worse, multilibs use *lots* of different values.
-# Worse yet, autoconf 2.5x makes some of these 'precious', meaning that
-# it doesn't automatically accept command-line overrides of them.
-# This means it's not safe for target subdirs to share a cache file,
-# which is disgusting, but there you have it. Hopefully this can be
-# fixed in future. It's still worthwhile to use a cache file for each
-# directory. I think.
-
-# Pass the appropriate --build, --host, --target and --cache-file arguments.
-# We need to pass --target, as newer autoconf's requires consistency
-# for target_alias and gcc doesn't manage it consistently.
-target_configargs="--cache-file=./config.cache ${target_configargs}"
-
-FLAGS_FOR_TARGET=
-case " $target_configdirs " in
- *" newlib "*)
- case " $target_configargs " in
- *" --with-newlib "*)
- case "$target" in
- *-cygwin*)
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -isystem $$s/winsup/cygwin/include'
- ;;
- esac
-
- # If we're not building GCC, don't discard standard headers.
- if test -d ${srcdir}/gcc; then
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
-
- if test "${build}" != "${host}"; then
- # On Canadian crosses, CC_FOR_TARGET will have already been set
- # by `configure', so we won't have an opportunity to add -Bgcc/
- # to it. This is right: we don't want to search that directory
- # for binaries, but we want the header files in there, so add
- # them explicitly.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/$(HOST_SUBDIR)/gcc/include -isystem $$r/$(HOST_SUBDIR)/gcc/include-fixed'
-
- # Someone might think of using the pre-installed headers on
- # Canadian crosses, in case the installed compiler is not fully
- # compatible with the compiler being built. In this case, it
- # would be better to flag an error than risking having
- # incompatible object files being constructed. We can't
- # guarantee that an error will be flagged, but let's hope the
- # compiler will do it, when presented with incompatible header
- # files.
- fi
- fi
-
- case "${target}-${is_cross_compiler}" in
- i[[3456789]]86-*-linux*-no)
- # Here host == target, so we don't need to build gcc,
- # so we don't want to discard standard headers.
- FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'`
- ;;
- *)
- # If we're building newlib, use its generic headers last, but search
- # for any libc-related directories first (so make it the last -B
- # switch).
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
-
- # If we're building libgloss, find the startup file, simulator library
- # and linker script.
- case " $target_configdirs " in
- *" libgloss "*)
- # Look for startup file, simulator library and maybe linker script.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/'"$libgloss_dir"
- # Look for libnosys.a in case the target needs it.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
- # Most targets have the linker script in the source directory.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$s/libgloss/'"$libgloss_dir"
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
-esac
-
-case "$target" in
- x86_64-*mingw* | *-w64-mingw*)
- # MinGW-w64 does not use newlib, nor does it use winsup. It may,
- # however, use a symlink named 'mingw' in ${prefix} .
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L${prefix}/${target}/lib -L${prefix}/mingw/lib -isystem ${prefix}/${target}/include -isystem ${prefix}/mingw/include'
- ;;
- *-mingw*)
- # MinGW can't be handled as Cygwin above since it does not use newlib.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include'
- ;;
-esac
-
-# Allow the user to override the flags for
-# our build compiler if desired.
-if test x"${build}" = x"${host}" ; then
- CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
- CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
- LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
-fi
-
-# On Canadian crosses, we'll be searching the right directories for
-# the previously-installed cross compiler, so don't bother to add
-# flags for directories within the install tree of the compiler
-# being built; programs in there won't even run.
-if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
- # Search for pre-installed headers if nothing else fits.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
-fi
-
-if test "x${use_gnu_ld}" = x &&
- echo " ${configdirs} " | grep " ld " > /dev/null ; then
- # Arrange for us to find uninstalled linker scripts.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
-fi
-
-# Search for other target-specific linker scripts and such.
-case "${target}" in
- mep*)
- FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
- ;;
-esac
-
-# Makefile fragments.
-for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
-do
- eval fragval=\$$frag
- if test $fragval != /dev/null; then
- eval $frag=${srcdir}/$fragval
- fi
-done
-AC_SUBST_FILE(host_makefile_frag)
-AC_SUBST_FILE(target_makefile_frag)
-AC_SUBST_FILE(alphaieee_frag)
-AC_SUBST_FILE(ospace_frag)
-
-# Miscellanea: directories, flags, etc.
-AC_SUBST(RPATH_ENVVAR)
-AC_SUBST(GCC_SHLIB_SUBDIR)
-AC_SUBST(tooldir)
-AC_SUBST(build_tooldir)
-AC_SUBST(CONFIGURE_GDB_TK)
-AC_SUBST(GDB_TK)
-AC_SUBST(INSTALL_GDB_TK)
-
-# Build module lists & subconfigure args.
-AC_SUBST(build_configargs)
-AC_SUBST(build_configdirs)
-
-# Host module lists & subconfigure args.
-AC_SUBST(host_configargs)
-AC_SUBST(configdirs)
-AC_SUBST(target_configdirs)
-
-# Target module lists & subconfigure args.
-AC_SUBST(target_configargs)
-
-
-# Build tools.
-AC_SUBST(AR_FOR_BUILD)
-AC_SUBST(AS_FOR_BUILD)
-AC_SUBST(CC_FOR_BUILD)
-AC_SUBST(CFLAGS_FOR_BUILD)
-AC_SUBST(CXXFLAGS_FOR_BUILD)
-AC_SUBST(CXX_FOR_BUILD)
-AC_SUBST(DLLTOOL_FOR_BUILD)
-AC_SUBST(GCJ_FOR_BUILD)
-AC_SUBST(GFORTRAN_FOR_BUILD)
-AC_SUBST(GOC_FOR_BUILD)
-AC_SUBST(LDFLAGS_FOR_BUILD)
-AC_SUBST(LD_FOR_BUILD)
-AC_SUBST(NM_FOR_BUILD)
-AC_SUBST(RANLIB_FOR_BUILD)
-AC_SUBST(WINDMC_FOR_BUILD)
-AC_SUBST(WINDRES_FOR_BUILD)
-
-# Generate default definitions for YACC, M4, LEX and other programs that run
-# on the build machine. These are used if the Makefile can't locate these
-# programs in objdir.
-MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
-
-AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
-case " $build_configdirs " in
- *" bison "*) YACC='$$r/$(BUILD_SUBDIR)/bison/tests/bison -y' ;;
-esac
-
-AC_CHECK_PROGS([BISON], [bison], [$MISSING bison])
-case " $build_configdirs " in
- *" bison "*) BISON='$$r/$(BUILD_SUBDIR)/bison/tests/bison' ;;
-esac
-
-AC_CHECK_PROGS([M4], [gm4 gnum4 m4], [$MISSING m4])
-case " $build_configdirs " in
- *" m4 "*) M4='$$r/$(BUILD_SUBDIR)/m4/m4' ;;
-esac
-
-AC_CHECK_PROGS([LEX], [flex lex], [$MISSING flex])
-case " $build_configdirs " in
- *" flex "*) LEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
- *" lex "*) LEX='$$r/$(BUILD_SUBDIR)/lex/lex' ;;
-esac
-
-AC_CHECK_PROGS([FLEX], [flex], [$MISSING flex])
-case " $build_configdirs " in
- *" flex "*) FLEX='$$r/$(BUILD_SUBDIR)/flex/flex' ;;
-esac
-
-AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
-case " $build_configdirs " in
- *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
- *)
-changequote(,)
- # For an installed makeinfo, we require it to be from texinfo 4.7 or
- # higher, else we use the "missing" dummy.
- if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
- :
- else
- MAKEINFO="$MISSING makeinfo"
- fi
- ;;
-changequote([,])
-esac
-
-# FIXME: expect and dejagnu may become build tools?
-
-AC_CHECK_PROGS(EXPECT, expect, expect)
-case " $configdirs " in
- *" expect "*)
- test $host = $build && EXPECT='$$r/$(HOST_SUBDIR)/expect/expect'
- ;;
-esac
-
-AC_CHECK_PROGS(RUNTEST, runtest, runtest)
-case " $configdirs " in
- *" dejagnu "*)
- test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest'
- ;;
-esac
-
-
-# Host tools.
-NCN_STRICT_CHECK_TOOLS(AR, ar)
-NCN_STRICT_CHECK_TOOLS(AS, as)
-NCN_STRICT_CHECK_TOOLS(DLLTOOL, dlltool)
-NCN_STRICT_CHECK_TOOLS(LD, ld)
-NCN_STRICT_CHECK_TOOLS(LIPO, lipo)
-NCN_STRICT_CHECK_TOOLS(NM, nm)
-NCN_STRICT_CHECK_TOOLS(RANLIB, ranlib, true)
-NCN_STRICT_CHECK_TOOLS(STRIP, strip, true)
-NCN_STRICT_CHECK_TOOLS(WINDRES, windres)
-NCN_STRICT_CHECK_TOOLS(WINDMC, windmc)
-NCN_STRICT_CHECK_TOOLS(OBJCOPY, objcopy)
-NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump)
-NCN_STRICT_CHECK_TOOLS(READELF, readelf)
-AC_SUBST(CC)
-AC_SUBST(CXX)
-AC_SUBST(CFLAGS)
-AC_SUBST(CXXFLAGS)
-
-# Target tools.
-AC_ARG_WITH([build-time-tools],
- [AS_HELP_STRING([--with-build-time-tools=PATH],
- [use given path to find target tools during the build])],
- [case x"$withval" in
- x/*) ;;
- *)
- with_build_time_tools=
- AC_MSG_WARN([argument to --with-build-time-tools must be an absolute path])
- ;;
- esac],
- [with_build_time_tools=])
-
-NCN_STRICT_CHECK_TARGET_TOOLS(CC_FOR_TARGET, cc gcc)
-NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
-NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
-NCN_STRICT_CHECK_TARGET_TOOLS(GCJ_FOR_TARGET, gcj)
-NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
-NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
-
-ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
-ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
-ACX_CHECK_INSTALLED_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
-ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld)
-ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo)
-ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm)
-ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump)
-ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib)
-ACX_CHECK_INSTALLED_TARGET_TOOL(READELF_FOR_TARGET, readelf)
-ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip)
-ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
-ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
-
-RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
-
-GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
-GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
-GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
-dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS
-GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
- [gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs],
- c++)
-GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
- [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs],
- c++)
-GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
-GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
-GCC_TARGET_TOOL(gcj, GCJ_FOR_TARGET, GCJ,
- [gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc/], java)
-GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN,
- [gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
-GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
- [gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
-GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
-GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
-GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
-GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump])
-GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib])
-GCC_TARGET_TOOL(readelf, READELF_FOR_TARGET, READELF, [binutils/readelf])
-GCC_TARGET_TOOL(strip, STRIP_FOR_TARGET, STRIP, [binutils/strip-new])
-GCC_TARGET_TOOL(windres, WINDRES_FOR_TARGET, WINDRES, [binutils/windres])
-GCC_TARGET_TOOL(windmc, WINDMC_FOR_TARGET, WINDMC, [binutils/windmc])
-
-AC_SUBST(FLAGS_FOR_TARGET)
-AC_SUBST(RAW_CXX_FOR_TARGET)
-
-# Certain tools may need extra flags.
-AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
-RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
-NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
-
-# When building target libraries, except in a Canadian cross, we use
-# the same toolchain as the compiler we just built.
-COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)'
-COMPILER_LD_FOR_TARGET='$(LD_FOR_TARGET)'
-COMPILER_NM_FOR_TARGET='$(NM_FOR_TARGET)'
-if test $host = $build; then
- case " $configdirs " in
- *" gcc "*)
- COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
- COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
- COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'${extra_nmflags_for_target}
- ;;
- esac
-fi
-
-AC_SUBST(COMPILER_AS_FOR_TARGET)
-AC_SUBST(COMPILER_LD_FOR_TARGET)
-AC_SUBST(COMPILER_NM_FOR_TARGET)
-
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
-AC_ARG_ENABLE(maintainer-mode,
-[AS_HELP_STRING([--enable-maintainer-mode],
- [enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer])],
- USE_MAINTAINER_MODE=$enableval,
- USE_MAINTAINER_MODE=no)
-AC_MSG_RESULT($USE_MAINTAINER_MODE)
-AC_SUBST(MAINTAINER_MODE_TRUE)
-AC_SUBST(MAINTAINER_MODE_FALSE)
-if test "$USE_MAINTAINER_MODE" = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-MAINT=$MAINTAINER_MODE_TRUE
-AC_SUBST(MAINT)dnl
-
-# ---------------------
-# GCC bootstrap support
-# ---------------------
-
-# Stage specific cflags for build.
-stage1_cflags="-g"
-case $build in
- vax-*-*)
- case ${GCC} in
- yes) stage1_cflags="-g -Wa,-J" ;;
- *) stage1_cflags="-g -J" ;;
- esac ;;
-esac
-
-AC_SUBST(stage1_cflags)
-
-# Enable --enable-checking in stage1 of the compiler.
-AC_ARG_ENABLE(stage1-checking,
-[AS_HELP_STRING([[--enable-stage1-checking[=all]]],
- [choose additional checking for stage1 of the compiler])],
-[stage1_checking=--enable-checking=${enable_stage1_checking}],
-[if test "x$enable_checking" = xno || test "x$enable_checking" = x; then
- stage1_checking=--enable-checking=yes,types
-else
- stage1_checking=--enable-checking=$enable_checking,types
-fi])
-AC_SUBST(stage1_checking)
-
-# Enable -Werror in bootstrap stage2 and later.
-AC_ARG_ENABLE(werror,
-[AS_HELP_STRING([--enable-werror],
- [enable -Werror in bootstrap stage2 and later])], [],
-[if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
- enable_werror=yes
-else
- enable_werror=no
-fi])
-case ${enable_werror} in
- yes) stage2_werror_flag="--enable-werror-always" ;;
- *) stage2_werror_flag="" ;;
-esac
-AC_SUBST(stage2_werror_flag)
-
-# Specify what files to not compare during bootstrap.
-
-compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
-case "$target" in
- hppa*64*-*-hpux*) ;;
- hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/*" ;;
- powerpc*-ibm-aix*) compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/* | *libgomp*\$(objext)" ;;
-esac
-AC_SUBST(compare_exclusions)
-
-AC_CONFIG_FILES([Makefile],
- [sed "$extrasub_build" Makefile |
- sed "$extrasub_host" |
- sed "$extrasub_target" > mf$$
- mv -f mf$$ Makefile],
- [extrasub_build="$extrasub_build"
- extrasub_host="$extrasub_host"
- extrasub_target="$extrasub_target"])
-AC_OUTPUT
diff --git a/include/ChangeLog b/include/ChangeLog
index f084976f3..4d02320bc 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-06 Paul Brook <paul@codesourcery.com>
+
+ include/elf/
+ * mips.h (R_MIPS_PC32): Update comment.
+
2013-04-03 Jason Merrill <jason@redhat.com>
Demangle C++11 ref-qualifier.
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index c72659207..dcbe68633 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,32 @@
+2013-06-06 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * mips.h (ELF_ST_SET_MIPS_PIC): Clear any STO_MIPS16 setting.
+
+2013-05-30 Paul Brook <paul@codesourcery.com>
+
+ * mips.h (R_MIPS_EH): New.
+
+2013-05-28 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * aarch64.h (R_AARCH64_TLSDESC_LD64_PREL19): Rename to ...
+ (R_AARCH64_TLSDESC_LD_PREL19): ... this.
+ (R_AARCH64_TLSDESC_ADR_PAGE): Rename to ...
+ (R_AARCH64_TLSDESC_ADR_PAGE21): ... this.
+
+2013-05-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * common.h (EM_INTEL205): New.
+ (EM_INTEL206): Likewise.
+ (EM_INTEL207): Likewise.
+ (EM_INTEL208): Likewise.
+ (EM_INTEL209): Likewise.
+
+2013-05-02 Nick Clifton <nickc@redhat.com>
+
+ * msp430.h: Add MSP430X relocs.
+ Add some more MSP430 machine numbers.
+ Add values used by .MSP430.attributes section.
+
2013-03-21 Michael Schewe <michael.schewe@gmx.net>
* h8.h: Add new reloc R_H8_DISP32A16 for relaxation of
diff --git a/include/elf/aarch64.h b/include/elf/aarch64.h
index e3af4442a..a7b86c10e 100644
--- a/include/elf/aarch64.h
+++ b/include/elf/aarch64.h
@@ -178,9 +178,9 @@ RELOC_NUMBER (R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 551)
FAKE_RELOC (R_AARCH64_tls_max, 552)
FAKE_RELOC (R_AARCH64_tlsdesc_min, 560)
-RELOC_NUMBER (R_AARCH64_TLSDESC_LD64_PREL19, 560)
+RELOC_NUMBER (R_AARCH64_TLSDESC_LD_PREL19, 560)
RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PREL21, 561)
-RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PAGE, 562)
+RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PAGE21, 562)
RELOC_NUMBER (R_AARCH64_TLSDESC_LD64_LO12_NC, 563)
RELOC_NUMBER (R_AARCH64_TLSDESC_ADD_LO12_NC, 564)
RELOC_NUMBER (R_AARCH64_TLSDESC_OFF_G1, 565)
diff --git a/include/elf/common.h b/include/elf/common.h
index 8bdefa60b..cd3bcdd2b 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -296,6 +296,11 @@
#define EM_TILEGX 191 /* Tilera TILE-Gx multicore architecture family */
#define EM_RL78 197 /* Renesas RL78 family. */
#define EM_78K0R 199 /* Renesas 78K0R. */
+#define EM_INTEL205 205 /* Reserved by Intel */
+#define EM_INTEL206 206 /* Reserved by Intel */
+#define EM_INTEL207 207 /* Reserved by Intel */
+#define EM_INTEL208 208 /* Reserved by Intel */
+#define EM_INTEL209 209 /* Reserved by Intel */
/* If it is necessary to assign new unofficial EM_* values, please pick large
random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
diff --git a/include/elf/mips.h b/include/elf/mips.h
index ca9fdcd78..44d815e82 100644
--- a/include/elf/mips.h
+++ b/include/elf/mips.h
@@ -152,10 +152,10 @@ START_RELOC_NUMBERS (elf_mips_reloc_type)
FAKE_RELOC (R_MICROMIPS_max, 174)
/* This was a GNU extension used by embedded-PIC. It was co-opted by
- mips-linux for exception-handling data. It is no longer used, but
- should continue to be supported by the linker for backward
- compatibility. (GCC stopped using it in May, 2004.) */
+ mips-linux for exception-handling data. GCC stopped using it in
+ May, 2004, then started using it again for compact unwind tables. */
RELOC_NUMBER (R_MIPS_PC32, 248)
+ RELOC_NUMBER (R_MIPS_EH, 249)
/* FIXME: this relocation is used internally by gas. */
RELOC_NUMBER (R_MIPS_GNU_REL16_S2, 250)
/* These are GNU extensions to enable C++ vtable garbage collection. */
@@ -811,7 +811,10 @@ extern void bfd_mips_elf32_swap_reginfo_out
although MIPS16 symbols are never considered to be MIPS_PIC. */
#define STO_MIPS_PIC 0x20
#define ELF_ST_IS_MIPS_PIC(other) (((other) & STO_MIPS_FLAGS) == STO_MIPS_PIC)
-#define ELF_ST_SET_MIPS_PIC(other) (((other) & ~STO_MIPS_FLAGS) | STO_MIPS_PIC)
+#define ELF_ST_SET_MIPS_PIC(other) \
+ ((ELF_ST_IS_MIPS16 (other) \
+ ? ((other) & ~(STO_MIPS16 | STO_MIPS_FLAGS)) \
+ : ((other) & ~STO_MIPS_FLAGS)) | STO_MIPS_PIC)
/* This value is used for a mips16 .text symbol. */
#define STO_MIPS16 0xf0
diff --git a/include/elf/msp430.h b/include/elf/msp430.h
index 44f5c51a7..ac8e28c31 100644
--- a/include/elf/msp430.h
+++ b/include/elf/msp430.h
@@ -1,5 +1,5 @@
/* MSP430 ELF support for BFD.
- Copyright (C) 2002, 2003, 2004, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2002-2013 Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
This file is part of BFD, the Binary File Descriptor library.
@@ -33,6 +33,11 @@
#define E_MSP430_MACH_MSP430x14 14
#define E_MSP430_MACH_MSP430x15 15
#define E_MSP430_MACH_MSP430x16 16
+#define E_MSP430_MACH_MSP430x20 20
+#define E_MSP430_MACH_MSP430x22 22
+#define E_MSP430_MACH_MSP430x23 23
+#define E_MSP430_MACH_MSP430x24 24
+#define E_MSP430_MACH_MSP430x26 26
#define E_MSP430_MACH_MSP430x31 31
#define E_MSP430_MACH_MSP430x32 32
#define E_MSP430_MACH_MSP430x33 33
@@ -40,6 +45,19 @@
#define E_MSP430_MACH_MSP430x42 42
#define E_MSP430_MACH_MSP430x43 43
#define E_MSP430_MACH_MSP430x44 44
+#define E_MSP430_MACH_MSP430X 45
+#define E_MSP430_MACH_MSP430x46 46
+#define E_MSP430_MACH_MSP430x47 47
+#define E_MSP430_MACH_MSP430x54 54
+
+#define SHT_MSP430_ATTRIBUTES 0x70000003 /* Section holds ABI attributes. */
+#define SHT_MSP430_SEC_FLAGS 0x7f000005 /* Holds TI compiler's section flags. */
+#define SHT_MSP430_SYM_ALIASES 0x7f000006 /* Holds TI compiler's symbol aliases. */
+
+/* Tag values for an attribute section. */
+#define OFBA_MSPABI_Tag_ISA 4
+#define OFBA_MSPABI_Tag_Code_Model 6
+#define OFBA_MSPABI_Tag_Data_Model 8
/* Relocations. */
START_RELOC_NUMBERS (elf_msp430_reloc_type)
@@ -52,7 +70,32 @@ START_RELOC_NUMBERS (elf_msp430_reloc_type)
RELOC_NUMBER (R_MSP430_16_PCREL_BYTE, 6)
RELOC_NUMBER (R_MSP430_2X_PCREL, 7)
RELOC_NUMBER (R_MSP430_RL_PCREL, 8)
-
+ RELOC_NUMBER (R_MSP430_8, 9)
+ RELOC_NUMBER (R_MSP430_SYM_DIFF, 10)
END_RELOC_NUMBERS (R_MSP430_max)
+START_RELOC_NUMBERS (elf_msp430x_reloc_type)
+ RELOC_NUMBER (R_MSP430_ABS32, 1) /* aka R_MSP430_32 */
+ RELOC_NUMBER (R_MSP430_ABS16, 2) /* aka R_MSP430_16 */
+ RELOC_NUMBER (R_MSP430_ABS8, 3)
+ RELOC_NUMBER (R_MSP430_PCR16, 4) /* aka R_MSP430_16_PCREL */
+ RELOC_NUMBER (R_MSP430X_PCR20_EXT_SRC, 5)
+ RELOC_NUMBER (R_MSP430X_PCR20_EXT_DST, 6)
+ RELOC_NUMBER (R_MSP430X_PCR20_EXT_ODST, 7)
+ RELOC_NUMBER (R_MSP430X_ABS20_EXT_SRC, 8)
+ RELOC_NUMBER (R_MSP430X_ABS20_EXT_DST, 9)
+ RELOC_NUMBER (R_MSP430X_ABS20_EXT_ODST, 10)
+ RELOC_NUMBER (R_MSP430X_ABS20_ADR_SRC, 11)
+ RELOC_NUMBER (R_MSP430X_ABS20_ADR_DST, 12)
+ RELOC_NUMBER (R_MSP430X_PCR16, 13) /* Like R_MSP430_PCR16 but with overflow checking. */
+ RELOC_NUMBER (R_MSP430X_PCR20_CALL, 14)
+ RELOC_NUMBER (R_MSP430X_ABS16, 15) /* Like R_MSP430_ABS16 but with overflow checking. */
+ RELOC_NUMBER (R_MSP430_ABS_HI16, 16)
+ RELOC_NUMBER (R_MSP430_PREL31, 17)
+ RELOC_NUMBER (R_MSP430_EHTYPE, 18) /* Mentioned in ABI. */
+ RELOC_NUMBER (R_MSP430X_10_PCREL, 19) /* Red Hat invention. Used for Jump instructions. */
+ RELOC_NUMBER (R_MSP430X_2X_PCREL, 20) /* Red Hat invention. Used for relaxing jumps. */
+ RELOC_NUMBER (R_MSP430X_SYM_DIFF, 21) /* Red Hat invention. Used for relaxing debug info. */
+END_RELOC_NUMBERS (R_MSP430x_max)
+
#endif /* _ELF_MSP430_H */
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 9eed10498..7ed2c6874 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,20 @@
+2013-05-22 Jürgen Urban <JuergenUrban@gmx.de>
+
+ * mips.h (M_LQC2_AB, M_SQC2_AB): New macros.
+
+2013-05-09 Andrew Pinski <apinski@cavium.com>
+
+ * mips.h (OP_MASK_CODE10): Correct definition.
+ (OP_SH_CODE10): Likewise.
+ Add a comment that "+J" is used now for OP_*CODE10.
+ (INSN_ASE_MASK): Update.
+ (INSN_VIRT): New macro.
+ (INSN_VIRT64): New macro
+
+2013-05-02 Nick Clifton <nickc@redhat.com>
+
+ * msp430.h: Add patterns for MSP430X instructions.
+
2013-04-06 David S. Miller <davem@davemloft.net>
* sparc.h (F_PREFERRED): Define.
diff --git a/include/opcode/avr.h b/include/opcode/avr.h
index 6e86c07ba..f1d73ad92 100644
--- a/include/opcode/avr.h
+++ b/include/opcode/avr.h
@@ -33,7 +33,7 @@
#define AVR_ISA_MOVW 0x1000 /* device has MOVW */
#define AVR_ISA_SPMX 0x2000 /* device has SPM Z[+] */
#define AVR_ISA_DES 0x4000 /* device has DES */
-#define AVR_ISA_XCH 0x8000 /* device has XCH, LAC, LAS, LAT */
+#define AVR_ISA_RMW 0x8000 /* device has RMW instructions XCH,LAC,LAS,LAT */
#define AVR_ISA_TINY1 (AVR_ISA_1200 | AVR_ISA_LPM)
#define AVR_ISA_2xxx (AVR_ISA_TINY1 | AVR_ISA_SRAM)
@@ -53,7 +53,8 @@
#define AVR_ISA_M323 (AVR_ISA_M161 | AVR_ISA_BRK)
#define AVR_ISA_M128 (AVR_ISA_M323 | AVR_ISA_ELPM | AVR_ISA_ELPMX)
#define AVR_ISA_M256 (AVR_ISA_M128 | AVR_ISA_EIND)
-#define AVR_ISA_XMEGA (AVR_ISA_M256 | AVR_ISA_SPMX | AVR_ISA_DES | AVR_ISA_XCH)
+#define AVR_ISA_XMEGA (AVR_ISA_M256 | AVR_ISA_SPMX | AVR_ISA_DES)
+#define AVR_ISA_XMEGAU (AVR_ISA_XMEGA | AVR_ISA_RMW)
#define AVR_ISA_AVR1 AVR_ISA_TINY1
#define AVR_ISA_AVR2 AVR_ISA_2xxx
@@ -266,10 +267,10 @@ AVR_INSN (ror, "r", "1001010rrrrr0111", 1, AVR_ISA_1200, 0x9407)
AVR_INSN (swap, "r", "1001010rrrrr0010", 1, AVR_ISA_1200, 0x9402)
/* Atomic memory operations for XMEGA. List before `sts'. */
-AVR_INSN (xch, "z,r", "1001001rrrrr0100", 1, AVR_ISA_XCH, 0x9204)
-AVR_INSN (las, "z,r", "1001001rrrrr0101", 1, AVR_ISA_XCH, 0x9205)
-AVR_INSN (lac, "z,r", "1001001rrrrr0110", 1, AVR_ISA_XCH, 0x9206)
-AVR_INSN (lat, "z,r", "1001001rrrrr0111", 1, AVR_ISA_XCH, 0x9207)
+AVR_INSN (xch, "z,r", "1001001rrrrr0100", 1, AVR_ISA_RMW, 0x9204)
+AVR_INSN (las, "z,r", "1001001rrrrr0101", 1, AVR_ISA_RMW, 0x9205)
+AVR_INSN (lac, "z,r", "1001001rrrrr0110", 1, AVR_ISA_RMW, 0x9206)
+AVR_INSN (lat, "z,r", "1001001rrrrr0111", 1, AVR_ISA_RMW, 0x9207)
/* Known to be decoded as `nop' by the old core. */
AVR_INSN (movw, "v,v", "00000001ddddrrrr", 1, AVR_ISA_MOVW, 0x0100)
diff --git a/include/opcode/mips.h b/include/opcode/mips.h
index ef81bbe2b..07259ea06 100644
--- a/include/opcode/mips.h
+++ b/include/opcode/mips.h
@@ -212,6 +212,10 @@
#define OP_OP_SDC2 0x3e
#define OP_OP_SDC3 0x3f /* a.k.a. sd */
+/* MIPS VIRT ASE */
+#define OP_MASK_CODE10 0x3ff
+#define OP_SH_CODE10 11
+
/* Values in the 'VSEL' field. */
#define MDMX_FMTSEL_IMM_QH 0x1d
#define MDMX_FMTSEL_IMM_OB 0x1e
@@ -255,8 +259,6 @@
of the operand handling in GAS. The fields below only exist
in the microMIPS encoding, so define each one to have an empty
range. */
-#define OP_MASK_CODE10 0
-#define OP_SH_CODE10 0
#define OP_MASK_TRAP 0
#define OP_SH_TRAP 0
#define OP_MASK_OFFSET10 0
@@ -486,6 +488,9 @@ struct mips_opcode
"~" 12 bit offset (OP_*_OFFSET12)
"\" 3 bit position for aset and aclr (OP_*_3BITPOS)
+ VIRT ASE usage:
+ "+J" 10-bit hypcall code (OP_*CODE10)
+
UDI immediates:
"+1" UDI immediate bits 6-10
"+2" UDI immediate bits 6-15
@@ -528,7 +533,7 @@ struct mips_opcode
Extension character sequences used so far ("+" followed by the
following), for quick reference when adding more:
"1234"
- "ABCDEFGHIPQSTXZ"
+ "ABCDEFGHIJPQSTXZ"
"abcpstxz"
*/
@@ -726,7 +731,7 @@ static const unsigned int mips_isa_table[] =
#define INSN_OCTEON2 0x00000100
/* Masks used for MIPS-defined ASEs. */
-#define INSN_ASE_MASK 0x3c00f010
+#define INSN_ASE_MASK 0x3c00f0d0
/* DSP ASE */
#define INSN_DSP 0x00001000
@@ -735,6 +740,10 @@ static const unsigned int mips_isa_table[] =
/* MIPS R5900 instruction */
#define INSN_5900 0x00004000
+/* Virtualization ASE */
+#define INSN_VIRT 0x00000080
+#define INSN_VIRT64 0x00000040
+
/* MIPS-3D ASE */
#define INSN_MIPS3D 0x00008000
@@ -1061,6 +1070,7 @@ enum
M_LDC1_AB,
M_LDC2_AB,
M_LDC2_OB,
+ M_LQC2_AB,
M_LDC3_AB,
M_LDL_AB,
M_LDL_OB,
@@ -1154,6 +1164,7 @@ enum
M_SDC1_AB,
M_SDC2_AB,
M_SDC2_OB,
+ M_SQC2_AB,
M_SDC3_AB,
M_SDL_AB,
M_SDL_OB,
diff --git a/include/opcode/msp430.h b/include/opcode/msp430.h
index d3bf130ee..caddc42db 100644
--- a/include/opcode/msp430.h
+++ b/include/opcode/msp430.h
@@ -1,6 +1,6 @@
/* Opcode table for the TI MSP430 microcontrollers
- Copyright 2002, 2004, 2010 Free Software Foundation, Inc.
+ Copyright 2002-2013 Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
This program is free software; you can redistribute it and/or modify
@@ -119,6 +119,74 @@ static struct msp430_opcode_s msp430_opcodes[] =
MSP_INSN (bleu, 5, 2, 0, 0xffff),
MSP_INSN (ble, 5, 3, 0, 0xffff),
+ /* MSP430X instructions - these ones use an extension word.
+ A negative format indicates an MSP430X instruction. */
+ MSP_INSN (addcx, -2, 2, 0x6000, 0xf000),
+ MSP_INSN (addx, -2, 2, 0x5000, 0xf000),
+ MSP_INSN (andx, -2, 2, 0xf000, 0xf000),
+ MSP_INSN (bicx, -2, 2, 0xc000, 0xf000),
+ MSP_INSN (bisx, -2, 2, 0xd000, 0xf000),
+ MSP_INSN (bitx, -2, 2, 0xb000, 0xf000),
+ MSP_INSN (cmpx, -2, 2, 0x9000, 0xf000),
+ MSP_INSN (daddx, -2, 2, 0xa000, 0xf000),
+ MSP_INSN (movx, -2, 2, 0x4000, 0xf000),
+ MSP_INSN (subcx, -2, 2, 0x7000, 0xf000),
+ MSP_INSN (subx, -2, 2, 0x8000, 0xf000),
+ MSP_INSN (xorx, -2, 2, 0xe000, 0xf000),
+
+ /* MSP430X Synthetic instructions. */
+ MSP_INSN (adcx, -1, 1, 0x6300, 0xff30),
+ MSP_INSN (clra, -1, 1, 0x4300, 0xff30),
+ MSP_INSN (clrx, -1, 1, 0x4300, 0xff30),
+ MSP_INSN (dadcx, -1, 1, 0xa300, 0xff30),
+ MSP_INSN (decx, -1, 1, 0x8310, 0xff30),
+ MSP_INSN (decda, -1, 1, 0x8320, 0xff30),
+ MSP_INSN (decdx, -1, 1, 0x8320, 0xff30),
+ MSP_INSN (incx, -1, 1, 0x5310, 0xff30),
+ MSP_INSN (incda, -1, 1, 0x5320, 0xff30),
+ MSP_INSN (incdx, -1, 1, 0x5320, 0xff30),
+ MSP_INSN (invx, -1, 1, 0xe330, 0xfff0),
+ MSP_INSN (popx, -1, 1, 0x4130, 0xff30),
+ MSP_INSN (rlax, -1, 2, 0x5000, 0xf000),
+ MSP_INSN (rlcx, -1, 2, 0x6000, 0xf000),
+ MSP_INSN (sbcx, -1, 1, 0x7300, 0xff30),
+ MSP_INSN (tsta, -1, 1, 0x9300, 0xff30),
+ MSP_INSN (tstx, -1, 1, 0x9300, 0xff30),
+
+ MSP_INSN (pushx, -3, 1, 0x1200, 0xff80),
+ MSP_INSN (rrax, -3, 1, 0x1100, 0xff80),
+ MSP_INSN (rrcx, -3, 1, 0x1000, 0xff80),
+ MSP_INSN (swpbx, -3, 1, 0x1080, 0xffc0),
+ MSP_INSN (sxtx, -3, 1, 0x1180, 0xffc0),
+
+ /* MSP430X Address instructions - no extension word needed.
+ The insn_opnumb field is used to encode the nature of the
+ instruction for assembly and disassembly purposes. */
+ MSP_INSN (calla, -1, 4, 0x1300, 0xff00),
+
+ MSP_INSN (popm, -1, 5, 0x1600, 0xfe00),
+ MSP_INSN (pushm, -1, 5, 0x1400, 0xfe00),
+
+ MSP_INSN (rrcm, -1, 6, 0x0040, 0xf3e0),
+ MSP_INSN (rram, -1, 6, 0x0140, 0xf3e0),
+ MSP_INSN (rlam, -1, 6, 0x0240, 0xf3e0),
+ MSP_INSN (rrum, -1, 6, 0x0340, 0xf3e0),
+
+ MSP_INSN (rrux, -1, 7, 0x0340, 0xffe0), /* Synthesized in terms of RRUM. */
+
+ MSP_INSN (adda, -1, 8, 0x00a0, 0xf0b0),
+ MSP_INSN (cmpa, -1, 8, 0x0090, 0xf0b0),
+ MSP_INSN (suba, -1, 8, 0x00b0, 0xf0b0),
+
+ MSP_INSN (reta, -1, 9, 0x0110, 0xffff),
+ MSP_INSN (bra, -1, 9, 0x0000, 0xf0cf),
+ MSP_INSN (mova, -1, 9, 0x0000, 0xf080),
+ MSP_INSN (mova, -1, 9, 0x0080, 0xf0b0),
+ MSP_INSN (mova, -1, 9, 0x00c0, 0xf0f0),
+
+ /* Pseudo instruction to set the repeat field in the extension word. */
+ MSP_INSN (rpt, -1, 10, 0x0000, 0x0000),
+
/* End of instruction set. */
{ NULL, 0, 0, 0, 0 }
};
diff --git a/ltgcc.m4 b/ltgcc.m4
deleted file mode 100644
index 844e2bc16..000000000
--- a/ltgcc.m4
+++ /dev/null
@@ -1,60 +0,0 @@
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'. Locally modified to
-# run its tests on C programs, because we cannot link Java programs until
-# we have finished building libjava.
-AC_DEFUN([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=c
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-GCC=yes
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-_LT_TAGVAR(compiler, $1)=${GCJ-gcj}
-AC_LANG_RESTORE
-])# _LT_LANG_GCJ_CONFIG
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index c6add4514..d22ff5041 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,202 @@
+2013-06-05 Joey Ye <joey.ye@arm.com>
+
+ * libc/machine/arm/strcmp.S: Use local labels.
+
+2013-06-03 Joey Ye <joey.ye@arm.com>
+
+ * libc/machine/arm/Makefile.am (MEMCPY_DEP): New define.
+ ($(lpfx)memcpy.o, $(lpfx)memcpy.obj): Depend on MEMCPY_DEP.
+ * libc/machine/arm/Makefile.in: Regenerated.
+ * newlib/libc/machine/arm/memcpy-stub.c: Exclude armv7-m/armv7e-m.
+ * newlib/libc/machine/arm/memcpy-armv7m.S: New.
+ * newlib/libc/machine/arm/memcpy.S: Replace with wrapper code. Old
+ code moved to ...
+ * newlib/libc/machine/arm/memcpy-armv7a.S: ... here. Remove
+ redundant architecture check.
+
+2013-05-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/machine/powerpc/times.c: Moved to libgloss/rs6000.
+ * libc/machine/powerpc/Makefile.am: Remove times.c.
+ * libc/machine/powerpc/Makefile.in: Regenerated.
+
+2013-05-29 Joey Ye <joey.ye@arm.com>
+ Bin Cheng <bin.cheng@arm.com>
+
+ * configure.in (--enable-newlib-nano-malloc): New option.
+ * configure: Regenerated.
+ * libc/configure.in (--enable-newlib-nano-malloc): New option.
+ * libc/configure: Regenerated.
+ * libc/stdlib/Makefile.am (NEWLIB_NANO_MALLOC): Use.
+ * libc/stdlib/Makefile.in: Regenerated.
+ * libc/stdlib/nano-mallocr.c: New file, implementing nano
+ version malloc family functions.
+
+2013-05-28 Richard Earnshaw <rearnsha@arm.com>
+
+ * libc/macine/arm/strcpy.S: Explicitly set build attributes when
+ building for thumb1 targets.
+
+2013-05-22 Corinna Vinschen <vinschen@redhat.com>
+
+ * libc/ctype/isalnum.c: Correct domain of definition to SUSv4 wording.
+ * libc/ctype/isalpha.c: Ditto.
+ * libc/ctype/isblank.c: Ditto.
+ * libc/ctype/iscntrl.c: Ditto.
+ * libc/ctype/isdigit.c: Ditto.
+ * libc/ctype/islower.c: Ditto.
+ * libc/ctype/isprint.c: Ditto.
+ * libc/ctype/ispunct.c: Ditto.
+ * libc/ctype/isxdigit.c: Ditto.
+
+2013-05-22 Corinna Vinschen <vinschen@redhat.com>
+
+ * libc/include/sys/cdefs.h (_Static_assert): Accommodate gcc >= 4.6.
+
+2013-05-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * libc/reent/reent.c (_wrapup_reent): Remove.
+
+2013-05-13 DJ Delorie <dj@delorie.com>
+ Nick Clifton <nickc@redhat.com>
+
+ * MAINTAINERS (msp430): Add.
+ * configure.host (msp430): Add.
+ * libc/include/machine/ieeefp.h: Add MSP430 support.
+ * libc/include/machine/setjmp.h: Likewise.
+ * libc/include/sys/config.h: Likewise.
+ * libc/machine/configure.in (msp430): Add.
+ * libc/machine/configure: Regenerate.
+ * libc/machine/msp430: New directory.
+
+2013-05-10 Freddie Chopin <freddie_chopin@op.pl>
+
+ * configure.in: Fix help text for disable-newlib-atexit-dynamic-alloc option.
+ * configure: Regenerated.
+
+2013-05-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * libc/include/sys/config.h (_REENT_GLOBAL_ATEXIT): Define for
+ RTEMS.
+ * libc/include/sys/reent.h (_reent): Use _REENT_GLOBAL_ATEXIT.
+ (_global_atexit): Declare if _REENT_GLOBAL_ATEXIT is defined.
+ * libc/reent/reent.c (_reclaim_reent): Remove atexit cleanup if
+ _REENT_GLOBAL_ATEXIT is defined.
+ (_wrapup_reent): Remove atexit handling if _REENT_GLOBAL_ATEXIT
+ is defined.
+ * libc/stdlib/__atexit.c (_global_atexit0): Define if
+ _REENT_GLOBAL_ATEXIT is defined.
+ * libc/stdlib/__call_atexit.c (_global_atexit): Define if
+ _REENT_GLOBAL_ATEXIT is defined.
+
+2013-05-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * libc/include/sys/reent.h (_ATEXIT_INIT): Define.
+ (_ATEXIT_INIT_PTR): Likewise.
+ (_REENT_INIT_ATEXIT): Likewise.
+ (_REENT_INIT_ATEXIT_PTR): Likewise.
+ (_GLOBAL_ATEXIT): Likewise.
+ * libc/stdlib/__atexit.c (_GLOBAL_ATEXIT0): Define.
+ (__register_exitproc): Use _GLOBAL_ATEXIT and _GLOBAL_ATEXIT0.
+ * libc/stdlib/__call_atexit.c (__call_exitprocs): Likewise.
+
+2013-05-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * libc/stdlib/__atexit.c (__atexit_lock): Declare.
+ * libc/stdlib/__call_atexit.c (__atexit_lock): Define.
+
+2013-05-06 Sandra Loosemore <sandra@codesourcery.com>
+
+ * configure.host (machine_dir, sys_dir, syscall_dir, newlib_cflags):
+ Add settings for nios2*.
+ * libc/include/machine/ieeefp.h (IEEE_BIG_ENDIAN, IEEE_LITTLE_ENDIAN):
+ Likewise.
+ * libc/include/machine/setjmp.h (JBLEN, JBTYPE): Likewise.
+ * libc/machine/configure.in: Add nios2 subdir.
+ * libc/machine/configure: Regenerated.
+ * libc/machine/nios2/Makefile.am: New.
+ * libc/machine/nios2/Makefile.in: New (autogenerated).
+ * libc/machine/nios2/aclocal.m4: New (copied from mips version).
+ * libc/machine/nios2/configure.in: New.
+ * libc/machine/nios2/configure: New (autogenerated).
+ * libc/machine/nios2/setjmp.s: New.
+
+2013-04-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * libc/stdio/local.h (CHECK_INIT): Evaluate argument only once.
+ (CHECK_STD_INIT): Likewise.
+ * libc/stdio/fgetc.c (fgetc): Use local variable for _REENT.
+ * libc/stdio/fgetwc.c (fwgetc): Likewise.
+ * libc/stdio/fgetws.c (fgetws): Likewise.
+ * libc/stdio/fputc.c (fputc): Likewise.
+ * libc/stdio/fputwc.c (fputwc): Likewise.
+ * libc/stdio/fputws.c (fputws): Likewise.
+ * libc/stdio/getc.c (getc): Likewise.
+ * libc/stdio/getchar.c (_getchar_r): Likewise.
+ * libc/stdio/putc.c (putc): Likewise.
+ * libc/stdio/putchar.c (putchar): Likewise.
+ * libc/stdio/scanf.c (scanf): Likewise.
+ * libc/stdio/setvbuf.c (setvbuf): Likewise.
+ * libc/stdio/ungetwc.c (ungetwc): Likewise.
+ * libc/stdio/vfscanf.c (VFSCANF): Likewise.
+ * libc/stdio/vfwscanf.c (VFWSCANF): Likewise.
+ * libc/stdio/viprintf.c (viprintf): Likewise.
+ * libc/stdio/viscanf.c (viscanf): Likewise.
+ * libc/stdio/vprintf.c (vprintf): Likewise.
+ * libc/stdio/vscanf.c (vscanf): Likewise.
+ * libc/stdio/vwprintf.c (vwprintf): Likewise.
+ * libc/stdio/vwscanf.c (vwscanf): Likewise.
+ * libc/stdio/wscanf.c (wscanf): Likewise.
+ * libc/stdlib/ecvtbuf.c (fcvtbuf): Likewise.
+ (fcvtbuf): Likewise.
+ (ecvtbuf): Likewise.
+ (ecvtbuf): Likewise.
+ * libc/stdlib/mblen.c (mblen): Likewise.
+ * libc/stdlib/mbrlen.c (mbrlen): Likewise.
+ * libc/stdlib/mbrtowc.c (mbrtowc): Likewise.
+ * libc/stdlib/mbtowc.c (mbtowc): Likewise.
+ * libc/stdlib/rand.c (srand): Likewise.
+ (rand): Likewise.
+ * libc/stdlib/wcrtomb.c (wcrtomb): Likewise.
+ * libc/stdlib/wctob.c (wctob): Likewise.
+ * libc/stdlib/wctomb.c (wctomb): Likewise.
+ * libc/string/strtok.c (strtok): Likewise.
+ * libc/time/asctime.c (asctime): Likewise.
+ * libc/time/gmtime.c (gmtime): Likewise.
+ * libc/time/lcltime.c (lcltime): Likewise.
+
+2013-04-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * libc/include/sys/reent.h (_REENT_INIT_PTR): Reduce code size.
+
+2013-04-29 Freddie Chopin <freddie_chopin@op.pl>
+
+ * libc/libc.texinfo: Fix @ references and change ifinfo to be
+ ifnottexinfo.
+ * libm/libm.texinfo: Ditto.
+
+2013-04-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): New define.
+ * libc/stdio/findfp.c (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Use define.
+
+2013-04-24 Corinna Vinschen <vinschen@redhat.com>
+ Nick Clifton <nickc@redhat.com>
+
+ * libc/stdlib/strtod.c: Manual update to latest algorithm from NetBSD.
+
+2013-04-23 Corinna Vinschen <vinschen@redhat.com>
+
+ Port newlib to x86_64-pc-cygwin.
+ * libc/include/sys/features.h: Redefine compilation environment
+ definitions for Cygwin to cover 64 bit Cygwin.
+ * libc/ctype/ctype_.c (_ctype_): Fix definition for 64 bit Cygwin.
+ * libc/include/machine/setjmp.h: Change definition of _JBLEN to allow
+ different values for 32 bit and 64 bit Cygwin.
+ * libc/include/reent.h (stat64): Define as stat under Cygwin, instead
+ of as __stat64. Undef stat64 if not building Newlib.
+ * libc/include/sys/stat.h (stat64): Define as stat under Cygwin.
+
2013-04-22 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/sys/cdefs.h: Align with latest FreeBSD file header.
diff --git a/newlib/MAINTAINERS b/newlib/MAINTAINERS
index 9a5932ba2..767462bc0 100644
--- a/newlib/MAINTAINERS
+++ b/newlib/MAINTAINERS
@@ -42,6 +42,8 @@ moxie Anthony Green green@moxielogic.com
rl78 DJ Delorie dj@redhat.com
aarch64 Richard Earnshaw richard.earnshaw@arm.com
Marcus Shawcroft marcus.shawcroft@arm.com
+msp430 DJ Delorie dj@redhat.com
+ Nick Clifton nickc@redhat.com
Write After Approval
diff --git a/newlib/configure b/newlib/configure
index cf14cd1ae..fe55eb115 100755
--- a/newlib/configure
+++ b/newlib/configure
@@ -792,6 +792,7 @@ enable_newlib_reent_small
enable_newlib_fvwrite_in_streamio
enable_newlib_fseek_optimization
enable_newlib_wide_orient
+enable_newlib_nano_malloc
enable_multilib
enable_target_optspace
enable_malloc_debugging
@@ -1453,11 +1454,12 @@ Optional Features:
--enable-newlib-iconv-from-encodings enable specific comma-separated list of \"from\" iconv encodings to be built-in
--enable-newlib-iconv-to-encodings enable specific comma-separated list of \"to\" iconv encodings to be built-in
--enable-newlib-iconv-external-ccs enable capabilities to load external CCS files for iconv
- --disable-newlib-atexit-alloc disable dynamic allocation of atexit entries
+ --disable-newlib-atexit-dynamic-alloc disable dynamic allocation of atexit entries
--enable-newlib-reent-small enable small reentrant struct support
--disable-newlib-fvwrite-in-streamio disable iov in streamio
--disable-newlib-fseek-optimization disable fseek optimization
--disable-newlib-wide-orient Turn off wide orientation in streamio
+ --enable-newlib-nano-malloc use small-footprint nano-malloc implementation
--enable-multilib build many library versions (default)
--enable-target-optspace optimize for space
--enable-malloc-debugging indicate malloc debugging requested
@@ -2395,6 +2397,19 @@ else
fi
+# Check whether --enable-newlib-nano-malloc was given.
+if test "${enable_newlib_nano_malloc+set}" = set; then :
+ enableval=$enable_newlib_nano_malloc; if test "${newlib_nano_malloc+set}" != set; then
+ case "${enableval}" in
+ yes) newlib_nano_malloc=yes ;;
+ no) newlib_nano_malloc=no ;;
+ *) as_fn_error $? "bad value ${enableval} for newlib-nano-malloc option" "$LINENO" 5 ;;
+ esac
+ fi
+else
+ newlib_nano_malloc=no
+fi
+
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
@@ -11695,7 +11710,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11684 "configure"
+#line 11698 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11801,7 +11816,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11790 "configure"
+#line 11804 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12297,6 +12312,13 @@ _ACEOF
fi
+if test "${newlib_nano_malloc}" = "yes"; then
+cat >>confdefs.h <<_ACEOF
+#define NEWLIB_NANO_MALLOC 1
+_ACEOF
+
+fi
+
if test "x${iconv_encodings}" != "x" \
|| test "x${iconv_to_encodings}" != "x" \
diff --git a/newlib/configure.host b/newlib/configure.host
index f1e130939..f19fa1580 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -79,7 +79,7 @@ case "${target_optspace}:${host}" in
yes:*)
newlib_cflags="${newlib_cflags} -Os"
;;
- :m32r-* | :d10v-* | :d30v-* | :avr-* | :m32c-* )
+ :m32r-* | :d10v-* | :d30v-* | :avr-* | :m32c-* | :msp430*-* )
newlib_cflags="${newlib_cflags} -Os"
;;
no:* | :*)
@@ -224,9 +224,18 @@ case "${host_cpu}" in
moxie)
machine_dir=moxie
;;
+ msp430*)
+ newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -DSMALL_MEMORY"
+ newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections "
+ newlib_cflags="${newlib_cflags} -mOs "
+ machine_dir=msp430
+ ;;
mt*)
machine_dir=mt
;;
+ nios2*)
+ machine_dir=nios2
+ ;;
or16)
;;
or32)
@@ -476,6 +485,9 @@ case "${host}" in
moxie*)
sys_dir=
;;
+ nios2*)
+ sys_dir=
+ ;;
powerpcle-*-pe)
posix_dir=posix
;;
@@ -703,6 +715,10 @@ case "${host}" in
syscall_dir=syscalls
default_newlib_io_long_long="yes"
;;
+ nios2*)
+ syscall_dir=
+ newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DHAVE_SYSTEM -DMISSING_SYSCALL_NAMES"
+ ;;
powerpc*-*-eabialtivec*)
default_newlib_io_long_long="yes"
newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
diff --git a/newlib/configure.in b/newlib/configure.in
index 58f56b9ad..5646d64d0 100644
--- a/newlib/configure.in
+++ b/newlib/configure.in
@@ -106,7 +106,7 @@ AC_ARG_ENABLE(newlib-iconv-external-ccs,
dnl Support --disable-newlib-atexit-dynamic-alloc
AC_ARG_ENABLE(newlib-atexit-dynamic-alloc,
-[ --disable-newlib-atexit-alloc disable dynamic allocation of atexit entries],
+[ --disable-newlib-atexit-dynamic-alloc disable dynamic allocation of atexit entries],
[if test "${newlib_atexit_dynamic_alloc+set}" != set; then
case "${enableval}" in
yes) newlib_atexit_dynamic_alloc=yes ;;
@@ -157,6 +157,19 @@ AC_ARG_ENABLE(newlib_wide_orient,
*) AC_MSG_ERROR(bad value ${enableval} for newlib-wide-orient) ;;
esac],[newlib_wide_orient=yes])
+dnl Support --enable-newlib-nano-malloc
+dnl This option is also read in libc/configure.in. It is repeated
+dnl here so that it shows up in the help text.
+AC_ARG_ENABLE(newlib-nano-malloc,
+[ --enable-newlib-nano-malloc use small-footprint nano-malloc implementation],
+[if test "${newlib_nano_malloc+set}" != set; then
+ case "${enableval}" in
+ yes) newlib_nano_malloc=yes ;;
+ no) newlib_nano_malloc=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-malloc option) ;;
+ esac
+ fi], [newlib_nano_malloc=no])dnl
+
NEWLIB_CONFIGURE(.)
dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
@@ -345,19 +358,23 @@ fi
if test "${newlib_atexit_dynamic_alloc}" = "yes"; then
AC_DEFINE_UNQUOTED(_ATEXIT_DYNAMIC_ALLOC)
fi
-
+
if test "${newlib_fvwrite_in_streamio}" = "yes"; then
AC_DEFINE_UNQUOTED(_FVWRITE_IN_STREAMIO)
fi
-
+
if test "${newlib_fseek_optimization}" = "yes"; then
AC_DEFINE_UNQUOTED(_FSEEK_OPTIMIZATION)
fi
-
+
if test "${newlib_wide_orient}" = "yes"; then
AC_DEFINE_UNQUOTED(_WIDE_ORIENT)
fi
+if test "${newlib_nano_malloc}" = "yes"; then
+AC_DEFINE_UNQUOTED(_NANO_MALLOC)
+fi
+
dnl
dnl Parse --enable-newlib-iconv-encodings option argument
dnl
diff --git a/newlib/libc/configure b/newlib/libc/configure
index 4a1ab6b99..e2782a5f5 100755
--- a/newlib/libc/configure
+++ b/newlib/libc/configure
@@ -749,6 +749,8 @@ build
newlib_basedir
MAY_SUPPLY_SYSCALLS_FALSE
MAY_SUPPLY_SYSCALLS_TRUE
+NEWLIB_NANO_MALLOC_FALSE
+NEWLIB_NANO_MALLOC_TRUE
NEWLIB_WIDE_ORIENT_FALSE
NEWLIB_WIDE_ORIENT_TRUE
target_alias
@@ -794,6 +796,7 @@ ac_user_opts='
enable_option_checking
enable_newlib_io_pos_args
enable_newlib_wide_orient
+enable_newlib_nano_malloc
enable_multilib
enable_target_optspace
enable_malloc_debugging
@@ -1444,6 +1447,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-newlib-io-pos-args enable printf-family positional arg support
--disable-newlib-wide-orient Turn off wide char orient in streamio
+ --enable-newlib-nano-malloc Use small-footprint nano-malloc implementation
--enable-multilib build many library versions (default)
--enable-target-optspace optimize for space
--enable-malloc-debugging indicate malloc debugging requested
@@ -2236,6 +2240,26 @@ else
fi
+# Check whether --enable-newlib_nano_malloc was given.
+if test "${enable_newlib_nano_malloc+set}" = set; then :
+ enableval=$enable_newlib_nano_malloc; case "${enableval}" in
+ yes) newlib_nano_malloc=yes ;;
+ no) newlib_nano_malloc=no ;;
+ *) as_fn_error $? "bad value ${enableval} for newlib-nano-malloc" "$LINENO" 5 ;;
+ esac
+else
+ newlib_nano_malloc=no
+fi
+
+ if test x$newlib_nano_malloc = xyes; then
+ NEWLIB_NANO_MALLOC_TRUE=
+ NEWLIB_NANO_MALLOC_FALSE='#'
+else
+ NEWLIB_NANO_MALLOC_TRUE='#'
+ NEWLIB_NANO_MALLOC_FALSE=
+fi
+
+
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
@@ -12213,6 +12237,14 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
+if test -z "${NEWLIB_WIDE_ORIENT_TRUE}" && test -z "${NEWLIB_WIDE_ORIENT_FALSE}"; then
+ as_fn_error $? "conditional \"NEWLIB_WIDE_ORIENT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NEWLIB_NANO_MALLOC_TRUE}" && test -z "${NEWLIB_NANO_MALLOC_FALSE}"; then
+ as_fn_error $? "conditional \"NEWLIB_NANO_MALLOC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then
as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/newlib/libc/configure.in b/newlib/libc/configure.in
index f262d7d45..d9df7c5f7 100644
--- a/newlib/libc/configure.in
+++ b/newlib/libc/configure.in
@@ -27,6 +27,16 @@ AC_ARG_ENABLE(newlib_wide_orient,
esac],[newlib_wide_orient=yes])
AM_CONDITIONAL(NEWLIB_WIDE_ORIENT, test x$newlib_wide_orient = xyes)
+dnl Support --enable-newlib-nano-malloc used by libc/stdlib
+AC_ARG_ENABLE(newlib_nano_malloc,
+[ --enable-newlib-nano-malloc Use small-footprint nano-malloc implementation],
+[case "${enableval}" in
+ yes) newlib_nano_malloc=yes ;;
+ no) newlib_nano_malloc=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-nano-malloc) ;;
+ esac],[newlib_nano_malloc=no])
+AM_CONDITIONAL(NEWLIB_NANO_MALLOC, test x$newlib_nano_malloc = xyes)
+
NEWLIB_CONFIGURE(..)
dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and
diff --git a/newlib/libc/ctype/ctype_.c b/newlib/libc/ctype/ctype_.c
index c3615d2a1..164a8eed7 100644
--- a/newlib/libc/ctype/ctype_.c
+++ b/newlib/libc/ctype/ctype_.c
@@ -111,14 +111,21 @@ _CONST
char __EXPORT *__ctype_ptr__ = (char *) _ctype_b + 127;
# ifdef __CYGWIN__
-
+# ifdef __x86_64__
+__asm__ (" \n\
+ .data \n\
+ .globl _ctype_ \n\
+ .set _ctype_,_ctype_b+127 \n\
+ .text \n\
+");
+# else
__asm__ (" \n\
.data \n\
.globl __ctype_ \n\
.set __ctype_,__ctype_b+127 \n\
.text \n\
");
-
+# endif
# else /* !__CYGWIN__ */
_CONST char _ctype_[1 + 256] = {
diff --git a/newlib/libc/ctype/isalnum.c b/newlib/libc/ctype/isalnum.c
index 3fd5f9515..8bc2897c9 100644
--- a/newlib/libc/ctype/isalnum.c
+++ b/newlib/libc/ctype/isalnum.c
@@ -18,7 +18,7 @@ DESCRIPTION
<<isalnum>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for alphabetic or
numeric ASCII characters, and <<0>> for other arguments. It is defined
-for all integer values.
+only if <[c]> is representable as an unsigned char or if <[c]> is EOF.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef isalnum>>'.
diff --git a/newlib/libc/ctype/isalpha.c b/newlib/libc/ctype/isalpha.c
index a30ca9e19..d25a8fa27 100644
--- a/newlib/libc/ctype/isalpha.c
+++ b/newlib/libc/ctype/isalpha.c
@@ -16,8 +16,8 @@ TRAD_SYNOPSIS
DESCRIPTION
<<isalpha>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero when <[c]> represents an
-alphabetic ASCII character, and 0 otherwise. It is defined only when
-<<isascii>>(<[c]>) is true or <[c]> is EOF.
+alphabetic ASCII character, and 0 otherwise. It is defined only if
+<[c]> is representable as an unsigned char or if <[c]> is EOF.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef isalpha>>'.
diff --git a/newlib/libc/ctype/isblank.c b/newlib/libc/ctype/isblank.c
index f4d38b95c..896a00768 100644
--- a/newlib/libc/ctype/isblank.c
+++ b/newlib/libc/ctype/isblank.c
@@ -17,7 +17,8 @@ TRAD_SYNOPSIS
DESCRIPTION
<<isblank>> is a function which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for blank characters, and 0
-for other characters.
+for other characters. It is defined only if <[c]> is representable as an
+unsigned char or if <[c]> is EOF.
RETURNS
<<isblank>> returns non-zero if <[c]> is a blank character.
diff --git a/newlib/libc/ctype/iscntrl.c b/newlib/libc/ctype/iscntrl.c
index a4fdff178..76b0f55de 100644
--- a/newlib/libc/ctype/iscntrl.c
+++ b/newlib/libc/ctype/iscntrl.c
@@ -17,8 +17,8 @@ TRAD_SYNOPSIS
DESCRIPTION
<<iscntrl>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for control characters, and 0
-for other characters. It is defined only when <<isascii>>(<[c]>) is
-true or <[c]> is EOF.
+for other characters. It is defined only if <[c]> is representable as an
+unsigned char or if <[c]> is EOF.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef iscntrl>>'.
diff --git a/newlib/libc/ctype/isdigit.c b/newlib/libc/ctype/isdigit.c
index 18383ee45..9db2700b7 100644
--- a/newlib/libc/ctype/isdigit.c
+++ b/newlib/libc/ctype/isdigit.c
@@ -16,8 +16,8 @@ int isdigit(<[c]>);
DESCRIPTION
<<isdigit>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for decimal digits, and 0 for
-other characters. It is defined only when <<isascii>>(<[c]>) is true
-or <[c]> is EOF.
+other characters. It is defined only if <[c]> is representable as an
+unsigned char or if <[c]> is EOF.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef isdigit>>'.
diff --git a/newlib/libc/ctype/islower.c b/newlib/libc/ctype/islower.c
index bef010b8b..ec4309610 100644
--- a/newlib/libc/ctype/islower.c
+++ b/newlib/libc/ctype/islower.c
@@ -18,7 +18,8 @@ DESCRIPTION
<<islower>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for minuscules
(lowercase alphabetic characters), and 0 for other characters.
-It is defined only when <<isascii>>(<[c]>) is true or <[c]> is EOF.
+It is defined only if <[c]> is representable as an unsigned char or if
+<[c]> is EOF.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef islower>>'.
diff --git a/newlib/libc/ctype/isprint.c b/newlib/libc/ctype/isprint.c
index 2f317a291..b95aedd16 100644
--- a/newlib/libc/ctype/isprint.c
+++ b/newlib/libc/ctype/isprint.c
@@ -23,7 +23,8 @@ DESCRIPTION
<<isprint>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for printable
characters, and 0 for other character arguments.
-It is defined only when <<isascii>>(<[c]>) is true or <[c]> is EOF.
+It is defined only if <[c]> is representable as an unsigned char or if
+<[c]> is EOF.
You can use a compiled subroutine instead of the macro definition by
undefining either macro using `<<#undef isprint>>' or `<<#undef isgraph>>'.
diff --git a/newlib/libc/ctype/ispunct.c b/newlib/libc/ctype/ispunct.c
index 9b9c9c0bc..9ca674975 100644
--- a/newlib/libc/ctype/ispunct.c
+++ b/newlib/libc/ctype/ispunct.c
@@ -17,8 +17,8 @@ int ispunct(<[c]>);
DESCRIPTION
<<ispunct>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for printable
-punctuation characters, and 0 for other characters. It is defined
-only when <<isascii>>(<[c]>) is true or <[c]> is EOF.
+punctuation characters, and 0 for other characters. It is defined only
+if <[c]> is representable as an unsigned char or if <[c]> is EOF.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef ispunct>>'.
diff --git a/newlib/libc/ctype/isxdigit.c b/newlib/libc/ctype/isxdigit.c
index 9748eb4b5..314f74e7e 100644
--- a/newlib/libc/ctype/isxdigit.c
+++ b/newlib/libc/ctype/isxdigit.c
@@ -17,8 +17,8 @@ int isxdigit(int <[c]>);
DESCRIPTION
<<isxdigit>> is a macro which classifies ASCII integer values by table
lookup. It is a predicate returning non-zero for hexadecimal digits,
-and <<0>> for other characters. It is defined only when
-<<isascii>>(<[c]>) is true or <[c]> is EOF.
+and <<0>> for other characters. It is defined only if <[c]> is
+representable as an unsigned char or if <[c]> is EOF.
You can use a compiled subroutine instead of the macro definition by
undefining the macro using `<<#undef isxdigit>>'.
diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h
index f8795c072..dd1fceda9 100644
--- a/newlib/libc/include/machine/ieeefp.h
+++ b/newlib/libc/include/machine/ieeefp.h
@@ -359,6 +359,11 @@
#define __IEEE_BIG_ENDIAN
#endif
+#ifdef __MSP430__
+#define __IEEE_LITTLE_ENDIAN
+#define __SMALL_BITFIELDS /* 16 Bit INT */
+#endif
+
#ifdef __RL78__
#define __IEEE_LITTLE_ENDIAN
#define __SMALL_BITFIELDS /* 16 Bit INT */
@@ -388,6 +393,14 @@
#define __SMALL_BITFIELDS /* 16 Bit INT */
#endif
+#ifdef __NIOS2__
+# ifdef __nios2_big_endian__
+# define __IEEE_BIG_ENDIAN
+# else
+# define __IEEE_LITTLE_ENDIAN
+# endif
+#endif
+
#ifndef __IEEE_BIG_ENDIAN
#ifndef __IEEE_LITTLE_ENDIAN
#error Endianess not declared!!
diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
index 31a8032d8..78fbdd78b 100644
--- a/newlib/libc/include/machine/setjmp.h
+++ b/newlib/libc/include/machine/setjmp.h
@@ -68,19 +68,24 @@ _BEGIN_STD_C
#define _JBLEN 9
#endif
-#if defined(__CYGWIN__) && !defined (_JBLEN)
-#define _JBLEN (13 * 4)
-#elif defined (__i386__)
-#if defined(__unix__) || defined(__rtems__)
-# define _JBLEN 9
-#else
-#include "setjmp-dj.h"
-#endif
+#ifdef __i386__
+# if defined(__CYGWIN__) && !defined (_JBLEN)
+# define _JBLEN (13 * 4)
+# elif defined(__unix__) || defined(__rtems__)
+# define _JBLEN 9
+# else
+# include "setjmp-dj.h"
+# endif
#endif
#ifdef __x86_64__
-#define _JBTYPE long long
-#define _JBLEN 8
+# ifdef __CYGWIN__
+# define _JBTYPE long
+# define _JBLEN 32
+# else
+# define _JBTYPE long long
+# define _JBLEN 8
+# endif
#endif
#ifdef __i960__
@@ -276,12 +281,40 @@ _BEGIN_STD_C
#define _JBTYPE unsigned short
#endif /* __m32c__ */
+#ifdef __MSP430__
+#define _JBLEN 9
+
+#ifdef __MSP430X_LARGE__
+#define _JBTYPE unsigned long
+#else
+#define _JBTYPE unsigned short
+#endif
+#endif
+
#ifdef __RL78__
/* Three banks of registers, SP, CS, ES, PC */
#define _JBLEN (8*3+8)
#define _JBTYPE unsigned char
#endif
+/*
+ * There are two versions of setjmp()/longjmp():
+ * 1) Compiler (gcc) built-in versions.
+ * 2) Function-call versions.
+ *
+ * The built-in versions are used most of the time. When used, gcc replaces
+ * calls to setjmp()/longjmp() with inline assembly code. The built-in
+ * versions save/restore a variable number of registers.
+
+ * _JBLEN is set to 40 to be ultra-safe with the built-in versions.
+ * It only needs to be 12 for the function-call versions
+ * but this data structure is used by both versions.
+ */
+#ifdef __NIOS2__
+#define _JBLEN 40
+#define _JBTYPE unsigned long
+#endif
+
#ifdef __RX__
#define _JBLEN 0x44
#endif
diff --git a/newlib/libc/include/reent.h b/newlib/libc/include/reent.h
index 4617c0d96..861be71d3 100644
--- a/newlib/libc/include/reent.h
+++ b/newlib/libc/include/reent.h
@@ -163,16 +163,22 @@ extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *__tp, void
#ifdef __LARGE64_FILES
-#if defined(__CYGWIN__) && defined(_COMPILING_NEWLIB)
-#define stat64 __stat64
-#endif
+#if defined(__CYGWIN__)
+#define stat64 stat
+#endif
struct stat64;
extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int));
extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *));
extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int));
extern int _stat64_r _PARAMS ((struct _reent *, const char *, struct stat64 *));
+
+/* Don't pollute namespace if not building newlib. */
+#if defined (__CYGWIN__) && !defined (_COMPILING_NEWLIB)
+#undef stat64
+#endif
+
#endif
#endif
diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h
index beeea3251..5f0922c7a 100644
--- a/newlib/libc/include/sys/cdefs.h
+++ b/newlib/libc/include/sys/cdefs.h
@@ -267,7 +267,9 @@
#define _Alignof(x) __alignof(x)
#define _Noreturn __dead2
#define _Thread_local __thread
-#ifdef __COUNTER__
+#if __GNUC_PREREQ__(4, 6) && !defined(__cplusplus)
+/* Do nothing: _Static_assert() works as per C11 */
+#elif defined(__COUNTER__)
#define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
#define __Static_assert(x, y) ___Static_assert(x, y)
#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1]
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index a6528b832..a641c4b29 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -145,6 +145,21 @@
#define __BUFSIZ__ 16
#define _REENT_SMALL
#endif
+
+#if defined __MSP430__
+#ifndef _REENT_SMALL
+#define _REENT_SMALL
+#endif
+
+#define __SMALL_BITFIELDS
+
+#ifdef __MSP430X_LARGE__
+#define _POINTER_INT long
+#else
+#define _POINTER_INT int
+#endif
+#endif
+
#ifdef __m32c__
#define __SMALL_BITFIELDS
#undef INT_MAX
@@ -217,6 +232,7 @@
#if defined(__rtems__)
#define __FILENAME_MAX__ 255
#define _READ_WRITE_RETURN_TYPE _ssize_t
+#define _REENT_GLOBAL_ATEXIT
#endif
#ifndef __EXPORT
diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h
index b5e003b5f..a3ba513bf 100644
--- a/newlib/libc/include/sys/features.h
+++ b/newlib/libc/include/sys/features.h
@@ -173,12 +173,18 @@ extern "C" {
#define _POSIX2_SW_DEV 200112L
#define _POSIX2_UPE 200112L
#define _POSIX_V6_ILP32_OFF32 -1
-#define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32
+#ifdef __LP64__
+#define _POSIX_V6_ILP32_OFFBIG -1
+#define _POSIX_V6_LP64_OFF64 1
+#define _POSIX_V6_LPBIG_OFFBIG 1
+#else
#define _POSIX_V6_ILP32_OFFBIG 1
-#define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG
#define _POSIX_V6_LP64_OFF64 -1
-#define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64
#define _POSIX_V6_LPBIG_OFFBIG -1
+#endif
+#define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32
+#define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG
+#define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64
#define _XBS5_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG
#define _XOPEN_CRYPT 1
#define _XOPEN_ENH_I18N 1
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 7e321e053..21f02cc61 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -85,6 +85,12 @@ struct _atexit {
void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */
struct _on_exit_args * _on_exit_args_ptr;
};
+# define _ATEXIT_INIT {_NULL, 0, {_NULL}, _NULL}
+# define _ATEXIT_INIT_PTR(var) \
+ (var)->_next = _NULL; \
+ (var)->_ind = 0; \
+ (var)->_fns[0] = _NULL; \
+ (var)->_on_exit_args_ptr = _NULL
#else
struct _atexit {
struct _atexit *_next; /* next in list */
@@ -93,6 +99,23 @@ struct _atexit {
void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */
struct _on_exit_args _on_exit_args;
};
+# define _ATEXIT_INIT {_NULL, 0, {_NULL}, {{_NULL}, {_NULL}, 0, 0}}
+# define _ATEXIT_INIT_PTR(var) \
+ (var)->_next = _NULL; \
+ (var)->_ind = 0; \
+ (var)->_fns[0] = _NULL; \
+ (var)->_on_exit_args._fntypes = 0; \
+ (var)->_on_exit_args._fnargs[0] = _NULL
+#endif
+
+#ifdef _REENT_GLOBAL_ATEXIT
+# define _REENT_INIT_ATEXIT
+# define _REENT_INIT_ATEXIT_PTR(var, var0)
+#else
+# define _REENT_INIT_ATEXIT \
+ _NULL, _ATEXIT_INIT,
+# define _REENT_INIT_ATEXIT_PTR(var, var0) \
+ (var)->_atexit = _NULL; _ATEXIT_INIT_PTR(var0);
#endif
/*
@@ -392,9 +415,11 @@ struct _reent
/* signal info */
void (**(_sig_func))(int);
+# ifndef _REENT_GLOBAL_ATEXIT
/* atexit stuff */
struct _atexit *_atexit;
struct _atexit _atexit0;
+# endif
struct _glue __sglue; /* root of glue chain */
__FILE *__sf; /* file descriptors */
@@ -425,8 +450,7 @@ extern const struct __sFILE_fake __sf_fake_stderr;
_NULL, \
_NULL, \
_NULL, \
- _NULL, \
- {_NULL, 0, {_NULL}, _NULL}, \
+ _REENT_INIT_ATEXIT \
{_NULL, 0, _NULL}, \
_NULL, \
_NULL, \
@@ -452,11 +476,7 @@ extern const struct __sFILE_fake __sf_fake_stderr;
(var)->_localtime_buf = _NULL; \
(var)->_asctime_buf = _NULL; \
(var)->_sig_func = _NULL; \
- (var)->_atexit = _NULL; \
- (var)->_atexit0._next = _NULL; \
- (var)->_atexit0._ind = 0; \
- (var)->_atexit0._fns[0] = _NULL; \
- (var)->_atexit0._on_exit_args_ptr = _NULL; \
+ _REENT_INIT_ATEXIT_PTR(var, &(var)->_atexit0) \
(var)->__sglue._next = _NULL; \
(var)->__sglue._niobs = 0; \
(var)->__sglue._iobs = _NULL; \
@@ -641,9 +661,11 @@ struct _reent
} _unused;
} _new;
+# ifndef _REENT_GLOBAL_ATEXIT
/* atexit stuff */
struct _atexit *_atexit; /* points to head of LIFO stack */
struct _atexit _atexit0; /* one guaranteed table, required by ANSI */
+# endif
/* signal info */
void (**(_sig_func))(int);
@@ -698,34 +720,17 @@ struct _reent
{0, {0}} \
} \
}, \
- _NULL, \
- {_NULL, 0, {_NULL}, {{_NULL}, {_NULL}, 0, 0}}, \
+ _REENT_INIT_ATEXIT \
_NULL, \
{_NULL, 0, _NULL} \
}
#define _REENT_INIT_PTR(var) \
- { (var)->_errno = 0; \
+ { memset((var), 0, sizeof(*(var))); \
(var)->_stdin = &(var)->__sf[0]; \
(var)->_stdout = &(var)->__sf[1]; \
(var)->_stderr = &(var)->__sf[2]; \
- (var)->_inc = 0; \
- memset(&(var)->_emergency, 0, sizeof((var)->_emergency)); \
- (var)->_current_category = 0; \
(var)->_current_locale = "C"; \
- (var)->__sdidinit = 0; \
- (var)->__cleanup = _NULL; \
- (var)->_result = _NULL; \
- (var)->_result_k = 0; \
- (var)->_p5s = _NULL; \
- (var)->_freelist = _NULL; \
- (var)->_cvtlen = 0; \
- (var)->_cvtbuf = _NULL; \
- (var)->_new._reent._unused_rand = 0; \
- (var)->_new._reent._strtok_last = _NULL; \
- (var)->_new._reent._asctime_buf[0] = 0; \
- memset(&(var)->_new._reent._localtime_buf, 0, sizeof((var)->_new._reent._localtime_buf)); \
- (var)->_new._reent._gamma_signgam = 0; \
(var)->_new._reent._rand_next = 1; \
(var)->_new._reent._r48._seed[0] = _RAND48_SEED_0; \
(var)->_new._reent._r48._seed[1] = _RAND48_SEED_1; \
@@ -734,36 +739,6 @@ struct _reent
(var)->_new._reent._r48._mult[1] = _RAND48_MULT_1; \
(var)->_new._reent._r48._mult[2] = _RAND48_MULT_2; \
(var)->_new._reent._r48._add = _RAND48_ADD; \
- (var)->_new._reent._mblen_state.__count = 0; \
- (var)->_new._reent._mblen_state.__value.__wch = 0; \
- (var)->_new._reent._mbtowc_state.__count = 0; \
- (var)->_new._reent._mbtowc_state.__value.__wch = 0; \
- (var)->_new._reent._wctomb_state.__count = 0; \
- (var)->_new._reent._wctomb_state.__value.__wch = 0; \
- (var)->_new._reent._mbrlen_state.__count = 0; \
- (var)->_new._reent._mbrlen_state.__value.__wch = 0; \
- (var)->_new._reent._mbrtowc_state.__count = 0; \
- (var)->_new._reent._mbrtowc_state.__value.__wch = 0; \
- (var)->_new._reent._mbsrtowcs_state.__count = 0; \
- (var)->_new._reent._mbsrtowcs_state.__value.__wch = 0; \
- (var)->_new._reent._wcrtomb_state.__count = 0; \
- (var)->_new._reent._wcrtomb_state.__value.__wch = 0; \
- (var)->_new._reent._wcsrtombs_state.__count = 0; \
- (var)->_new._reent._wcsrtombs_state.__value.__wch = 0; \
- (var)->_new._reent._l64a_buf[0] = '\0'; \
- (var)->_new._reent._signal_buf[0] = '\0'; \
- (var)->_new._reent._getdate_err = 0; \
- (var)->_atexit = _NULL; \
- (var)->_atexit0._next = _NULL; \
- (var)->_atexit0._ind = 0; \
- (var)->_atexit0._fns[0] = _NULL; \
- (var)->_atexit0._on_exit_args._fntypes = 0; \
- (var)->_atexit0._on_exit_args._fnargs[0] = _NULL; \
- (var)->_sig_func = _NULL; \
- (var)->__sglue._next = _NULL; \
- (var)->__sglue._niobs = 0; \
- (var)->__sglue._iobs = _NULL; \
- memset(&(var)->__sf, 0, sizeof((var)->__sf)); \
}
#define _REENT_CHECK_RAND48(ptr) /* nothing */
@@ -837,6 +812,13 @@ void _reclaim_reent _PARAMS ((struct _reent *));
#define _GLOBAL_REENT _global_impure_ptr
+#ifdef _REENT_GLOBAL_ATEXIT
+extern struct _atexit *_global_atexit; /* points to head of LIFO stack */
+# define _GLOBAL_ATEXIT _global_atexit
+#else
+# define _GLOBAL_ATEXIT (_GLOBAL_REENT->_atexit)
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h
index fa2036dd3..937bcacd2 100644
--- a/newlib/libc/include/sys/stat.h
+++ b/newlib/libc/include/sys/stat.h
@@ -19,7 +19,7 @@ extern "C" {
#ifdef __CYGWIN__
#include <cygwin/stat.h>
#ifdef _COMPILING_NEWLIB
-#define stat64 __stat64
+#define stat64 stat
#endif
#else
struct stat
diff --git a/newlib/libc/libc.texinfo b/newlib/libc/libc.texinfo
index b75d57773..74d448d88 100644
--- a/newlib/libc/libc.texinfo
+++ b/newlib/libc/libc.texinfo
@@ -429,7 +429,7 @@ usage as the ANSI C version from @file{stdarg.h}.
@printindex cp
@tex
-% I think something like @colophon should be in texinfo. In the
+% I think something like @@colophon should be in texinfo. In the
% meantime:
\long\def\colophon{\hbox to0pt{}\vfill
\centerline{The body of this manual is set in}
@@ -440,7 +440,7 @@ usage as the ANSI C version from @file{stdarg.h}.
\centerline{{\sl\fontname\tensl\/}}
\centerline{are used for emphasis.}\vfill}
\page\colophon
-% Blame: pesch@cygnus.com, 28mar91.
+% Blame: pesch@@cygnus.com, 28mar91.
@end tex
@contents
diff --git a/newlib/libc/machine/aarch64/Makefile.am b/newlib/libc/machine/aarch64/Makefile.am
deleted file mode 100644
index 2a810e253..000000000
--- a/newlib/libc/machine/aarch64/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-
-AM_CCASFLAGS = $(INCLUDES)
-
-noinst_LIBRARIES = lib.a
-
-lib_a_SOURCES =
-lib_a_SOURCES += memcmp-stub.c
-lib_a_SOURCES += memcmp.S
-lib_a_SOURCES += memcpy-stub.c
-lib_a_SOURCES += memcpy.S
-lib_a_SOURCES += memmove-stub.c
-lib_a_SOURCES += memmove.S
-lib_a_SOURCES += memset-stub.c
-lib_a_SOURCES += memset.S
-lib_a_SOURCES += setjmp.S
-lib_a_SOURCES += strcmp-stub.c
-lib_a_SOURCES += strcmp.S
-lib_a_SOURCES += strlen-stub.c
-lib_a_SOURCES += strlen.S
-lib_a_SOURCES += strncmp-stub.c
-lib_a_SOURCES += strncmp.S
-lib_a_SOURCES += strnlen-stub.c
-lib_a_SOURCES += strnlen.S
-
-lib_a_CCASFLAGS=$(AM_CCASFLAGS)
-lib_a_CFLAGS=$(AM_CFLAGS)
-
-ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
-CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libc/machine/aarch64/Makefile.in b/newlib/libc/machine/aarch64/Makefile.in
deleted file mode 100644
index 6e568858e..000000000
--- a/newlib/libc/machine/aarch64/Makefile.in
+++ /dev/null
@@ -1,553 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/../../../../mkinstalldirs
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-lib_a_AR = $(AR) $(ARFLAGS)
-lib_a_LIBADD =
-am_lib_a_OBJECTS = lib_a-memcmp-stub.$(OBJEXT) lib_a-memcmp.$(OBJEXT) \
- lib_a-memcpy-stub.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \
- lib_a-memmove-stub.$(OBJEXT) lib_a-memmove.$(OBJEXT) \
- lib_a-memset-stub.$(OBJEXT) lib_a-memset.$(OBJEXT) \
- lib_a-setjmp.$(OBJEXT) lib_a-strcmp-stub.$(OBJEXT) \
- lib_a-strcmp.$(OBJEXT) lib_a-strlen-stub.$(OBJEXT) \
- lib_a-strlen.$(OBJEXT) lib_a-strncmp-stub.$(OBJEXT) \
- lib_a-strncmp.$(OBJEXT) lib_a-strnlen-stub.$(OBJEXT) \
- lib_a-strnlen.$(OBJEXT)
-lib_a_OBJECTS = $(am_lib_a_OBJECTS)
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp =
-am__depfiles_maybe =
-CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(lib_a_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-ETAGS = etags
-CTAGS = ctags
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
-NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-READELF = @READELF@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-aext = @aext@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libm_machine_dir = @libm_machine_dir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lpfx = @lpfx@
-machine_dir = @machine_dir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-newlib_basedir = @newlib_basedir@
-oext = @oext@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_dir = @sys_dir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = cygnus
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-AM_CCASFLAGS = $(INCLUDES)
-noinst_LIBRARIES = lib.a
-lib_a_SOURCES = memcmp-stub.c memcmp.S memcpy-stub.c memcpy.S \
- memmove-stub.c memmove.S memset-stub.c memset.S setjmp.S \
- strcmp-stub.c strcmp.S strlen-stub.c strlen.S strncmp-stub.c \
- strncmp.S strnlen-stub.c strnlen.S
-lib_a_CCASFLAGS = $(AM_CCASFLAGS)
-lib_a_CFLAGS = $(AM_CFLAGS)
-ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
-CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .S .c .o .obj
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --cygnus Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES)
- -rm -f lib.a
- $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
- $(RANLIB) lib.a
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.S.o:
- $(CPPASCOMPILE) -c -o $@ $<
-
-.S.obj:
- $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-lib_a-memcmp.o: memcmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcmp.o `test -f 'memcmp.S' || echo '$(srcdir)/'`memcmp.S
-
-lib_a-memcmp.obj: memcmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcmp.obj `if test -f 'memcmp.S'; then $(CYGPATH_W) 'memcmp.S'; else $(CYGPATH_W) '$(srcdir)/memcmp.S'; fi`
-
-lib_a-memcpy.o: memcpy.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy.o `test -f 'memcpy.S' || echo '$(srcdir)/'`memcpy.S
-
-lib_a-memcpy.obj: memcpy.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy.obj `if test -f 'memcpy.S'; then $(CYGPATH_W) 'memcpy.S'; else $(CYGPATH_W) '$(srcdir)/memcpy.S'; fi`
-
-lib_a-memmove.o: memmove.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memmove.o `test -f 'memmove.S' || echo '$(srcdir)/'`memmove.S
-
-lib_a-memmove.obj: memmove.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memmove.obj `if test -f 'memmove.S'; then $(CYGPATH_W) 'memmove.S'; else $(CYGPATH_W) '$(srcdir)/memmove.S'; fi`
-
-lib_a-memset.o: memset.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memset.o `test -f 'memset.S' || echo '$(srcdir)/'`memset.S
-
-lib_a-memset.obj: memset.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memset.obj `if test -f 'memset.S'; then $(CYGPATH_W) 'memset.S'; else $(CYGPATH_W) '$(srcdir)/memset.S'; fi`
-
-lib_a-setjmp.o: setjmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.o `test -f 'setjmp.S' || echo '$(srcdir)/'`setjmp.S
-
-lib_a-setjmp.obj: setjmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
-
-lib_a-strcmp.o: strcmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strcmp.o `test -f 'strcmp.S' || echo '$(srcdir)/'`strcmp.S
-
-lib_a-strcmp.obj: strcmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strcmp.obj `if test -f 'strcmp.S'; then $(CYGPATH_W) 'strcmp.S'; else $(CYGPATH_W) '$(srcdir)/strcmp.S'; fi`
-
-lib_a-strlen.o: strlen.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strlen.o `test -f 'strlen.S' || echo '$(srcdir)/'`strlen.S
-
-lib_a-strlen.obj: strlen.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strlen.obj `if test -f 'strlen.S'; then $(CYGPATH_W) 'strlen.S'; else $(CYGPATH_W) '$(srcdir)/strlen.S'; fi`
-
-lib_a-strncmp.o: strncmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strncmp.o `test -f 'strncmp.S' || echo '$(srcdir)/'`strncmp.S
-
-lib_a-strncmp.obj: strncmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strncmp.obj `if test -f 'strncmp.S'; then $(CYGPATH_W) 'strncmp.S'; else $(CYGPATH_W) '$(srcdir)/strncmp.S'; fi`
-
-lib_a-strnlen.o: strnlen.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strnlen.o `test -f 'strnlen.S' || echo '$(srcdir)/'`strnlen.S
-
-lib_a-strnlen.obj: strnlen.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strnlen.obj `if test -f 'strnlen.S'; then $(CYGPATH_W) 'strnlen.S'; else $(CYGPATH_W) '$(srcdir)/strnlen.S'; fi`
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-lib_a-memcmp-stub.o: memcmp-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcmp-stub.o `test -f 'memcmp-stub.c' || echo '$(srcdir)/'`memcmp-stub.c
-
-lib_a-memcmp-stub.obj: memcmp-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcmp-stub.obj `if test -f 'memcmp-stub.c'; then $(CYGPATH_W) 'memcmp-stub.c'; else $(CYGPATH_W) '$(srcdir)/memcmp-stub.c'; fi`
-
-lib_a-memcpy-stub.o: memcpy-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy-stub.o `test -f 'memcpy-stub.c' || echo '$(srcdir)/'`memcpy-stub.c
-
-lib_a-memcpy-stub.obj: memcpy-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy-stub.obj `if test -f 'memcpy-stub.c'; then $(CYGPATH_W) 'memcpy-stub.c'; else $(CYGPATH_W) '$(srcdir)/memcpy-stub.c'; fi`
-
-lib_a-memmove-stub.o: memmove-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmove-stub.o `test -f 'memmove-stub.c' || echo '$(srcdir)/'`memmove-stub.c
-
-lib_a-memmove-stub.obj: memmove-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmove-stub.obj `if test -f 'memmove-stub.c'; then $(CYGPATH_W) 'memmove-stub.c'; else $(CYGPATH_W) '$(srcdir)/memmove-stub.c'; fi`
-
-lib_a-memset-stub.o: memset-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memset-stub.o `test -f 'memset-stub.c' || echo '$(srcdir)/'`memset-stub.c
-
-lib_a-memset-stub.obj: memset-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memset-stub.obj `if test -f 'memset-stub.c'; then $(CYGPATH_W) 'memset-stub.c'; else $(CYGPATH_W) '$(srcdir)/memset-stub.c'; fi`
-
-lib_a-strcmp-stub.o: strcmp-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcmp-stub.o `test -f 'strcmp-stub.c' || echo '$(srcdir)/'`strcmp-stub.c
-
-lib_a-strcmp-stub.obj: strcmp-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcmp-stub.obj `if test -f 'strcmp-stub.c'; then $(CYGPATH_W) 'strcmp-stub.c'; else $(CYGPATH_W) '$(srcdir)/strcmp-stub.c'; fi`
-
-lib_a-strlen-stub.o: strlen-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlen-stub.o `test -f 'strlen-stub.c' || echo '$(srcdir)/'`strlen-stub.c
-
-lib_a-strlen-stub.obj: strlen-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlen-stub.obj `if test -f 'strlen-stub.c'; then $(CYGPATH_W) 'strlen-stub.c'; else $(CYGPATH_W) '$(srcdir)/strlen-stub.c'; fi`
-
-lib_a-strncmp-stub.o: strncmp-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncmp-stub.o `test -f 'strncmp-stub.c' || echo '$(srcdir)/'`strncmp-stub.c
-
-lib_a-strncmp-stub.obj: strncmp-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncmp-stub.obj `if test -f 'strncmp-stub.c'; then $(CYGPATH_W) 'strncmp-stub.c'; else $(CYGPATH_W) '$(srcdir)/strncmp-stub.c'; fi`
-
-lib_a-strnlen-stub.o: strnlen-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnlen-stub.o `test -f 'strnlen-stub.c' || echo '$(srcdir)/'`strnlen-stub.c
-
-lib_a-strnlen-stub.obj: strnlen-stub.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnlen-stub.obj `if test -f 'strnlen-stub.c'; then $(CYGPATH_W) 'strnlen-stub.c'; else $(CYGPATH_W) '$(srcdir)/strnlen-stub.c'; fi`
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-am
-all-am: Makefile $(LIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-generic clean-noinstLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-tags dvi dvi-am \
- html html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/newlib/libc/machine/aarch64/aclocal.m4 b/newlib/libc/machine/aarch64/aclocal.m4
deleted file mode 100644
index 18dab02aa..000000000
--- a/newlib/libc/machine/aarch64/aclocal.m4
+++ /dev/null
@@ -1,1012 +0,0 @@
-# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.6], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.6])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 9
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 12
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 16
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
-# 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_MAINTAINER_MODE([DEFAULT-MODE])
-# ----------------------------------
-# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless `enable' is passed literally.
-# For symmetry, `disable' may be passed as well. Anyway, the user
-# can override the default with the --enable/--disable switch.
-AC_DEFUN([AM_MAINTAINER_MODE],
-[m4_case(m4_default([$1], [disable]),
- [enable], [m4_define([am_maintainer_other], [disable])],
- [disable], [m4_define([am_maintainer_other], [enable])],
- [m4_define([am_maintainer_other], [enable])
- m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode's default is 'disable' unless 'enable' is passed
- AC_ARG_ENABLE([maintainer-mode],
-[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
- AC_MSG_RESULT([$USE_MAINTAINER_MODE])
- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST([MAINT])dnl
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([../../../acinclude.m4])
diff --git a/newlib/libc/machine/aarch64/configure b/newlib/libc/machine/aarch64/configure
deleted file mode 100755
index d96b7718a..000000000
--- a/newlib/libc/machine/aarch64/configure
+++ /dev/null
@@ -1,4748 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for newlib 2.0.0.
-#
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='newlib'
-PACKAGE_TARNAME='newlib'
-PACKAGE_VERSION='2.0.0'
-PACKAGE_STRING='newlib 2.0.0'
-PACKAGE_BUGREPORT=''
-PACKAGE_URL=''
-
-ac_unique_file="setjmp.S"
-ac_subst_vars='LTLIBOBJS
-LIBOBJS
-sys_dir
-machine_dir
-libm_machine_dir
-lpfx
-aext
-oext
-OBJEXT
-USE_LIBTOOL_FALSE
-USE_LIBTOOL_TRUE
-ELIX_LEVEL_4_FALSE
-ELIX_LEVEL_4_TRUE
-ELIX_LEVEL_3_FALSE
-ELIX_LEVEL_3_TRUE
-ELIX_LEVEL_2_FALSE
-ELIX_LEVEL_2_TRUE
-ELIX_LEVEL_1_FALSE
-ELIX_LEVEL_1_TRUE
-ELIX_LEVEL_0_FALSE
-ELIX_LEVEL_0_TRUE
-LDFLAGS
-NO_INCLUDE_LIST
-NEWLIB_CFLAGS
-CCASFLAGS
-CCAS
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-READELF
-RANLIB
-AR
-AS
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-CC
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-newlib_basedir
-MAY_SUPPLY_SYSCALLS_FALSE
-MAY_SUPPLY_SYSCALLS_TRUE
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_multilib
-enable_target_optspace
-enable_malloc_debugging
-enable_newlib_multithread
-enable_newlib_iconv
-enable_newlib_elix_level
-enable_newlib_io_float
-enable_newlib_supplied_syscalls
-enable_dependency_tracking
-enable_maintainer_mode
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CCAS
-CCASFLAGS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures newlib 2.0.0 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/newlib]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of newlib 2.0.0:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-multilib build many library versions (default)
- --enable-target-optspace optimize for space
- --enable-malloc-debugging indicate malloc debugging requested
- --enable-newlib-multithread enable support for multiple threads
- --enable-newlib-iconv enable iconv library support
- --enable-newlib-elix-level supply desired elix library level (1-4)
- --disable-newlib-io-float disable printf/scanf family float support
- --disable-newlib-supplied-syscalls disable newlib from supplying syscalls
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
-
-Some influential environment variables:
- CCAS assembler compiler command (defaults to CC)
- CCASFLAGS assembler compiler flags (defaults to CFLAGS)
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-newlib configure 2.0.0
-generated by GNU Autoconf 2.68
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by newlib $as_me 2.0.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-ac_aux_dir=
-for ac_dir in ../../../.. "$srcdir"/../../../..; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../../.. \"$srcdir\"/../../../.." "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-am__api_version='1.11'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error $? "bad value ${enableval} for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-# Check whether --enable-target-optspace was given.
-if test "${enable_target_optspace+set}" = set; then :
- enableval=$enable_target_optspace; case "${enableval}" in
- yes) target_optspace=yes ;;
- no) target_optspace=no ;;
- *) as_fn_error $? "bad value ${enableval} for target-optspace option" "$LINENO" 5 ;;
- esac
-else
- target_optspace=
-fi
-
-# Check whether --enable-malloc-debugging was given.
-if test "${enable_malloc_debugging+set}" = set; then :
- enableval=$enable_malloc_debugging; case "${enableval}" in
- yes) malloc_debugging=yes ;;
- no) malloc_debugging=no ;;
- *) as_fn_error $? "bad value ${enableval} for malloc-debugging option" "$LINENO" 5 ;;
- esac
-else
- malloc_debugging=
-fi
-
-# Check whether --enable-newlib-multithread was given.
-if test "${enable_newlib_multithread+set}" = set; then :
- enableval=$enable_newlib_multithread; case "${enableval}" in
- yes) newlib_multithread=yes ;;
- no) newlib_multithread=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-multithread option" "$LINENO" 5 ;;
- esac
-else
- newlib_multithread=yes
-fi
-
-# Check whether --enable-newlib-iconv was given.
-if test "${enable_newlib_iconv+set}" = set; then :
- enableval=$enable_newlib_iconv; if test "${newlib_iconv+set}" != set; then
- case "${enableval}" in
- yes) newlib_iconv=yes ;;
- no) newlib_iconv=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-iconv option" "$LINENO" 5 ;;
- esac
- fi
-else
- newlib_iconv=${newlib_iconv}
-fi
-
-# Check whether --enable-newlib-elix-level was given.
-if test "${enable_newlib_elix_level+set}" = set; then :
- enableval=$enable_newlib_elix_level; case "${enableval}" in
- 0) newlib_elix_level=0 ;;
- 1) newlib_elix_level=1 ;;
- 2) newlib_elix_level=2 ;;
- 3) newlib_elix_level=3 ;;
- 4) newlib_elix_level=4 ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-elix-level option" "$LINENO" 5 ;;
- esac
-else
- newlib_elix_level=0
-fi
-
-# Check whether --enable-newlib-io-float was given.
-if test "${enable_newlib_io_float+set}" = set; then :
- enableval=$enable_newlib_io_float; case "${enableval}" in
- yes) newlib_io_float=yes ;;
- no) newlib_io_float=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-io-float option" "$LINENO" 5 ;;
- esac
-else
- newlib_io_float=yes
-fi
-
-# Check whether --enable-newlib-supplied-syscalls was given.
-if test "${enable_newlib_supplied_syscalls+set}" = set; then :
- enableval=$enable_newlib_supplied_syscalls; case "${enableval}" in
- yes) newlib_may_supply_syscalls=yes ;;
- no) newlib_may_supply_syscalls=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-supplied-syscalls option" "$LINENO" 5 ;;
- esac
-else
- newlib_may_supply_syscalls=yes
-fi
-
- if test x${newlib_may_supply_syscalls} = xyes; then
- MAY_SUPPLY_SYSCALLS_TRUE=
- MAY_SUPPLY_SYSCALLS_FALSE='#'
-else
- MAY_SUPPLY_SYSCALLS_TRUE='#'
- MAY_SUPPLY_SYSCALLS_FALSE=
-fi
-
-
-
-test -z "${with_target_subdir}" && with_target_subdir=.
-
-if test "${srcdir}" = "."; then
- if test "${with_target_subdir}" != "."; then
- newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
- else
- newlib_basedir="${srcdir}/${with_multisrctop}../../.."
- fi
-else
- newlib_basedir="${srcdir}/../../.."
-fi
-
-
-
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='newlib'
- VERSION='2.0.0'
-
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-# FIXME: We temporarily define our own version of AC_PROG_CC. This is
-# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
-# are probably using a cross compiler, which will not be able to fully
-# link an executable. This should really be fixed in autoconf
-# itself.
-
-
-
-
-
-
-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU C" >&5
-$as_echo_n "checking whether we are using GNU C... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_c_compiler_gnu=yes
-else
- ac_cv_c_compiler_gnu=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-
-if test $ac_cv_c_compiler_gnu = yes; then
- GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AS="${ac_tool_prefix}as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AS"; then
- ac_ct_AS=$AS
- # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AS"; then
- ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AS="as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AS" = x; then
- AS=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AS=$ac_ct_AS
- fi
-else
- AS="$ac_cv_prog_AS"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AR" = x; then
- AR=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
-set dummy ${ac_tool_prefix}readelf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_READELF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$READELF"; then
- ac_cv_prog_READELF="$READELF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_READELF="${ac_tool_prefix}readelf"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-READELF=$ac_cv_prog_READELF
-if test -n "$READELF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
-$as_echo "$READELF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_READELF"; then
- ac_ct_READELF=$READELF
- # Extract the first word of "readelf", so it can be a program name with args.
-set dummy readelf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_READELF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_READELF"; then
- ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_READELF="readelf"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
-if test -n "$ac_ct_READELF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
-$as_echo "$ac_ct_READELF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_READELF" = x; then
- READELF=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- READELF=$ac_ct_READELF
- fi
-else
- READELF="$ac_cv_prog_READELF"
-fi
-
-
-
-
-# Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13. */
-ac_given_INSTALL=$INSTALL
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-# By default we simply use the C compiler to build assembly code.
-
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-
-
-
-
-# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
-# at least currently, we never actually build a program, so we never
-# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
-# fails, because we are probably configuring with a cross compiler
-# which can't create executables. So we include AC_EXEEXT to keep
-# automake happy, but we don't execute it, since we don't care about
-# the result.
-if false; then
-
- dummy_var=1
-fi
-
-. ${newlib_basedir}/configure.host
-
-newlib_cflags="${newlib_cflags} -fno-builtin"
-
-NEWLIB_CFLAGS=${newlib_cflags}
-
-
-NO_INCLUDE_LIST=${noinclude}
-
-
-LDFLAGS=${ldflags}
-
-
- if test x${newlib_elix_level} = x0; then
- ELIX_LEVEL_0_TRUE=
- ELIX_LEVEL_0_FALSE='#'
-else
- ELIX_LEVEL_0_TRUE='#'
- ELIX_LEVEL_0_FALSE=
-fi
-
- if test x${newlib_elix_level} = x1; then
- ELIX_LEVEL_1_TRUE=
- ELIX_LEVEL_1_FALSE='#'
-else
- ELIX_LEVEL_1_TRUE='#'
- ELIX_LEVEL_1_FALSE=
-fi
-
- if test x${newlib_elix_level} = x2; then
- ELIX_LEVEL_2_TRUE=
- ELIX_LEVEL_2_FALSE='#'
-else
- ELIX_LEVEL_2_TRUE='#'
- ELIX_LEVEL_2_FALSE=
-fi
-
- if test x${newlib_elix_level} = x3; then
- ELIX_LEVEL_3_TRUE=
- ELIX_LEVEL_3_FALSE='#'
-else
- ELIX_LEVEL_3_TRUE='#'
- ELIX_LEVEL_3_FALSE=
-fi
-
- if test x${newlib_elix_level} = x4; then
- ELIX_LEVEL_4_TRUE=
- ELIX_LEVEL_4_FALSE='#'
-else
- ELIX_LEVEL_4_TRUE='#'
- ELIX_LEVEL_4_FALSE=
-fi
-
-
- if test x${use_libtool} = xyes; then
- USE_LIBTOOL_TRUE=
- USE_LIBTOOL_FALSE='#'
-else
- USE_LIBTOOL_TRUE='#'
- USE_LIBTOOL_FALSE=
-fi
-
-
-# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we
-# use oext, which is set in configure.host based on the target platform.
-OBJEXT=${oext}
-
-
-
-
-
-
-
-
-
-
-
-ac_config_files="$ac_config_files Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
-t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then
- as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_0_TRUE}" && test -z "${ELIX_LEVEL_0_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_0\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_1_TRUE}" && test -z "${ELIX_LEVEL_1_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_1\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_2_TRUE}" && test -z "${ELIX_LEVEL_2_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_2\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_3_TRUE}" && test -z "${ELIX_LEVEL_3_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_3\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_4_TRUE}" && test -z "${ELIX_LEVEL_4_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_4\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then
- as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by newlib $as_me 2.0.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-newlib config.status 2.0.0
-configured by $0, generated by GNU Autoconf 2.68,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h | --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-
-eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/newlib/libc/machine/aarch64/configure.in b/newlib/libc/machine/aarch64/configure.in
deleted file mode 100644
index 25415c804..000000000
--- a/newlib/libc/machine/aarch64/configure.in
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl This is the newlib/libc/machine/aarch64 configure.in file.
-dnl Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.59)
-AC_INIT([newlib],[NEWLIB_VERSION])
-AC_CONFIG_SRCDIR([setjmp.S])
-
-dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
-AC_CONFIG_AUX_DIR(../../../..)
-
-NEWLIB_CONFIGURE(../../..)
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/newlib/libc/machine/aarch64/memcmp-stub.c b/newlib/libc/machine/aarch64/memcmp-stub.c
deleted file mode 100644
index a4e4876c3..000000000
--- a/newlib/libc/machine/aarch64/memcmp-stub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-# include "../../string/memcmp.c"
-#else
-/* See memcmp.S */
-#endif
diff --git a/newlib/libc/machine/aarch64/memcmp.S b/newlib/libc/machine/aarch64/memcmp.S
deleted file mode 100644
index 860384cc8..000000000
--- a/newlib/libc/machine/aarch64/memcmp.S
+++ /dev/null
@@ -1,167 +0,0 @@
-/* memcmp - compare memory
-
- Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-/* See memcmp-stub.c */
-#else
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- */
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-/* Parameters and result. */
-#define src1 x0
-#define src2 x1
-#define limit x2
-#define result x0
-
-/* Internal variables. */
-#define data1 x3
-#define data1w w3
-#define data2 x4
-#define data2w w4
-#define has_nul x5
-#define diff x6
-#define endloop x7
-#define tmp1 x8
-#define tmp2 x9
-#define tmp3 x10
-#define pos x11
-#define limit_wd x12
-#define mask x13
-
-def_fn memcmp p2align=6
- cbz limit, .Lret0
- eor tmp1, src1, src2
- tst tmp1, #7
- b.ne .Lmisaligned8
- ands tmp1, src1, #7
- b.ne .Lmutual_align
- add limit_wd, limit, #7
- lsr limit_wd, limit_wd, #3
- /* Start of performance-critical section -- one 64B cache line. */
-.Lloop_aligned:
- ldr data1, [src1], #8
- ldr data2, [src2], #8
-.Lstart_realigned:
- subs limit_wd, limit_wd, #1
- eor diff, data1, data2 /* Non-zero if differences found. */
- csinv endloop, diff, xzr, ne /* Last Dword or differences. */
- cbz endloop, .Lloop_aligned
- /* End of performance-critical section -- one 64B cache line. */
-
- /* Not reached the limit, must have found a diff. */
- cbnz limit_wd, .Lnot_limit
-
- /* Limit % 8 == 0 => all bytes significant. */
- ands limit, limit, #7
- b.eq .Lnot_limit
-
- lsl limit, limit, #3 /* Bits -> bytes. */
- mov mask, #~0
-#ifdef __AARCH64EB__
- lsr mask, mask, limit
-#else
- lsl mask, mask, limit
-#endif
- bic data1, data1, mask
- bic data2, data2, mask
-
- orr diff, diff, mask
-.Lnot_limit:
-
-#ifndef __AARCH64EB__
- rev diff, diff
- rev data1, data1
- rev data2, data2
-#endif
- /* The MS-non-zero bit of DIFF marks either the first bit
- that is different, or the end of the significant data.
- Shifting left now will bring the critical information into the
- top bits. */
- clz pos, diff
- lsl data1, data1, pos
- lsl data2, data2, pos
- /* But we need to zero-extend (char is unsigned) the value and then
- perform a signed 32-bit subtraction. */
- lsr data1, data1, #56
- sub result, data1, data2, lsr #56
- ret
-
-.Lmutual_align:
- /* Sources are mutually aligned, but are not currently at an
- alignment boundary. Round down the addresses and then mask off
- the bytes that precede the start point. */
- bic src1, src1, #7
- bic src2, src2, #7
- add limit, limit, tmp1 /* Adjust the limit for the extra. */
- lsl tmp1, tmp1, #3 /* Bytes beyond alignment -> bits. */
- ldr data1, [src1], #8
- neg tmp1, tmp1 /* Bits to alignment -64. */
- ldr data2, [src2], #8
- mov tmp2, #~0
-#ifdef __AARCH64EB__
- /* Big-endian. Early bytes are at MSB. */
- lsl tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
-#else
- /* Little-endian. Early bytes are at LSB. */
- lsr tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
-#endif
- add limit_wd, limit, #7
- orr data1, data1, tmp2
- orr data2, data2, tmp2
- lsr limit_wd, limit_wd, #3
- b .Lstart_realigned
-
-.Lret0:
- mov result, #0
- ret
-
- .p2align 6
-.Lmisaligned8:
- sub limit, limit, #1
-1:
- /* Perhaps we can do better than this. */
- ldrb data1w, [src1], #1
- ldrb data2w, [src2], #1
- subs limit, limit, #1
- ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
- b.eq 1b
- sub result, data1, data2
- ret
- .size memcmp, . - memcmp
-
-#endif \ No newline at end of file
diff --git a/newlib/libc/machine/aarch64/memcpy-stub.c b/newlib/libc/machine/aarch64/memcpy-stub.c
deleted file mode 100644
index cd6d72a8b..000000000
--- a/newlib/libc/machine/aarch64/memcpy-stub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2012-2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-# include "../../string/memcpy.c"
-#else
-/* See memcpy.S */
-#endif
diff --git a/newlib/libc/machine/aarch64/memcpy.S b/newlib/libc/machine/aarch64/memcpy.S
deleted file mode 100644
index ef5c3a999..000000000
--- a/newlib/libc/machine/aarch64/memcpy.S
+++ /dev/null
@@ -1,195 +0,0 @@
-/* Copyright (c) 2012-2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- * Unaligned accesses
- *
- */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-/* See memcpy-stub.c */
-#else
-
-#define dstin x0
-#define src x1
-#define count x2
-#define tmp1 x3
-#define tmp1w w3
-#define tmp2 x4
-#define tmp2w w4
-#define tmp3 x5
-#define tmp3w w5
-#define dst x6
-
-#define A_l x7
-#define A_h x8
-#define B_l x9
-#define B_h x10
-#define C_l x11
-#define C_h x12
-#define D_l x13
-#define D_h x14
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-def_fn memcpy p2align=6
-
- mov dst, dstin
- cmp count, #64
- b.ge .Lcpy_not_short
- cmp count, #15
- b.le .Ltail15tiny
-
- /* Deal with small copies quickly by dropping straight into the
- * exit block. */
-.Ltail63:
- /* Copy up to 48 bytes of data. At this point we only need the
- * bottom 6 bits of count to be accurate. */
- ands tmp1, count, #0x30
- b.eq .Ltail15
- add dst, dst, tmp1
- add src, src, tmp1
- cmp tmp1w, #0x20
- b.eq 1f
- b.lt 2f
- ldp A_l, A_h, [src, #-48]
- stp A_l, A_h, [dst, #-48]
-1:
- ldp A_l, A_h, [src, #-32]
- stp A_l, A_h, [dst, #-32]
-2:
- ldp A_l, A_h, [src, #-16]
- stp A_l, A_h, [dst, #-16]
-
-.Ltail15:
- ands count, count, #15
- beq 1f
- add src, src, count
- ldp A_l, A_h, [src, #-16]
- add dst, dst, count
- stp A_l, A_h, [dst, #-16]
-1:
- ret
-
-.Ltail15tiny:
- /* Copy up to 15 bytes of data. Does not assume additional data
- being copied. */
- tbz count, #3, 1f
- ldr tmp1, [src], #8
- str tmp1, [dst], #8
-1:
- tbz count, #2, 1f
- ldr tmp1w, [src], #4
- str tmp1w, [dst], #4
-1:
- tbz count, #1, 1f
- ldrh tmp1w, [src], #2
- strh tmp1w, [dst], #2
-1:
- tbz count, #0, 1f
- ldrb tmp1w, [src]
- strb tmp1w, [dst]
-1:
- ret
-
-.Lcpy_not_short:
- /* We don't much care about the alignment of DST, but we want SRC
- * to be 128-bit (16 byte) aligned so that we don't cross cache line
- * boundaries on both loads and stores. */
- neg tmp2, src
- ands tmp2, tmp2, #15 /* Bytes to reach alignment. */
- b.eq 2f
- sub count, count, tmp2
- /* Copy more data than needed; it's faster than jumping
- * around copying sub-Quadword quantities. We know that
- * it can't overrun. */
- ldp A_l, A_h, [src]
- add src, src, tmp2
- stp A_l, A_h, [dst]
- add dst, dst, tmp2
- /* There may be less than 63 bytes to go now. */
- cmp count, #63
- b.le .Ltail63
-2:
- subs count, count, #128
- b.ge .Lcpy_body_large
- /* Less than 128 bytes to copy, so handle 64 here and then jump
- * to the tail. */
- ldp A_l, A_h, [src]
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]
- stp A_l, A_h, [dst]
- stp B_l, B_h, [dst, #16]
- stp C_l, C_h, [dst, #32]
- stp D_l, D_h, [dst, #48]
- tst count, #0x3f
- add src, src, #64
- add dst, dst, #64
- b.ne .Ltail63
- ret
-
- /* Critical loop. Start at a new cache line boundary. Assuming
- * 64 bytes per line this ensures the entire loop is in one line. */
- .p2align 6
-.Lcpy_body_large:
- /* There are at least 128 bytes to copy. */
- ldp A_l, A_h, [src, #0]
- sub dst, dst, #16 /* Pre-bias. */
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]! /* src += 64 - Pre-bias. */
-1:
- stp A_l, A_h, [dst, #16]
- ldp A_l, A_h, [src, #16]
- stp B_l, B_h, [dst, #32]
- ldp B_l, B_h, [src, #32]
- stp C_l, C_h, [dst, #48]
- ldp C_l, C_h, [src, #48]
- stp D_l, D_h, [dst, #64]!
- ldp D_l, D_h, [src, #64]!
- subs count, count, #64
- b.ge 1b
- stp A_l, A_h, [dst, #16]
- stp B_l, B_h, [dst, #32]
- stp C_l, C_h, [dst, #48]
- stp D_l, D_h, [dst, #64]
- add src, src, #16
- add dst, dst, #64 + 16
- tst count, #0x3f
- b.ne .Ltail63
- ret
- .size memcpy, .-memcpy
-
-#endif
diff --git a/newlib/libc/machine/aarch64/memmove-stub.c b/newlib/libc/machine/aarch64/memmove-stub.c
deleted file mode 100644
index 8fa4ab938..000000000
--- a/newlib/libc/machine/aarch64/memmove-stub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-# include "../../string/memmove.c"
-#else
-/* See memmove.S */
-#endif
diff --git a/newlib/libc/machine/aarch64/memmove.S b/newlib/libc/machine/aarch64/memmove.S
deleted file mode 100644
index 8cb91f099..000000000
--- a/newlib/libc/machine/aarch64/memmove.S
+++ /dev/null
@@ -1,329 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-/* See memmove-stub.c */
-#else
-
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- * Unaligned accesses
- */
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-/* Parameters and result. */
-#define dstin x0
-#define src x1
-#define count x2
-#define tmp1 x3
-#define tmp1w w3
-#define tmp2 x4
-#define tmp2w w4
-#define tmp3 x5
-#define tmp3w w5
-#define dst x6
-
-#define A_l x7
-#define A_h x8
-#define B_l x9
-#define B_h x10
-#define C_l x11
-#define C_h x12
-#define D_l x13
-#define D_h x14
-
-def_fn memmove, 6
- cmp dstin, src
- b.lo .Ldownwards
- add tmp1, src, count
- cmp dstin, tmp1
- b.hs memcpy /* No overlap. */
-
- /* Upwards move with potential overlap.
- * Need to move from the tail backwards. SRC and DST point one
- * byte beyond the remaining data to move. */
- add dst, dstin, count
- add src, src, count
- cmp count, #64
- b.ge .Lmov_not_short_up
-
- /* Deal with small moves quickly by dropping straight into the
- * exit block. */
-.Ltail63up:
- /* Move up to 48 bytes of data. At this point we only need the
- * bottom 6 bits of count to be accurate. */
- ands tmp1, count, #0x30
- b.eq .Ltail15up
- sub dst, dst, tmp1
- sub src, src, tmp1
- cmp tmp1w, #0x20
- b.eq 1f
- b.lt 2f
- ldp A_l, A_h, [src, #32]
- stp A_l, A_h, [dst, #32]
-1:
- ldp A_l, A_h, [src, #16]
- stp A_l, A_h, [dst, #16]
-2:
- ldp A_l, A_h, [src]
- stp A_l, A_h, [dst]
-.Ltail15up:
- /* Move up to 15 bytes of data. Does not assume additional data
- * being moved. */
- tbz count, #3, 1f
- ldr tmp1, [src, #-8]!
- str tmp1, [dst, #-8]!
-1:
- tbz count, #2, 1f
- ldr tmp1w, [src, #-4]!
- str tmp1w, [dst, #-4]!
-1:
- tbz count, #1, 1f
- ldrh tmp1w, [src, #-2]!
- strh tmp1w, [dst, #-2]!
-1:
- tbz count, #0, 1f
- ldrb tmp1w, [src, #-1]
- strb tmp1w, [dst, #-1]
-1:
- ret
-
-.Lmov_not_short_up:
- /* We don't much care about the alignment of DST, but we want SRC
- * to be 128-bit (16 byte) aligned so that we don't cross cache line
- * boundaries on both loads and stores. */
- ands tmp2, src, #15 /* Bytes to reach alignment. */
- b.eq 2f
- sub count, count, tmp2
- /* Move enough data to reach alignment; unlike memcpy, we have to
- * be aware of the overlap, which means we can't move data twice. */
- tbz tmp2, #3, 1f
- ldr tmp1, [src, #-8]!
- str tmp1, [dst, #-8]!
-1:
- tbz tmp2, #2, 1f
- ldr tmp1w, [src, #-4]!
- str tmp1w, [dst, #-4]!
-1:
- tbz tmp2, #1, 1f
- ldrh tmp1w, [src, #-2]!
- strh tmp1w, [dst, #-2]!
-1:
- tbz tmp2, #0, 1f
- ldrb tmp1w, [src, #-1]!
- strb tmp1w, [dst, #-1]!
-1:
-
- /* There may be less than 63 bytes to go now. */
- cmp count, #63
- b.le .Ltail63up
-2:
- subs count, count, #128
- b.ge .Lmov_body_large_up
- /* Less than 128 bytes to move, so handle 64 here and then jump
- * to the tail. */
- ldp A_l, A_h, [src, #-64]!
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]
- stp A_l, A_h, [dst, #-64]!
- stp B_l, B_h, [dst, #16]
- stp C_l, C_h, [dst, #32]
- stp D_l, D_h, [dst, #48]
- tst count, #0x3f
- b.ne .Ltail63up
- ret
-
- /* Critical loop. Start at a new Icache line boundary. Assuming
- * 64 bytes per line this ensures the entire loop is in one line. */
- .p2align 6
-.Lmov_body_large_up:
- /* There are at least 128 bytes to move. */
- ldp A_l, A_h, [src, #-16]
- ldp B_l, B_h, [src, #-32]
- ldp C_l, C_h, [src, #-48]
- ldp D_l, D_h, [src, #-64]!
-1:
- stp A_l, A_h, [dst, #-16]
- ldp A_l, A_h, [src, #-16]
- stp B_l, B_h, [dst, #-32]
- ldp B_l, B_h, [src, #-32]
- stp C_l, C_h, [dst, #-48]
- ldp C_l, C_h, [src, #-48]
- stp D_l, D_h, [dst, #-64]!
- ldp D_l, D_h, [src, #-64]!
- subs count, count, #64
- b.ge 1b
- stp A_l, A_h, [dst, #-16]
- stp B_l, B_h, [dst, #-32]
- stp C_l, C_h, [dst, #-48]
- stp D_l, D_h, [dst, #-64]!
- tst count, #0x3f
- b.ne .Ltail63up
- ret
-
-
-.Ldownwards:
- /* For a downwards move we can safely use memcpy provided that
- * DST is more than 16 bytes away from SRC. */
- sub tmp1, src, #16
- cmp dstin, tmp1
- b.ls memcpy /* May overlap, but not critically. */
-
- mov dst, dstin /* Preserve DSTIN for return value. */
- cmp count, #64
- b.ge .Lmov_not_short_down
-
- /* Deal with small moves quickly by dropping straight into the
- * exit block. */
-.Ltail63down:
- /* Move up to 48 bytes of data. At this point we only need the
- * bottom 6 bits of count to be accurate. */
- ands tmp1, count, #0x30
- b.eq .Ltail15down
- add dst, dst, tmp1
- add src, src, tmp1
- cmp tmp1w, #0x20
- b.eq 1f
- b.lt 2f
- ldp A_l, A_h, [src, #-48]
- stp A_l, A_h, [dst, #-48]
-1:
- ldp A_l, A_h, [src, #-32]
- stp A_l, A_h, [dst, #-32]
-2:
- ldp A_l, A_h, [src, #-16]
- stp A_l, A_h, [dst, #-16]
-.Ltail15down:
- /* Move up to 15 bytes of data. Does not assume additional data
- being moved. */
- tbz count, #3, 1f
- ldr tmp1, [src], #8
- str tmp1, [dst], #8
-1:
- tbz count, #2, 1f
- ldr tmp1w, [src], #4
- str tmp1w, [dst], #4
-1:
- tbz count, #1, 1f
- ldrh tmp1w, [src], #2
- strh tmp1w, [dst], #2
-1:
- tbz count, #0, 1f
- ldrb tmp1w, [src]
- strb tmp1w, [dst]
-1:
- ret
-
-.Lmov_not_short_down:
- /* We don't much care about the alignment of DST, but we want SRC
- * to be 128-bit (16 byte) aligned so that we don't cross cache line
- * boundaries on both loads and stores. */
- neg tmp2, src
- ands tmp2, tmp2, #15 /* Bytes to reach alignment. */
- b.eq 2f
- sub count, count, tmp2
- /* Move enough data to reach alignment; unlike memcpy, we have to
- * be aware of the overlap, which means we can't move data twice. */
- tbz tmp2, #3, 1f
- ldr tmp1, [src], #8
- str tmp1, [dst], #8
-1:
- tbz tmp2, #2, 1f
- ldr tmp1w, [src], #4
- str tmp1w, [dst], #4
-1:
- tbz tmp2, #1, 1f
- ldrh tmp1w, [src], #2
- strh tmp1w, [dst], #2
-1:
- tbz tmp2, #0, 1f
- ldrb tmp1w, [src], #1
- strb tmp1w, [dst], #1
-1:
-
- /* There may be less than 63 bytes to go now. */
- cmp count, #63
- b.le .Ltail63down
-2:
- subs count, count, #128
- b.ge .Lmov_body_large_down
- /* Less than 128 bytes to move, so handle 64 here and then jump
- * to the tail. */
- ldp A_l, A_h, [src]
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]
- stp A_l, A_h, [dst]
- stp B_l, B_h, [dst, #16]
- stp C_l, C_h, [dst, #32]
- stp D_l, D_h, [dst, #48]
- tst count, #0x3f
- add src, src, #64
- add dst, dst, #64
- b.ne .Ltail63down
- ret
-
- /* Critical loop. Start at a new cache line boundary. Assuming
- * 64 bytes per line this ensures the entire loop is in one line. */
- .p2align 6
-.Lmov_body_large_down:
- /* There are at least 128 bytes to move. */
- ldp A_l, A_h, [src, #0]
- sub dst, dst, #16 /* Pre-bias. */
- ldp B_l, B_h, [src, #16]
- ldp C_l, C_h, [src, #32]
- ldp D_l, D_h, [src, #48]! /* src += 64 - Pre-bias. */
-1:
- stp A_l, A_h, [dst, #16]
- ldp A_l, A_h, [src, #16]
- stp B_l, B_h, [dst, #32]
- ldp B_l, B_h, [src, #32]
- stp C_l, C_h, [dst, #48]
- ldp C_l, C_h, [src, #48]
- stp D_l, D_h, [dst, #64]!
- ldp D_l, D_h, [src, #64]!
- subs count, count, #64
- b.ge 1b
- stp A_l, A_h, [dst, #16]
- stp B_l, B_h, [dst, #32]
- stp C_l, C_h, [dst, #48]
- stp D_l, D_h, [dst, #64]
- add src, src, #16
- add dst, dst, #64 + 16
- tst count, #0x3f
- b.ne .Ltail63down
- ret
- .size memmove, . - memmove
-#endif
diff --git a/newlib/libc/machine/aarch64/memset-stub.c b/newlib/libc/machine/aarch64/memset-stub.c
deleted file mode 100644
index 7defee835..000000000
--- a/newlib/libc/machine/aarch64/memset-stub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2012-2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-# include "../../string/memset.c"
-#else
-/* See memset.S */
-#endif
diff --git a/newlib/libc/machine/aarch64/memset.S b/newlib/libc/machine/aarch64/memset.S
deleted file mode 100644
index 20372df94..000000000
--- a/newlib/libc/machine/aarch64/memset.S
+++ /dev/null
@@ -1,246 +0,0 @@
-/* Copyright (c) 2012-2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- * Unaligned accesses
- *
- */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-/* See memset-stub.c */
-#else
-
-/* By default we assume that the DC instruction can be used to zero
- data blocks more efficiently. In some circumstances this might be
- unsafe, for example in an asymmetric multiprocessor environment with
- different DC clear lengths (neither the upper nor lower lengths are
- safe to use). The feature can be disabled by defining DONT_USE_DC.
-
- If code may be run in a virtualized environment, then define
- MAYBE_VIRT. This will cause the code to cache the system register
- values rather than re-reading them each call. */
-
-#define dstin x0
-#define val w1
-#define count x2
-#define tmp1 x3
-#define tmp1w w3
-#define tmp2 x4
-#define tmp2w w4
-#define zva_len_x x5
-#define zva_len w5
-#define zva_bits_x x6
-
-#define A_l x7
-#define A_lw w7
-#define dst x8
-#define tmp3w w9
-
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-def_fn memset p2align=6
-
- mov dst, dstin /* Preserve return value. */
- ands A_lw, val, #255
-#ifndef DONT_USE_DC
- b.eq .Lzero_mem
-#endif
- orr A_lw, A_lw, A_lw, lsl #8
- orr A_lw, A_lw, A_lw, lsl #16
- orr A_l, A_l, A_l, lsl #32
-.Ltail_maybe_long:
- cmp count, #64
- b.ge .Lnot_short
-.Ltail_maybe_tiny:
- cmp count, #15
- b.le .Ltail15tiny
-.Ltail63:
- ands tmp1, count, #0x30
- b.eq .Ltail15
- add dst, dst, tmp1
- cmp tmp1w, #0x20
- b.eq 1f
- b.lt 2f
- stp A_l, A_l, [dst, #-48]
-1:
- stp A_l, A_l, [dst, #-32]
-2:
- stp A_l, A_l, [dst, #-16]
-
-.Ltail15:
- and count, count, #15
- add dst, dst, count
- stp A_l, A_l, [dst, #-16] /* Repeat some/all of last store. */
- ret
-
-.Ltail15tiny:
- /* Set up to 15 bytes. Does not assume earlier memory
- being set. */
- tbz count, #3, 1f
- str A_l, [dst], #8
-1:
- tbz count, #2, 1f
- str A_lw, [dst], #4
-1:
- tbz count, #1, 1f
- strh A_lw, [dst], #2
-1:
- tbz count, #0, 1f
- strb A_lw, [dst]
-1:
- ret
-
- /* Critical loop. Start at a new cache line boundary. Assuming
- * 64 bytes per line, this ensures the entire loop is in one line. */
- .p2align 6
-.Lnot_short:
- neg tmp2, dst
- ands tmp2, tmp2, #15
- b.eq 2f
- /* Bring DST to 128-bit (16-byte) alignment. We know that there's
- * more than that to set, so we simply store 16 bytes and advance by
- * the amount required to reach alignment. */
- sub count, count, tmp2
- stp A_l, A_l, [dst]
- add dst, dst, tmp2
- /* There may be less than 63 bytes to go now. */
- cmp count, #63
- b.le .Ltail63
-2:
- sub dst, dst, #16 /* Pre-bias. */
- sub count, count, #64
-1:
- stp A_l, A_l, [dst, #16]
- stp A_l, A_l, [dst, #32]
- stp A_l, A_l, [dst, #48]
- stp A_l, A_l, [dst, #64]!
- subs count, count, #64
- b.ge 1b
- tst count, #0x3f
- add dst, dst, #16
- b.ne .Ltail63
- ret
-
-#ifndef DONT_USE_DC
- /* For zeroing memory, check to see if we can use the ZVA feature to
- * zero entire 'cache' lines. */
-.Lzero_mem:
- mov A_l, #0
- cmp count, #63
- b.le .Ltail_maybe_tiny
- neg tmp2, dst
- ands tmp2, tmp2, #15
- b.eq 1f
- sub count, count, tmp2
- stp A_l, A_l, [dst]
- add dst, dst, tmp2
- cmp count, #63
- b.le .Ltail63
-1:
- /* For zeroing small amounts of memory, it's not worth setting up
- * the line-clear code. */
- cmp count, #128
- b.lt .Lnot_short
-#ifdef MAYBE_VIRT
- /* For efficiency when virtualized, we cache the ZVA capability. */
- adrp tmp2, .Lcache_clear
- ldr zva_len, [tmp2, #:lo12:.Lcache_clear]
- tbnz zva_len, #31, .Lnot_short
- cbnz zva_len, .Lzero_by_line
- mrs tmp1, dczid_el0
- tbz tmp1, #4, 1f
- /* ZVA not available. Remember this for next time. */
- mov zva_len, #~0
- str zva_len, [tmp2, #:lo12:.Lcache_clear]
- b .Lnot_short
-1:
- mov tmp3w, #4
- and zva_len, tmp1w, #15 /* Safety: other bits reserved. */
- lsl zva_len, tmp3w, zva_len
- str zva_len, [tmp2, #:lo12:.Lcache_clear]
-#else
- mrs tmp1, dczid_el0
- tbnz tmp1, #4, .Lnot_short
- mov tmp3w, #4
- and zva_len, tmp1w, #15 /* Safety: other bits reserved. */
- lsl zva_len, tmp3w, zva_len
-#endif
-
-.Lzero_by_line:
- /* Compute how far we need to go to become suitably aligned. We're
- * already at quad-word alignment. */
- cmp count, zva_len_x
- b.lt .Lnot_short /* Not enough to reach alignment. */
- sub zva_bits_x, zva_len_x, #1
- neg tmp2, dst
- ands tmp2, tmp2, zva_bits_x
- b.eq 1f /* Already aligned. */
- /* Not aligned, check that there's enough to copy after alignment. */
- sub tmp1, count, tmp2
- cmp tmp1, #64
- ccmp tmp1, zva_len_x, #8, ge /* NZCV=0b1000 */
- b.lt .Lnot_short
- /* We know that there's at least 64 bytes to zero and that it's safe
- * to overrun by 64 bytes. */
- mov count, tmp1
-2:
- stp A_l, A_l, [dst]
- stp A_l, A_l, [dst, #16]
- stp A_l, A_l, [dst, #32]
- subs tmp2, tmp2, #64
- stp A_l, A_l, [dst, #48]
- add dst, dst, #64
- b.ge 2b
- /* We've overrun a bit, so adjust dst downwards. */
- add dst, dst, tmp2
-1:
- sub count, count, zva_len_x
-3:
- dc zva, dst
- add dst, dst, zva_len_x
- subs count, count, zva_len_x
- b.ge 3b
- ands count, count, zva_bits_x
- b.ne .Ltail_maybe_long
- ret
- .size memset, .-memset
-#ifdef MAYBE_VIRT
- .bss
- .p2align 2
-.Lcache_clear:
- .space 4
-#endif
-#endif /* DONT_USE_DC */
-#endif
diff --git a/newlib/libc/machine/aarch64/setjmp.S b/newlib/libc/machine/aarch64/setjmp.S
deleted file mode 100644
index 0856145bf..000000000
--- a/newlib/libc/machine/aarch64/setjmp.S
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Copyright (c) 2011, 2012 ARM Ltd
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#define GPR_LAYOUT \
- REG_PAIR (x19, x20, 0); \
- REG_PAIR (x21, x22, 16); \
- REG_PAIR (x23, x24, 32); \
- REG_PAIR (x25, x26, 48); \
- REG_PAIR (x27, x28, 64); \
- REG_PAIR (x29, x30, 80); \
- REG_ONE (x16, 96)
-
-#define FPR_LAYOUT \
- REG_PAIR ( d8, d9, 112); \
- REG_PAIR (d10, d11, 128); \
- REG_PAIR (d12, d13, 144); \
- REG_PAIR (d14, d15, 160);
-
-// int setjmp (jmp_buf)
- .global setjmp
- .type setjmp, %function
-setjmp:
- mov x16, sp
-#define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS]
-#define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS]
- GPR_LAYOUT
- FPR_LAYOUT
-#undef REG_PAIR
-#undef REG_ONE
- mov w0, #0
- ret
- .size setjmp, .-setjmp
-
-// void longjmp (jmp_buf, int) __attribute__ ((noreturn))
- .global longjmp
- .type longjmp, %function
-longjmp:
-#define REG_PAIR(REG1, REG2, OFFS) ldp REG1, REG2, [x0, OFFS]
-#define REG_ONE(REG1, OFFS) ldr REG1, [x0, OFFS]
- GPR_LAYOUT
- FPR_LAYOUT
-#undef REG_PAIR
-#undef REG_ONE
- mov sp, x16
- cmp w1, #0
- cinc w0, w1, eq
- // use br not ret, as ret is guaranteed to mispredict
- br x30
- .size longjmp, .-longjmp
diff --git a/newlib/libc/machine/aarch64/strcmp-stub.c b/newlib/libc/machine/aarch64/strcmp-stub.c
deleted file mode 100644
index 871a24197..000000000
--- a/newlib/libc/machine/aarch64/strcmp-stub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2012-2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-# include "../../string/strcmp.c"
-#else
-/* See strcmp.S */
-#endif
diff --git a/newlib/libc/machine/aarch64/strcmp.S b/newlib/libc/machine/aarch64/strcmp.S
deleted file mode 100644
index 85baca920..000000000
--- a/newlib/libc/machine/aarch64/strcmp.S
+++ /dev/null
@@ -1,173 +0,0 @@
-/* Copyright (c) 2012-2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-/* See strcmp-stub.c */
-#else
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-#define REP8_01 0x0101010101010101
-#define REP8_7f 0x7f7f7f7f7f7f7f7f
-#define REP8_80 0x8080808080808080
-
-/* Parameters and result. */
-#define src1 x0
-#define src2 x1
-#define result x0
-
-/* Internal variables. */
-#define data1 x2
-#define data1w w2
-#define data2 x3
-#define data2w w3
-#define has_nul x4
-#define diff x5
-#define syndrome x6
-#define tmp1 x7
-#define tmp2 x8
-#define tmp3 x9
-#define zeroones x10
-#define pos x11
-
- /* Start of performance-critical section -- one 64B cache line. */
-def_fn strcmp p2align=6
- eor tmp1, src1, src2
- mov zeroones, #REP8_01
- tst tmp1, #7
- b.ne .Lmisaligned8
- ands tmp1, src1, #7
- b.ne .Lmutual_align
- /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
- (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
- can be done in parallel across the entire word. */
-.Lloop_aligned:
- ldr data1, [src1], #8
- ldr data2, [src2], #8
-.Lstart_realigned:
- sub tmp1, data1, zeroones
- orr tmp2, data1, #REP8_7f
- eor diff, data1, data2 /* Non-zero if differences found. */
- bic has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
- orr syndrome, diff, has_nul
- cbz syndrome, .Lloop_aligned
- /* End of performance-critical section -- one 64B cache line. */
-
-#ifndef __AARCH64EB__
- rev syndrome, syndrome
- rev data1, data1
- /* The MS-non-zero bit of the syndrome marks either the first bit
- that is different, or the top bit of the first zero byte.
- Shifting left now will bring the critical information into the
- top bits. */
- clz pos, syndrome
- rev data2, data2
- lsl data1, data1, pos
- lsl data2, data2, pos
- /* But we need to zero-extend (char is unsigned) the value and then
- perform a signed 32-bit subtraction. */
- lsr data1, data1, #56
- sub result, data1, data2, lsr #56
- ret
-#else
- /* For big-endian we cannot use the trick with the syndrome value
- as carry-propagation can corrupt the upper bits if the trailing
- bytes in the string contain 0x01. */
- /* However, if there is no NUL byte in the dword, we can generate
- the result directly. We can't just subtract the bytes as the
- MSB might be significant. */
- cbnz has_nul, 1f
- cmp data1, data2
- cset result, ne
- cneg result, result, lo
- ret
-1:
- /* Re-compute the NUL-byte detection, using a byte-reversed value. */
- rev tmp3, data1
- sub tmp1, tmp3, zeroones
- orr tmp2, tmp3, #REP8_7f
- bic has_nul, tmp1, tmp2
- rev has_nul, has_nul
- orr syndrome, diff, has_nul
- clz pos, syndrome
- /* The MS-non-zero bit of the syndrome marks either the first bit
- that is different, or the top bit of the first zero byte.
- Shifting left now will bring the critical information into the
- top bits. */
- lsl data1, data1, pos
- lsl data2, data2, pos
- /* But we need to zero-extend (char is unsigned) the value and then
- perform a signed 32-bit subtraction. */
- lsr data1, data1, #56
- sub result, data1, data2, lsr #56
- ret
-#endif
-
-.Lmutual_align:
- /* Sources are mutually aligned, but are not currently at an
- alignment boundary. Round down the addresses and then mask off
- the bytes that preceed the start point. */
- bic src1, src1, #7
- bic src2, src2, #7
- lsl tmp1, tmp1, #3 /* Bytes beyond alignment -> bits. */
- ldr data1, [src1], #8
- neg tmp1, tmp1 /* Bits to alignment -64. */
- ldr data2, [src2], #8
- mov tmp2, #~0
-#ifdef __AARCH64EB__
- /* Big-endian. Early bytes are at MSB. */
- lsl tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
-#else
- /* Little-endian. Early bytes are at LSB. */
- lsr tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
-#endif
- orr data1, data1, tmp2
- orr data2, data2, tmp2
- b .Lstart_realigned
-
-.Lmisaligned8:
- /* We can do better than this. */
- ldrb data1w, [src1], #1
- ldrb data2w, [src2], #1
- cmp data1w, #1
- ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
- b.eq .Lmisaligned8
- sub result, data1, data2
- ret
- .size strcmp, .-strcmp
-
-#endif
diff --git a/newlib/libc/machine/aarch64/strlen-stub.c b/newlib/libc/machine/aarch64/strlen-stub.c
deleted file mode 100644
index 717e209fb..000000000
--- a/newlib/libc/machine/aarch64/strlen-stub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-# include "../../string/strlen.c"
-#else
-/* See strlen.S */
-#endif
diff --git a/newlib/libc/machine/aarch64/strlen.S b/newlib/libc/machine/aarch64/strlen.S
deleted file mode 100644
index 36fde1fd9..000000000
--- a/newlib/libc/machine/aarch64/strlen.S
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-/* See strlen-stub.c */
-#else
-
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- */
-
-/* Arguments and results. */
-#define srcin x0
-#define len x0
-
-/* Locals and temporaries. */
-#define src x1
-#define data1 x2
-#define data2 x3
-#define data2a x4
-#define has_nul1 x5
-#define has_nul2 x6
-#define tmp1 x7
-#define tmp2 x8
-#define tmp3 x9
-#define tmp4 x10
-#define zeroones x11
-#define pos x12
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-#define REP8_01 0x0101010101010101
-#define REP8_7f 0x7f7f7f7f7f7f7f7f
-#define REP8_80 0x8080808080808080
-
- /* Start of critial section -- keep to one 64Byte cache line. */
-def_fn strlen p2align=6
- mov zeroones, #REP8_01
- bic src, srcin, #15
- ands tmp1, srcin, #15
- b.ne .Lmisaligned
- /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
- (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
- can be done in parallel across the entire word. */
- /* The inner loop deals with two Dwords at a time. This has a
- slightly higher start-up cost, but we should win quite quickly,
- especially on cores with a high number of issue slots per
- cycle, as we get much better parallelism out of the operations. */
-.Lloop:
- ldp data1, data2, [src], #16
-.Lrealigned:
- sub tmp1, data1, zeroones
- orr tmp2, data1, #REP8_7f
- sub tmp3, data2, zeroones
- orr tmp4, data2, #REP8_7f
- bic has_nul1, tmp1, tmp2
- bics has_nul2, tmp3, tmp4
- ccmp has_nul1, #0, #0, eq /* NZCV = 0000 */
- b.eq .Lloop
- /* End of critical section -- keep to one 64Byte cache line. */
-
- sub len, src, srcin
- cbz has_nul1, .Lnul_in_data2
-#ifdef __AARCH64EB__
- mov data2, data1
-#endif
- sub len, len, #8
- mov has_nul2, has_nul1
-.Lnul_in_data2:
-#ifdef __AARCH64EB__
- /* For big-endian, carry propagation (if the final byte in the
- string is 0x01) means we cannot use has_nul directly. The
- easiest way to get the correct byte is to byte-swap the data
- and calculate the syndrome a second time. */
- rev data2, data2
- sub tmp1, data2, zeroones
- orr tmp2, data2, #REP8_7f
- bic has_nul2, tmp1, tmp2
-#endif
- sub len, len, #8
- rev has_nul2, has_nul2
- clz pos, has_nul2
- add len, len, pos, lsr #3 /* Bits to bytes. */
- ret
-
-.Lmisaligned:
- cmp tmp1, #8
- neg tmp1, tmp1
- ldp data1, data2, [src], #16
- lsl tmp1, tmp1, #3 /* Bytes beyond alignment -> bits. */
- mov tmp2, #~0
-#ifdef __AARCH64EB__
- /* Big-endian. Early bytes are at MSB. */
- lsl tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
-#else
- /* Little-endian. Early bytes are at LSB. */
- lsr tmp2, tmp2, tmp1 /* Shift (tmp1 & 63). */
-#endif
- orr data1, data1, tmp2
- orr data2a, data2, tmp2
- csinv data1, data1, xzr, le
- csel data2, data2, data2a, le
- b .Lrealigned
-
- .size strlen, . - strlen
-#endif
diff --git a/newlib/libc/machine/aarch64/strncmp-stub.c b/newlib/libc/machine/aarch64/strncmp-stub.c
deleted file mode 100644
index 1eb988f78..000000000
--- a/newlib/libc/machine/aarch64/strncmp-stub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-# include "../../string/strncmp.c"
-#else
-/* See strncmp.S */
-#endif
diff --git a/newlib/libc/machine/aarch64/strncmp.S b/newlib/libc/machine/aarch64/strncmp.S
deleted file mode 100644
index 0b90dd8a6..000000000
--- a/newlib/libc/machine/aarch64/strncmp.S
+++ /dev/null
@@ -1,228 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-/* See strcmp-stub.c */
-#else
-
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- */
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-#define REP8_01 0x0101010101010101
-#define REP8_7f 0x7f7f7f7f7f7f7f7f
-#define REP8_80 0x8080808080808080
-
-/* Parameters and result. */
-#define src1 x0
-#define src2 x1
-#define limit x2
-#define result x0
-
-/* Internal variables. */
-#define data1 x3
-#define data1w w3
-#define data2 x4
-#define data2w w4
-#define has_nul x5
-#define diff x6
-#define syndrome x7
-#define tmp1 x8
-#define tmp2 x9
-#define tmp3 x10
-#define zeroones x11
-#define pos x12
-#define limit_wd x13
-#define mask x14
-#define endloop x15
-
- .text
- .p2align 6
- .rep 7
- nop /* Pad so that the loop below fits a cache line. */
- .endr
-def_fn strncmp
- cbz limit, .Lret0
- eor tmp1, src1, src2
- mov zeroones, #REP8_01
- tst tmp1, #7
- b.ne .Lmisaligned8
- ands tmp1, src1, #7
- b.ne .Lmutual_align
- /* Calculate the number of full and partial words -1. */
- sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
- lsr limit_wd, limit_wd, #3 /* Convert to Dwords. */
-
- /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
- (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
- can be done in parallel across the entire word. */
- /* Start of performance-critical section -- one 64B cache line. */
-.Lloop_aligned:
- ldr data1, [src1], #8
- ldr data2, [src2], #8
-.Lstart_realigned:
- subs limit_wd, limit_wd, #1
- sub tmp1, data1, zeroones
- orr tmp2, data1, #REP8_7f
- eor diff, data1, data2 /* Non-zero if differences found. */
- csinv endloop, diff, xzr, pl /* Last Dword or differences. */
- bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
- ccmp endloop, #0, #0, eq
- b.eq .Lloop_aligned
- /* End of performance-critical section -- one 64B cache line. */
-
- /* Not reached the limit, must have found the end or a diff. */
- tbz limit_wd, #63, .Lnot_limit
-
- /* Limit % 8 == 0 => all bytes significant. */
- ands limit, limit, #7
- b.eq .Lnot_limit
-
- lsl limit, limit, #3 /* Bits -> bytes. */
- mov mask, #~0
-#ifdef __AARCH64EB__
- lsr mask, mask, limit
-#else
- lsl mask, mask, limit
-#endif
- bic data1, data1, mask
- bic data2, data2, mask
-
- /* Make sure that the NUL byte is marked in the syndrome. */
- orr has_nul, has_nul, mask
-
-.Lnot_limit:
- orr syndrome, diff, has_nul
-
-#ifndef __AARCH64EB__
- rev syndrome, syndrome
- rev data1, data1
- /* The MS-non-zero bit of the syndrome marks either the first bit
- that is different, or the top bit of the first zero byte.
- Shifting left now will bring the critical information into the
- top bits. */
- clz pos, syndrome
- rev data2, data2
- lsl data1, data1, pos
- lsl data2, data2, pos
- /* But we need to zero-extend (char is unsigned) the value and then
- perform a signed 32-bit subtraction. */
- lsr data1, data1, #56
- sub result, data1, data2, lsr #56
- ret
-#else
- /* For big-endian we cannot use the trick with the syndrome value
- as carry-propagation can corrupt the upper bits if the trailing
- bytes in the string contain 0x01. */
- /* However, if there is no NUL byte in the dword, we can generate
- the result directly. We can't just subtract the bytes as the
- MSB might be significant. */
- cbnz has_nul, 1f
- cmp data1, data2
- cset result, ne
- cneg result, result, lo
- ret
-1:
- /* Re-compute the NUL-byte detection, using a byte-reversed value. */
- rev tmp3, data1
- sub tmp1, tmp3, zeroones
- orr tmp2, tmp3, #REP8_7f
- bic has_nul, tmp1, tmp2
- rev has_nul, has_nul
- orr syndrome, diff, has_nul
- clz pos, syndrome
- /* The MS-non-zero bit of the syndrome marks either the first bit
- that is different, or the top bit of the first zero byte.
- Shifting left now will bring the critical information into the
- top bits. */
- lsl data1, data1, pos
- lsl data2, data2, pos
- /* But we need to zero-extend (char is unsigned) the value and then
- perform a signed 32-bit subtraction. */
- lsr data1, data1, #56
- sub result, data1, data2, lsr #56
- ret
-#endif
-
-.Lmutual_align:
- /* Sources are mutually aligned, but are not currently at an
- alignment boundary. Round down the addresses and then mask off
- the bytes that precede the start point.
- We also need to adjust the limit calculations, but without
- overflowing if the limit is near ULONG_MAX. */
- bic src1, src1, #7
- bic src2, src2, #7
- ldr data1, [src1], #8
- neg tmp3, tmp1, lsl #3 /* 64 - bits(bytes beyond align). */
- ldr data2, [src2], #8
- mov tmp2, #~0
- sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
-#ifdef __AARCH64EB__
- /* Big-endian. Early bytes are at MSB. */
- lsl tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */
-#else
- /* Little-endian. Early bytes are at LSB. */
- lsr tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */
-#endif
- and tmp3, limit_wd, #7
- lsr limit_wd, limit_wd, #3
- /* Adjust the limit. Only low 3 bits used, so overflow irrelevant. */
- add limit, limit, tmp1
- add tmp3, tmp3, tmp1
- orr data1, data1, tmp2
- orr data2, data2, tmp2
- add limit_wd, limit_wd, tmp3, lsr #3
- b .Lstart_realigned
-
-.Lret0:
- mov result, #0
- ret
-
- .p2align 6
-.Lmisaligned8:
- sub limit, limit, #1
-1:
- /* Perhaps we can do better than this. */
- ldrb data1w, [src1], #1
- ldrb data2w, [src2], #1
- subs limit, limit, #1
- ccmp data1w, #1, #0, cs /* NZCV = 0b0000. */
- ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
- b.eq 1b
- sub result, data1, data2
- ret
- .size strncmp, . - strncmp
-
-#endif
diff --git a/newlib/libc/machine/aarch64/strnlen-stub.c b/newlib/libc/machine/aarch64/strnlen-stub.c
deleted file mode 100644
index 8e1903c8e..000000000
--- a/newlib/libc/machine/aarch64/strnlen-stub.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-# include "../../string/strnlen.c"
-#else
-/* See strnlen.S */
-#endif
diff --git a/newlib/libc/machine/aarch64/strnlen.S b/newlib/libc/machine/aarch64/strnlen.S
deleted file mode 100644
index c255c3f7c..000000000
--- a/newlib/libc/machine/aarch64/strnlen.S
+++ /dev/null
@@ -1,187 +0,0 @@
-/* strnlen - calculate the length of a string with limit.
-
- Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Linaro nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED))
-/* See strlen-stub.c */
-#else
-
-/* Assumptions:
- *
- * ARMv8-a, AArch64
- */
-
-/* Arguments and results. */
-#define srcin x0
-#define len x0
-#define limit x1
-
-/* Locals and temporaries. */
-#define src x2
-#define data1 x3
-#define data2 x4
-#define data2a x5
-#define has_nul1 x6
-#define has_nul2 x7
-#define tmp1 x8
-#define tmp2 x9
-#define tmp3 x10
-#define tmp4 x11
-#define zeroones x12
-#define pos x13
-#define limit_wd x14
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-#define REP8_01 0x0101010101010101
-#define REP8_7f 0x7f7f7f7f7f7f7f7f
-#define REP8_80 0x8080808080808080
-
- .text
- .p2align 6
-.Lstart:
- /* Pre-pad to ensure critical loop begins an icache line. */
- .rep 7
- nop
- .endr
- /* Put this code here to avoid wasting more space with pre-padding. */
-.Lhit_limit:
- mov len, limit
- ret
-
-def_fn strnlen
- cbz limit, .Lhit_limit
- mov zeroones, #REP8_01
- bic src, srcin, #15
- ands tmp1, srcin, #15
- b.ne .Lmisaligned
- /* Calculate the number of full and partial words -1. */
- sub limit_wd, limit, #1 /* Limit != 0, so no underflow. */
- lsr limit_wd, limit_wd, #4 /* Convert to Qwords. */
-
- /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
- (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
- can be done in parallel across the entire word. */
- /* The inner loop deals with two Dwords at a time. This has a
- slightly higher start-up cost, but we should win quite quickly,
- especially on cores with a high number of issue slots per
- cycle, as we get much better parallelism out of the operations. */
-
- /* Start of critial section -- keep to one 64Byte cache line. */
-.Lloop:
- ldp data1, data2, [src], #16
-.Lrealigned:
- sub tmp1, data1, zeroones
- orr tmp2, data1, #REP8_7f
- sub tmp3, data2, zeroones
- orr tmp4, data2, #REP8_7f
- bic has_nul1, tmp1, tmp2
- bic has_nul2, tmp3, tmp4
- subs limit_wd, limit_wd, #1
- orr tmp1, has_nul1, has_nul2
- ccmp tmp1, #0, #0, pl /* NZCV = 0000 */
- b.eq .Lloop
- /* End of critical section -- keep to one 64Byte cache line. */
-
- orr tmp1, has_nul1, has_nul2
- cbz tmp1, .Lhit_limit /* No null in final Qword. */
-
- /* We know there's a null in the final Qword. The easiest thing
- to do now is work out the length of the string and return
- MIN (len, limit). */
-
- sub len, src, srcin
- cbz has_nul1, .Lnul_in_data2
-#ifdef __AARCH64EB__
- mov data2, data1
-#endif
- sub len, len, #8
- mov has_nul2, has_nul1
-.Lnul_in_data2:
-#ifdef __AARCH64EB__
- /* For big-endian, carry propagation (if the final byte in the
- string is 0x01) means we cannot use has_nul directly. The
- easiest way to get the correct byte is to byte-swap the data
- and calculate the syndrome a second time. */
- rev data2, data2
- sub tmp1, data2, zeroones
- orr tmp2, data2, #REP8_7f
- bic has_nul2, tmp1, tmp2
-#endif
- sub len, len, #8
- rev has_nul2, has_nul2
- clz pos, has_nul2
- add len, len, pos, lsr #3 /* Bits to bytes. */
- cmp len, limit
- csel len, len, limit, ls /* Return the lower value. */
- ret
-
-.Lmisaligned:
- /* Deal with a partial first word.
- We're doing two things in parallel here;
- 1) Calculate the number of words (but avoiding overflow if
- limit is near ULONG_MAX) - to do this we need to work out
- limit + tmp1 - 1 as a 65-bit value before shifting it;
- 2) Load and mask the initial data words - we force the bytes
- before the ones we are interested in to 0xff - this ensures
- early bytes will not hit any zero detection. */
- sub limit_wd, limit, #1
- neg tmp4, tmp1
- cmp tmp1, #8
-
- and tmp3, limit_wd, #15
- lsr limit_wd, limit_wd, #4
- mov tmp2, #~0
-
- ldp data1, data2, [src], #16
- lsl tmp4, tmp4, #3 /* Bytes beyond alignment -> bits. */
- add tmp3, tmp3, tmp1
-
-#ifdef __AARCH64EB__
- /* Big-endian. Early bytes are at MSB. */
- lsl tmp2, tmp2, tmp4 /* Shift (tmp1 & 63). */
-#else
- /* Little-endian. Early bytes are at LSB. */
- lsr tmp2, tmp2, tmp4 /* Shift (tmp1 & 63). */
-#endif
- add limit_wd, limit_wd, tmp3, lsr #4
-
- orr data1, data1, tmp2
- orr data2a, data2, tmp2
-
- csinv data1, data1, xzr, le
- csel data2, data2, data2a, le
- b .Lrealigned
- .size strnlen, . - .Lstart /* Include pre-padding in size. */
-
-#endif
diff --git a/newlib/libc/machine/arm/Makefile.am b/newlib/libc/machine/arm/Makefile.am
index 0490026cf..c5e797e70 100644
--- a/newlib/libc/machine/arm/Makefile.am
+++ b/newlib/libc/machine/arm/Makefile.am
@@ -16,3 +16,9 @@ lib_a_CFLAGS = $(AM_CFLAGS)
ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
+
+MEMCPY_DEP=memcpy-armv7a.S memcpy-armv7m.S
+
+$(lpfx)memcpy.o: $(MEMCPY_DEP)
+
+$(lpfx)memcpy.obj: $(MEMCPY_DEP)
diff --git a/newlib/libc/machine/arm/Makefile.in b/newlib/libc/machine/arm/Makefile.in
index d5ab8a021..975103f6c 100644
--- a/newlib/libc/machine/arm/Makefile.in
+++ b/newlib/libc/machine/arm/Makefile.in
@@ -208,6 +208,7 @@ lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
+MEMCPY_DEP = memcpy-armv7a.S memcpy-armv7m.S
all: all-am
.SUFFIXES:
@@ -503,6 +504,10 @@ uninstall-am:
uninstall-am
+$(lpfx)memcpy.o: $(MEMCPY_DEP)
+
+$(lpfx)memcpy.obj: $(MEMCPY_DEP)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/newlib/libc/machine/arm/memcpy-armv7a.S b/newlib/libc/machine/arm/memcpy-armv7a.S
new file mode 100644
index 000000000..de5bf9ad8
--- /dev/null
+++ b/newlib/libc/machine/arm/memcpy-armv7a.S
@@ -0,0 +1,619 @@
+/* Copyright (c) 2013, Linaro Limited
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of Linaro Limited nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This memcpy routine is optimised for Cortex-A15 cores and takes advantage
+ of VFP or NEON when built with the appropriate flags.
+
+ Assumptions:
+
+ ARMv6 (ARMv7-a if using Neon)
+ ARM state
+ Unaligned accesses
+ LDRD/STRD support unaligned word accesses
+
+ If compiled with GCC, this file should be enclosed within following
+ pre-processing check:
+ if defined (__ARM_ARCH_7A__) && defined (__ARM_FEATURE_UNALIGNED)
+
+ */
+ .syntax unified
+ /* This implementation requires ARM state. */
+ .arm
+
+#ifdef __ARM_NEON__
+
+ .fpu neon
+ .arch armv7-a
+# define FRAME_SIZE 4
+# define USE_VFP
+# define USE_NEON
+
+#elif !defined (__SOFTFP__)
+
+ .arch armv6
+ .fpu vfpv2
+# define FRAME_SIZE 32
+# define USE_VFP
+
+#else
+ .arch armv6
+# define FRAME_SIZE 32
+
+#endif
+
+/* Old versions of GAS incorrectly implement the NEON align semantics. */
+#ifdef BROKEN_ASM_NEON_ALIGN
+#define ALIGN(addr, align) addr,:align
+#else
+#define ALIGN(addr, align) addr:align
+#endif
+
+#define PC_OFFSET 8 /* PC pipeline compensation. */
+#define INSN_SIZE 4
+
+/* Call parameters. */
+#define dstin r0
+#define src r1
+#define count r2
+
+/* Locals. */
+#define tmp1 r3
+#define dst ip
+#define tmp2 r10
+
+#ifndef USE_NEON
+/* For bulk copies using GP registers. */
+#define A_l r2 /* Call-clobbered. */
+#define A_h r3 /* Call-clobbered. */
+#define B_l r4
+#define B_h r5
+#define C_l r6
+#define C_h r7
+#define D_l r8
+#define D_h r9
+#endif
+
+/* Number of lines ahead to pre-fetch data. If you change this the code
+ below will need adjustment to compensate. */
+
+#define prefetch_lines 5
+
+#ifdef USE_VFP
+ .macro cpy_line_vfp vreg, base
+ vstr \vreg, [dst, #\base]
+ vldr \vreg, [src, #\base]
+ vstr d0, [dst, #\base + 8]
+ vldr d0, [src, #\base + 8]
+ vstr d1, [dst, #\base + 16]
+ vldr d1, [src, #\base + 16]
+ vstr d2, [dst, #\base + 24]
+ vldr d2, [src, #\base + 24]
+ vstr \vreg, [dst, #\base + 32]
+ vldr \vreg, [src, #\base + prefetch_lines * 64 - 32]
+ vstr d0, [dst, #\base + 40]
+ vldr d0, [src, #\base + 40]
+ vstr d1, [dst, #\base + 48]
+ vldr d1, [src, #\base + 48]
+ vstr d2, [dst, #\base + 56]
+ vldr d2, [src, #\base + 56]
+ .endm
+
+ .macro cpy_tail_vfp vreg, base
+ vstr \vreg, [dst, #\base]
+ vldr \vreg, [src, #\base]
+ vstr d0, [dst, #\base + 8]
+ vldr d0, [src, #\base + 8]
+ vstr d1, [dst, #\base + 16]
+ vldr d1, [src, #\base + 16]
+ vstr d2, [dst, #\base + 24]
+ vldr d2, [src, #\base + 24]
+ vstr \vreg, [dst, #\base + 32]
+ vstr d0, [dst, #\base + 40]
+ vldr d0, [src, #\base + 40]
+ vstr d1, [dst, #\base + 48]
+ vldr d1, [src, #\base + 48]
+ vstr d2, [dst, #\base + 56]
+ vldr d2, [src, #\base + 56]
+ .endm
+#endif
+
+ .macro def_fn f p2align=0
+ .text
+ .p2align \p2align
+ .global \f
+ .type \f, %function
+\f:
+ .endm
+
+def_fn memcpy p2align=6
+
+ mov dst, dstin /* Preserve dstin, we need to return it. */
+ cmp count, #64
+ bge .Lcpy_not_short
+ /* Deal with small copies quickly by dropping straight into the
+ exit block. */
+
+.Ltail63unaligned:
+#ifdef USE_NEON
+ and tmp1, count, #0x38
+ rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
+ add pc, pc, tmp1
+ vld1.8 {d0}, [src]! /* 14 words to go. */
+ vst1.8 {d0}, [dst]!
+ vld1.8 {d0}, [src]! /* 12 words to go. */
+ vst1.8 {d0}, [dst]!
+ vld1.8 {d0}, [src]! /* 10 words to go. */
+ vst1.8 {d0}, [dst]!
+ vld1.8 {d0}, [src]! /* 8 words to go. */
+ vst1.8 {d0}, [dst]!
+ vld1.8 {d0}, [src]! /* 6 words to go. */
+ vst1.8 {d0}, [dst]!
+ vld1.8 {d0}, [src]! /* 4 words to go. */
+ vst1.8 {d0}, [dst]!
+ vld1.8 {d0}, [src]! /* 2 words to go. */
+ vst1.8 {d0}, [dst]!
+
+ tst count, #4
+ ldrne tmp1, [src], #4
+ strne tmp1, [dst], #4
+#else
+ /* Copy up to 15 full words of data. May not be aligned. */
+ /* Cannot use VFP for unaligned data. */
+ and tmp1, count, #0x3c
+ add dst, dst, tmp1
+ add src, src, tmp1
+ rsb tmp1, tmp1, #(60 - PC_OFFSET/2 + INSN_SIZE/2)
+ /* Jump directly into the sequence below at the correct offset. */
+ add pc, pc, tmp1, lsl #1
+
+ ldr tmp1, [src, #-60] /* 15 words to go. */
+ str tmp1, [dst, #-60]
+
+ ldr tmp1, [src, #-56] /* 14 words to go. */
+ str tmp1, [dst, #-56]
+ ldr tmp1, [src, #-52]
+ str tmp1, [dst, #-52]
+
+ ldr tmp1, [src, #-48] /* 12 words to go. */
+ str tmp1, [dst, #-48]
+ ldr tmp1, [src, #-44]
+ str tmp1, [dst, #-44]
+
+ ldr tmp1, [src, #-40] /* 10 words to go. */
+ str tmp1, [dst, #-40]
+ ldr tmp1, [src, #-36]
+ str tmp1, [dst, #-36]
+
+ ldr tmp1, [src, #-32] /* 8 words to go. */
+ str tmp1, [dst, #-32]
+ ldr tmp1, [src, #-28]
+ str tmp1, [dst, #-28]
+
+ ldr tmp1, [src, #-24] /* 6 words to go. */
+ str tmp1, [dst, #-24]
+ ldr tmp1, [src, #-20]
+ str tmp1, [dst, #-20]
+
+ ldr tmp1, [src, #-16] /* 4 words to go. */
+ str tmp1, [dst, #-16]
+ ldr tmp1, [src, #-12]
+ str tmp1, [dst, #-12]
+
+ ldr tmp1, [src, #-8] /* 2 words to go. */
+ str tmp1, [dst, #-8]
+ ldr tmp1, [src, #-4]
+ str tmp1, [dst, #-4]
+#endif
+
+ lsls count, count, #31
+ ldrhcs tmp1, [src], #2
+ ldrbne src, [src] /* Src is dead, use as a scratch. */
+ strhcs tmp1, [dst], #2
+ strbne src, [dst]
+ bx lr
+
+.Lcpy_not_short:
+ /* At least 64 bytes to copy, but don't know the alignment yet. */
+ str tmp2, [sp, #-FRAME_SIZE]!
+ and tmp2, src, #3
+ and tmp1, dst, #3
+ cmp tmp1, tmp2
+ bne .Lcpy_notaligned
+
+#ifdef USE_VFP
+ /* Magic dust alert! Force VFP on Cortex-A9. Experiments show
+ that the FP pipeline is much better at streaming loads and
+ stores. This is outside the critical loop. */
+ vmov.f32 s0, s0
+#endif
+
+ /* SRC and DST have the same mutual 32-bit alignment, but we may
+ still need to pre-copy some bytes to get to natural alignment.
+ We bring DST into full 64-bit alignment. */
+ lsls tmp2, dst, #29
+ beq 1f
+ rsbs tmp2, tmp2, #0
+ sub count, count, tmp2, lsr #29
+ ldrmi tmp1, [src], #4
+ strmi tmp1, [dst], #4
+ lsls tmp2, tmp2, #2
+ ldrhcs tmp1, [src], #2
+ ldrbne tmp2, [src], #1
+ strhcs tmp1, [dst], #2
+ strbne tmp2, [dst], #1
+
+1:
+ subs tmp2, count, #64 /* Use tmp2 for count. */
+ blt .Ltail63aligned
+
+ cmp tmp2, #512
+ bge .Lcpy_body_long
+
+.Lcpy_body_medium: /* Count in tmp2. */
+#ifdef USE_VFP
+1:
+ vldr d0, [src, #0]
+ subs tmp2, tmp2, #64
+ vldr d1, [src, #8]
+ vstr d0, [dst, #0]
+ vldr d0, [src, #16]
+ vstr d1, [dst, #8]
+ vldr d1, [src, #24]
+ vstr d0, [dst, #16]
+ vldr d0, [src, #32]
+ vstr d1, [dst, #24]
+ vldr d1, [src, #40]
+ vstr d0, [dst, #32]
+ vldr d0, [src, #48]
+ vstr d1, [dst, #40]
+ vldr d1, [src, #56]
+ vstr d0, [dst, #48]
+ add src, src, #64
+ vstr d1, [dst, #56]
+ add dst, dst, #64
+ bge 1b
+ tst tmp2, #0x3f
+ beq .Ldone
+
+.Ltail63aligned: /* Count in tmp2. */
+ and tmp1, tmp2, #0x38
+ add dst, dst, tmp1
+ add src, src, tmp1
+ rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
+ add pc, pc, tmp1
+
+ vldr d0, [src, #-56] /* 14 words to go. */
+ vstr d0, [dst, #-56]
+ vldr d0, [src, #-48] /* 12 words to go. */
+ vstr d0, [dst, #-48]
+ vldr d0, [src, #-40] /* 10 words to go. */
+ vstr d0, [dst, #-40]
+ vldr d0, [src, #-32] /* 8 words to go. */
+ vstr d0, [dst, #-32]
+ vldr d0, [src, #-24] /* 6 words to go. */
+ vstr d0, [dst, #-24]
+ vldr d0, [src, #-16] /* 4 words to go. */
+ vstr d0, [dst, #-16]
+ vldr d0, [src, #-8] /* 2 words to go. */
+ vstr d0, [dst, #-8]
+#else
+ sub src, src, #8
+ sub dst, dst, #8
+1:
+ ldrd A_l, A_h, [src, #8]
+ strd A_l, A_h, [dst, #8]
+ ldrd A_l, A_h, [src, #16]
+ strd A_l, A_h, [dst, #16]
+ ldrd A_l, A_h, [src, #24]
+ strd A_l, A_h, [dst, #24]
+ ldrd A_l, A_h, [src, #32]
+ strd A_l, A_h, [dst, #32]
+ ldrd A_l, A_h, [src, #40]
+ strd A_l, A_h, [dst, #40]
+ ldrd A_l, A_h, [src, #48]
+ strd A_l, A_h, [dst, #48]
+ ldrd A_l, A_h, [src, #56]
+ strd A_l, A_h, [dst, #56]
+ ldrd A_l, A_h, [src, #64]!
+ strd A_l, A_h, [dst, #64]!
+ subs tmp2, tmp2, #64
+ bge 1b
+ tst tmp2, #0x3f
+ bne 1f
+ ldr tmp2,[sp], #FRAME_SIZE
+ bx lr
+1:
+ add src, src, #8
+ add dst, dst, #8
+
+.Ltail63aligned: /* Count in tmp2. */
+ /* Copy up to 7 d-words of data. Similar to Ltail63unaligned, but
+ we know that the src and dest are 32-bit aligned so we can use
+ LDRD/STRD to improve efficiency. */
+ /* TMP2 is now negative, but we don't care about that. The bottom
+ six bits still tell us how many bytes are left to copy. */
+
+ and tmp1, tmp2, #0x38
+ add dst, dst, tmp1
+ add src, src, tmp1
+ rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
+ add pc, pc, tmp1
+ ldrd A_l, A_h, [src, #-56] /* 14 words to go. */
+ strd A_l, A_h, [dst, #-56]
+ ldrd A_l, A_h, [src, #-48] /* 12 words to go. */
+ strd A_l, A_h, [dst, #-48]
+ ldrd A_l, A_h, [src, #-40] /* 10 words to go. */
+ strd A_l, A_h, [dst, #-40]
+ ldrd A_l, A_h, [src, #-32] /* 8 words to go. */
+ strd A_l, A_h, [dst, #-32]
+ ldrd A_l, A_h, [src, #-24] /* 6 words to go. */
+ strd A_l, A_h, [dst, #-24]
+ ldrd A_l, A_h, [src, #-16] /* 4 words to go. */
+ strd A_l, A_h, [dst, #-16]
+ ldrd A_l, A_h, [src, #-8] /* 2 words to go. */
+ strd A_l, A_h, [dst, #-8]
+
+#endif
+ tst tmp2, #4
+ ldrne tmp1, [src], #4
+ strne tmp1, [dst], #4
+ lsls tmp2, tmp2, #31 /* Count (tmp2) now dead. */
+ ldrhcs tmp1, [src], #2
+ ldrbne tmp2, [src]
+ strhcs tmp1, [dst], #2
+ strbne tmp2, [dst]
+
+.Ldone:
+ ldr tmp2, [sp], #FRAME_SIZE
+ bx lr
+
+.Lcpy_body_long: /* Count in tmp2. */
+
+ /* Long copy. We know that there's at least (prefetch_lines * 64)
+ bytes to go. */
+#ifdef USE_VFP
+ /* Don't use PLD. Instead, read some data in advance of the current
+ copy position into a register. This should act like a PLD
+ operation but we won't have to repeat the transfer. */
+
+ vldr d3, [src, #0]
+ vldr d4, [src, #64]
+ vldr d5, [src, #128]
+ vldr d6, [src, #192]
+ vldr d7, [src, #256]
+
+ vldr d0, [src, #8]
+ vldr d1, [src, #16]
+ vldr d2, [src, #24]
+ add src, src, #32
+
+ subs tmp2, tmp2, #prefetch_lines * 64 * 2
+ blt 2f
+1:
+ cpy_line_vfp d3, 0
+ cpy_line_vfp d4, 64
+ cpy_line_vfp d5, 128
+ add dst, dst, #3 * 64
+ add src, src, #3 * 64
+ cpy_line_vfp d6, 0
+ cpy_line_vfp d7, 64
+ add dst, dst, #2 * 64
+ add src, src, #2 * 64
+ subs tmp2, tmp2, #prefetch_lines * 64
+ bge 1b
+
+2:
+ cpy_tail_vfp d3, 0
+ cpy_tail_vfp d4, 64
+ cpy_tail_vfp d5, 128
+ add src, src, #3 * 64
+ add dst, dst, #3 * 64
+ cpy_tail_vfp d6, 0
+ vstr d7, [dst, #64]
+ vldr d7, [src, #64]
+ vstr d0, [dst, #64 + 8]
+ vldr d0, [src, #64 + 8]
+ vstr d1, [dst, #64 + 16]
+ vldr d1, [src, #64 + 16]
+ vstr d2, [dst, #64 + 24]
+ vldr d2, [src, #64 + 24]
+ vstr d7, [dst, #64 + 32]
+ add src, src, #96
+ vstr d0, [dst, #64 + 40]
+ vstr d1, [dst, #64 + 48]
+ vstr d2, [dst, #64 + 56]
+ add dst, dst, #128
+ add tmp2, tmp2, #prefetch_lines * 64
+ b .Lcpy_body_medium
+#else
+ /* Long copy. Use an SMS style loop to maximize the I/O
+ bandwidth of the core. We don't have enough spare registers
+ to synthesise prefetching, so use PLD operations. */
+ /* Pre-bias src and dst. */
+ sub src, src, #8
+ sub dst, dst, #8
+ pld [src, #8]
+ pld [src, #72]
+ subs tmp2, tmp2, #64
+ pld [src, #136]
+ ldrd A_l, A_h, [src, #8]
+ strd B_l, B_h, [sp, #8]
+ ldrd B_l, B_h, [src, #16]
+ strd C_l, C_h, [sp, #16]
+ ldrd C_l, C_h, [src, #24]
+ strd D_l, D_h, [sp, #24]
+ pld [src, #200]
+ ldrd D_l, D_h, [src, #32]!
+ b 1f
+ .p2align 6
+2:
+ pld [src, #232]
+ strd A_l, A_h, [dst, #40]
+ ldrd A_l, A_h, [src, #40]
+ strd B_l, B_h, [dst, #48]
+ ldrd B_l, B_h, [src, #48]
+ strd C_l, C_h, [dst, #56]
+ ldrd C_l, C_h, [src, #56]
+ strd D_l, D_h, [dst, #64]!
+ ldrd D_l, D_h, [src, #64]!
+ subs tmp2, tmp2, #64
+1:
+ strd A_l, A_h, [dst, #8]
+ ldrd A_l, A_h, [src, #8]
+ strd B_l, B_h, [dst, #16]
+ ldrd B_l, B_h, [src, #16]
+ strd C_l, C_h, [dst, #24]
+ ldrd C_l, C_h, [src, #24]
+ strd D_l, D_h, [dst, #32]
+ ldrd D_l, D_h, [src, #32]
+ bcs 2b
+ /* Save the remaining bytes and restore the callee-saved regs. */
+ strd A_l, A_h, [dst, #40]
+ add src, src, #40
+ strd B_l, B_h, [dst, #48]
+ ldrd B_l, B_h, [sp, #8]
+ strd C_l, C_h, [dst, #56]
+ ldrd C_l, C_h, [sp, #16]
+ strd D_l, D_h, [dst, #64]
+ ldrd D_l, D_h, [sp, #24]
+ add dst, dst, #72
+ tst tmp2, #0x3f
+ bne .Ltail63aligned
+ ldr tmp2, [sp], #FRAME_SIZE
+ bx lr
+#endif
+
+.Lcpy_notaligned:
+ pld [src]
+ pld [src, #64]
+ /* There's at least 64 bytes to copy, but there is no mutual
+ alignment. */
+ /* Bring DST to 64-bit alignment. */
+ lsls tmp2, dst, #29
+ pld [src, #(2 * 64)]
+ beq 1f
+ rsbs tmp2, tmp2, #0
+ sub count, count, tmp2, lsr #29
+ ldrmi tmp1, [src], #4
+ strmi tmp1, [dst], #4
+ lsls tmp2, tmp2, #2
+ ldrbne tmp1, [src], #1
+ ldrhcs tmp2, [src], #2
+ strbne tmp1, [dst], #1
+ strhcs tmp2, [dst], #2
+1:
+ pld [src, #(3 * 64)]
+ subs count, count, #64
+ ldrmi tmp2, [sp], #FRAME_SIZE
+ bmi .Ltail63unaligned
+ pld [src, #(4 * 64)]
+
+#ifdef USE_NEON
+ vld1.8 {d0-d3}, [src]!
+ vld1.8 {d4-d7}, [src]!
+ subs count, count, #64
+ bmi 2f
+1:
+ pld [src, #(4 * 64)]
+ vst1.8 {d0-d3}, [ALIGN (dst, 64)]!
+ vld1.8 {d0-d3}, [src]!
+ vst1.8 {d4-d7}, [ALIGN (dst, 64)]!
+ vld1.8 {d4-d7}, [src]!
+ subs count, count, #64
+ bpl 1b
+2:
+ vst1.8 {d0-d3}, [ALIGN (dst, 64)]!
+ vst1.8 {d4-d7}, [ALIGN (dst, 64)]!
+ ands count, count, #0x3f
+#else
+ /* Use an SMS style loop to maximize the I/O bandwidth. */
+ sub src, src, #4
+ sub dst, dst, #8
+ subs tmp2, count, #64 /* Use tmp2 for count. */
+ ldr A_l, [src, #4]
+ ldr A_h, [src, #8]
+ strd B_l, B_h, [sp, #8]
+ ldr B_l, [src, #12]
+ ldr B_h, [src, #16]
+ strd C_l, C_h, [sp, #16]
+ ldr C_l, [src, #20]
+ ldr C_h, [src, #24]
+ strd D_l, D_h, [sp, #24]
+ ldr D_l, [src, #28]
+ ldr D_h, [src, #32]!
+ b 1f
+ .p2align 6
+2:
+ pld [src, #(5 * 64) - (32 - 4)]
+ strd A_l, A_h, [dst, #40]
+ ldr A_l, [src, #36]
+ ldr A_h, [src, #40]
+ strd B_l, B_h, [dst, #48]
+ ldr B_l, [src, #44]
+ ldr B_h, [src, #48]
+ strd C_l, C_h, [dst, #56]
+ ldr C_l, [src, #52]
+ ldr C_h, [src, #56]
+ strd D_l, D_h, [dst, #64]!
+ ldr D_l, [src, #60]
+ ldr D_h, [src, #64]!
+ subs tmp2, tmp2, #64
+1:
+ strd A_l, A_h, [dst, #8]
+ ldr A_l, [src, #4]
+ ldr A_h, [src, #8]
+ strd B_l, B_h, [dst, #16]
+ ldr B_l, [src, #12]
+ ldr B_h, [src, #16]
+ strd C_l, C_h, [dst, #24]
+ ldr C_l, [src, #20]
+ ldr C_h, [src, #24]
+ strd D_l, D_h, [dst, #32]
+ ldr D_l, [src, #28]
+ ldr D_h, [src, #32]
+ bcs 2b
+
+ /* Save the remaining bytes and restore the callee-saved regs. */
+ strd A_l, A_h, [dst, #40]
+ add src, src, #36
+ strd B_l, B_h, [dst, #48]
+ ldrd B_l, B_h, [sp, #8]
+ strd C_l, C_h, [dst, #56]
+ ldrd C_l, C_h, [sp, #16]
+ strd D_l, D_h, [dst, #64]
+ ldrd D_l, D_h, [sp, #24]
+ add dst, dst, #72
+ ands count, tmp2, #0x3f
+#endif
+ ldr tmp2, [sp], #FRAME_SIZE
+ bne .Ltail63unaligned
+ bx lr
+
+ .size memcpy, . - memcpy
diff --git a/newlib/libc/machine/arm/memcpy-armv7m.S b/newlib/libc/machine/arm/memcpy-armv7m.S
new file mode 100644
index 000000000..8a70c7d73
--- /dev/null
+++ b/newlib/libc/machine/arm/memcpy-armv7m.S
@@ -0,0 +1,321 @@
+/*
+ * Copyright (c) 2013 ARM Ltd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* This memcpy routine is optimised for Cortex-M3/M4 cores with/without
+ unaligned access.
+
+ If compiled with GCC, this file should be enclosed within following
+ pre-processing check:
+ if defined (__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
+
+ Prototype: void *memcpy (void *dst, const void *src, size_t count);
+
+ The job will be done in 5 steps.
+ Step 1: Align src/dest pointers, copy mis-aligned if fail to align both
+ Step 2: Repeatedly copy big block size of __OPT_BIG_BLOCK_SIZE
+ Step 3: Repeatedly copy big block size of __OPT_MID_BLOCK_SIZE
+ Step 4: Copy word by word
+ Step 5: Copy byte-to-byte
+
+ Tunable options:
+ __OPT_BIG_BLOCK_SIZE: Size of big block in words. Default to 64.
+ __OPT_MID_BLOCK_SIZE: Size of big block in words. Default to 16.
+ */
+#ifndef __OPT_BIG_BLOCK_SIZE
+#define __OPT_BIG_BLOCK_SIZE (4 * 16)
+#endif
+
+#ifndef __OPT_MID_BLOCK_SIZE
+#define __OPT_MID_BLOCK_SIZE (4 * 4)
+#endif
+
+#if __OPT_BIG_BLOCK_SIZE == 16
+#define BEGIN_UNROLL_BIG_BLOCK \
+ .irp offset, 0,4,8,12
+#elif __OPT_BIG_BLOCK_SIZE == 32
+#define BEGIN_UNROLL_BIG_BLOCK \
+ .irp offset, 0,4,8,12,16,20,24,28
+#elif __OPT_BIG_BLOCK_SIZE == 64
+#define BEGIN_UNROLL_BIG_BLOCK \
+ .irp offset, 0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60
+#else
+#error "Illegal __OPT_BIG_BLOCK_SIZE"
+#endif
+
+#if __OPT_MID_BLOCK_SIZE == 8
+#define BEGIN_UNROLL_MID_BLOCK \
+ .irp offset, 0,4
+#elif __OPT_MID_BLOCK_SIZE == 16
+#define BEGIN_UNROLL_MID_BLOCK \
+ .irp offset, 0,4,8,12
+#else
+#error "Illegal __OPT_MID_BLOCK_SIZE"
+#endif
+
+#define END_UNROLL .endr
+
+ .syntax unified
+ .text
+ .align 2
+ .global memcpy
+ .thumb
+ .thumb_func
+ .type memcpy, %function
+memcpy:
+ @ r0: dst
+ @ r1: src
+ @ r2: len
+#ifdef __ARM_FEATURE_UNALIGNED
+ /* In case of UNALIGNED access supported, ip is not used in
+ function body. */
+ mov ip, r0
+#else
+ push {r0}
+#endif
+ orr r3, r1, r0
+ ands r3, r3, #3
+ bne .Lmisaligned_copy
+
+.Lbig_block:
+ subs r2, __OPT_BIG_BLOCK_SIZE
+ blo .Lmid_block
+
+ /* Kernel loop for big block copy */
+ .align 2
+.Lbig_block_loop:
+ BEGIN_UNROLL_BIG_BLOCK
+#ifdef __ARM_ARCH_7EM__
+ ldr r3, [r1], #4
+ str r3, [r0], #4
+ END_UNROLL
+#else /* __ARM_ARCH_7M__ */
+ ldr r3, [r1, \offset]
+ str r3, [r0, \offset]
+ END_UNROLL
+ adds r0, __OPT_BIG_BLOCK_SIZE
+ adds r1, __OPT_BIG_BLOCK_SIZE
+#endif
+ subs r2, __OPT_BIG_BLOCK_SIZE
+ bhs .Lbig_block_loop
+
+.Lmid_block:
+ adds r2, __OPT_BIG_BLOCK_SIZE - __OPT_MID_BLOCK_SIZE
+ blo .Lcopy_word_by_word
+
+ /* Kernel loop for mid-block copy */
+ .align 2
+.Lmid_block_loop:
+ BEGIN_UNROLL_MID_BLOCK
+#ifdef __ARM_ARCH_7EM__
+ ldr r3, [r1], #4
+ str r3, [r0], #4
+ END_UNROLL
+#else /* __ARM_ARCH_7M__ */
+ ldr r3, [r1, \offset]
+ str r3, [r0, \offset]
+ END_UNROLL
+ adds r0, __OPT_MID_BLOCK_SIZE
+ adds r1, __OPT_MID_BLOCK_SIZE
+#endif
+ subs r2, __OPT_MID_BLOCK_SIZE
+ bhs .Lmid_block_loop
+
+.Lcopy_word_by_word:
+ adds r2, __OPT_MID_BLOCK_SIZE - 4
+ blo .Lcopy_less_than_4
+
+ /* Kernel loop for small block copy */
+ .align 2
+.Lcopy_word_by_word_loop:
+ ldr r3, [r1], #4
+ str r3, [r0], #4
+ subs r2, #4
+ bhs .Lcopy_word_by_word_loop
+
+.Lcopy_less_than_4:
+ adds r2, #4
+ beq .Ldone
+
+ lsls r2, r2, #31
+ itt ne
+ ldrbne r3, [r1], #1
+ strbne r3, [r0], #1
+
+ bcc .Ldone
+#ifdef __ARM_FEATURE_UNALIGNED
+ ldrh r3, [r1]
+ strh r3, [r0]
+#else
+ ldrb r3, [r1]
+ strb r3, [r0]
+ ldrb r3, [r1, #1]
+ strb r3, [r0, #1]
+#endif /* __ARM_FEATURE_UNALIGNED */
+
+.Ldone:
+#ifdef __ARM_FEATURE_UNALIGNED
+ mov r0, ip
+#else
+ pop {r0}
+#endif
+ bx lr
+
+ .align 2
+.Lmisaligned_copy:
+#ifdef __ARM_FEATURE_UNALIGNED
+ /* Define label DST_ALIGNED to BIG_BLOCK. It will go to aligned copy
+ once destination is adjusted to aligned. */
+#define Ldst_aligned Lbig_block
+
+ /* Copy word by word using LDR when alignment can be done in hardware,
+ i.e., SCTLR.A is set, supporting unaligned access in LDR and STR. */
+
+ cmp r2, #8
+ blo .Lbyte_copy
+
+ /* if src is aligned, just go to the big block loop. */
+ lsls r3, r1, #30
+ beq .Ldst_aligned
+#else
+ /* if len < 12, misalignment adjustment has more overhead than
+ just byte-to-byte copy. Also, len must >=8 to guarantee code
+ afterward work correctly. */
+ cmp r2, #12
+ blo .Lbyte_copy
+#endif /* __ARM_FEATURE_UNALIGNED */
+
+ /* Align dst only, not trying to align src. That is the because
+ handling of aligned src and misaligned dst need more overhead than
+ otherwise. By doing this the worst case is when initial src is aligned,
+ additional up to 4 byte additional copy will executed, which is
+ acceptable. */
+
+ ands r3, r0, #3
+ beq .Ldst_aligned
+
+ rsb r3, #4
+ subs r2, r3
+
+ lsls r3, r3, #31
+ itt ne
+ ldrbne r3, [r1], #1
+ strbne r3, [r0], #1
+
+ bcc .Ldst_aligned
+
+#ifdef __ARM_FEATURE_UNALIGNED
+ ldrh r3, [r1], #2
+ strh r3, [r0], #2
+ b .Ldst_aligned
+#else
+ ldrb r3, [r1], #1
+ strb r3, [r0], #1
+ ldrb r3, [r1], #1
+ strb r3, [r0], #1
+ /* Now that dst is aligned */
+.Ldst_aligned:
+ /* if r1 is aligned now, it means r0/r1 has the same misalignment,
+ and they are both aligned now. Go aligned copy. */
+ ands r3, r1, #3
+ beq .Lbig_block
+
+ /* dst is aligned, but src isn't. Misaligned copy. */
+
+ push {r4, r5}
+ subs r2, #4
+
+ /* Backward r1 by misaligned bytes, to make r1 aligned.
+ Since we need to restore r1 to unaligned address after the loop,
+ we need keep the offset bytes to ip and sub it from r1 afterward. */
+ subs r1, r3
+ rsb ip, r3, #4
+
+ /* Pre-load on word */
+ ldr r4, [r1], #4
+
+ cmp r3, #2
+ beq .Lmisaligned_copy_2_2
+ cmp r3, #3
+ beq .Lmisaligned_copy_3_1
+
+ .macro mis_src_copy shift
+1:
+ lsrs r4, r4, \shift
+ ldr r3, [r1], #4
+ lsls r5, r3, 32-\shift
+ orr r4, r4, r5
+ str r4, [r0], #4
+ mov r4, r3
+ subs r2, #4
+ bhs 1b
+ .endm
+
+.Lmisaligned_copy_1_3:
+ mis_src_copy shift=8
+ b .Lsrc_misaligned_tail
+
+.Lmisaligned_copy_3_1:
+ mis_src_copy shift=24
+ b .Lsrc_misaligned_tail
+
+.Lmisaligned_copy_2_2:
+ /* For 2_2 misalignment, ldr is still faster than 2 x ldrh. */
+ mis_src_copy shift=16
+
+.Lsrc_misaligned_tail:
+ adds r2, #4
+ subs r1, ip
+ pop {r4, r5}
+
+#endif /* __ARM_FEATURE_UNALIGNED */
+
+.Lbyte_copy:
+ subs r2, #4
+ blo .Lcopy_less_than_4
+
+.Lbyte_copy_loop:
+ subs r2, #1
+ ldrb r3, [r1], #1
+ strb r3, [r0], #1
+ bhs .Lbyte_copy_loop
+
+ ldrb r3, [r1]
+ strb r3, [r0]
+ ldrb r3, [r1, #1]
+ strb r3, [r0, #1]
+ ldrb r3, [r1, #2]
+ strb r3, [r0, #2]
+
+#ifdef __ARM_FEATURE_UNALIGNED
+ mov r0, ip
+#else
+ pop {r0}
+#endif
+ bx lr
+
+ .size memcpy, .-memcpy
diff --git a/newlib/libc/machine/arm/memcpy-stub.c b/newlib/libc/machine/arm/memcpy-stub.c
index 513631a9f..449d31a50 100644
--- a/newlib/libc/machine/arm/memcpy-stub.c
+++ b/newlib/libc/machine/arm/memcpy-stub.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 ARM Ltd
+ * Copyright (c) 2013 ARM Ltd
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,10 +26,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* The sole purpose of this file is to include the plain memcpy provided in newlib.
- An optimized version of memcpy is provided in the assembly file memcpy.S in this directory. */
+/* The sole purpose of this file is to include the plain memcpy provided
+ in newlib. An optimized version of memcpy is provided in the assembly
+ file memcpy.S in this directory. */
#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
- (!(defined (__ARM_ARCH_7A__) && defined (__ARM_FEATURE_UNALIGNED))))
+ (!((defined (__ARM_ARCH_7A__) && defined (__ARM_FEATURE_UNALIGNED)) \
+ || defined (__ARM_ARCH_7EM__) || defined (__ARM_ARCH_7M__))))
#include "../../string/memcpy.c"
diff --git a/newlib/libc/machine/arm/memcpy.S b/newlib/libc/machine/arm/memcpy.S
index bc54bb3f5..734a19776 100644
--- a/newlib/libc/machine/arm/memcpy.S
+++ b/newlib/libc/machine/arm/memcpy.S
@@ -1,625 +1,39 @@
-/* Copyright (c) 2013, Linaro Limited
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of Linaro Limited nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This memcpy routine is optimised for Cortex-A15 cores and takes advantage
- of VFP or NEON when built with the appropriate flags.
-
- Assumptions:
-
- ARMv6 (ARMv7-a if using Neon)
- ARM state
- Unaligned accesses
- LDRD/STRD support unaligned word accesses
-
+/*
+ * Copyright (c) 2013 ARM Ltd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
- (!(defined (__ARM_ARCH_7A__) && defined (__ARM_FEATURE_UNALIGNED))))
-
+#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)
/* Do nothing here. See memcpy-stub.c in the same directory. */
+#elif defined (__ARM_ARCH_7A__) && defined (__ARM_FEATURE_UNALIGNED)
+#include "memcpy-armv7a.S"
-#else
-
- .syntax unified
- /* This implementation requires ARM state. */
- .arm
-
-#ifdef __ARM_NEON__
-
- .fpu neon
- .arch armv7-a
-# define FRAME_SIZE 4
-# define USE_VFP
-# define USE_NEON
-
-#elif !defined (__SOFTFP__)
-
- .arch armv6
- .fpu vfpv2
-# define FRAME_SIZE 32
-# define USE_VFP
-
-#else
- .arch armv6
-# define FRAME_SIZE 32
-
-#endif
+#elif defined (__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
+#include "memcpy-armv7m.S"
-/* Old versions of GAS incorrectly implement the NEON align semantics. */
-#ifdef BROKEN_ASM_NEON_ALIGN
-#define ALIGN(addr, align) addr,:align
#else
-#define ALIGN(addr, align) addr:align
-#endif
-
-#define PC_OFFSET 8 /* PC pipeline compensation. */
-#define INSN_SIZE 4
-
-/* Call parameters. */
-#define dstin r0
-#define src r1
-#define count r2
-
-/* Locals. */
-#define tmp1 r3
-#define dst ip
-#define tmp2 r10
-
-#ifndef USE_NEON
-/* For bulk copies using GP registers. */
-#define A_l r2 /* Call-clobbered. */
-#define A_h r3 /* Call-clobbered. */
-#define B_l r4
-#define B_h r5
-#define C_l r6
-#define C_h r7
-#define D_l r8
-#define D_h r9
-#endif
-
-/* Number of lines ahead to pre-fetch data. If you change this the code
- below will need adjustment to compensate. */
-
-#define prefetch_lines 5
-
-#ifdef USE_VFP
- .macro cpy_line_vfp vreg, base
- vstr \vreg, [dst, #\base]
- vldr \vreg, [src, #\base]
- vstr d0, [dst, #\base + 8]
- vldr d0, [src, #\base + 8]
- vstr d1, [dst, #\base + 16]
- vldr d1, [src, #\base + 16]
- vstr d2, [dst, #\base + 24]
- vldr d2, [src, #\base + 24]
- vstr \vreg, [dst, #\base + 32]
- vldr \vreg, [src, #\base + prefetch_lines * 64 - 32]
- vstr d0, [dst, #\base + 40]
- vldr d0, [src, #\base + 40]
- vstr d1, [dst, #\base + 48]
- vldr d1, [src, #\base + 48]
- vstr d2, [dst, #\base + 56]
- vldr d2, [src, #\base + 56]
- .endm
-
- .macro cpy_tail_vfp vreg, base
- vstr \vreg, [dst, #\base]
- vldr \vreg, [src, #\base]
- vstr d0, [dst, #\base + 8]
- vldr d0, [src, #\base + 8]
- vstr d1, [dst, #\base + 16]
- vldr d1, [src, #\base + 16]
- vstr d2, [dst, #\base + 24]
- vldr d2, [src, #\base + 24]
- vstr \vreg, [dst, #\base + 32]
- vstr d0, [dst, #\base + 40]
- vldr d0, [src, #\base + 40]
- vstr d1, [dst, #\base + 48]
- vldr d1, [src, #\base + 48]
- vstr d2, [dst, #\base + 56]
- vldr d2, [src, #\base + 56]
- .endm
-#endif
-
- .macro def_fn f p2align=0
- .text
- .p2align \p2align
- .global \f
- .type \f, %function
-\f:
- .endm
-
-def_fn memcpy p2align=6
-
- mov dst, dstin /* Preserve dstin, we need to return it. */
- cmp count, #64
- bge .Lcpy_not_short
- /* Deal with small copies quickly by dropping straight into the
- exit block. */
-
-.Ltail63unaligned:
-#ifdef USE_NEON
- and tmp1, count, #0x38
- rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
- add pc, pc, tmp1
- vld1.8 {d0}, [src]! /* 14 words to go. */
- vst1.8 {d0}, [dst]!
- vld1.8 {d0}, [src]! /* 12 words to go. */
- vst1.8 {d0}, [dst]!
- vld1.8 {d0}, [src]! /* 10 words to go. */
- vst1.8 {d0}, [dst]!
- vld1.8 {d0}, [src]! /* 8 words to go. */
- vst1.8 {d0}, [dst]!
- vld1.8 {d0}, [src]! /* 6 words to go. */
- vst1.8 {d0}, [dst]!
- vld1.8 {d0}, [src]! /* 4 words to go. */
- vst1.8 {d0}, [dst]!
- vld1.8 {d0}, [src]! /* 2 words to go. */
- vst1.8 {d0}, [dst]!
-
- tst count, #4
- ldrne tmp1, [src], #4
- strne tmp1, [dst], #4
-#else
- /* Copy up to 15 full words of data. May not be aligned. */
- /* Cannot use VFP for unaligned data. */
- and tmp1, count, #0x3c
- add dst, dst, tmp1
- add src, src, tmp1
- rsb tmp1, tmp1, #(60 - PC_OFFSET/2 + INSN_SIZE/2)
- /* Jump directly into the sequence below at the correct offset. */
- add pc, pc, tmp1, lsl #1
-
- ldr tmp1, [src, #-60] /* 15 words to go. */
- str tmp1, [dst, #-60]
-
- ldr tmp1, [src, #-56] /* 14 words to go. */
- str tmp1, [dst, #-56]
- ldr tmp1, [src, #-52]
- str tmp1, [dst, #-52]
-
- ldr tmp1, [src, #-48] /* 12 words to go. */
- str tmp1, [dst, #-48]
- ldr tmp1, [src, #-44]
- str tmp1, [dst, #-44]
-
- ldr tmp1, [src, #-40] /* 10 words to go. */
- str tmp1, [dst, #-40]
- ldr tmp1, [src, #-36]
- str tmp1, [dst, #-36]
-
- ldr tmp1, [src, #-32] /* 8 words to go. */
- str tmp1, [dst, #-32]
- ldr tmp1, [src, #-28]
- str tmp1, [dst, #-28]
-
- ldr tmp1, [src, #-24] /* 6 words to go. */
- str tmp1, [dst, #-24]
- ldr tmp1, [src, #-20]
- str tmp1, [dst, #-20]
-
- ldr tmp1, [src, #-16] /* 4 words to go. */
- str tmp1, [dst, #-16]
- ldr tmp1, [src, #-12]
- str tmp1, [dst, #-12]
-
- ldr tmp1, [src, #-8] /* 2 words to go. */
- str tmp1, [dst, #-8]
- ldr tmp1, [src, #-4]
- str tmp1, [dst, #-4]
-#endif
-
- lsls count, count, #31
- ldrhcs tmp1, [src], #2
- ldrbne src, [src] /* Src is dead, use as a scratch. */
- strhcs tmp1, [dst], #2
- strbne src, [dst]
- bx lr
-
-.Lcpy_not_short:
- /* At least 64 bytes to copy, but don't know the alignment yet. */
- str tmp2, [sp, #-FRAME_SIZE]!
- and tmp2, src, #3
- and tmp1, dst, #3
- cmp tmp1, tmp2
- bne .Lcpy_notaligned
-
-#ifdef USE_VFP
- /* Magic dust alert! Force VFP on Cortex-A9. Experiments show
- that the FP pipeline is much better at streaming loads and
- stores. This is outside the critical loop. */
- vmov.f32 s0, s0
-#endif
-
- /* SRC and DST have the same mutual 32-bit alignment, but we may
- still need to pre-copy some bytes to get to natural alignment.
- We bring DST into full 64-bit alignment. */
- lsls tmp2, dst, #29
- beq 1f
- rsbs tmp2, tmp2, #0
- sub count, count, tmp2, lsr #29
- ldrmi tmp1, [src], #4
- strmi tmp1, [dst], #4
- lsls tmp2, tmp2, #2
- ldrhcs tmp1, [src], #2
- ldrbne tmp2, [src], #1
- strhcs tmp1, [dst], #2
- strbne tmp2, [dst], #1
-
-1:
- subs tmp2, count, #64 /* Use tmp2 for count. */
- blt .Ltail63aligned
-
- cmp tmp2, #512
- bge .Lcpy_body_long
-
-.Lcpy_body_medium: /* Count in tmp2. */
-#ifdef USE_VFP
-1:
- vldr d0, [src, #0]
- subs tmp2, tmp2, #64
- vldr d1, [src, #8]
- vstr d0, [dst, #0]
- vldr d0, [src, #16]
- vstr d1, [dst, #8]
- vldr d1, [src, #24]
- vstr d0, [dst, #16]
- vldr d0, [src, #32]
- vstr d1, [dst, #24]
- vldr d1, [src, #40]
- vstr d0, [dst, #32]
- vldr d0, [src, #48]
- vstr d1, [dst, #40]
- vldr d1, [src, #56]
- vstr d0, [dst, #48]
- add src, src, #64
- vstr d1, [dst, #56]
- add dst, dst, #64
- bge 1b
- tst tmp2, #0x3f
- beq .Ldone
-
-.Ltail63aligned: /* Count in tmp2. */
- and tmp1, tmp2, #0x38
- add dst, dst, tmp1
- add src, src, tmp1
- rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
- add pc, pc, tmp1
-
- vldr d0, [src, #-56] /* 14 words to go. */
- vstr d0, [dst, #-56]
- vldr d0, [src, #-48] /* 12 words to go. */
- vstr d0, [dst, #-48]
- vldr d0, [src, #-40] /* 10 words to go. */
- vstr d0, [dst, #-40]
- vldr d0, [src, #-32] /* 8 words to go. */
- vstr d0, [dst, #-32]
- vldr d0, [src, #-24] /* 6 words to go. */
- vstr d0, [dst, #-24]
- vldr d0, [src, #-16] /* 4 words to go. */
- vstr d0, [dst, #-16]
- vldr d0, [src, #-8] /* 2 words to go. */
- vstr d0, [dst, #-8]
-#else
- sub src, src, #8
- sub dst, dst, #8
-1:
- ldrd A_l, A_h, [src, #8]
- strd A_l, A_h, [dst, #8]
- ldrd A_l, A_h, [src, #16]
- strd A_l, A_h, [dst, #16]
- ldrd A_l, A_h, [src, #24]
- strd A_l, A_h, [dst, #24]
- ldrd A_l, A_h, [src, #32]
- strd A_l, A_h, [dst, #32]
- ldrd A_l, A_h, [src, #40]
- strd A_l, A_h, [dst, #40]
- ldrd A_l, A_h, [src, #48]
- strd A_l, A_h, [dst, #48]
- ldrd A_l, A_h, [src, #56]
- strd A_l, A_h, [dst, #56]
- ldrd A_l, A_h, [src, #64]!
- strd A_l, A_h, [dst, #64]!
- subs tmp2, tmp2, #64
- bge 1b
- tst tmp2, #0x3f
- bne 1f
- ldr tmp2,[sp], #FRAME_SIZE
- bx lr
-1:
- add src, src, #8
- add dst, dst, #8
-
-.Ltail63aligned: /* Count in tmp2. */
- /* Copy up to 7 d-words of data. Similar to Ltail63unaligned, but
- we know that the src and dest are 32-bit aligned so we can use
- LDRD/STRD to improve efficiency. */
- /* TMP2 is now negative, but we don't care about that. The bottom
- six bits still tell us how many bytes are left to copy. */
-
- and tmp1, tmp2, #0x38
- add dst, dst, tmp1
- add src, src, tmp1
- rsb tmp1, tmp1, #(56 - PC_OFFSET + INSN_SIZE)
- add pc, pc, tmp1
- ldrd A_l, A_h, [src, #-56] /* 14 words to go. */
- strd A_l, A_h, [dst, #-56]
- ldrd A_l, A_h, [src, #-48] /* 12 words to go. */
- strd A_l, A_h, [dst, #-48]
- ldrd A_l, A_h, [src, #-40] /* 10 words to go. */
- strd A_l, A_h, [dst, #-40]
- ldrd A_l, A_h, [src, #-32] /* 8 words to go. */
- strd A_l, A_h, [dst, #-32]
- ldrd A_l, A_h, [src, #-24] /* 6 words to go. */
- strd A_l, A_h, [dst, #-24]
- ldrd A_l, A_h, [src, #-16] /* 4 words to go. */
- strd A_l, A_h, [dst, #-16]
- ldrd A_l, A_h, [src, #-8] /* 2 words to go. */
- strd A_l, A_h, [dst, #-8]
-
-#endif
- tst tmp2, #4
- ldrne tmp1, [src], #4
- strne tmp1, [dst], #4
- lsls tmp2, tmp2, #31 /* Count (tmp2) now dead. */
- ldrhcs tmp1, [src], #2
- ldrbne tmp2, [src]
- strhcs tmp1, [dst], #2
- strbne tmp2, [dst]
-
-.Ldone:
- ldr tmp2, [sp], #FRAME_SIZE
- bx lr
-
-.Lcpy_body_long: /* Count in tmp2. */
-
- /* Long copy. We know that there's at least (prefetch_lines * 64)
- bytes to go. */
-#ifdef USE_VFP
- /* Don't use PLD. Instead, read some data in advance of the current
- copy position into a register. This should act like a PLD
- operation but we won't have to repeat the transfer. */
-
- vldr d3, [src, #0]
- vldr d4, [src, #64]
- vldr d5, [src, #128]
- vldr d6, [src, #192]
- vldr d7, [src, #256]
-
- vldr d0, [src, #8]
- vldr d1, [src, #16]
- vldr d2, [src, #24]
- add src, src, #32
-
- subs tmp2, tmp2, #prefetch_lines * 64 * 2
- blt 2f
-1:
- cpy_line_vfp d3, 0
- cpy_line_vfp d4, 64
- cpy_line_vfp d5, 128
- add dst, dst, #3 * 64
- add src, src, #3 * 64
- cpy_line_vfp d6, 0
- cpy_line_vfp d7, 64
- add dst, dst, #2 * 64
- add src, src, #2 * 64
- subs tmp2, tmp2, #prefetch_lines * 64
- bge 1b
-
-2:
- cpy_tail_vfp d3, 0
- cpy_tail_vfp d4, 64
- cpy_tail_vfp d5, 128
- add src, src, #3 * 64
- add dst, dst, #3 * 64
- cpy_tail_vfp d6, 0
- vstr d7, [dst, #64]
- vldr d7, [src, #64]
- vstr d0, [dst, #64 + 8]
- vldr d0, [src, #64 + 8]
- vstr d1, [dst, #64 + 16]
- vldr d1, [src, #64 + 16]
- vstr d2, [dst, #64 + 24]
- vldr d2, [src, #64 + 24]
- vstr d7, [dst, #64 + 32]
- add src, src, #96
- vstr d0, [dst, #64 + 40]
- vstr d1, [dst, #64 + 48]
- vstr d2, [dst, #64 + 56]
- add dst, dst, #128
- add tmp2, tmp2, #prefetch_lines * 64
- b .Lcpy_body_medium
-#else
- /* Long copy. Use an SMS style loop to maximize the I/O
- bandwidth of the core. We don't have enough spare registers
- to synthesise prefetching, so use PLD operations. */
- /* Pre-bias src and dst. */
- sub src, src, #8
- sub dst, dst, #8
- pld [src, #8]
- pld [src, #72]
- subs tmp2, tmp2, #64
- pld [src, #136]
- ldrd A_l, A_h, [src, #8]
- strd B_l, B_h, [sp, #8]
- ldrd B_l, B_h, [src, #16]
- strd C_l, C_h, [sp, #16]
- ldrd C_l, C_h, [src, #24]
- strd D_l, D_h, [sp, #24]
- pld [src, #200]
- ldrd D_l, D_h, [src, #32]!
- b 1f
- .p2align 6
-2:
- pld [src, #232]
- strd A_l, A_h, [dst, #40]
- ldrd A_l, A_h, [src, #40]
- strd B_l, B_h, [dst, #48]
- ldrd B_l, B_h, [src, #48]
- strd C_l, C_h, [dst, #56]
- ldrd C_l, C_h, [src, #56]
- strd D_l, D_h, [dst, #64]!
- ldrd D_l, D_h, [src, #64]!
- subs tmp2, tmp2, #64
-1:
- strd A_l, A_h, [dst, #8]
- ldrd A_l, A_h, [src, #8]
- strd B_l, B_h, [dst, #16]
- ldrd B_l, B_h, [src, #16]
- strd C_l, C_h, [dst, #24]
- ldrd C_l, C_h, [src, #24]
- strd D_l, D_h, [dst, #32]
- ldrd D_l, D_h, [src, #32]
- bcs 2b
- /* Save the remaining bytes and restore the callee-saved regs. */
- strd A_l, A_h, [dst, #40]
- add src, src, #40
- strd B_l, B_h, [dst, #48]
- ldrd B_l, B_h, [sp, #8]
- strd C_l, C_h, [dst, #56]
- ldrd C_l, C_h, [sp, #16]
- strd D_l, D_h, [dst, #64]
- ldrd D_l, D_h, [sp, #24]
- add dst, dst, #72
- tst tmp2, #0x3f
- bne .Ltail63aligned
- ldr tmp2, [sp], #FRAME_SIZE
- bx lr
-#endif
-
-.Lcpy_notaligned:
- pld [src]
- pld [src, #64]
- /* There's at least 64 bytes to copy, but there is no mutual
- alignment. */
- /* Bring DST to 64-bit alignment. */
- lsls tmp2, dst, #29
- pld [src, #(2 * 64)]
- beq 1f
- rsbs tmp2, tmp2, #0
- sub count, count, tmp2, lsr #29
- ldrmi tmp1, [src], #4
- strmi tmp1, [dst], #4
- lsls tmp2, tmp2, #2
- ldrbne tmp1, [src], #1
- ldrhcs tmp2, [src], #2
- strbne tmp1, [dst], #1
- strhcs tmp2, [dst], #2
-1:
- pld [src, #(3 * 64)]
- subs count, count, #64
- ldrmi tmp2, [sp], #FRAME_SIZE
- bmi .Ltail63unaligned
- pld [src, #(4 * 64)]
-
-#ifdef USE_NEON
- vld1.8 {d0-d3}, [src]!
- vld1.8 {d4-d7}, [src]!
- subs count, count, #64
- bmi 2f
-1:
- pld [src, #(4 * 64)]
- vst1.8 {d0-d3}, [ALIGN (dst, 64)]!
- vld1.8 {d0-d3}, [src]!
- vst1.8 {d4-d7}, [ALIGN (dst, 64)]!
- vld1.8 {d4-d7}, [src]!
- subs count, count, #64
- bpl 1b
-2:
- vst1.8 {d0-d3}, [ALIGN (dst, 64)]!
- vst1.8 {d4-d7}, [ALIGN (dst, 64)]!
- ands count, count, #0x3f
-#else
- /* Use an SMS style loop to maximize the I/O bandwidth. */
- sub src, src, #4
- sub dst, dst, #8
- subs tmp2, count, #64 /* Use tmp2 for count. */
- ldr A_l, [src, #4]
- ldr A_h, [src, #8]
- strd B_l, B_h, [sp, #8]
- ldr B_l, [src, #12]
- ldr B_h, [src, #16]
- strd C_l, C_h, [sp, #16]
- ldr C_l, [src, #20]
- ldr C_h, [src, #24]
- strd D_l, D_h, [sp, #24]
- ldr D_l, [src, #28]
- ldr D_h, [src, #32]!
- b 1f
- .p2align 6
-2:
- pld [src, #(5 * 64) - (32 - 4)]
- strd A_l, A_h, [dst, #40]
- ldr A_l, [src, #36]
- ldr A_h, [src, #40]
- strd B_l, B_h, [dst, #48]
- ldr B_l, [src, #44]
- ldr B_h, [src, #48]
- strd C_l, C_h, [dst, #56]
- ldr C_l, [src, #52]
- ldr C_h, [src, #56]
- strd D_l, D_h, [dst, #64]!
- ldr D_l, [src, #60]
- ldr D_h, [src, #64]!
- subs tmp2, tmp2, #64
-1:
- strd A_l, A_h, [dst, #8]
- ldr A_l, [src, #4]
- ldr A_h, [src, #8]
- strd B_l, B_h, [dst, #16]
- ldr B_l, [src, #12]
- ldr B_h, [src, #16]
- strd C_l, C_h, [dst, #24]
- ldr C_l, [src, #20]
- ldr C_h, [src, #24]
- strd D_l, D_h, [dst, #32]
- ldr D_l, [src, #28]
- ldr D_h, [src, #32]
- bcs 2b
-
- /* Save the remaining bytes and restore the callee-saved regs. */
- strd A_l, A_h, [dst, #40]
- add src, src, #36
- strd B_l, B_h, [dst, #48]
- ldrd B_l, B_h, [sp, #8]
- strd C_l, C_h, [dst, #56]
- ldrd C_l, C_h, [sp, #16]
- strd D_l, D_h, [dst, #64]
- ldrd D_l, D_h, [sp, #24]
- add dst, dst, #72
- ands count, tmp2, #0x3f
+ /* Do nothing here. See memcpy-stub.c in the same directory. */
#endif
- ldr tmp2, [sp], #FRAME_SIZE
- bne .Ltail63unaligned
- bx lr
-
- .size memcpy, . - memcpy
-
-#endif /* memcpy */
diff --git a/newlib/libc/machine/arm/strcmp.S b/newlib/libc/machine/arm/strcmp.S
index 0a4057e3b..f3e738776 100644
--- a/newlib/libc/machine/arm/strcmp.S
+++ b/newlib/libc/machine/arm/strcmp.S
@@ -55,6 +55,13 @@
#if defined (__thumb__)
.thumb
.thumb_func
+#if !defined (__thumb2__)
+ /* If we have thumb1 only, we need to explictly mark the
+ compatibility. */
+ .arch armv4t
+ .eabi_attribute Tag_also_compatible_with, "\006\013" /* v6-M. */
+ .eabi_attribute Tag_ARM_ISA_use, 0
+#endif
#endif
.global strcmp
.type strcmp, %function
@@ -201,12 +208,12 @@ strcmp:
/* Are both strings double-word aligned? */
orr ip, r0, r1
tst ip, #7
- bne do_align
+ bne .Ldo_align
/* Fast path. */
init
-doubleword_aligned:
+.Ldoubleword_aligned:
/* Get here when the strings to compare are double-word aligned. */
/* Compare two words in every iteration. */
@@ -221,14 +228,14 @@ doubleword_aligned:
ldrd r2, r3, [r0], #8
ldrd r4, r5, [r1], #8
- magic_compare_and_branch w1=r2, w2=r4, label=return_24
- magic_compare_and_branch w1=r3, w2=r5, label=return_35
+ magic_compare_and_branch w1=r2, w2=r4, label=.Lreturn_24
+ magic_compare_and_branch w1=r3, w2=r5, label=.Lreturn_35
b 2b
-do_align:
+.Ldo_align:
/* Is the first string word-aligned? */
ands ip, r0, #3
- beq word_aligned_r0
+ beq .Lword_aligned_r0
/* Fast compare byte by byte until the first string is word-aligned. */
/* The offset of r0 from a word boundary is in ip. Thus, the number of bytes
@@ -236,58 +243,58 @@ do_align:
bic r0, r0, #3
ldr r2, [r0], #4
lsls ip, ip, #31
- beq byte2
- bcs byte3
+ beq .Lbyte2
+ bcs .Lbyte3
-byte1:
+.Lbyte1:
ldrb ip, [r1], #1
uxtb r3, r2, ror #BYTE1_OFFSET
subs ip, r3, ip
- bne fast_return
- m_cbz reg=r3, label=fast_return
+ bne .Lfast_return
+ m_cbz reg=r3, label=.Lfast_return
-byte2:
+.Lbyte2:
ldrb ip, [r1], #1
uxtb r3, r2, ror #BYTE2_OFFSET
subs ip, r3, ip
- bne fast_return
- m_cbz reg=r3, label=fast_return
+ bne .Lfast_return
+ m_cbz reg=r3, label=.Lfast_return
-byte3:
+.Lbyte3:
ldrb ip, [r1], #1
uxtb r3, r2, ror #BYTE3_OFFSET
subs ip, r3, ip
- bne fast_return
- m_cbnz reg=r3, label=word_aligned_r0
+ bne .Lfast_return
+ m_cbnz reg=r3, label=.Lword_aligned_r0
-fast_return:
+.Lfast_return:
mov r0, ip
bx lr
-word_aligned_r0:
+.Lword_aligned_r0:
init
/* The first string is word-aligned. */
/* Is the second string word-aligned? */
ands ip, r1, #3
- bne strcmp_unaligned
+ bne .Lstrcmp_unaligned
-word_aligned:
+.Lword_aligned:
/* The strings are word-aligned. */
/* Is the first string double-word aligned? */
tst r0, #4
- beq doubleword_aligned_r0
+ beq .Ldoubleword_aligned_r0
/* If r0 is not double-word aligned yet, align it by loading
and comparing the next word from each string. */
ldr r2, [r0], #4
ldr r4, [r1], #4
- magic_compare_and_branch w1=r2 w2=r4 label=return_24
+ magic_compare_and_branch w1=r2 w2=r4 label=.Lreturn_24
-doubleword_aligned_r0:
+.Ldoubleword_aligned_r0:
/* Get here when r0 is double-word aligned. */
/* Is r1 doubleword_aligned? */
tst r1, #4
- beq doubleword_aligned
+ beq .Ldoubleword_aligned
/* Get here when the strings to compare are word-aligned,
r0 is double-word aligned, but r1 is not double-word aligned. */
@@ -305,9 +312,9 @@ doubleword_aligned_r0:
/* Load the next double-word from each string and compare. */
ldrd r2, r3, [r0], #8
- magic_compare_and_branch w1=r2 w2=r5 label=return_25
+ magic_compare_and_branch w1=r2 w2=r5 label=.Lreturn_25
ldrd r4, r5, [r1], #8
- magic_compare_and_branch w1=r3 w2=r4 label=return_34
+ magic_compare_and_branch w1=r3 w2=r4 label=.Lreturn_34
b 3b
.macro miscmp_word offsetlo offsethi
@@ -331,47 +338,47 @@ doubleword_aligned_r0:
and r2, r3, r6, S2LOMEM #\offsetlo
it eq
cmpeq r2, r5
- bne return_25
+ bne .Lreturn_25
ldr r5, [r1], #4
cmp ip, #0
eor r3, r2, r3
S2HIMEM r2, r5, #\offsethi
it eq
cmpeq r3, r2
- bne return_32
+ bne .Lreturn_32
b 7b
.endm /* miscmp_word */
-strcmp_unaligned:
+.Lstrcmp_unaligned:
/* r0 is word-aligned, r1 is at offset ip from a word. */
/* Align r1 to the (previous) word-boundary. */
bic r1, r1, #3
/* Unaligned comparison word by word using LDRs. */
cmp ip, #2
- beq miscmp_word_16 /* If ip == 2. */
- bge miscmp_word_24 /* If ip == 3. */
+ beq .Lmiscmp_word_16 /* If ip == 2. */
+ bge .Lmiscmp_word_24 /* If ip == 3. */
miscmp_word offsetlo=8 offsethi=24 /* If ip == 1. */
-miscmp_word_16: miscmp_word offsetlo=16 offsethi=16
-miscmp_word_24: miscmp_word offsetlo=24 offsethi=8
+.Lmiscmp_word_16: miscmp_word offsetlo=16 offsethi=16
+.Lmiscmp_word_24: miscmp_word offsetlo=24 offsethi=8
-return_32:
+.Lreturn_32:
setup_return w1=r3, w2=r2
- b do_return
-return_34:
+ b .Ldo_return
+.Lreturn_34:
setup_return w1=r3, w2=r4
- b do_return
-return_25:
+ b .Ldo_return
+.Lreturn_25:
setup_return w1=r2, w2=r5
- b do_return
-return_35:
+ b .Ldo_return
+.Lreturn_35:
setup_return w1=r3, w2=r5
- b do_return
-return_24:
+ b .Ldo_return
+.Lreturn_24:
setup_return w1=r2, w2=r4
-do_return:
+.Ldo_return:
#ifdef __ARMEB__
mov r0, ip
@@ -387,7 +394,7 @@ do_return:
/* There is a zero or a different byte between r1 and r2. */
/* r0 contains a mask of all-zero bytes in r1. */
/* Using r0 and not ip here because cbz requires low register. */
- m_cbz reg=r0, label=compute_return_value
+ m_cbz reg=r0, label=.Lcompute_return_value
clz r0, r0
/* r0 contains the number of bits on the left of the first all-zero byte in r1. */
rsb r0, r0, #24
@@ -395,7 +402,7 @@ do_return:
lsr r1, r1, r0
lsr r2, r2, r0
-compute_return_value:
+.Lcompute_return_value:
movs r0, #1
cmp r1, r2
/* The return value is computed as follows.
@@ -429,7 +436,7 @@ compute_return_value:
eor r2, r0, r1
tst r2, #3
/* Strings not at same byte offset from a word boundary. */
- bne strcmp_unaligned
+ bne .Lstrcmp_unaligned
ands r2, r0, #3
bic r0, r0, #3
bic r1, r1, #3
@@ -506,7 +513,7 @@ compute_return_value:
RETURN
-strcmp_unaligned:
+.Lstrcmp_unaligned:
#if 0
/* The assembly code below is based on the following alogrithm. */
diff --git a/newlib/libc/machine/configure b/newlib/libc/machine/configure
index 7b0b26a75..a8bbe9984 100755
--- a/newlib/libc/machine/configure
+++ b/newlib/libc/machine/configure
@@ -814,8 +814,10 @@ mips
mn10200
mn10300
moxie
+msp430
mt
necv70
+nios2
powerpc
rl78
rx
@@ -11469,7 +11471,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11472 "configure"
+#line 11473 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11575,7 +11577,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11578 "configure"
+#line 11579 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11878,10 +11880,14 @@ subdirs="$subdirs a29k"
;;
moxie) subdirs="$subdirs moxie"
;;
+ msp430) subdirs="$subdirs msp430"
+ ;;
mt) subdirs="$subdirs mt"
;;
necv70) subdirs="$subdirs necv70"
;;
+ nios2) subdirs="$subdirs nios2"
+ ;;
powerpc) subdirs="$subdirs powerpc"
;;
rl78) subdirs="$subdirs rl78"
diff --git a/newlib/libc/machine/configure.in b/newlib/libc/machine/configure.in
index 7cdb2a1ec..5314175c2 100644
--- a/newlib/libc/machine/configure.in
+++ b/newlib/libc/machine/configure.in
@@ -53,8 +53,10 @@ if test -n "${machine_dir}"; then
mn10200) AC_CONFIG_SUBDIRS(mn10200) ;;
mn10300) AC_CONFIG_SUBDIRS(mn10300) ;;
moxie) AC_CONFIG_SUBDIRS(moxie) ;;
+ msp430) AC_CONFIG_SUBDIRS(msp430) ;;
mt) AC_CONFIG_SUBDIRS(mt) ;;
necv70) AC_CONFIG_SUBDIRS(necv70) ;;
+ nios2) AC_CONFIG_SUBDIRS(nios2) ;;
powerpc) AC_CONFIG_SUBDIRS(powerpc) ;;
rl78) AC_CONFIG_SUBDIRS(rl78) ;;
rx) AC_CONFIG_SUBDIRS(rx) ;;
diff --git a/newlib/libc/machine/epiphany/Makefile.am b/newlib/libc/machine/epiphany/Makefile.am
deleted file mode 100644
index 6e95d8fc8..000000000
--- a/newlib/libc/machine/epiphany/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-## Copyright (c) 2011, Adapteva, Inc.
-## All rights reserved.
-
-## Redistribution and use in source and binary forms, with or without
-## modification, are permitted provided that the following conditions are met:
-## * Redistributions of source code must retain the above copyright notice,
-## this list of conditions and the following disclaimer.
-## * Redistributions in binary form must reproduce the above copyright
-## notice, this list of conditions and the following disclaimer in the
-## documentation and/or other materials provided with the distribution.
-## * Neither the name of Adapteva nor the names of its contributors may be
-## used to endorse or promote products derived from this software without
-## specific prior written permission.
-
-## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-## POSSIBILITY OF SUCH DAMAGE.
-
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-
-AM_CCASFLAGS = $(INCLUDES)
-
-noinst_LIBRARIES = lib.a
-
-lib_a_SOURCES = setjmp.S
-lib_a_CCASFLAGS=$(AM_CCASFLAGS)
-lib_a_CFLAGS = $(AM_CFLAGS)
-
-ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
-CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libc/machine/epiphany/Makefile.in b/newlib/libc/machine/epiphany/Makefile.in
deleted file mode 100644
index 465fb7f65..000000000
--- a/newlib/libc/machine/epiphany/Makefile.in
+++ /dev/null
@@ -1,440 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/../../../../mkinstalldirs
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-lib_a_AR = $(AR) $(ARFLAGS)
-lib_a_LIBADD =
-am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT)
-lib_a_OBJECTS = $(am_lib_a_OBJECTS)
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp =
-am__depfiles_maybe =
-CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(lib_a_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-ETAGS = etags
-CTAGS = ctags
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
-NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-READELF = @READELF@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-aext = @aext@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libm_machine_dir = @libm_machine_dir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lpfx = @lpfx@
-machine_dir = @machine_dir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-newlib_basedir = @newlib_basedir@
-oext = @oext@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_dir = @sys_dir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = cygnus
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-AM_CCASFLAGS = $(INCLUDES)
-noinst_LIBRARIES = lib.a
-lib_a_SOURCES = setjmp.S
-lib_a_CCASFLAGS = $(AM_CCASFLAGS)
-lib_a_CFLAGS = $(AM_CFLAGS)
-ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
-CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .S .o .obj
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --cygnus Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES)
- -rm -f lib.a
- $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
- $(RANLIB) lib.a
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.S.o:
- $(CPPASCOMPILE) -c -o $@ $<
-
-.S.obj:
- $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-lib_a-setjmp.o: setjmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.o `test -f 'setjmp.S' || echo '$(srcdir)/'`setjmp.S
-
-lib_a-setjmp.obj: setjmp.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-am
-all-am: Makefile $(LIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-generic clean-noinstLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-tags dvi dvi-am \
- html html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/newlib/libc/machine/epiphany/aclocal.m4 b/newlib/libc/machine/epiphany/aclocal.m4
deleted file mode 100644
index 18dab02aa..000000000
--- a/newlib/libc/machine/epiphany/aclocal.m4
+++ /dev/null
@@ -1,1012 +0,0 @@
-# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.6], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.6])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 9
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 12
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 16
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
-# 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_MAINTAINER_MODE([DEFAULT-MODE])
-# ----------------------------------
-# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless `enable' is passed literally.
-# For symmetry, `disable' may be passed as well. Anyway, the user
-# can override the default with the --enable/--disable switch.
-AC_DEFUN([AM_MAINTAINER_MODE],
-[m4_case(m4_default([$1], [disable]),
- [enable], [m4_define([am_maintainer_other], [disable])],
- [disable], [m4_define([am_maintainer_other], [enable])],
- [m4_define([am_maintainer_other], [enable])
- m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode's default is 'disable' unless 'enable' is passed
- AC_ARG_ENABLE([maintainer-mode],
-[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
- AC_MSG_RESULT([$USE_MAINTAINER_MODE])
- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST([MAINT])dnl
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([../../../acinclude.m4])
diff --git a/newlib/libc/machine/epiphany/configure b/newlib/libc/machine/epiphany/configure
deleted file mode 100755
index 7f4d0d6df..000000000
--- a/newlib/libc/machine/epiphany/configure
+++ /dev/null
@@ -1,4748 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for newlib 2.0.0.
-#
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='newlib'
-PACKAGE_TARNAME='newlib'
-PACKAGE_VERSION='2.0.0'
-PACKAGE_STRING='newlib 2.0.0'
-PACKAGE_BUGREPORT=''
-PACKAGE_URL=''
-
-ac_unique_file="Makefile.am"
-ac_subst_vars='LTLIBOBJS
-LIBOBJS
-sys_dir
-machine_dir
-libm_machine_dir
-lpfx
-aext
-oext
-OBJEXT
-USE_LIBTOOL_FALSE
-USE_LIBTOOL_TRUE
-ELIX_LEVEL_4_FALSE
-ELIX_LEVEL_4_TRUE
-ELIX_LEVEL_3_FALSE
-ELIX_LEVEL_3_TRUE
-ELIX_LEVEL_2_FALSE
-ELIX_LEVEL_2_TRUE
-ELIX_LEVEL_1_FALSE
-ELIX_LEVEL_1_TRUE
-ELIX_LEVEL_0_FALSE
-ELIX_LEVEL_0_TRUE
-LDFLAGS
-NO_INCLUDE_LIST
-NEWLIB_CFLAGS
-CCASFLAGS
-CCAS
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-READELF
-RANLIB
-AR
-AS
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-CC
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-newlib_basedir
-MAY_SUPPLY_SYSCALLS_FALSE
-MAY_SUPPLY_SYSCALLS_TRUE
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_multilib
-enable_target_optspace
-enable_malloc_debugging
-enable_newlib_multithread
-enable_newlib_iconv
-enable_newlib_elix_level
-enable_newlib_io_float
-enable_newlib_supplied_syscalls
-enable_dependency_tracking
-enable_maintainer_mode
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CCAS
-CCASFLAGS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures newlib 2.0.0 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/newlib]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of newlib 2.0.0:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-multilib build many library versions (default)
- --enable-target-optspace optimize for space
- --enable-malloc-debugging indicate malloc debugging requested
- --enable-newlib-multithread enable support for multiple threads
- --enable-newlib-iconv enable iconv library support
- --enable-newlib-elix-level supply desired elix library level (1-4)
- --disable-newlib-io-float disable printf/scanf family float support
- --disable-newlib-supplied-syscalls disable newlib from supplying syscalls
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
-
-Some influential environment variables:
- CCAS assembler compiler command (defaults to CC)
- CCASFLAGS assembler compiler flags (defaults to CFLAGS)
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-newlib configure 2.0.0
-generated by GNU Autoconf 2.68
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by newlib $as_me 2.0.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-ac_aux_dir=
-for ac_dir in ../../../.. "$srcdir"/../../../..; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../../.. \"$srcdir\"/../../../.." "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-am__api_version='1.11'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error $? "bad value ${enableval} for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-# Check whether --enable-target-optspace was given.
-if test "${enable_target_optspace+set}" = set; then :
- enableval=$enable_target_optspace; case "${enableval}" in
- yes) target_optspace=yes ;;
- no) target_optspace=no ;;
- *) as_fn_error $? "bad value ${enableval} for target-optspace option" "$LINENO" 5 ;;
- esac
-else
- target_optspace=
-fi
-
-# Check whether --enable-malloc-debugging was given.
-if test "${enable_malloc_debugging+set}" = set; then :
- enableval=$enable_malloc_debugging; case "${enableval}" in
- yes) malloc_debugging=yes ;;
- no) malloc_debugging=no ;;
- *) as_fn_error $? "bad value ${enableval} for malloc-debugging option" "$LINENO" 5 ;;
- esac
-else
- malloc_debugging=
-fi
-
-# Check whether --enable-newlib-multithread was given.
-if test "${enable_newlib_multithread+set}" = set; then :
- enableval=$enable_newlib_multithread; case "${enableval}" in
- yes) newlib_multithread=yes ;;
- no) newlib_multithread=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-multithread option" "$LINENO" 5 ;;
- esac
-else
- newlib_multithread=yes
-fi
-
-# Check whether --enable-newlib-iconv was given.
-if test "${enable_newlib_iconv+set}" = set; then :
- enableval=$enable_newlib_iconv; if test "${newlib_iconv+set}" != set; then
- case "${enableval}" in
- yes) newlib_iconv=yes ;;
- no) newlib_iconv=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-iconv option" "$LINENO" 5 ;;
- esac
- fi
-else
- newlib_iconv=${newlib_iconv}
-fi
-
-# Check whether --enable-newlib-elix-level was given.
-if test "${enable_newlib_elix_level+set}" = set; then :
- enableval=$enable_newlib_elix_level; case "${enableval}" in
- 0) newlib_elix_level=0 ;;
- 1) newlib_elix_level=1 ;;
- 2) newlib_elix_level=2 ;;
- 3) newlib_elix_level=3 ;;
- 4) newlib_elix_level=4 ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-elix-level option" "$LINENO" 5 ;;
- esac
-else
- newlib_elix_level=0
-fi
-
-# Check whether --enable-newlib-io-float was given.
-if test "${enable_newlib_io_float+set}" = set; then :
- enableval=$enable_newlib_io_float; case "${enableval}" in
- yes) newlib_io_float=yes ;;
- no) newlib_io_float=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-io-float option" "$LINENO" 5 ;;
- esac
-else
- newlib_io_float=yes
-fi
-
-# Check whether --enable-newlib-supplied-syscalls was given.
-if test "${enable_newlib_supplied_syscalls+set}" = set; then :
- enableval=$enable_newlib_supplied_syscalls; case "${enableval}" in
- yes) newlib_may_supply_syscalls=yes ;;
- no) newlib_may_supply_syscalls=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-supplied-syscalls option" "$LINENO" 5 ;;
- esac
-else
- newlib_may_supply_syscalls=yes
-fi
-
- if test x${newlib_may_supply_syscalls} = xyes; then
- MAY_SUPPLY_SYSCALLS_TRUE=
- MAY_SUPPLY_SYSCALLS_FALSE='#'
-else
- MAY_SUPPLY_SYSCALLS_TRUE='#'
- MAY_SUPPLY_SYSCALLS_FALSE=
-fi
-
-
-
-test -z "${with_target_subdir}" && with_target_subdir=.
-
-if test "${srcdir}" = "."; then
- if test "${with_target_subdir}" != "."; then
- newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
- else
- newlib_basedir="${srcdir}/${with_multisrctop}../../.."
- fi
-else
- newlib_basedir="${srcdir}/../../.."
-fi
-
-
-
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='newlib'
- VERSION='2.0.0'
-
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-# FIXME: We temporarily define our own version of AC_PROG_CC. This is
-# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
-# are probably using a cross compiler, which will not be able to fully
-# link an executable. This should really be fixed in autoconf
-# itself.
-
-
-
-
-
-
-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU C" >&5
-$as_echo_n "checking whether we are using GNU C... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_c_compiler_gnu=yes
-else
- ac_cv_c_compiler_gnu=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-
-if test $ac_cv_c_compiler_gnu = yes; then
- GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AS="${ac_tool_prefix}as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AS"; then
- ac_ct_AS=$AS
- # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AS"; then
- ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AS="as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AS" = x; then
- AS=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AS=$ac_ct_AS
- fi
-else
- AS="$ac_cv_prog_AS"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AR" = x; then
- AR=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
-set dummy ${ac_tool_prefix}readelf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_READELF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$READELF"; then
- ac_cv_prog_READELF="$READELF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_READELF="${ac_tool_prefix}readelf"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-READELF=$ac_cv_prog_READELF
-if test -n "$READELF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
-$as_echo "$READELF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_READELF"; then
- ac_ct_READELF=$READELF
- # Extract the first word of "readelf", so it can be a program name with args.
-set dummy readelf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_READELF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_READELF"; then
- ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_READELF="readelf"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
-if test -n "$ac_ct_READELF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
-$as_echo "$ac_ct_READELF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_READELF" = x; then
- READELF=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- READELF=$ac_ct_READELF
- fi
-else
- READELF="$ac_cv_prog_READELF"
-fi
-
-
-
-
-# Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13. */
-ac_given_INSTALL=$INSTALL
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-# By default we simply use the C compiler to build assembly code.
-
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-
-
-
-
-# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
-# at least currently, we never actually build a program, so we never
-# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
-# fails, because we are probably configuring with a cross compiler
-# which can't create executables. So we include AC_EXEEXT to keep
-# automake happy, but we don't execute it, since we don't care about
-# the result.
-if false; then
-
- dummy_var=1
-fi
-
-. ${newlib_basedir}/configure.host
-
-newlib_cflags="${newlib_cflags} -fno-builtin"
-
-NEWLIB_CFLAGS=${newlib_cflags}
-
-
-NO_INCLUDE_LIST=${noinclude}
-
-
-LDFLAGS=${ldflags}
-
-
- if test x${newlib_elix_level} = x0; then
- ELIX_LEVEL_0_TRUE=
- ELIX_LEVEL_0_FALSE='#'
-else
- ELIX_LEVEL_0_TRUE='#'
- ELIX_LEVEL_0_FALSE=
-fi
-
- if test x${newlib_elix_level} = x1; then
- ELIX_LEVEL_1_TRUE=
- ELIX_LEVEL_1_FALSE='#'
-else
- ELIX_LEVEL_1_TRUE='#'
- ELIX_LEVEL_1_FALSE=
-fi
-
- if test x${newlib_elix_level} = x2; then
- ELIX_LEVEL_2_TRUE=
- ELIX_LEVEL_2_FALSE='#'
-else
- ELIX_LEVEL_2_TRUE='#'
- ELIX_LEVEL_2_FALSE=
-fi
-
- if test x${newlib_elix_level} = x3; then
- ELIX_LEVEL_3_TRUE=
- ELIX_LEVEL_3_FALSE='#'
-else
- ELIX_LEVEL_3_TRUE='#'
- ELIX_LEVEL_3_FALSE=
-fi
-
- if test x${newlib_elix_level} = x4; then
- ELIX_LEVEL_4_TRUE=
- ELIX_LEVEL_4_FALSE='#'
-else
- ELIX_LEVEL_4_TRUE='#'
- ELIX_LEVEL_4_FALSE=
-fi
-
-
- if test x${use_libtool} = xyes; then
- USE_LIBTOOL_TRUE=
- USE_LIBTOOL_FALSE='#'
-else
- USE_LIBTOOL_TRUE='#'
- USE_LIBTOOL_FALSE=
-fi
-
-
-# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we
-# use oext, which is set in configure.host based on the target platform.
-OBJEXT=${oext}
-
-
-
-
-
-
-
-
-
-
-
-ac_config_files="$ac_config_files Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
-t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then
- as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_0_TRUE}" && test -z "${ELIX_LEVEL_0_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_0\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_1_TRUE}" && test -z "${ELIX_LEVEL_1_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_1\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_2_TRUE}" && test -z "${ELIX_LEVEL_2_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_2\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_3_TRUE}" && test -z "${ELIX_LEVEL_3_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_3\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_4_TRUE}" && test -z "${ELIX_LEVEL_4_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_4\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then
- as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by newlib $as_me 2.0.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-newlib config.status 2.0.0
-configured by $0, generated by GNU Autoconf 2.68,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h | --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-
-eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/newlib/libc/machine/epiphany/configure.in b/newlib/libc/machine/epiphany/configure.in
deleted file mode 100644
index c9d85b816..000000000
--- a/newlib/libc/machine/epiphany/configure.in
+++ /dev/null
@@ -1,41 +0,0 @@
-dnl This is the newlib/libc/machine/epiphany configure.in file.
-
-dnl Copyright (c) 2011, 2012 Adapteva, Inc.
-dnl All rights reserved.
-
-dnl Redistribution and use in source and binary forms, with or without
-dnl modification, are permitted provided that the following conditions are met:
-dnl * Redistributions of source code must retain the above copyright notice,
-dnl this list of conditions and the following disclaimer.
-dnl * Redistributions in binary form must reproduce the above copyright
-dnl notice, this list of conditions and the following disclaimer in the
-dnl documentation and/or other materials provided with the distribution.
-dnl * Neither the name of Adapteva nor the names of its contributors may be
-dnl used to endorse or promote products derived from this software without
-dnl specific prior written permission.
-
-dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-dnl AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-dnl ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-dnl POSSIBILITY OF SUCH DAMAGE.
-
-dnl Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.59)
-AC_INIT([newlib],[NEWLIB_VERSION])
-AC_CONFIG_SRCDIR([Makefile.am])
-
-dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
-AC_CONFIG_AUX_DIR(../../../..)
-
-NEWLIB_CONFIGURE(../../..)
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/newlib/libc/machine/epiphany/machine/stdlib.h b/newlib/libc/machine/epiphany/machine/stdlib.h
deleted file mode 100644
index 95b4063b0..000000000
--- a/newlib/libc/machine/epiphany/machine/stdlib.h
+++ /dev/null
@@ -1,15 +0,0 @@
-static __inline__ long int
-random (void)
-{
- extern int rand(void);
-
- return rand ();
-}
-
-static __inline__ void
-srandom (unsigned int seed)
-{
- void srand(unsigned int seed);
-
- srand (seed);
-}
diff --git a/newlib/libc/machine/epiphany/setjmp.S b/newlib/libc/machine/epiphany/setjmp.S
deleted file mode 100644
index 2986bb47a..000000000
--- a/newlib/libc/machine/epiphany/setjmp.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/* setjmp and longjmp
-
- Copyright (c) 2011, Adapteva, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of Adapteva nor the names of its contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE. */
-
- .file "setjmp.S"
- .section .text
- .align 4
- .global _setjmp
- .type _setjmp, %function
-_setjmp:
- strd lr,[r0]
- strd r4,[r0,1]
- strd r6,[r0,2]
- strd r8,[r0,3]
- strd r10,[r0,4]
- strd r32,[r0,5]
- strd r34,[r0,6]
- strd r36,[r0,7]
- strd r38,[r0,8]
- str sp,[r0,18]
- mov r0,#0
- rts
- .size _setjmp, .-_setjmp
-
- .global _longjmp
-_longjmp:
- ldrd lr,[r0] ; return address / r15
- ldrd r4,[r0,1]
- ldrd r6,[r0,2]
- ldrd r8,[r0,3]
- ldrd r10,[r0,4]
- ldrd r32,[r0,5]
- ldrd r34,[r0,6]
- ldrd r36,[r0,7]
- ldrd r38,[r0,8]
- ldr sp,[r0,18]
- sub r1,r1,0
- mov r0,#1
- movne r0,r1
- jr lr
- .size _longjmp, .-_longjmp
diff --git a/newlib/libc/machine/powerpc/Makefile.am b/newlib/libc/machine/powerpc/Makefile.am
index ef8a66792..60f49741d 100644
--- a/newlib/libc/machine/powerpc/Makefile.am
+++ b/newlib/libc/machine/powerpc/Makefile.am
@@ -10,7 +10,7 @@ noinst_LIBRARIES = lib.a
AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
-lib_a_SOURCES = setjmp.S times.c
+lib_a_SOURCES = setjmp.S
lib_a_CCASFLAGS=$(AM_CCASFLAGS)
lib_a_CFLAGS=$(AM_CFLAGS)
lib_a_LIBADD = @extra_objs@
diff --git a/newlib/libc/machine/powerpc/Makefile.in b/newlib/libc/machine/powerpc/Makefile.in
index ee1c8bbaa..047d42207 100644
--- a/newlib/libc/machine/powerpc/Makefile.in
+++ b/newlib/libc/machine/powerpc/Makefile.in
@@ -68,7 +68,7 @@ CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
ARFLAGS = cru
lib_a_AR = $(AR) $(ARFLAGS)
-am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-times.$(OBJEXT)
+am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
@@ -197,7 +197,7 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
AM_CCASFLAGS = $(INCLUDES)
noinst_LIBRARIES = lib.a
AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
-lib_a_SOURCES = setjmp.S times.c
+lib_a_SOURCES = setjmp.S
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
lib_a_LIBADD = @extra_objs@
@@ -208,7 +208,7 @@ VEC_MALLOC_COMPILE = $(COMPILE) -DINTERNAL_NEWLIB
all: all-am
.SUFFIXES:
-.SUFFIXES: .S .c .o .obj
+.SUFFIXES: .S .o .obj
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@@ -269,18 +269,6 @@ lib_a-setjmp.o: setjmp.S
lib_a-setjmp.obj: setjmp.S
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-lib_a-times.o: times.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c
-
-lib_a-times.obj: times.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi`
-
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
diff --git a/newlib/libc/machine/powerpc/times.c b/newlib/libc/machine/powerpc/times.c
deleted file mode 100644
index 64f4ddcb8..000000000
--- a/newlib/libc/machine/powerpc/times.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Time support routines for PowerPC.
- *
- * Written by Aldy Hernandez.
- */
-
-#include <_ansi.h>
-#include <reent.h>
-#include <sys/time.h>
-#include <sys/times.h>
-#include <sys/resource.h>
-
-clock_t
-times (struct tms *tp)
-{
- struct rusage usage;
- union {
- struct rusage r;
- /* Newlib's rusage has only 2 fields. We need to make room for
- when we call the system's rusage. This should be enough. */
- int filler[32];
- } host_ru;
-
- getrusage (RUSAGE_SELF, (void *)&host_ru);
-
- if (tp)
- {
- tp->tms_utime = host_ru.r.ru_utime.tv_sec * 1000
- + host_ru.r.ru_utime.tv_usec;
- tp->tms_stime = host_ru.r.ru_stime.tv_sec * 1000
- + host_ru.r.ru_stime.tv_usec;
- tp->tms_cutime = 0; /* user time, children */
- tp->tms_cstime = 0; /* system time, children */
- }
-
- return tp->tms_utime;
-}
diff --git a/newlib/libc/reent/reent.c b/newlib/libc/reent/reent.c
index 63812db83..9f5a8c0d3 100644
--- a/newlib/libc/reent/reent.c
+++ b/newlib/libc/reent/reent.c
@@ -87,10 +87,14 @@ _DEFUN (_reclaim_reent, (ptr),
_free_r (ptr, ptr->_localtime_buf);
if (ptr->_asctime_buf)
_free_r (ptr, ptr->_asctime_buf);
+#endif
+
+#ifndef _REENT_GLOBAL_ATEXIT
+ /* atexit stuff */
+# ifdef _REENT_SMALL
if (ptr->_atexit && ptr->_atexit->_on_exit_args_ptr)
_free_r (ptr, ptr->_atexit->_on_exit_args_ptr);
-#else
- /* atexit stuff */
+# else
if ((ptr->_atexit) && (ptr->_atexit != &ptr->_atexit0))
{
struct _atexit *p, *q;
@@ -101,6 +105,7 @@ _DEFUN (_reclaim_reent, (ptr),
_free_r (ptr, q);
}
}
+# endif
#endif
if (ptr->_cvtbuf)
@@ -120,32 +125,3 @@ _DEFUN (_reclaim_reent, (ptr),
}
}
-
-/*
- * Do atexit() processing and cleanup
- *
- * NOTE: This is to be executed at task exit. It does not tear anything
- * down which is used on a global basis.
- */
-
-void
-_DEFUN (_wrapup_reent, (ptr), struct _reent *ptr)
-{
- register struct _atexit *p;
- register int n;
-
- if (ptr == NULL)
- ptr = _REENT;
-
-#ifdef _REENT_SMALL
- for (p = ptr->_atexit, n = p ? p->_ind : 0; --n >= 0;)
- (*p->_fns[n]) ();
-#else
- for (p = ptr->_atexit; p; p = p->_next)
- for (n = p->_ind; --n >= 0;)
- (*p->_fns[n]) ();
-#endif
- if (ptr->__cleanup)
- (*ptr->__cleanup) (ptr);
-}
-
diff --git a/newlib/libc/stdio/fgetc.c b/newlib/libc/stdio/fgetc.c
index 99d8330fe..20492d24b 100644
--- a/newlib/libc/stdio/fgetc.c
+++ b/newlib/libc/stdio/fgetc.c
@@ -92,9 +92,11 @@ _DEFUN(fgetc, (fp),
{
#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
int result;
- CHECK_INIT(_REENT, fp);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT(reent, fp);
_newlib_flockfile_start (fp);
- result = __sgetc_r (_REENT, fp);
+ result = __sgetc_r (reent, fp);
_newlib_flockfile_end (fp);
return result;
#else
diff --git a/newlib/libc/stdio/fgetwc.c b/newlib/libc/stdio/fgetwc.c
index 0eaaecb2f..14c554786 100644
--- a/newlib/libc/stdio/fgetwc.c
+++ b/newlib/libc/stdio/fgetwc.c
@@ -175,6 +175,8 @@ wint_t
_DEFUN(fgetwc, (fp),
FILE *fp)
{
- CHECK_INIT(_REENT, fp);
- return _fgetwc_r (_REENT, fp);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT(reent, fp);
+ return _fgetwc_r (reent, fp);
}
diff --git a/newlib/libc/stdio/fgetws.c b/newlib/libc/stdio/fgetws.c
index 3cf45a976..b5d8851e1 100644
--- a/newlib/libc/stdio/fgetws.c
+++ b/newlib/libc/stdio/fgetws.c
@@ -160,6 +160,8 @@ _DEFUN(fgetws, (ws, n, fp),
int n _AND
FILE *fp)
{
- CHECK_INIT (_REENT, fp);
- return _fgetws_r (_REENT, ws, n, fp);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT (reent, fp);
+ return _fgetws_r (reent, ws, n, fp);
}
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index 7ab3bdba5..e40500a07 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -62,7 +62,11 @@ _DEFUN(std, (ptr, flags, file, data),
ptr->_flags |= __SL64;
#endif /* __LARGE64_FILES */
ptr->_seek = __sseek;
+#ifdef _STDIO_CLOSE_PER_REENT_STD_STREAMS
ptr->_close = __sclose;
+#else /* _STDIO_CLOSE_STD_STREAMS */
+ ptr->_close = NULL;
+#endif /* _STDIO_CLOSE_STD_STREAMS */
#if !defined(__SINGLE_THREAD__) && !defined(_REENT_SMALL)
__lock_init_recursive (ptr->_lock);
/*
diff --git a/newlib/libc/stdio/fputc.c b/newlib/libc/stdio/fputc.c
index 6af79d470..f380717d1 100644
--- a/newlib/libc/stdio/fputc.c
+++ b/newlib/libc/stdio/fputc.c
@@ -97,9 +97,11 @@ _DEFUN(fputc, (ch, file),
{
#if !defined(__OPTIMIZE_SIZE__) && !defined(PREFER_SIZE_OVER_SPEED)
int result;
- CHECK_INIT(_REENT, file);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT(reent, file);
_newlib_flockfile_start (file);
- result = _putc_r (_REENT, ch, file);
+ result = _putc_r (reent, ch, file);
_newlib_flockfile_end (file);
return result;
#else
diff --git a/newlib/libc/stdio/fputwc.c b/newlib/libc/stdio/fputwc.c
index 74e7a452c..5ec85d1ab 100644
--- a/newlib/libc/stdio/fputwc.c
+++ b/newlib/libc/stdio/fputwc.c
@@ -172,6 +172,8 @@ _DEFUN(fputwc, (wc, fp),
wchar_t wc _AND
FILE *fp)
{
- CHECK_INIT(_REENT, fp);
- return _fputwc_r (_REENT, wc, fp);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT(reent, fp);
+ return _fputwc_r (reent, wc, fp);
}
diff --git a/newlib/libc/stdio/fputws.c b/newlib/libc/stdio/fputws.c
index 0893b3c33..a28a5551b 100644
--- a/newlib/libc/stdio/fputws.c
+++ b/newlib/libc/stdio/fputws.c
@@ -145,6 +145,8 @@ _DEFUN(fputws, (ws, fp),
const wchar_t *ws _AND
FILE *fp)
{
- CHECK_INIT (_REENT, fp);
- return _fputws_r (_REENT, ws, fp);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT (reent, fp);
+ return _fputws_r (reent, ws, fp);
}
diff --git a/newlib/libc/stdio/getc.c b/newlib/libc/stdio/getc.c
index 355b19131..7951cdc93 100644
--- a/newlib/libc/stdio/getc.c
+++ b/newlib/libc/stdio/getc.c
@@ -105,9 +105,11 @@ _DEFUN(getc, (fp),
register FILE *fp)
{
int result;
- CHECK_INIT (_REENT, fp);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT (reent, fp);
_newlib_flockfile_start (fp);
- result = __sgetc_r (_REENT, fp);
+ result = __sgetc_r (reent, fp);
_newlib_flockfile_end (fp);
return result;
}
diff --git a/newlib/libc/stdio/getchar.c b/newlib/libc/stdio/getchar.c
index da2f5dfaf..7f3ceac62 100644
--- a/newlib/libc/stdio/getchar.c
+++ b/newlib/libc/stdio/getchar.c
@@ -91,9 +91,11 @@ _DEFUN(_getchar_r, (reent),
int
_DEFUN_VOID(getchar)
{
+ struct _reent *reent = _REENT;
+
/* CHECK_INIT is called (eventually) by __srefill_r. */
- _REENT_SMALL_CHECK_INIT (_REENT);
- return _getc_r (_REENT, _stdin_r (_REENT));
+ _REENT_SMALL_CHECK_INIT (reent);
+ return _getc_r (reent, _stdin_r (reent));
}
#endif
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h
index cbfeac77d..54854b49d 100644
--- a/newlib/libc/stdio/local.h
+++ b/newlib/libc/stdio/local.h
@@ -32,6 +32,16 @@
# include <io.h>
#endif
+/* The following define determines if the per-reent stdin, stdout and stderr
+ streams are closed during _reclaim_reent(). The stdin, stdout and stderr
+ streams are initialized to use file descriptors 0, 1 and 2 respectively. In
+ case _STDIO_CLOSE_PER_REENT_STD_STREAMS is defined these file descriptors
+ will be closed via close() provided the owner of the reent structure
+ triggerd the on demand reent initilization, see CHECK_INIT(). */
+#ifndef __rtems__
+#define _STDIO_CLOSE_PER_REENT_STD_STREAMS
+#endif
+
/* The following macros are supposed to replace calls to _flockfile/_funlockfile
and __sfp_lock_acquire/__sfp_lock_release. In case of multi-threaded
environments using pthreads, it's not sufficient to lock the stdio functions
@@ -165,34 +175,37 @@ extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *,
#ifdef _REENT_SMALL
#define CHECK_INIT(ptr, fp) \
- do \
- { \
- if ((ptr) && !(ptr)->__sdidinit) \
- __sinit (ptr); \
- if ((fp) == (FILE *)&__sf_fake_stdin) \
- (fp) = _stdin_r(ptr); \
- else if ((fp) == (FILE *)&__sf_fake_stdout) \
- (fp) = _stdout_r(ptr); \
- else if ((fp) == (FILE *)&__sf_fake_stderr) \
- (fp) = _stderr_r(ptr); \
- } \
+ do \
+ { \
+ struct _reent *_check_init_ptr = (ptr); \
+ if ((_check_init_ptr) && !(_check_init_ptr)->__sdidinit) \
+ __sinit (_check_init_ptr); \
+ if ((fp) == (FILE *)&__sf_fake_stdin) \
+ (fp) = _stdin_r(_check_init_ptr); \
+ else if ((fp) == (FILE *)&__sf_fake_stdout) \
+ (fp) = _stdout_r(_check_init_ptr); \
+ else if ((fp) == (FILE *)&__sf_fake_stderr) \
+ (fp) = _stderr_r(_check_init_ptr); \
+ } \
while (0)
#else /* !_REENT_SMALL */
#define CHECK_INIT(ptr, fp) \
- do \
- { \
- if ((ptr) && !(ptr)->__sdidinit) \
- __sinit (ptr); \
- } \
+ do \
+ { \
+ struct _reent *_check_init_ptr = (ptr); \
+ if ((_check_init_ptr) && !(_check_init_ptr)->__sdidinit) \
+ __sinit (_check_init_ptr); \
+ } \
while (0)
#endif /* !_REENT_SMALL */
#define CHECK_STD_INIT(ptr) \
- do \
- { \
- if ((ptr) && !(ptr)->__sdidinit) \
- __sinit (ptr); \
- } \
+ do \
+ { \
+ struct _reent *_check_init_ptr = (ptr); \
+ if ((_check_init_ptr) && !(_check_init_ptr)->__sdidinit) \
+ __sinit (_check_init_ptr); \
+ } \
while (0)
/* Return true and set errno and stream error flag iff the given FILE
diff --git a/newlib/libc/stdio/putc.c b/newlib/libc/stdio/putc.c
index 1115bf40d..2b1fd1bf3 100644
--- a/newlib/libc/stdio/putc.c
+++ b/newlib/libc/stdio/putc.c
@@ -111,9 +111,11 @@ _DEFUN(putc, (c, fp),
{
#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
int result;
- CHECK_INIT (_REENT, fp);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT (reent, fp);
_newlib_flockfile_start (fp);
- result = __sputc_r (_REENT, c, fp);
+ result = __sputc_r (reent, c, fp);
_newlib_flockfile_end (fp);
return result;
#else
diff --git a/newlib/libc/stdio/putchar.c b/newlib/libc/stdio/putchar.c
index 06bcbb46e..bb27dc4e6 100644
--- a/newlib/libc/stdio/putchar.c
+++ b/newlib/libc/stdio/putchar.c
@@ -90,8 +90,10 @@ int
_DEFUN(putchar, (c),
int c)
{
- _REENT_SMALL_CHECK_INIT (_REENT);
- return _putc_r (_REENT, c, _stdout_r (_REENT));
+ struct _reent *reent = _REENT;
+
+ _REENT_SMALL_CHECK_INIT (reent);
+ return _putc_r (reent, c, _stdout_r (reent));
}
#endif
diff --git a/newlib/libc/stdio/scanf.c b/newlib/libc/stdio/scanf.c
index 68fd8fb65..19c85be4f 100644
--- a/newlib/libc/stdio/scanf.c
+++ b/newlib/libc/stdio/scanf.c
@@ -38,14 +38,15 @@ scanf(fmt, va_alist)
{
int ret;
va_list ap;
+ struct _reent *reent = _REENT;
- _REENT_SMALL_CHECK_INIT (_REENT);
+ _REENT_SMALL_CHECK_INIT (reent);
#ifdef _HAVE_STDC
va_start (ap, fmt);
#else
va_start (ap);
#endif
- ret = _vfscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
+ ret = _vfscanf_r (reent, _stdin_r (reent), fmt, ap);
va_end (ap);
return ret;
}
diff --git a/newlib/libc/stdio/setvbuf.c b/newlib/libc/stdio/setvbuf.c
index 63f1f80db..41bdff6b6 100644
--- a/newlib/libc/stdio/setvbuf.c
+++ b/newlib/libc/stdio/setvbuf.c
@@ -103,8 +103,9 @@ _DEFUN(setvbuf, (fp, buf, mode, size),
register size_t size)
{
int ret = 0;
+ struct _reent *reent = _REENT;
- CHECK_INIT (_REENT, fp);
+ CHECK_INIT (reent, fp);
_newlib_flockfile_start (fp);
@@ -126,11 +127,11 @@ _DEFUN(setvbuf, (fp, buf, mode, size),
* non buffer flags, and clear malloc flag.
*/
- _fflush_r (_REENT, fp);
+ _fflush_r (reent, fp);
fp->_r = 0;
fp->_lbfsize = 0;
if (fp->_flags & __SMBF)
- _free_r (_REENT, (_PTR) fp->_bf._base);
+ _free_r (reent, (_PTR) fp->_bf._base);
fp->_flags &= ~(__SLBF | __SNBF | __SMBF);
if (mode == _IONBF)
@@ -180,7 +181,7 @@ nbf:
case _IOFBF:
/* no flag */
- _REENT->__cleanup = _cleanup_r;
+ reent->__cleanup = _cleanup_r;
fp->_bf._base = fp->_p = (unsigned char *) buf;
fp->_bf._size = size;
break;
diff --git a/newlib/libc/stdio/ungetwc.c b/newlib/libc/stdio/ungetwc.c
index ee0d7fc75..a69449eb2 100644
--- a/newlib/libc/stdio/ungetwc.c
+++ b/newlib/libc/stdio/ungetwc.c
@@ -110,6 +110,8 @@ _DEFUN(ungetwc, (wint_t wc, FILE *fp),
wint_t wc _AND
FILE *fp)
{
- CHECK_INIT (_REENT, fp);
- return _ungetwc_r (_REENT, wc, fp);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT (reent, fp);
+ return _ungetwc_r (reent, wc, fp);
}
diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c
index e967719b7..ae94cea3f 100644
--- a/newlib/libc/stdio/vfscanf.c
+++ b/newlib/libc/stdio/vfscanf.c
@@ -266,8 +266,10 @@ _DEFUN(VFSCANF, (fp, fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- CHECK_INIT(_REENT, fp);
- return __SVFSCANF_R (_REENT, fp, fmt, ap);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT(reent, fp);
+ return __SVFSCANF_R (reent, fp, fmt, ap);
}
int
diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c
index 5d2388df8..3379b5e19 100644
--- a/newlib/libc/stdio/vfwscanf.c
+++ b/newlib/libc/stdio/vfwscanf.c
@@ -258,8 +258,10 @@ _DEFUN(VFWSCANF, (fp, fmt, ap),
_CONST wchar_t *fmt _AND
va_list ap)
{
- CHECK_INIT(_REENT, fp);
- return __SVFWSCANF_R (_REENT, fp, fmt, ap);
+ struct _reent *reent = _REENT;
+
+ CHECK_INIT(reent, fp);
+ return __SVFWSCANF_R (reent, fp, fmt, ap);
}
int
diff --git a/newlib/libc/stdio/viprintf.c b/newlib/libc/stdio/viprintf.c
index 3717f3a08..fec92fa8a 100644
--- a/newlib/libc/stdio/viprintf.c
+++ b/newlib/libc/stdio/viprintf.c
@@ -109,8 +109,10 @@ _DEFUN(viprintf, (fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- _REENT_SMALL_CHECK_INIT (_REENT);
- return _vfiprintf_r (_REENT, _stdout_r (_REENT), fmt, ap);
+ struct _reent *reent = _REENT;
+
+ _REENT_SMALL_CHECK_INIT (reent);
+ return _vfiprintf_r (reent, _stdout_r (reent), fmt, ap);
}
#endif /* !_REENT_ONLY */
diff --git a/newlib/libc/stdio/viscanf.c b/newlib/libc/stdio/viscanf.c
index a60c32ff0..9a7d0c5f2 100644
--- a/newlib/libc/stdio/viscanf.c
+++ b/newlib/libc/stdio/viscanf.c
@@ -127,8 +127,10 @@ _DEFUN(viscanf, (fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- _REENT_SMALL_CHECK_INIT (_REENT);
- return __svfiscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
+ struct _reent *reent = _REENT;
+
+ _REENT_SMALL_CHECK_INIT (reent);
+ return __svfiscanf_r (reent, _stdin_r (reent), fmt, ap);
}
#endif /* !_REENT_ONLY */
diff --git a/newlib/libc/stdio/vprintf.c b/newlib/libc/stdio/vprintf.c
index 69edc87ae..375656972 100644
--- a/newlib/libc/stdio/vprintf.c
+++ b/newlib/libc/stdio/vprintf.c
@@ -33,8 +33,10 @@ _DEFUN(vprintf, (fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- _REENT_SMALL_CHECK_INIT (_REENT);
- return _vfprintf_r (_REENT, _stdout_r (_REENT), fmt, ap);
+ struct _reent *reent = _REENT;
+
+ _REENT_SMALL_CHECK_INIT (reent);
+ return _vfprintf_r (reent, _stdout_r (reent), fmt, ap);
}
#endif /* !_REENT_ONLY */
diff --git a/newlib/libc/stdio/vscanf.c b/newlib/libc/stdio/vscanf.c
index e559b77a8..210774b05 100644
--- a/newlib/libc/stdio/vscanf.c
+++ b/newlib/libc/stdio/vscanf.c
@@ -34,8 +34,10 @@ _DEFUN(vscanf, (fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
- _REENT_SMALL_CHECK_INIT (_REENT);
- return __svfscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
+ struct _reent *reent = _REENT;
+
+ _REENT_SMALL_CHECK_INIT (reent);
+ return __svfscanf_r (reent, _stdin_r (reent), fmt, ap);
}
#endif /* !_REENT_ONLY */
diff --git a/newlib/libc/stdio/vwprintf.c b/newlib/libc/stdio/vwprintf.c
index ce28fdabb..de95346a0 100644
--- a/newlib/libc/stdio/vwprintf.c
+++ b/newlib/libc/stdio/vwprintf.c
@@ -30,8 +30,10 @@ _DEFUN(vwprintf, (fmt, ap),
_CONST wchar_t *fmt _AND
va_list ap)
{
- _REENT_SMALL_CHECK_INIT (_REENT);
- return _vfwprintf_r (_REENT, _stdout_r (_REENT), fmt, ap);
+ struct _reent *reent = _REENT;
+
+ _REENT_SMALL_CHECK_INIT (reent);
+ return _vfwprintf_r (reent, _stdout_r (reent), fmt, ap);
}
#endif /* !_REENT_ONLY */
diff --git a/newlib/libc/stdio/vwscanf.c b/newlib/libc/stdio/vwscanf.c
index 3c60fbb73..d0b535170 100644
--- a/newlib/libc/stdio/vwscanf.c
+++ b/newlib/libc/stdio/vwscanf.c
@@ -33,8 +33,10 @@
int
vwscanf (_CONST wchar_t *fmt, va_list ap)
{
- _REENT_SMALL_CHECK_INIT (_REENT);
- return __svfwscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
+ struct _reent *reent = _REENT;
+
+ _REENT_SMALL_CHECK_INIT (reent);
+ return __svfwscanf_r (reent, _stdin_r (reent), fmt, ap);
}
#endif /* !_REENT_ONLY */
diff --git a/newlib/libc/stdio/wscanf.c b/newlib/libc/stdio/wscanf.c
index abe8dc07a..9fee3c176 100644
--- a/newlib/libc/stdio/wscanf.c
+++ b/newlib/libc/stdio/wscanf.c
@@ -29,10 +29,11 @@ wscanf(_CONST wchar_t *fmt, ...)
{
int ret;
va_list ap;
+ struct _reent *reent = _REENT;
- _REENT_SMALL_CHECK_INIT (_REENT);
+ _REENT_SMALL_CHECK_INIT (reent);
va_start (ap, fmt);
- ret = _vfwscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
+ ret = _vfwscanf_r (reent, _stdin_r (reent), fmt, ap);
va_end (ap);
return ret;
}
diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am
index 38120e6e2..22fedcc84 100644
--- a/newlib/libc/stdlib/Makefile.am
+++ b/newlib/libc/stdlib/Makefile.am
@@ -66,12 +66,40 @@ GENERAL_SOURCES += \
wcstold.c
endif # HAVE_LONG_DOUBLE
+if NEWLIB_NANO_MALLOC
+MALIGNR=nano-malignr
+MALLOPTR=nano-malloptr
+PVALLOCR=nano-pvallocr
+VALLOCR=nano-vallocr
+FREER=nano-freer
+REALLOCR=nano-reallocr
+CALLOCR=nano-callocr
+CFREER=nano-cfreer
+MALLINFOR=nano-mallinfor
+MALLSTATSR=nano-mallstatsr
+MSIZER=nano-msizer
+MALLOCR=nano-mallocr
+else
+MALIGNR=malignr
+MALLOPTR=malloptr
+PVALLOCR=pvallocr
+VALLOCR=vallocr
+FREER=freer
+REALLOCR=reallocr
+CALLOCR=callocr
+CFREER=cfreer
+MALLINFOR=mallinfor
+MALLSTATSR=mallstatsr
+MSIZER=msizer
+MALLOCR=mallocr
+endif
+
EXTENDED_SOURCES = \
cxa_atexit.c \
cxa_finalize.c \
drand48.c \
- ecvtbuf.c \
- efgcvt.c \
+ ecvtbuf.c \
+ efgcvt.c \
erand48.c \
jrand48.c \
lcong48.c \
@@ -115,10 +143,10 @@ ELIX_2_SOURCES = \
wctob.c
ELIX_2_OBJS = \
- $(lpfx)malignr.$(oext) \
- $(lpfx)malloptr.$(oext) \
- $(lpfx)pvallocr.$(oext) \
- $(lpfx)vallocr.$(oext)
+ $(lpfx)$(MALIGNR).$(oext) \
+ $(lpfx)$(MALLOPTR).$(oext) \
+ $(lpfx)$(PVALLOCR).$(oext) \
+ $(lpfx)$(VALLOCR).$(oext)
ELIX_3_SOURCES = \
putenv.c \
@@ -148,10 +176,10 @@ endif
endif
# Because of how libtool moves objects around, mallocr must be built last.
-LIBADD_OBJS = $(lpfx)freer.$(oext) $(lpfx)reallocr.$(oext) \
- $(lpfx)callocr.$(oext) $(lpfx)cfreer.$(oext) \
- $(lpfx)mallinfor.$(oext) $(lpfx)mallstatsr.$(oext) \
- $(lpfx)msizer.$(oext) $(lpfx)mallocr.$(oext)
+LIBADD_OBJS = $(lpfx)$(FREER).$(oext) $(lpfx)$(REALLOCR).$(oext) \
+ $(lpfx)$(CALLOCR).$(oext) $(lpfx)$(CFREER).$(oext) \
+ $(lpfx)$(MALLINFOR).$(oext) $(lpfx)$(MALLSTATSR).$(oext) \
+ $(lpfx)$(MSIZER).$(oext) $(lpfx)$(MALLOCR).$(oext)
libstdlib_la_LDFLAGS = -Xcompiler -nostdlib
@@ -176,41 +204,41 @@ include $(srcdir)/../../Makefile.shared
MALLOC_COMPILE = $(LIB_COMPILE) -DINTERNAL_NEWLIB
-$(lpfx)mallocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)freer.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(FREER).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)reallocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(REALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)callocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(CALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)cfreer.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(CFREER).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)malignr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALIGNR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)vallocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(VALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)pvallocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(PVALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)mallinfor.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALLINFOR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)mallstatsr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALLSTATSR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)msizer.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MSIZER).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)malloptr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALLOPTR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/$(MALLOCR).c -o $@
CHEWOUT_FILES= \
_Exit.def \
@@ -234,7 +262,7 @@ CHEWOUT_FILES= \
llabs.def \
lldiv.def \
malloc.def \
- mallocr.def \
+ $(MALLOCR).def \
mblen.def \
mbsnrtowcs.def \
mbstowcs.def \
diff --git a/newlib/libc/stdlib/Makefile.in b/newlib/libc/stdlib/Makefile.in
index 33e5f260d..319079dd5 100644
--- a/newlib/libc/stdlib/Makefile.in
+++ b/newlib/libc/stdlib/Makefile.in
@@ -361,12 +361,36 @@ GENERAL_SOURCES = __adjust.c __atexit.c __call_atexit.c __exp10.c \
reallocf.c sb_charsets.c strtod.c strtol.c strtoul.c wcstod.c \
wcstol.c wcstoul.c wcstombs.c wcstombs_r.c wctomb.c wctomb_r.c \
$(am__append_1)
+@NEWLIB_NANO_MALLOC_FALSE@MALIGNR = malignr
+@NEWLIB_NANO_MALLOC_TRUE@MALIGNR = nano-malignr
+@NEWLIB_NANO_MALLOC_FALSE@MALLOPTR = malloptr
+@NEWLIB_NANO_MALLOC_TRUE@MALLOPTR = nano-malloptr
+@NEWLIB_NANO_MALLOC_FALSE@PVALLOCR = pvallocr
+@NEWLIB_NANO_MALLOC_TRUE@PVALLOCR = nano-pvallocr
+@NEWLIB_NANO_MALLOC_FALSE@VALLOCR = vallocr
+@NEWLIB_NANO_MALLOC_TRUE@VALLOCR = nano-vallocr
+@NEWLIB_NANO_MALLOC_FALSE@FREER = freer
+@NEWLIB_NANO_MALLOC_TRUE@FREER = nano-freer
+@NEWLIB_NANO_MALLOC_FALSE@REALLOCR = reallocr
+@NEWLIB_NANO_MALLOC_TRUE@REALLOCR = nano-reallocr
+@NEWLIB_NANO_MALLOC_FALSE@CALLOCR = callocr
+@NEWLIB_NANO_MALLOC_TRUE@CALLOCR = nano-callocr
+@NEWLIB_NANO_MALLOC_FALSE@CFREER = cfreer
+@NEWLIB_NANO_MALLOC_TRUE@CFREER = nano-cfreer
+@NEWLIB_NANO_MALLOC_FALSE@MALLINFOR = mallinfor
+@NEWLIB_NANO_MALLOC_TRUE@MALLINFOR = nano-mallinfor
+@NEWLIB_NANO_MALLOC_FALSE@MALLSTATSR = mallstatsr
+@NEWLIB_NANO_MALLOC_TRUE@MALLSTATSR = nano-mallstatsr
+@NEWLIB_NANO_MALLOC_FALSE@MSIZER = msizer
+@NEWLIB_NANO_MALLOC_TRUE@MSIZER = nano-msizer
+@NEWLIB_NANO_MALLOC_FALSE@MALLOCR = mallocr
+@NEWLIB_NANO_MALLOC_TRUE@MALLOCR = nano-mallocr
EXTENDED_SOURCES = \
cxa_atexit.c \
cxa_finalize.c \
drand48.c \
- ecvtbuf.c \
- efgcvt.c \
+ ecvtbuf.c \
+ efgcvt.c \
erand48.c \
jrand48.c \
lcong48.c \
@@ -410,10 +434,10 @@ ELIX_2_SOURCES = \
wctob.c
ELIX_2_OBJS = \
- $(lpfx)malignr.$(oext) \
- $(lpfx)malloptr.$(oext) \
- $(lpfx)pvallocr.$(oext) \
- $(lpfx)vallocr.$(oext)
+ $(lpfx)$(MALIGNR).$(oext) \
+ $(lpfx)$(MALLOPTR).$(oext) \
+ $(lpfx)$(PVALLOCR).$(oext) \
+ $(lpfx)$(VALLOCR).$(oext)
ELIX_3_SOURCES = \
putenv.c \
@@ -434,10 +458,10 @@ ELIX_4_SOURCES = \
@ELIX_LEVEL_1_TRUE@ELIX_OBJS =
# Because of how libtool moves objects around, mallocr must be built last.
-LIBADD_OBJS = $(lpfx)freer.$(oext) $(lpfx)reallocr.$(oext) \
- $(lpfx)callocr.$(oext) $(lpfx)cfreer.$(oext) \
- $(lpfx)mallinfor.$(oext) $(lpfx)mallstatsr.$(oext) \
- $(lpfx)msizer.$(oext) $(lpfx)mallocr.$(oext)
+LIBADD_OBJS = $(lpfx)$(FREER).$(oext) $(lpfx)$(REALLOCR).$(oext) \
+ $(lpfx)$(CALLOCR).$(oext) $(lpfx)$(CFREER).$(oext) \
+ $(lpfx)$(MALLINFOR).$(oext) $(lpfx)$(MALLSTATSR).$(oext) \
+ $(lpfx)$(MSIZER).$(oext) $(lpfx)$(MALLOCR).$(oext)
libstdlib_la_LDFLAGS = -Xcompiler -nostdlib
@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libstdlib.la
@@ -476,7 +500,7 @@ CHEWOUT_FILES = \
llabs.def \
lldiv.def \
malloc.def \
- mallocr.def \
+ $(MALLOCR).def \
mblen.def \
mbsnrtowcs.def \
mbstowcs.def \
@@ -1388,41 +1412,41 @@ objectlist.awk.in: $(noinst_LTLIBRARIES)
echo $$i `pwd`/$$i >> objectlist.awk.in ; \
done
-$(lpfx)mallocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)freer.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(FREER).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)reallocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(REALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)callocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(CALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)cfreer.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(CFREER).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)malignr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALIGNR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)vallocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(VALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)pvallocr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(PVALLOCR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)mallinfor.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALLINFOR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)mallstatsr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALLSTATSR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)msizer.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MSIZER).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/$(MALLOCR).c -o $@
-$(lpfx)malloptr.$(oext): mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/mallocr.c -o $@
+$(lpfx)$(MALLOPTR).$(oext): $(MALLOCR).c
+ $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/$(MALLOCR).c -o $@
.c.def:
$(CHEW) < $< > $*.def 2> $*.ref
diff --git a/newlib/libc/stdlib/__atexit.c b/newlib/libc/stdlib/__atexit.c
index 4687d0023..f04f00d8e 100644
--- a/newlib/libc/stdlib/__atexit.c
+++ b/newlib/libc/stdlib/__atexit.c
@@ -10,7 +10,17 @@
/* Make this a weak reference to avoid pulling in malloc. */
void * malloc(size_t) _ATTRIBUTE((__weak__));
-__LOCK_INIT_RECURSIVE(, __atexit_lock);
+
+#ifndef __SINGLE_THREAD__
+extern _LOCK_RECURSIVE_T __atexit_lock;
+#endif
+
+#ifdef _REENT_GLOBAL_ATEXIT
+static struct _atexit _global_atexit0 = _ATEXIT_INIT;
+# define _GLOBAL_ATEXIT0 (&_global_atexit0)
+#else
+# define _GLOBAL_ATEXIT0 (&_GLOBAL_REENT->_atexit0)
+#endif
/*
* Register a function to be performed at exit or on shared library unload.
@@ -31,9 +41,9 @@ _DEFUN (__register_exitproc,
__lock_acquire_recursive(__atexit_lock);
#endif
- p = _GLOBAL_REENT->_atexit;
+ p = _GLOBAL_ATEXIT;
if (p == NULL)
- _GLOBAL_REENT->_atexit = p = &_GLOBAL_REENT->_atexit0;
+ _GLOBAL_ATEXIT = p = _GLOBAL_ATEXIT0;
if (p->_ind >= _ATEXIT_SIZE)
{
#ifndef _ATEXIT_DYNAMIC_ALLOC
@@ -53,8 +63,8 @@ _DEFUN (__register_exitproc,
return -1;
}
p->_ind = 0;
- p->_next = _GLOBAL_REENT->_atexit;
- _GLOBAL_REENT->_atexit = p;
+ p->_next = _GLOBAL_ATEXIT;
+ _GLOBAL_ATEXIT = p;
#ifndef _REENT_SMALL
p->_on_exit_args._fntypes = 0;
p->_on_exit_args._is_cxa = 0;
diff --git a/newlib/libc/stdlib/__call_atexit.c b/newlib/libc/stdlib/__call_atexit.c
index 4c4506343..1e6e71044 100644
--- a/newlib/libc/stdlib/__call_atexit.c
+++ b/newlib/libc/stdlib/__call_atexit.c
@@ -11,8 +11,10 @@
/* Make this a weak reference to avoid pulling in free. */
void free(void *) _ATTRIBUTE((__weak__));
-#ifndef __SINGLE_THREAD__
-extern _LOCK_RECURSIVE_T __atexit_lock;
+__LOCK_INIT_RECURSIVE(, __atexit_lock);
+
+#ifdef _REENT_GLOBAL_ATEXIT
+struct _atexit *_global_atexit = _NULL;
#endif
#ifdef _WANT_REGISTER_FINI
@@ -78,8 +80,8 @@ _DEFUN (__call_exitprocs, (code, d),
restart:
- p = _GLOBAL_REENT->_atexit;
- lastp = &_GLOBAL_REENT->_atexit;
+ p = _GLOBAL_ATEXIT;
+ lastp = &_GLOBAL_ATEXIT;
while (p)
{
#ifdef _REENT_SMALL
diff --git a/newlib/libc/stdlib/ecvtbuf.c b/newlib/libc/stdlib/ecvtbuf.c
index 2b9b9eb8a..feaa33fd0 100644
--- a/newlib/libc/stdlib/ecvtbuf.c
+++ b/newlib/libc/stdlib/ecvtbuf.c
@@ -233,6 +233,7 @@ _DEFUN (fcvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf),
int *sign _AND
char *fcvt_buf)
{
+ struct _reent *reent = _REENT;
char *save;
char *p;
char *end;
@@ -240,27 +241,27 @@ _DEFUN (fcvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf),
if (fcvt_buf == NULL)
{
- if (_REENT->_cvtlen <= ndigit + 35)
+ if (reent->_cvtlen <= ndigit + 35)
{
- if ((fcvt_buf = (char *) _realloc_r (_REENT, _REENT->_cvtbuf,
+ if ((fcvt_buf = (char *) _realloc_r (reent, reent->_cvtbuf,
ndigit + 36)) == NULL)
return NULL;
- _REENT->_cvtlen = ndigit + 36;
- _REENT->_cvtbuf = fcvt_buf;
+ reent->_cvtlen = ndigit + 36;
+ reent->_cvtbuf = fcvt_buf;
}
- fcvt_buf = _REENT->_cvtbuf ;
+ fcvt_buf = reent->_cvtbuf ;
}
save = fcvt_buf;
if (invalue < 1.0 && invalue > -1.0)
{
- p = _dtoa_r (_REENT, invalue, 2, ndigit, decpt, sign, &end);
+ p = _dtoa_r (reent, invalue, 2, ndigit, decpt, sign, &end);
}
else
{
- p = _dtoa_r (_REENT, invalue, 3, ndigit, decpt, sign, &end);
+ p = _dtoa_r (reent, invalue, 3, ndigit, decpt, sign, &end);
}
/* Now copy */
@@ -289,6 +290,7 @@ _DEFUN (ecvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf),
int *sign _AND
char *fcvt_buf)
{
+ struct _reent *reent = _REENT;
char *save;
char *p;
char *end;
@@ -296,21 +298,21 @@ _DEFUN (ecvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf),
if (fcvt_buf == NULL)
{
- if (_REENT->_cvtlen <= ndigit)
+ if (reent->_cvtlen <= ndigit)
{
- if ((fcvt_buf = (char *) _realloc_r (_REENT, _REENT->_cvtbuf,
+ if ((fcvt_buf = (char *) _realloc_r (reent, reent->_cvtbuf,
ndigit + 1)) == NULL)
return NULL;
- _REENT->_cvtlen = ndigit + 1;
- _REENT->_cvtbuf = fcvt_buf;
+ reent->_cvtlen = ndigit + 1;
+ reent->_cvtbuf = fcvt_buf;
}
- fcvt_buf = _REENT->_cvtbuf ;
+ fcvt_buf = reent->_cvtbuf ;
}
save = fcvt_buf;
- p = _dtoa_r (_REENT, invalue, 2, ndigit, decpt, sign, &end);
+ p = _dtoa_r (reent, invalue, 2, ndigit, decpt, sign, &end);
/* Now copy */
diff --git a/newlib/libc/stdlib/mblen.c b/newlib/libc/stdlib/mblen.c
index ace23889b..4d9ac38bd 100644
--- a/newlib/libc/stdlib/mblen.c
+++ b/newlib/libc/stdlib/mblen.c
@@ -55,11 +55,12 @@ _DEFUN (mblen, (s, n),
{
#ifdef _MB_CAPABLE
int retval = 0;
+ struct _reent *reent = _REENT;
mbstate_t *state;
- _REENT_CHECK_MISC(_REENT);
- state = &(_REENT_MBLEN_STATE(_REENT));
- retval = __mbtowc (_REENT, NULL, s, n, __locale_charset (), state);
+ _REENT_CHECK_MISC(reent);
+ state = &(_REENT_MBLEN_STATE(reent));
+ retval = __mbtowc (reent, NULL, s, n, __locale_charset (), state);
if (retval < 0)
{
state->__count = 0;
diff --git a/newlib/libc/stdlib/mbrlen.c b/newlib/libc/stdlib/mbrlen.c
index ac9aa324f..4319875a1 100644
--- a/newlib/libc/stdlib/mbrlen.c
+++ b/newlib/libc/stdlib/mbrlen.c
@@ -11,8 +11,10 @@ mbrlen(const char *s, size_t n, mbstate_t *ps)
#ifdef _MB_CAPABLE
if (ps == NULL)
{
- _REENT_CHECK_MISC(_REENT);
- ps = &(_REENT_MBRLEN_STATE(_REENT));
+ struct _reent *reent = _REENT;
+
+ _REENT_CHECK_MISC(reent);
+ ps = &(_REENT_MBRLEN_STATE(reent));
}
#endif
diff --git a/newlib/libc/stdlib/mbrtowc.c b/newlib/libc/stdlib/mbrtowc.c
index e191e1158..0a8c23a9d 100644
--- a/newlib/libc/stdlib/mbrtowc.c
+++ b/newlib/libc/stdlib/mbrtowc.c
@@ -52,24 +52,25 @@ _DEFUN (mbrtowc, (pwc, s, n, ps),
return _mbrtowc_r (_REENT, pwc, s, n, ps);
#else
int retval = 0;
+ struct _reent *reent = _REENT;
#ifdef _MB_CAPABLE
if (ps == NULL)
{
- _REENT_CHECK_MISC(_REENT);
- ps = &(_REENT_MBRTOWC_STATE(_REENT));
+ _REENT_CHECK_MISC(reent);
+ ps = &(_REENT_MBRTOWC_STATE(reent));
}
#endif
if (s == NULL)
- retval = __mbtowc (_REENT, NULL, "", 1, __locale_charset (), ps);
+ retval = __mbtowc (reent, NULL, "", 1, __locale_charset (), ps);
else
- retval = __mbtowc (_REENT, pwc, s, n, __locale_charset (), ps);
+ retval = __mbtowc (reent, pwc, s, n, __locale_charset (), ps);
if (retval == -1)
{
ps->__count = 0;
- _REENT->_errno = EILSEQ;
+ reent->_errno = EILSEQ;
return (size_t)(-1);
}
else
diff --git a/newlib/libc/stdlib/mbtowc.c b/newlib/libc/stdlib/mbtowc.c
index 83b6a0eda..8da309e2d 100644
--- a/newlib/libc/stdlib/mbtowc.c
+++ b/newlib/libc/stdlib/mbtowc.c
@@ -64,12 +64,13 @@ _DEFUN (mbtowc, (pwc, s, n),
{
#ifdef _MB_CAPABLE
int retval = 0;
+ struct _reent *reent = _REENT;
mbstate_t *ps;
- _REENT_CHECK_MISC(_REENT);
- ps = &(_REENT_MBTOWC_STATE(_REENT));
+ _REENT_CHECK_MISC(reent);
+ ps = &(_REENT_MBTOWC_STATE(reent));
- retval = __mbtowc (_REENT, pwc, s, n, __locale_charset (), ps);
+ retval = __mbtowc (reent, pwc, s, n, __locale_charset (), ps);
if (retval < 0)
{
diff --git a/newlib/libc/stdlib/nano-mallocr.c b/newlib/libc/stdlib/nano-mallocr.c
new file mode 100644
index 000000000..e0a919590
--- /dev/null
+++ b/newlib/libc/stdlib/nano-mallocr.c
@@ -0,0 +1,581 @@
+/*
+ * Copyright (c) 2012, 2013 ARM Ltd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Implementation of <<malloc>> <<free>> <<calloc>> <<realloc>>, optional
+ * as to be reenterable.
+ *
+ * Interface documentation refer to malloc.c.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#if DEBUG
+#include <assert.h>
+#else
+#define assert(x) ((void)0)
+#endif
+
+#ifndef MAX
+#define MAX(a,b) ((a) >= (b) ? (a) : (b))
+#endif
+
+#ifdef INTERNAL_NEWLIB
+
+#include <sys/config.h>
+#include <reent.h>
+
+#define RARG struct _reent *reent_ptr,
+#define RONEARG struct _reent *reent_ptr
+#define RCALL reent_ptr,
+
+/* Disable MALLOC_LOCK so far. So it won't be thread safe */
+#define MALLOC_LOCK /*__malloc_lock(reent_ptr) */
+#define MALLOC_UNLOCK /*__malloc_unlock(reent_ptr) */
+
+#define RERRNO reent_ptr->_errno
+
+#define nano_malloc _malloc_r
+#define nano_free _free_r
+#define nano_realloc _realloc_r
+#define nano_memalign _memalign_r
+#define nano_valloc _valloc_r
+#define nano_pvalloc _pvalloc_r
+#define nano_calloc _calloc_r
+#define nano_cfree _cfree_r
+#define nano_malloc_usable_size _malloc_usable_size_r
+#define nano_malloc_stats _malloc_stats_r
+#define nano_mallinfo _mallinfo_r
+#define nano_allopt _mallopt_r
+
+#else /* ! INTERNAL_NEWLIB */
+
+#define RARG
+#define RONEARG
+#define RCALL
+#define MALLOC_LOCK
+#define MALLOC_UNLOCK
+#define RERRNO errno
+
+#define nano_malloc malloc
+#define nano_free free
+#define nano_realloc realloc
+#define nano_memalign memalign
+#define nano_valloc valloc
+#define nano_pvalloc pvalloc
+#define nano_calloc calloc
+#define nano_cfree cfree
+#define nano_malloc_usable_size malloc_usable_size
+#define nano_malloc_stats malloc_stats
+#define nano_mallinfo mallinfo
+#define nano_allopt mallopt
+#endif /* ! INTERNAL_NEWLIB */
+
+/* Define free_list as internal name to avoid conflict with user names */
+#define free_list __malloc_free_list
+
+#define ALIGN_TO(size, align) \
+ (((size) + (align) -1) & ~((align) -1))
+
+/* Alignment of allocated block */
+#define MALLOC_ALIGN (8U)
+#define CHUNK_ALIGN (sizeof(void*))
+#define MALLOC_PADDING ((MAX(MALLOC_ALIGN, CHUNK_ALIGN)) - CHUNK_ALIGN)
+
+/* as well as the minimal allocation size
+ * to hold a free pointer */
+#define MALLOC_MINSIZE (sizeof(void *))
+#define MALLOC_PAGE_ALIGN (0x1000)
+#define MAX_ALLOC_SIZE (0x80000000U)
+
+typedef size_t malloc_size_t;
+
+typedef struct malloc_chunk
+{
+ /* ------------------
+ * chunk->| size (4 bytes) |
+ * ------------------
+ * | Padding for |
+ * | alignment |
+ * | holding neg |
+ * | offset to size |
+ * ------------------
+ * mem_ptr->| point to next |
+ * | free when freed|
+ * | or data load |
+ * | when allocated |
+ * ------------------
+ */
+ /* size of the allocated payload area, including size before
+ CHUNK_OFFSET */
+ int size;
+
+ /* since here, the memory is either the next free block, or data load */
+ struct malloc_chunk * next;
+}chunk;
+
+#define CHUNK_OFFSET ((malloc_size_t)(&(((struct malloc_chunk *)0)->next)))
+
+/* size of smallest possible chunk. A memory piece smaller than this size
+ * won't be able to create a chunk */
+#define MALLOC_MINCHUNK (CHUNK_OFFSET + MALLOC_PADDING + MALLOC_MINSIZE)
+
+static chunk * get_chunk_from_ptr(void * ptr)
+{
+ chunk * c = (chunk *)((char *)ptr - CHUNK_OFFSET);
+ /* Skip the padding area */
+ if (c->size < 0) c = (chunk *)((char *)c + c->size);
+ return c;
+}
+
+#ifdef DEFINE_MALLOC
+chunk * free_list = NULL;
+
+/** Function sbrk_aligned
+ * Algorithm:
+ * Use sbrk() to obtain more memory and ensure it is CHUNK_ALIGN aligned
+ * Optimise for the case that it is already aligned - only ask for extra
+ * padding after we know we need it
+ */
+static void* sbrk_aligned(RARG malloc_size_t s)
+{
+ char *p, *align_p;
+
+ p = _sbrk_r(RCALL s);
+
+ /* sbrk returns -1 if fail to allocate */
+ if (p == (void *)-1)
+ return p;
+
+ align_p = (char*)ALIGN_TO((unsigned long)p, CHUNK_ALIGN);
+ if (align_p != p)
+ {
+ /* p is not aligned, ask for a few more bytes so that we have s
+ * bytes reserved from align_p. */
+ p = _sbrk_r(RCALL align_p - p);
+ if (p == (void *)-1)
+ return p;
+ }
+ return align_p;
+}
+
+/** Function nano_malloc
+ * Algorithm:
+ * Walk through the free list to find the first match. If fails to find
+ * one, call sbrk to allocate a new chunk.
+ */
+void * nano_malloc(RARG malloc_size_t s)
+{
+ chunk *p, *r;
+ char * ptr, * align_ptr;
+ int offset;
+
+ malloc_size_t alloc_size;
+
+ alloc_size = ALIGN_TO(s, CHUNK_ALIGN); /* size of aligned data load */
+ alloc_size += MALLOC_PADDING; /* padding */
+ alloc_size += CHUNK_OFFSET; /* size of chunk head */
+ alloc_size = MAX(alloc_size, MALLOC_MINCHUNK);
+
+ if (alloc_size >= MAX_ALLOC_SIZE || alloc_size < s)
+ {
+ RERRNO = ENOMEM;
+ return NULL;
+ }
+
+ MALLOC_LOCK;
+
+ p = free_list;
+ r = p;
+
+ while (r)
+ {
+ int rem = r->size - alloc_size;
+ if (rem >= 0)
+ {
+ if (rem >= MALLOC_MINCHUNK)
+ {
+ /* Find a chunk that much larger than required size, break
+ * it into two chunks and return the second one */
+ r->size = rem;
+ r = (chunk *)((char *)r + rem);
+ r->size = alloc_size;
+ }
+ /* Find a chunk that is exactly the size or slightly bigger
+ * than requested size, just return this chunk */
+ else if (p == r)
+ {
+ /* Now it implies p==r==free_list. Move the free_list
+ * to next chunk */
+ free_list = r->next;
+ }
+ else
+ {
+ /* Normal case. Remove it from free_list */
+ p->next = r->next;
+ }
+ break;
+ }
+ p=r;
+ r=r->next;
+ }
+
+ /* Failed to find a appropriate chunk. Ask for more memory */
+ if (r == NULL)
+ {
+ r = sbrk_aligned(RCALL alloc_size);
+
+ /* sbrk returns -1 if fail to allocate */
+ if (r == (void *)-1)
+ {
+ RERRNO = ENOMEM;
+ MALLOC_UNLOCK;
+ return NULL;
+ }
+ r->size = alloc_size;
+ }
+ MALLOC_UNLOCK;
+
+ ptr = (char *)r + CHUNK_OFFSET;
+
+ align_ptr = (char *)ALIGN_TO((unsigned long)ptr, MALLOC_ALIGN);
+ offset = align_ptr - ptr;
+
+ if (offset)
+ {
+ *(int *)((char *)r + offset) = -offset;
+ }
+
+ assert(align_ptr + size <= (char *)r + alloc_size);
+ return align_ptr;
+}
+#endif /* DEFINE_MALLOC */
+
+#ifdef DEFINE_FREE
+#define MALLOC_CHECK_DOUBLE_FREE
+
+extern chunk * free_list;
+/** Function nano_free
+ * Implementation of libc free.
+ * Algorithm:
+ * Maintain a global free chunk single link list, headed by global
+ * variable free_list.
+ * When free, insert the to-be-freed chunk into free list. The place to
+ * insert should make sure all chunks are sorted by address from low to
+ * high. Then merge with neighbor chunks if adjacent.
+ */
+void nano_free (RARG void * free_p)
+{
+ chunk * p_to_free;
+ chunk * p, * q;
+
+ if (free_p == NULL) return;
+
+ p_to_free = get_chunk_from_ptr(free_p);
+
+ MALLOC_LOCK;
+ if (free_list == NULL)
+ {
+ /* Set first free list element */
+ p_to_free->next = free_list;
+ free_list = p_to_free;
+ MALLOC_UNLOCK;
+ return;
+ }
+
+ if (p_to_free < free_list)
+ {
+ if ((char *)p_to_free + p_to_free->size == (char *)free_list)
+ {
+ /* Chunk to free is just before the first element of
+ * free list */
+ p_to_free->size += free_list->size;
+ p_to_free->next = free_list->next;
+ }
+ else
+ {
+ /* Insert before current free_list */
+ p_to_free->next = free_list;
+ }
+ free_list = p_to_free;
+ MALLOC_UNLOCK;
+ return;
+ }
+
+ q = free_list;
+ /* Walk through the free list to find the place for insert. */
+ do
+ {
+ p = q;
+ q = q->next;
+ } while (q && q <= p_to_free);
+
+ /* Now p <= p_to_free and either q == NULL or q > p_to_free
+ * Try to merge with chunks immediately before/after it. */
+
+ if ((char *)p + p->size == (char *)p_to_free)
+ {
+ /* Chunk to be freed is adjacent
+ * to a free chunk before it */
+ p->size += p_to_free->size;
+ /* If the merged chunk is also adjacent
+ * to the chunk after it, merge again */
+ if ((char *)p + p->size == (char *) q)
+ {
+ p->size += q->size;
+ p->next = q->next;
+ }
+ }
+#ifdef MALLOC_CHECK_DOUBLE_FREE
+ else if ((char *)p + p->size > (char *)p_to_free)
+ {
+ /* Report double free fault */
+ RERRNO = ENOMEM;
+ MALLOC_UNLOCK;
+ return;
+ }
+#endif
+ else if ((char *)p_to_free + p_to_free->size == (char *) q)
+ {
+ /* Chunk to be freed is adjacent
+ * to a free chunk after it */
+ p_to_free->size += q->size;
+ p_to_free->next = q->next;
+ p->next = p_to_free;
+ }
+ else
+ {
+ /* Not adjacent to any chunk. Just insert it. Resulting
+ * a fragment. */
+ p_to_free->next = q;
+ p->next = p_to_free;
+ }
+ MALLOC_UNLOCK;
+}
+#endif /* DEFINE_FREE */
+
+#ifdef DEFINE_CFREE
+void nano_free (RARG void * free_p);
+
+void nano_cfree(RARG void * ptr)
+{
+ nano_free(RCALL ptr);
+}
+#endif /* DEFINE_CFREE */
+
+#ifdef DEFINE_CALLOC
+void * nano_malloc(RARG malloc_size_t s);
+
+/* Function nano_calloc
+ * Implement calloc simply by calling malloc and set zero */
+void * nano_calloc(RARG malloc_size_t n, malloc_size_t elem)
+{
+ void * mem = nano_malloc(RCALL n * elem);
+ if (mem != NULL) memset(mem, 0, n * elem);
+ return mem;
+}
+#endif /* DEFINE_CALLOC */
+
+#ifdef DEFINE_REALLOC
+void * nano_malloc(RARG malloc_size_t s);
+void nano_free (RARG void * free_p);
+malloc_size_t nano_malloc_usable_size(RARG void * ptr);
+
+/* Function nano_realloc
+ * Implement realloc by malloc + memcpy */
+void * nano_realloc(RARG void * ptr, malloc_size_t size)
+{
+ void * mem;
+ chunk * p_to_realloc;
+
+ if (ptr == NULL) return nano_malloc(RCALL size);
+
+ if (size == 0)
+ {
+ nano_free(RCALL ptr);
+ return NULL;
+ }
+
+ /* TODO: There is chance to shrink the chunk if newly requested
+ * size is much small */
+ if (nano_malloc_usable_size(RCALL ptr) >= size)
+ return ptr;
+
+ mem = nano_malloc(RCALL size);
+ if (mem != NULL)
+ {
+ memcpy(mem, ptr, size);
+ nano_free(RCALL ptr);
+ }
+ return mem;
+}
+#endif /* DEFINE_REALLOC */
+
+#ifdef DEFINE_MALLINFO
+struct mallinfo
+{
+ int arena; /* total space allocated from system */
+ int ordblks; /* number of non-inuse chunks */
+ int smblks; /* unused -- always zero */
+ int hblks; /* number of mmapped regions */
+ int hblkhd; /* total space in mmapped regions */
+ int usmblks; /* unused -- always zero */
+ int fsmblks; /* unused -- always zero */
+ int uordblks; /* total allocated space */
+ int fordblks; /* total non-inuse space */
+ int keepcost; /* top-most, releasable (via malloc_trim) space */
+};
+
+static struct mallinfo current_mallinfo={0,0,0,0,0,0,0,0,0,0};
+
+struct mallinfo nano_mallinfo(RONEARG)
+{
+ return current_mallinfo;
+}
+
+#endif /* DEFINE_MALLINFO */
+
+#ifdef DEFINE_MALLOC_STATS
+void nano_malloc_stats(RONEARG)
+{
+}
+#endif /* DEFINE_MALLOC_STATS */
+
+#ifdef DEFINE_MALLOC_USABLE_SIZE
+malloc_size_t nano_malloc_usable_size(RARG void * ptr)
+{
+ chunk * c = (chunk *)((char *)ptr - CHUNK_OFFSET);
+ int size_or_offset = c->size;
+
+ if (size_or_offset < 0)
+ {
+ /* Padding is used. Excluding the padding size */
+ c = (chunk *)((char *)c + c->size);
+ return c->size - CHUNK_OFFSET + size_or_offset;
+ }
+ return c->size - CHUNK_OFFSET;
+}
+#endif /* DEFINE_MALLOC_USABLE_SIZE */
+
+#ifdef DEFINE_MEMALIGN
+void * nano_malloc(RARG malloc_size_t s);
+
+/* Function nano_memalign
+ * Allocate memory block aligned at specific boundary.
+ * align: required alignment. Must be power of 2. Return NULL
+ * if not power of 2. Undefined behavior is bigger than
+ * pointer value range.
+ * s: required size.
+ * Return: allocated memory pointer aligned to align
+ * Algorithm: Malloc a big enough block, padding pointer to aligned
+ * address, then truncate and free the tail if too big.
+ * Record the offset of align pointer and original pointer
+ * in the padding area.
+ */
+void * nano_memalign(RARG size_t align, size_t s)
+{
+ chunk * chunk_p;
+ malloc_size_t size_allocated, offset, ma_size, size_with_padding;
+ char * allocated, * aligned_p;
+
+ /* Return NULL if align isn't power of 2 */
+ if ((align & (align-1)) != 0) return NULL;
+
+ align = MAX(align, MALLOC_ALIGN);
+ ma_size = ALIGN_TO(MAX(s, MALLOC_MINSIZE), CHUNK_ALIGN);
+ size_with_padding = ma_size + align - MALLOC_ALIGN;
+
+ allocated = nano_malloc(RCALL size_with_padding);
+ if (allocated == NULL) return NULL;
+
+ chunk_p = get_chunk_from_ptr(allocated);
+ aligned_p = (char *)ALIGN_TO(
+ (unsigned long)((char *)chunk_p + CHUNK_OFFSET),
+ (unsigned long)align);
+ offset = aligned_p - ((char *)chunk_p + CHUNK_OFFSET);
+
+ if (offset)
+ {
+ if (offset >= MALLOC_MINCHUNK)
+ {
+ /* Padding is too large, free it */
+ chunk * front_chunk = chunk_p;
+ chunk_p = (chunk *)((char *)chunk_p + offset);
+ chunk_p->size = front_chunk->size - offset;
+ front_chunk->size = offset;
+ nano_free(RCALL (char *)front_chunk + CHUNK_OFFSET);
+ }
+ else
+ {
+ /* Padding is used. Need to set a jump offset for aligned pointer
+ * to get back to chunk head */
+ assert(offset >= sizeof(int));
+ *(int *)((char *)chunk_p + offset) = -offset;
+ }
+ }
+
+ size_allocated = chunk_p->size;
+ if ((char *)chunk_p + size_allocated >
+ (aligned_p + ma_size + MALLOC_MINCHUNK))
+ {
+ /* allocated much more than what's required for padding, free
+ * tail part */
+ chunk * tail_chunk = (chunk *)(aligned_p + ma_size);
+ chunk_p->size = aligned_p + ma_size - (char *)chunk_p;
+ tail_chunk->size = size_allocated - chunk_p->size;
+ nano_free(RCALL (char *)tail_chunk + CHUNK_OFFSET);
+ }
+ return aligned_p;
+}
+#endif /* DEFINE_MEMALIGN */
+
+#ifdef DEFINE_MALLOPT
+int nano_mallopt(RARG int parameter_number, int parameter_value)
+{
+ return 0;
+}
+#endif /* DEFINE_MALLOPT */
+
+#ifdef DEFINE_VALLOC
+void * nano_memalign(RARG size_t align, size_t s);
+
+void * nano_valloc(RARG size_t s)
+{
+ return nano_memalign(RCALL MALLOC_PAGE_ALIGN, s);
+}
+#endif /* DEFINE_VALLOC */
+
+#ifdef DEFINE_PVALLOC
+void * nano_valloc(RARG size_t s);
+
+void * nano_pvalloc(RARG size_t s)
+{
+ return nano_valloc(RCALL ALIGN_TO(s, MALLOC_PAGE_ALIGN));
+}
+#endif /* DEFINE_PVALLOC */
diff --git a/newlib/libc/stdlib/rand.c b/newlib/libc/stdlib/rand.c
index 131e5cf09..42acde4aa 100644
--- a/newlib/libc/stdlib/rand.c
+++ b/newlib/libc/stdlib/rand.c
@@ -72,20 +72,24 @@ on two different systems.
void
_DEFUN (srand, (seed), unsigned int seed)
{
- _REENT_CHECK_RAND48(_REENT);
- _REENT_RAND_NEXT(_REENT) = seed;
+ struct _reent *reent = _REENT;
+
+ _REENT_CHECK_RAND48(reent);
+ _REENT_RAND_NEXT(reent) = seed;
}
int
_DEFUN_VOID (rand)
{
+ struct _reent *reent = _REENT;
+
/* This multiplier was obtained from Knuth, D.E., "The Art of
Computer Programming," Vol 2, Seminumerical Algorithms, Third
Edition, Addison-Wesley, 1998, p. 106 (line 26) & p. 108 */
- _REENT_CHECK_RAND48(_REENT);
- _REENT_RAND_NEXT(_REENT) =
- _REENT_RAND_NEXT(_REENT) * __extension__ 6364136223846793005LL + 1;
- return (int)((_REENT_RAND_NEXT(_REENT) >> 32) & RAND_MAX);
+ _REENT_CHECK_RAND48(reent);
+ _REENT_RAND_NEXT(reent) =
+ _REENT_RAND_NEXT(reent) * __extension__ 6364136223846793005LL + 1;
+ return (int)((_REENT_RAND_NEXT(reent) >> 32) & RAND_MAX);
}
#endif /* _REENT_ONLY */
diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c
index fe6aac206..159c9695b 100644
--- a/newlib/libc/stdlib/strtod.c
+++ b/newlib/libc/stdlib/strtod.c
@@ -128,11 +128,17 @@ THIS SOFTWARE.
#ifndef NO_IEEE_Scale
#define Avoid_Underflow
#undef tinytens
-/* The factor of 2^53 in tinytens[4] helps us avoid setting the underflow */
+/* The factor of 2^106 in tinytens[4] helps us avoid setting the underflow */
/* flag unnecessarily. It leads to a song and dance at the end of strtod. */
-static _CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128,
- 9007199254740992.e-256
- };
+static _CONST double tinytens[] = { 1e-16, 1e-32,
+#ifdef _DOUBLE_IS_32BITS
+ 0.0, 0.0, 0.0
+#else
+ 1e-64, 1e-128,
+ 9007199254740992. * 9007199254740992.e-256
+#endif
+ };
+
#endif
#endif
@@ -144,6 +150,28 @@ static _CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128,
#define Rounding Flt_Rounds
#endif
+#ifdef Avoid_Underflow /*{*/
+ static double
+_DEFUN (sulp, (x, scale),
+ U x _AND
+ int scale)
+{
+ U u;
+ double rv;
+ int i;
+
+ rv = ulp(dval(x));
+ if (!scale || (i = 2*P + 1 - ((dword0(x) & Exp_mask) >> Exp_shift)) <= 0)
+ return rv; /* Is there an example where i <= 0 ? */
+ dword0(u) = Exp_1 + (i << Exp_shift);
+#ifndef _DOUBLE_IS_32BITS
+ dword1(u) = 0;
+#endif
+ return rv * u.d;
+ }
+#endif /*}*/
+
+
#ifndef NO_HEX_FP
static void
@@ -221,7 +249,10 @@ _DEFUN (_strtod_r, (ptr, s00, se),
U aadj1, rv, rv0;
Long L;
__ULong y, z;
- _Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
+ _Bigint *bb = NULL, *bb1, *bd = NULL, *bd0, *bs = NULL, *delta = NULL;
+#ifdef Avoid_Underflow
+ __ULong Lsb, Lsb1;
+#endif
#ifdef SET_INEXACT
int inexact, oldinexact;
#endif
@@ -279,6 +310,8 @@ _DEFUN (_strtod_r, (ptr, s00, se),
switch((i = gethex(ptr, &s, &fpi1, &exp, &bb, sign)) & STRTOG_Retmask) {
case STRTOG_NoNumber:
s = s00;
+ sign = 0;
+ /* FALLTHROUGH */
case STRTOG_Zero:
break;
default:
@@ -299,14 +332,11 @@ _DEFUN (_strtod_r, (ptr, s00, se),
}
s0 = s;
y = z = 0;
- for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) {
- if (nd < DBL_DIG + 1) {
- if (nd < 9)
- y = 10*y + c - '0';
- else
- z = 10*z + c - '0';
- }
- }
+ for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
+ if (nd < 9)
+ y = 10*y + c - '0';
+ else
+ z = 10*z + c - '0';
nd0 = nd;
if (strncmp (s, _localeconv_r (ptr)->decimal_point,
strlen (_localeconv_r (ptr)->decimal_point)) == 0)
@@ -329,20 +359,15 @@ _DEFUN (_strtod_r, (ptr, s00, se),
nz++;
if (c -= '0') {
nf += nz;
- for(i = 1; i < nz; i++) {
- if (nd++ <= DBL_DIG + 1) {
- if (nd < 10)
- y *= 10;
- else
- z *= 10;
- }
- }
- if (nd++ <= DBL_DIG + 1) {
- if (nd < 10)
- y = 10*y + c;
- else
- z = 10*z + c;
- }
+ for(i = 1; i < nz; i++)
+ if (nd++ < 9)
+ y *= 10;
+ else if (nd <= DBL_DIG + 1)
+ z *= 10;
+ if (nd++ < 9)
+ y = 10*y + c;
+ else if (nd <= DBL_DIG + 1)
+ z = 10*z + c;
nz = 0;
}
}
@@ -691,12 +716,20 @@ _DEFUN (_strtod_r, (ptr, s00, se),
/* Put digits into bd: true value = bd * 10^e */
bd0 = s2b(ptr, s0, nd0, nd, y);
+ if (bd0 == NULL)
+ goto ovfl;
for(;;) {
bd = Balloc(ptr,bd0->_k);
+ if (bd == NULL)
+ goto ovfl;
Bcopy(bd, bd0);
bb = d2b(ptr,dval(rv), &bbe, &bbbits); /* rv = bb * 2^bbe */
+ if (bb == NULL)
+ goto ovfl;
bs = i2b(ptr,1);
+ if (bs == NULL)
+ goto ovfl;
if (e >= 0) {
bb2 = bb5 = 0;
@@ -716,12 +749,19 @@ _DEFUN (_strtod_r, (ptr, s00, se),
bs2++;
#endif
#ifdef Avoid_Underflow
+ Lsb = LSB;
+ Lsb1 = 0;
j = bbe - scale;
i = j + bbbits - 1; /* logb(rv) */
- if (i < Emin) /* denormal */
- j += P - Emin;
- else
- j = P + 1 - bbbits;
+ j = P + 1 - bbbits;
+ if (i < Emin) { /* denormal */
+ i = Emin - i;
+ j -= i;
+ if (i < 32)
+ Lsb <<= i;
+ else
+ Lsb1 = Lsb << (i-32);
+ }
#else /*Avoid_Underflow*/
#ifdef Sudden_Underflow
#ifdef IBM
@@ -753,19 +793,37 @@ _DEFUN (_strtod_r, (ptr, s00, se),
}
if (bb5 > 0) {
bs = pow5mult(ptr, bs, bb5);
+ if (bs == NULL)
+ goto ovfl;
bb1 = mult(ptr, bs, bb);
+ if (bb1 == NULL)
+ goto ovfl;
Bfree(ptr, bb);
bb = bb1;
}
- if (bb2 > 0)
+ if (bb2 > 0) {
bb = lshift(ptr, bb, bb2);
- if (bd5 > 0)
+ if (bb == NULL)
+ goto ovfl;
+ }
+ if (bd5 > 0) {
bd = pow5mult(ptr, bd, bd5);
- if (bd2 > 0)
+ if (bd == NULL)
+ goto ovfl;
+ }
+ if (bd2 > 0) {
bd = lshift(ptr, bd, bd2);
- if (bs2 > 0)
+ if (bd == NULL)
+ goto ovfl;
+ }
+ if (bs2 > 0) {
bs = lshift(ptr, bs, bs2);
+ if (bs == NULL)
+ goto ovfl;
+ }
delta = diff(ptr, bb, bd);
+ if (delta == NULL)
+ goto ovfl;
dsign = delta->_sign;
delta->_sign = 0;
i = cmp(delta, bs);
@@ -789,7 +847,7 @@ _DEFUN (_strtod_r, (ptr, s00, se),
else if (!dsign) {
adj = -1.;
if (!dword1(rv)
- && !(dword0(rv) & Frac_mask)) {
+ && !(dword0(rv) & Frac_mask)) {
y = dword0(rv) & Exp_mask;
#ifdef Avoid_Underflow
if (!scale || y > 2*P*Exp_msk1)
@@ -852,7 +910,9 @@ _DEFUN (_strtod_r, (ptr, s00, se),
#endif /*Sudden_Underflow*/
#endif /*Avoid_Underflow*/
adj *= ulp(dval(rv));
- if (dsign)
+ if (dsign) {
+ if (dword0(rv) == Big0 && dword1(rv) == Big1)
+ goto ovfl;
dval(rv) += adj;
else
dval(rv) -= adj;
@@ -902,6 +962,8 @@ _DEFUN (_strtod_r, (ptr, s00, se),
#endif
0xffffffff)) {
/*boundary case -- increment exponent*/
+ if (dword0(rv) == Big0 && dword1(rv) == Big1)
+ goto ovfl;
dword0(rv) = (dword0(rv) & Exp_mask)
+ Exp_msk1
#ifdef IBM
@@ -960,14 +1022,31 @@ _DEFUN (_strtod_r, (ptr, s00, se),
#endif
}
#ifndef ROUND_BIASED
+#ifdef Avoid_Underflow
+ if (Lsb1) {
+ if (!(dword0(rv) & Lsb1))
+ break;
+ }
+ else if (!(dword1(rv) & Lsb))
+ break;
+#else
if (!(dword1(rv) & LSB))
break;
#endif
+#endif
if (dsign)
+#ifdef Avoid_Underflow
+ dval(rv) += sulp(rv, scale);
+#else
dval(rv) += ulp(dval(rv));
+#endif
#ifndef ROUND_BIASED
else {
+#ifdef Avoid_Underflow
+ dval(rv) -= sulp(rv, scale);
+#else
dval(rv) -= ulp(dval(rv));
+#endif
#ifndef Sudden_Underflow
if (!dval(rv))
goto undfl;
@@ -1044,7 +1123,7 @@ _DEFUN (_strtod_r, (ptr, s00, se),
#ifdef Avoid_Underflow
if (scale && y <= 2*P*Exp_msk1) {
if (aadj <= 0x7fffffff) {
- if ((z = aadj) <= 0)
+ if ((z = aadj) == 0)
z = 1;
aadj = z;
dval(aadj1) = dsign ? aadj : -aadj;
diff --git a/newlib/libc/stdlib/wcrtomb.c b/newlib/libc/stdlib/wcrtomb.c
index 60e0d89c8..b634c23ce 100644
--- a/newlib/libc/stdlib/wcrtomb.c
+++ b/newlib/libc/stdlib/wcrtomb.c
@@ -50,25 +50,26 @@ _DEFUN (wcrtomb, (s, wc, ps),
return _wcrtomb_r (_REENT, s, wc, ps);
#else
int retval = 0;
+ struct _reent *reent = _REENT;
char buf[10];
#ifdef _MB_CAPABLE
if (ps == NULL)
{
- _REENT_CHECK_MISC(_REENT);
- ps = &(_REENT_WCRTOMB_STATE(_REENT));
+ _REENT_CHECK_MISC(reent);
+ ps = &(_REENT_WCRTOMB_STATE(reent));
}
#endif
if (s == NULL)
- retval = __wctomb (_REENT, buf, L'\0', __locale_charset (), ps);
+ retval = __wctomb (reent, buf, L'\0', __locale_charset (), ps);
else
- retval = __wctomb (_REENT, s, wc, __locale_charset (), ps);
+ retval = __wctomb (reent, s, wc, __locale_charset (), ps);
if (retval == -1)
{
ps->__count = 0;
- _REENT->_errno = EILSEQ;
+ reent->_errno = EILSEQ;
return (size_t)(-1);
}
else
diff --git a/newlib/libc/stdlib/wctob.c b/newlib/libc/stdlib/wctob.c
index d97c01f24..eebaec84f 100644
--- a/newlib/libc/stdlib/wctob.c
+++ b/newlib/libc/stdlib/wctob.c
@@ -8,6 +8,7 @@
int
wctob (wint_t wc)
{
+ struct _reent *reent;
mbstate_t mbs;
unsigned char pmb[MB_LEN_MAX];
@@ -17,8 +18,9 @@ wctob (wint_t wc)
/* Put mbs in initial state. */
memset (&mbs, '\0', sizeof (mbs));
- _REENT_CHECK_MISC(_REENT);
+ reent = _REENT;
+ _REENT_CHECK_MISC(reent);
- return __wctomb (_REENT, (char *) pmb, wc, __locale_charset (), &mbs) == 1
+ return __wctomb (reent, (char *) pmb, wc, __locale_charset (), &mbs) == 1
? (int) pmb[0] : EOF;
}
diff --git a/newlib/libc/stdlib/wctomb.c b/newlib/libc/stdlib/wctomb.c
index 9e82eaaba..8d4ceb8ad 100644
--- a/newlib/libc/stdlib/wctomb.c
+++ b/newlib/libc/stdlib/wctomb.c
@@ -57,10 +57,12 @@ _DEFUN (wctomb, (s, wchar),
wchar_t wchar)
{
#ifdef _MB_CAPABLE
- _REENT_CHECK_MISC(_REENT);
+ struct _reent *reent = _REENT;
- return __wctomb (_REENT, s, wchar, __locale_charset (),
- &(_REENT_WCTOMB_STATE(_REENT)));
+ _REENT_CHECK_MISC(reent);
+
+ return __wctomb (reent, s, wchar, __locale_charset (),
+ &(_REENT_WCTOMB_STATE(reent)));
#else /* not _MB_CAPABLE */
if (s == NULL)
return 0;
diff --git a/newlib/libc/string/strtok.c b/newlib/libc/string/strtok.c
index 7640fb73d..01bb09046 100644
--- a/newlib/libc/string/strtok.c
+++ b/newlib/libc/string/strtok.c
@@ -95,7 +95,9 @@ _DEFUN (strtok, (s, delim),
register char *s _AND
register const char *delim)
{
- _REENT_CHECK_MISC(_REENT);
- return __strtok_r (s, delim, &(_REENT_STRTOK_LAST(_REENT)), 1);
+ struct _reent *reent = _REENT;
+
+ _REENT_CHECK_MISC(reent);
+ return __strtok_r (s, delim, &(_REENT_STRTOK_LAST(reent)), 1);
}
#endif
diff --git a/newlib/libc/sys/epiphany/Makefile.am b/newlib/libc/sys/epiphany/Makefile.am
deleted file mode 100644
index c95cca536..000000000
--- a/newlib/libc/sys/epiphany/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2011, Adapteva, Inc.
-# All rights reserved.
-
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Adapteva nor the names of its contributors may be
-# used to endorse or promote products derived from this software without
-# specific prior written permission.
-
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-
-AM_CCASFLAGS = $(INCLUDES)
-
-noinst_LIBRARIES = lib.a
-
-# crt0.o comes from libgloss
-lib_a_SOURCES = e_printf.c
-lib_a_CCASFLAGS = $(AM_CCASFLAGS)
-lib_a_CFLAGS = $(AM_CFLAGS)
-
-ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
-CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libc/sys/epiphany/Makefile.in b/newlib/libc/sys/epiphany/Makefile.in
deleted file mode 100644
index e6a7a64e5..000000000
--- a/newlib/libc/sys/epiphany/Makefile.in
+++ /dev/null
@@ -1,466 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2011, Adapteva, Inc.
-# All rights reserved.
-
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Adapteva nor the names of its contributors may be
-# used to endorse or promote products derived from this software without
-# specific prior written permission.
-
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/../../../../mkinstalldirs
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-lib_a_AR = $(AR) $(ARFLAGS)
-lib_a_LIBADD =
-am_lib_a_OBJECTS = lib_a-e_printf.$(OBJEXT)
-lib_a_OBJECTS = $(am_lib_a_OBJECTS)
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(lib_a_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-ETAGS = etags
-CTAGS = ctags
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
-NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-READELF = @READELF@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-aext = @aext@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libm_machine_dir = @libm_machine_dir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lpfx = @lpfx@
-machine_dir = @machine_dir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-newlib_basedir = @newlib_basedir@
-oext = @oext@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_dir = @sys_dir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = cygnus
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-AM_CCASFLAGS = $(INCLUDES)
-noinst_LIBRARIES = lib.a
-
-# crt0.o comes from libgloss
-lib_a_SOURCES = e_printf.c
-lib_a_CCASFLAGS = $(AM_CCASFLAGS)
-lib_a_CFLAGS = $(AM_CFLAGS)
-ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
-CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --cygnus Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES)
- -rm -f lib.a
- $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
- $(RANLIB) lib.a
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-lib_a-e_printf.o: e_printf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-e_printf.o `test -f 'e_printf.c' || echo '$(srcdir)/'`e_printf.c
-
-lib_a-e_printf.obj: e_printf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-e_printf.obj `if test -f 'e_printf.c'; then $(CYGPATH_W) 'e_printf.c'; else $(CYGPATH_W) '$(srcdir)/e_printf.c'; fi`
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-am
-all-am: Makefile $(LIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-generic clean-noinstLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-tags dvi dvi-am \
- html html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/newlib/libc/sys/epiphany/aclocal.m4 b/newlib/libc/sys/epiphany/aclocal.m4
deleted file mode 100644
index 18dab02aa..000000000
--- a/newlib/libc/sys/epiphany/aclocal.m4
+++ /dev/null
@@ -1,1012 +0,0 @@
-# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.6], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.6])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 9
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 12
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 16
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
-# 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_MAINTAINER_MODE([DEFAULT-MODE])
-# ----------------------------------
-# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless `enable' is passed literally.
-# For symmetry, `disable' may be passed as well. Anyway, the user
-# can override the default with the --enable/--disable switch.
-AC_DEFUN([AM_MAINTAINER_MODE],
-[m4_case(m4_default([$1], [disable]),
- [enable], [m4_define([am_maintainer_other], [disable])],
- [disable], [m4_define([am_maintainer_other], [enable])],
- [m4_define([am_maintainer_other], [enable])
- m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode's default is 'disable' unless 'enable' is passed
- AC_ARG_ENABLE([maintainer-mode],
-[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
- AC_MSG_RESULT([$USE_MAINTAINER_MODE])
- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST([MAINT])dnl
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([../../../acinclude.m4])
diff --git a/newlib/libc/sys/epiphany/configure b/newlib/libc/sys/epiphany/configure
deleted file mode 100755
index 8d6b2ca37..000000000
--- a/newlib/libc/sys/epiphany/configure
+++ /dev/null
@@ -1,4748 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for newlib 2.0.0.
-#
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='newlib'
-PACKAGE_TARNAME='newlib'
-PACKAGE_VERSION='2.0.0'
-PACKAGE_STRING='newlib 2.0.0'
-PACKAGE_BUGREPORT=''
-PACKAGE_URL=''
-
-ac_unique_file="e_printf.c"
-ac_subst_vars='LTLIBOBJS
-LIBOBJS
-sys_dir
-machine_dir
-libm_machine_dir
-lpfx
-aext
-oext
-OBJEXT
-USE_LIBTOOL_FALSE
-USE_LIBTOOL_TRUE
-ELIX_LEVEL_4_FALSE
-ELIX_LEVEL_4_TRUE
-ELIX_LEVEL_3_FALSE
-ELIX_LEVEL_3_TRUE
-ELIX_LEVEL_2_FALSE
-ELIX_LEVEL_2_TRUE
-ELIX_LEVEL_1_FALSE
-ELIX_LEVEL_1_TRUE
-ELIX_LEVEL_0_FALSE
-ELIX_LEVEL_0_TRUE
-LDFLAGS
-NO_INCLUDE_LIST
-NEWLIB_CFLAGS
-CCASFLAGS
-CCAS
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-READELF
-RANLIB
-AR
-AS
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-CC
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-newlib_basedir
-MAY_SUPPLY_SYSCALLS_FALSE
-MAY_SUPPLY_SYSCALLS_TRUE
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_multilib
-enable_target_optspace
-enable_malloc_debugging
-enable_newlib_multithread
-enable_newlib_iconv
-enable_newlib_elix_level
-enable_newlib_io_float
-enable_newlib_supplied_syscalls
-enable_dependency_tracking
-enable_maintainer_mode
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CCAS
-CCASFLAGS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures newlib 2.0.0 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/newlib]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of newlib 2.0.0:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-multilib build many library versions (default)
- --enable-target-optspace optimize for space
- --enable-malloc-debugging indicate malloc debugging requested
- --enable-newlib-multithread enable support for multiple threads
- --enable-newlib-iconv enable iconv library support
- --enable-newlib-elix-level supply desired elix library level (1-4)
- --disable-newlib-io-float disable printf/scanf family float support
- --disable-newlib-supplied-syscalls disable newlib from supplying syscalls
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
-
-Some influential environment variables:
- CCAS assembler compiler command (defaults to CC)
- CCASFLAGS assembler compiler flags (defaults to CFLAGS)
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-newlib configure 2.0.0
-generated by GNU Autoconf 2.68
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by newlib $as_me 2.0.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-ac_aux_dir=
-for ac_dir in ../../../.. "$srcdir"/../../../..; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../../.. \"$srcdir\"/../../../.." "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-am__api_version='1.11'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error $? "bad value ${enableval} for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-# Check whether --enable-target-optspace was given.
-if test "${enable_target_optspace+set}" = set; then :
- enableval=$enable_target_optspace; case "${enableval}" in
- yes) target_optspace=yes ;;
- no) target_optspace=no ;;
- *) as_fn_error $? "bad value ${enableval} for target-optspace option" "$LINENO" 5 ;;
- esac
-else
- target_optspace=
-fi
-
-# Check whether --enable-malloc-debugging was given.
-if test "${enable_malloc_debugging+set}" = set; then :
- enableval=$enable_malloc_debugging; case "${enableval}" in
- yes) malloc_debugging=yes ;;
- no) malloc_debugging=no ;;
- *) as_fn_error $? "bad value ${enableval} for malloc-debugging option" "$LINENO" 5 ;;
- esac
-else
- malloc_debugging=
-fi
-
-# Check whether --enable-newlib-multithread was given.
-if test "${enable_newlib_multithread+set}" = set; then :
- enableval=$enable_newlib_multithread; case "${enableval}" in
- yes) newlib_multithread=yes ;;
- no) newlib_multithread=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-multithread option" "$LINENO" 5 ;;
- esac
-else
- newlib_multithread=yes
-fi
-
-# Check whether --enable-newlib-iconv was given.
-if test "${enable_newlib_iconv+set}" = set; then :
- enableval=$enable_newlib_iconv; if test "${newlib_iconv+set}" != set; then
- case "${enableval}" in
- yes) newlib_iconv=yes ;;
- no) newlib_iconv=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-iconv option" "$LINENO" 5 ;;
- esac
- fi
-else
- newlib_iconv=${newlib_iconv}
-fi
-
-# Check whether --enable-newlib-elix-level was given.
-if test "${enable_newlib_elix_level+set}" = set; then :
- enableval=$enable_newlib_elix_level; case "${enableval}" in
- 0) newlib_elix_level=0 ;;
- 1) newlib_elix_level=1 ;;
- 2) newlib_elix_level=2 ;;
- 3) newlib_elix_level=3 ;;
- 4) newlib_elix_level=4 ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-elix-level option" "$LINENO" 5 ;;
- esac
-else
- newlib_elix_level=0
-fi
-
-# Check whether --enable-newlib-io-float was given.
-if test "${enable_newlib_io_float+set}" = set; then :
- enableval=$enable_newlib_io_float; case "${enableval}" in
- yes) newlib_io_float=yes ;;
- no) newlib_io_float=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-io-float option" "$LINENO" 5 ;;
- esac
-else
- newlib_io_float=yes
-fi
-
-# Check whether --enable-newlib-supplied-syscalls was given.
-if test "${enable_newlib_supplied_syscalls+set}" = set; then :
- enableval=$enable_newlib_supplied_syscalls; case "${enableval}" in
- yes) newlib_may_supply_syscalls=yes ;;
- no) newlib_may_supply_syscalls=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-supplied-syscalls option" "$LINENO" 5 ;;
- esac
-else
- newlib_may_supply_syscalls=yes
-fi
-
- if test x${newlib_may_supply_syscalls} = xyes; then
- MAY_SUPPLY_SYSCALLS_TRUE=
- MAY_SUPPLY_SYSCALLS_FALSE='#'
-else
- MAY_SUPPLY_SYSCALLS_TRUE='#'
- MAY_SUPPLY_SYSCALLS_FALSE=
-fi
-
-
-
-test -z "${with_target_subdir}" && with_target_subdir=.
-
-if test "${srcdir}" = "."; then
- if test "${with_target_subdir}" != "."; then
- newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
- else
- newlib_basedir="${srcdir}/${with_multisrctop}../../.."
- fi
-else
- newlib_basedir="${srcdir}/../../.."
-fi
-
-
-
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='newlib'
- VERSION='2.0.0'
-
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-# FIXME: We temporarily define our own version of AC_PROG_CC. This is
-# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
-# are probably using a cross compiler, which will not be able to fully
-# link an executable. This should really be fixed in autoconf
-# itself.
-
-
-
-
-
-
-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU C" >&5
-$as_echo_n "checking whether we are using GNU C... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_c_compiler_gnu=yes
-else
- ac_cv_c_compiler_gnu=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-
-if test $ac_cv_c_compiler_gnu = yes; then
- GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AS="${ac_tool_prefix}as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AS"; then
- ac_ct_AS=$AS
- # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AS"; then
- ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AS="as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AS" = x; then
- AS=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AS=$ac_ct_AS
- fi
-else
- AS="$ac_cv_prog_AS"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AR" = x; then
- AR=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
-set dummy ${ac_tool_prefix}readelf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_READELF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$READELF"; then
- ac_cv_prog_READELF="$READELF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_READELF="${ac_tool_prefix}readelf"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-READELF=$ac_cv_prog_READELF
-if test -n "$READELF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
-$as_echo "$READELF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_READELF"; then
- ac_ct_READELF=$READELF
- # Extract the first word of "readelf", so it can be a program name with args.
-set dummy readelf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_READELF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_READELF"; then
- ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_READELF="readelf"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
-if test -n "$ac_ct_READELF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
-$as_echo "$ac_ct_READELF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_READELF" = x; then
- READELF=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- READELF=$ac_ct_READELF
- fi
-else
- READELF="$ac_cv_prog_READELF"
-fi
-
-
-
-
-# Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13. */
-ac_given_INSTALL=$INSTALL
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-# By default we simply use the C compiler to build assembly code.
-
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-
-
-
-
-# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
-# at least currently, we never actually build a program, so we never
-# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
-# fails, because we are probably configuring with a cross compiler
-# which can't create executables. So we include AC_EXEEXT to keep
-# automake happy, but we don't execute it, since we don't care about
-# the result.
-if false; then
-
- dummy_var=1
-fi
-
-. ${newlib_basedir}/configure.host
-
-newlib_cflags="${newlib_cflags} -fno-builtin"
-
-NEWLIB_CFLAGS=${newlib_cflags}
-
-
-NO_INCLUDE_LIST=${noinclude}
-
-
-LDFLAGS=${ldflags}
-
-
- if test x${newlib_elix_level} = x0; then
- ELIX_LEVEL_0_TRUE=
- ELIX_LEVEL_0_FALSE='#'
-else
- ELIX_LEVEL_0_TRUE='#'
- ELIX_LEVEL_0_FALSE=
-fi
-
- if test x${newlib_elix_level} = x1; then
- ELIX_LEVEL_1_TRUE=
- ELIX_LEVEL_1_FALSE='#'
-else
- ELIX_LEVEL_1_TRUE='#'
- ELIX_LEVEL_1_FALSE=
-fi
-
- if test x${newlib_elix_level} = x2; then
- ELIX_LEVEL_2_TRUE=
- ELIX_LEVEL_2_FALSE='#'
-else
- ELIX_LEVEL_2_TRUE='#'
- ELIX_LEVEL_2_FALSE=
-fi
-
- if test x${newlib_elix_level} = x3; then
- ELIX_LEVEL_3_TRUE=
- ELIX_LEVEL_3_FALSE='#'
-else
- ELIX_LEVEL_3_TRUE='#'
- ELIX_LEVEL_3_FALSE=
-fi
-
- if test x${newlib_elix_level} = x4; then
- ELIX_LEVEL_4_TRUE=
- ELIX_LEVEL_4_FALSE='#'
-else
- ELIX_LEVEL_4_TRUE='#'
- ELIX_LEVEL_4_FALSE=
-fi
-
-
- if test x${use_libtool} = xyes; then
- USE_LIBTOOL_TRUE=
- USE_LIBTOOL_FALSE='#'
-else
- USE_LIBTOOL_TRUE='#'
- USE_LIBTOOL_FALSE=
-fi
-
-
-# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we
-# use oext, which is set in configure.host based on the target platform.
-OBJEXT=${oext}
-
-
-
-
-
-
-
-
-
-
-
-ac_config_files="$ac_config_files Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
-t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then
- as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_0_TRUE}" && test -z "${ELIX_LEVEL_0_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_0\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_1_TRUE}" && test -z "${ELIX_LEVEL_1_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_1\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_2_TRUE}" && test -z "${ELIX_LEVEL_2_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_2\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_3_TRUE}" && test -z "${ELIX_LEVEL_3_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_3\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_4_TRUE}" && test -z "${ELIX_LEVEL_4_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_4\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then
- as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by newlib $as_me 2.0.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-newlib config.status 2.0.0
-configured by $0, generated by GNU Autoconf 2.68,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h | --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-
-eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/newlib/libc/sys/epiphany/configure.in b/newlib/libc/sys/epiphany/configure.in
deleted file mode 100644
index 0e08f6e03..000000000
--- a/newlib/libc/sys/epiphany/configure.in
+++ /dev/null
@@ -1,41 +0,0 @@
-dnl This is the newlib/libc/sys/epiphany configure.in file.
-
-dnl Copyright (c) 2011, Adapteva, Inc.
-dnl All rights reserved.
-
-dnl Redistribution and use in source and binary forms, with or without
-dnl modification, are permitted provided that the following conditions are met:
-dnl * Redistributions of source code must retain the above copyright notice,
-dnl this list of conditions and the following disclaimer.
-dnl * Redistributions in binary form must reproduce the above copyright
-dnl notice, this list of conditions and the following disclaimer in the
-dnl documentation and/or other materials provided with the distribution.
-dnl * Neither the name of Adapteva nor the names of its contributors may be
-dnl used to endorse or promote products derived from this software without
-dnl specific prior written permission.
-
-dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-dnl AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-dnl ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-dnl POSSIBILITY OF SUCH DAMAGE.
-
-dnl Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.59)
-AC_INIT([newlib],[NEWLIB_VERSION])
-AC_CONFIG_SRCDIR([e_printf.c])
-
-dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
-AC_CONFIG_AUX_DIR(../../../..)
-
-NEWLIB_CONFIGURE(../../..)
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/newlib/libc/sys/epiphany/e_printf.c b/newlib/libc/sys/epiphany/e_printf.c
deleted file mode 100644
index a93c34320..000000000
--- a/newlib/libc/sys/epiphany/e_printf.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* e_printf.c
-
- Copyright (c) 2011, Adapteva, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of Adapteva nor the names of its contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE. */
-#include <stdarg.h>
-#include <string.h>
-
-
-
-
-int trap_7( char *s , int _bsize, int _argsize) {
- volatile register void* buff_adrr asm("r0") = s;
- volatile register unsigned bsize asm("r1") = _bsize;
- volatile register unsigned argsize asm("r2") = _argsize;
- volatile register int result asm("r0");
- __asm__ __volatile__ ("trap 7" : "=r" (result) : "r" (buff_adrr), "r" (bsize) , "r" (argsize));
- return result;
-
-}
-
-//#include <stdio.h>
-//#include <string.h>
-//#include <stdlib.h>
-
-volatile static int*fp_int =0;
-volatile int getIntFromFloat(float *f) {
- fp_int= (int*)f;
-
- return *fp_int;
-}
-
-
-int e_printf(const char *fmt, ...) {
-
- char buf[256],*p,*fmt_p;
- va_list args;
- int percentMet=0;
- int pos = 0;
-
- char *v_arg_s;
- unsigned v_arg_int;
- float fl_f[1];
-
- unsigned fmt_len = strnlen(fmt,128);
-
- fmt_p = (char*)fmt;
-
- //printf("---- 111 +++ %d \n", strlen(fmt));
-
- va_start(args, fmt);
-
- p = (char*)buf;
-
- strcpy(buf,fmt);
- pos =fmt_len;
- p[pos] = '\0';
- pos++;
-
- va_start(args, fmt);
-
- while (*fmt_p) {
-
-// putchar(*p);
-// puts("");
-
- if(*fmt_p == '%') {
- percentMet=1;
- }
- if(*fmt_p == 's' && percentMet == 1 ) {
- percentMet=0;
- v_arg_s = va_arg(args, char *);
- if (!v_arg_s) v_arg_s = "<NULL>";
-
- strcpy(p + pos , v_arg_s );
- pos+=strlen(v_arg_s);
-
- p[pos] = '\0';
- pos++;
- }
-
- if((*fmt_p == 'i' || *fmt_p == 'd' || *fmt_p == 'u' || *fmt_p == 'x' || *fmt_p == 'f' ) && percentMet == 1 ) {
- percentMet=0;
- if(*fmt_p == 'f' ) {
- fl_f[0] = (float)va_arg(args, double);
- //printf("v_arg_ float --- %f \n", fl_f[0]);
- //printf("v_arg_ p --- %x \n", *( (unsigned *)fl_f));
-
- v_arg_int = getIntFromFloat (fl_f);
-
- //v_arg_int = 0;
-
- } else {
- v_arg_int = (int)va_arg(args, int);
- }
-
-// if(*fmt_p == 'd') {
-// printf("v_arg_int --- %d \n", v_arg_int);
-// }
-// if(*fmt_p == 'x') {
-// printf("v_arg_int --- %x \n", v_arg_int);
-// }
-// if(*fmt_p == 'f') {
-// printf("fff++v_arg_int --- %x \n", v_arg_int);
-// fl = (float*)&v_arg_int;
-// printf("fff++ v_arg_float --- %f \n", *fl);
-// }
-
- *(p + pos) = ((v_arg_int>>24) & 0xff);
- pos++;
- *(p + pos) = ((v_arg_int>>16) & 0xff);
- pos++;
- *(p + pos) = ((v_arg_int>>8) & 0xff);
- pos++;
- *(p + pos) = ((v_arg_int>>0) & 0xff);
- pos++;
- }
-
- fmt_p++;
- }
-
- va_end(args);
-
- //printf(" +++ %d %d \n" , strlen(fmt), pos);
-
- return trap_7((char*)buf ,fmt_len, pos) ;
- //return 1;
-}
diff --git a/newlib/libc/time/asctime.c b/newlib/libc/time/asctime.c
index 4c4640861..024310bbf 100644
--- a/newlib/libc/time/asctime.c
+++ b/newlib/libc/time/asctime.c
@@ -57,8 +57,10 @@ char *
_DEFUN (asctime, (tim_p),
_CONST struct tm *tim_p)
{
- _REENT_CHECK_ASCTIME_BUF(_REENT);
- return asctime_r (tim_p, _REENT_ASCTIME_BUF(_REENT));
+ struct _reent *reent = _REENT;
+
+ _REENT_CHECK_ASCTIME_BUF(reent);
+ return asctime_r (tim_p, _REENT_ASCTIME_BUF(reent));
}
#endif
diff --git a/newlib/libc/time/gmtime.c b/newlib/libc/time/gmtime.c
index 4d3dfff4c..141d20327 100644
--- a/newlib/libc/time/gmtime.c
+++ b/newlib/libc/time/gmtime.c
@@ -61,8 +61,10 @@ struct tm *
_DEFUN (gmtime, (tim_p),
_CONST time_t * tim_p)
{
- _REENT_CHECK_TM(_REENT);
- return gmtime_r (tim_p, (struct tm *)_REENT_TM(_REENT));
+ struct _reent *reent = _REENT;
+
+ _REENT_CHECK_TM(reent);
+ return gmtime_r (tim_p, (struct tm *)_REENT_TM(reent));
}
#endif
diff --git a/newlib/libc/time/lcltime.c b/newlib/libc/time/lcltime.c
index 399ab6901..16162bfb0 100644
--- a/newlib/libc/time/lcltime.c
+++ b/newlib/libc/time/lcltime.c
@@ -53,8 +53,10 @@ struct tm *
_DEFUN (localtime, (tim_p),
_CONST time_t * tim_p)
{
- _REENT_CHECK_TM(_REENT);
- return localtime_r (tim_p, (struct tm *)_REENT_TM(_REENT));
+ struct _reent *reent = _REENT;
+
+ _REENT_CHECK_TM(reent);
+ return localtime_r (tim_p, (struct tm *)_REENT_TM(reent));
}
#endif
diff --git a/newlib/libm/libm.texinfo b/newlib/libm/libm.texinfo
index 49e66e97b..147dc7ec6 100644
--- a/newlib/libm/libm.texinfo
+++ b/newlib/libm/libm.texinfo
@@ -86,10 +86,10 @@ into another language, under the above conditions for modified versions.
@end titlepage
@end iftex
-@ifinfo
+@ifnottex
@node Top
@top LIBM
-@end ifinfo
+@end ifnottex
@menu
* Math:: The mathematical functions (`math.h').
@@ -135,7 +135,7 @@ For such platforms, the long double math functions are implemented as calls to t
@printindex cp
@tex
-% I think something like @colophon should be in texinfo. In the
+% I think something like @@colophon should be in texinfo. In the
% meantime:
\long\def\colophon{\hbox to0pt{}\vfill
\centerline{The body of this manual is set in}
@@ -146,7 +146,7 @@ For such platforms, the long double math functions are implemented as calls to t
\centerline{{\sl\fontname\tensl\/}}
\centerline{are used for emphasis.}\vfill}
\page\colophon
-% Blame: pesch@cygnus.com, 28mar91.
+% Blame: pesch@@cygnus.com, 28mar91.
@end tex
@contents
diff --git a/newlib/libm/machine/aarch64/Makefile.am b/newlib/libm/machine/aarch64/Makefile.am
deleted file mode 100644
index 22706a95f..000000000
--- a/newlib/libm/machine/aarch64/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-
-INCLUDES = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
- $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-
-LIB_SOURCES = \
- s_ceil.c \
- s_floor.c \
- s_fma.c \
- s_fmax.c \
- s_fmin.c \
- s_llrint.c \
- s_llround.c \
- s_lrint.c \
- s_lround.c \
- s_nearbyint.c \
- s_rint.c \
- s_round.c \
- s_trunc.c \
- sf_ceil.c \
- sf_floor.c \
- sf_fma.c \
- sf_fmax.c \
- sf_fmin.c \
- sf_llrint.c \
- sf_llround.c \
- sf_lrint.c \
- sf_lround.c \
- sf_nearbyint.c \
- sf_rint.c \
- sf_round.c \
- sf_trunc.c
-
-noinst_LIBRARIES = lib.a
-lib_a_SOURCES = $(LIB_SOURCES)
-lib_a_CFLAGS = $(AM_CFLAGS)
-lib_a_CCASFLAGS = $(AM_CCASFLAGS)
-noinst_DATA =
-
-include $(srcdir)/../../../Makefile.shared
-
-ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
-CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libm/machine/aarch64/Makefile.in b/newlib/libm/machine/aarch64/Makefile.in
deleted file mode 100644
index 0e74c750b..000000000
--- a/newlib/libm/machine/aarch64/Makefile.in
+++ /dev/null
@@ -1,640 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = $(srcdir)/../../../Makefile.shared $(srcdir)/Makefile.in \
- $(srcdir)/Makefile.am $(top_srcdir)/configure \
- $(am__configure_deps) $(srcdir)/../../../../mkinstalldirs
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-lib_a_AR = $(AR) $(ARFLAGS)
-lib_a_LIBADD =
-am__objects_1 = lib_a-s_ceil.$(OBJEXT) lib_a-s_floor.$(OBJEXT) \
- lib_a-s_fma.$(OBJEXT) lib_a-s_fmax.$(OBJEXT) \
- lib_a-s_fmin.$(OBJEXT) lib_a-s_llrint.$(OBJEXT) \
- lib_a-s_llround.$(OBJEXT) lib_a-s_lrint.$(OBJEXT) \
- lib_a-s_lround.$(OBJEXT) lib_a-s_nearbyint.$(OBJEXT) \
- lib_a-s_rint.$(OBJEXT) lib_a-s_round.$(OBJEXT) \
- lib_a-s_trunc.$(OBJEXT) lib_a-sf_ceil.$(OBJEXT) \
- lib_a-sf_floor.$(OBJEXT) lib_a-sf_fma.$(OBJEXT) \
- lib_a-sf_fmax.$(OBJEXT) lib_a-sf_fmin.$(OBJEXT) \
- lib_a-sf_llrint.$(OBJEXT) lib_a-sf_llround.$(OBJEXT) \
- lib_a-sf_lrint.$(OBJEXT) lib_a-sf_lround.$(OBJEXT) \
- lib_a-sf_nearbyint.$(OBJEXT) lib_a-sf_rint.$(OBJEXT) \
- lib_a-sf_round.$(OBJEXT) lib_a-sf_trunc.$(OBJEXT)
-am_lib_a_OBJECTS = $(am__objects_1)
-lib_a_OBJECTS = $(am_lib_a_OBJECTS)
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(lib_a_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-DATA = $(noinst_DATA)
-ETAGS = etags
-CTAGS = ctags
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
-NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-READELF = @READELF@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-aext = @aext@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libm_machine_dir = @libm_machine_dir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lpfx = @lpfx@
-machine_dir = @machine_dir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-newlib_basedir = @newlib_basedir@
-oext = @oext@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_dir = @sys_dir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = cygnus
-INCLUDES = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \
- $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-
-LIB_SOURCES = \
- s_ceil.c \
- s_floor.c \
- s_fma.c \
- s_fmax.c \
- s_fmin.c \
- s_llrint.c \
- s_llround.c \
- s_lrint.c \
- s_lround.c \
- s_nearbyint.c \
- s_rint.c \
- s_round.c \
- s_trunc.c \
- sf_ceil.c \
- sf_floor.c \
- sf_fma.c \
- sf_fmax.c \
- sf_fmin.c \
- sf_llrint.c \
- sf_llround.c \
- sf_lrint.c \
- sf_lround.c \
- sf_nearbyint.c \
- sf_rint.c \
- sf_round.c \
- sf_trunc.c
-
-noinst_LIBRARIES = lib.a
-lib_a_SOURCES = $(LIB_SOURCES)
-lib_a_CFLAGS = $(AM_CFLAGS)
-lib_a_CCASFLAGS = $(AM_CCASFLAGS)
-noinst_DATA =
-ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
-CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../../Makefile.shared $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --cygnus Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-$(srcdir)/../../../Makefile.shared:
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES)
- -rm -f lib.a
- $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
- $(RANLIB) lib.a
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-lib_a-s_ceil.o: s_ceil.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_ceil.o `test -f 's_ceil.c' || echo '$(srcdir)/'`s_ceil.c
-
-lib_a-s_ceil.obj: s_ceil.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_ceil.obj `if test -f 's_ceil.c'; then $(CYGPATH_W) 's_ceil.c'; else $(CYGPATH_W) '$(srcdir)/s_ceil.c'; fi`
-
-lib_a-s_floor.o: s_floor.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_floor.o `test -f 's_floor.c' || echo '$(srcdir)/'`s_floor.c
-
-lib_a-s_floor.obj: s_floor.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_floor.obj `if test -f 's_floor.c'; then $(CYGPATH_W) 's_floor.c'; else $(CYGPATH_W) '$(srcdir)/s_floor.c'; fi`
-
-lib_a-s_fma.o: s_fma.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_fma.o `test -f 's_fma.c' || echo '$(srcdir)/'`s_fma.c
-
-lib_a-s_fma.obj: s_fma.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_fma.obj `if test -f 's_fma.c'; then $(CYGPATH_W) 's_fma.c'; else $(CYGPATH_W) '$(srcdir)/s_fma.c'; fi`
-
-lib_a-s_fmax.o: s_fmax.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_fmax.o `test -f 's_fmax.c' || echo '$(srcdir)/'`s_fmax.c
-
-lib_a-s_fmax.obj: s_fmax.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_fmax.obj `if test -f 's_fmax.c'; then $(CYGPATH_W) 's_fmax.c'; else $(CYGPATH_W) '$(srcdir)/s_fmax.c'; fi`
-
-lib_a-s_fmin.o: s_fmin.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_fmin.o `test -f 's_fmin.c' || echo '$(srcdir)/'`s_fmin.c
-
-lib_a-s_fmin.obj: s_fmin.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_fmin.obj `if test -f 's_fmin.c'; then $(CYGPATH_W) 's_fmin.c'; else $(CYGPATH_W) '$(srcdir)/s_fmin.c'; fi`
-
-lib_a-s_llrint.o: s_llrint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_llrint.o `test -f 's_llrint.c' || echo '$(srcdir)/'`s_llrint.c
-
-lib_a-s_llrint.obj: s_llrint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_llrint.obj `if test -f 's_llrint.c'; then $(CYGPATH_W) 's_llrint.c'; else $(CYGPATH_W) '$(srcdir)/s_llrint.c'; fi`
-
-lib_a-s_llround.o: s_llround.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_llround.o `test -f 's_llround.c' || echo '$(srcdir)/'`s_llround.c
-
-lib_a-s_llround.obj: s_llround.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_llround.obj `if test -f 's_llround.c'; then $(CYGPATH_W) 's_llround.c'; else $(CYGPATH_W) '$(srcdir)/s_llround.c'; fi`
-
-lib_a-s_lrint.o: s_lrint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_lrint.o `test -f 's_lrint.c' || echo '$(srcdir)/'`s_lrint.c
-
-lib_a-s_lrint.obj: s_lrint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_lrint.obj `if test -f 's_lrint.c'; then $(CYGPATH_W) 's_lrint.c'; else $(CYGPATH_W) '$(srcdir)/s_lrint.c'; fi`
-
-lib_a-s_lround.o: s_lround.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_lround.o `test -f 's_lround.c' || echo '$(srcdir)/'`s_lround.c
-
-lib_a-s_lround.obj: s_lround.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_lround.obj `if test -f 's_lround.c'; then $(CYGPATH_W) 's_lround.c'; else $(CYGPATH_W) '$(srcdir)/s_lround.c'; fi`
-
-lib_a-s_nearbyint.o: s_nearbyint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_nearbyint.o `test -f 's_nearbyint.c' || echo '$(srcdir)/'`s_nearbyint.c
-
-lib_a-s_nearbyint.obj: s_nearbyint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_nearbyint.obj `if test -f 's_nearbyint.c'; then $(CYGPATH_W) 's_nearbyint.c'; else $(CYGPATH_W) '$(srcdir)/s_nearbyint.c'; fi`
-
-lib_a-s_rint.o: s_rint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_rint.o `test -f 's_rint.c' || echo '$(srcdir)/'`s_rint.c
-
-lib_a-s_rint.obj: s_rint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_rint.obj `if test -f 's_rint.c'; then $(CYGPATH_W) 's_rint.c'; else $(CYGPATH_W) '$(srcdir)/s_rint.c'; fi`
-
-lib_a-s_round.o: s_round.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_round.o `test -f 's_round.c' || echo '$(srcdir)/'`s_round.c
-
-lib_a-s_round.obj: s_round.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_round.obj `if test -f 's_round.c'; then $(CYGPATH_W) 's_round.c'; else $(CYGPATH_W) '$(srcdir)/s_round.c'; fi`
-
-lib_a-s_trunc.o: s_trunc.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_trunc.o `test -f 's_trunc.c' || echo '$(srcdir)/'`s_trunc.c
-
-lib_a-s_trunc.obj: s_trunc.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_trunc.obj `if test -f 's_trunc.c'; then $(CYGPATH_W) 's_trunc.c'; else $(CYGPATH_W) '$(srcdir)/s_trunc.c'; fi`
-
-lib_a-sf_ceil.o: sf_ceil.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_ceil.o `test -f 'sf_ceil.c' || echo '$(srcdir)/'`sf_ceil.c
-
-lib_a-sf_ceil.obj: sf_ceil.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_ceil.obj `if test -f 'sf_ceil.c'; then $(CYGPATH_W) 'sf_ceil.c'; else $(CYGPATH_W) '$(srcdir)/sf_ceil.c'; fi`
-
-lib_a-sf_floor.o: sf_floor.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_floor.o `test -f 'sf_floor.c' || echo '$(srcdir)/'`sf_floor.c
-
-lib_a-sf_floor.obj: sf_floor.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_floor.obj `if test -f 'sf_floor.c'; then $(CYGPATH_W) 'sf_floor.c'; else $(CYGPATH_W) '$(srcdir)/sf_floor.c'; fi`
-
-lib_a-sf_fma.o: sf_fma.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fma.o `test -f 'sf_fma.c' || echo '$(srcdir)/'`sf_fma.c
-
-lib_a-sf_fma.obj: sf_fma.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fma.obj `if test -f 'sf_fma.c'; then $(CYGPATH_W) 'sf_fma.c'; else $(CYGPATH_W) '$(srcdir)/sf_fma.c'; fi`
-
-lib_a-sf_fmax.o: sf_fmax.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fmax.o `test -f 'sf_fmax.c' || echo '$(srcdir)/'`sf_fmax.c
-
-lib_a-sf_fmax.obj: sf_fmax.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fmax.obj `if test -f 'sf_fmax.c'; then $(CYGPATH_W) 'sf_fmax.c'; else $(CYGPATH_W) '$(srcdir)/sf_fmax.c'; fi`
-
-lib_a-sf_fmin.o: sf_fmin.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fmin.o `test -f 'sf_fmin.c' || echo '$(srcdir)/'`sf_fmin.c
-
-lib_a-sf_fmin.obj: sf_fmin.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fmin.obj `if test -f 'sf_fmin.c'; then $(CYGPATH_W) 'sf_fmin.c'; else $(CYGPATH_W) '$(srcdir)/sf_fmin.c'; fi`
-
-lib_a-sf_llrint.o: sf_llrint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_llrint.o `test -f 'sf_llrint.c' || echo '$(srcdir)/'`sf_llrint.c
-
-lib_a-sf_llrint.obj: sf_llrint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_llrint.obj `if test -f 'sf_llrint.c'; then $(CYGPATH_W) 'sf_llrint.c'; else $(CYGPATH_W) '$(srcdir)/sf_llrint.c'; fi`
-
-lib_a-sf_llround.o: sf_llround.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_llround.o `test -f 'sf_llround.c' || echo '$(srcdir)/'`sf_llround.c
-
-lib_a-sf_llround.obj: sf_llround.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_llround.obj `if test -f 'sf_llround.c'; then $(CYGPATH_W) 'sf_llround.c'; else $(CYGPATH_W) '$(srcdir)/sf_llround.c'; fi`
-
-lib_a-sf_lrint.o: sf_lrint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_lrint.o `test -f 'sf_lrint.c' || echo '$(srcdir)/'`sf_lrint.c
-
-lib_a-sf_lrint.obj: sf_lrint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_lrint.obj `if test -f 'sf_lrint.c'; then $(CYGPATH_W) 'sf_lrint.c'; else $(CYGPATH_W) '$(srcdir)/sf_lrint.c'; fi`
-
-lib_a-sf_lround.o: sf_lround.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_lround.o `test -f 'sf_lround.c' || echo '$(srcdir)/'`sf_lround.c
-
-lib_a-sf_lround.obj: sf_lround.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_lround.obj `if test -f 'sf_lround.c'; then $(CYGPATH_W) 'sf_lround.c'; else $(CYGPATH_W) '$(srcdir)/sf_lround.c'; fi`
-
-lib_a-sf_nearbyint.o: sf_nearbyint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_nearbyint.o `test -f 'sf_nearbyint.c' || echo '$(srcdir)/'`sf_nearbyint.c
-
-lib_a-sf_nearbyint.obj: sf_nearbyint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_nearbyint.obj `if test -f 'sf_nearbyint.c'; then $(CYGPATH_W) 'sf_nearbyint.c'; else $(CYGPATH_W) '$(srcdir)/sf_nearbyint.c'; fi`
-
-lib_a-sf_rint.o: sf_rint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_rint.o `test -f 'sf_rint.c' || echo '$(srcdir)/'`sf_rint.c
-
-lib_a-sf_rint.obj: sf_rint.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_rint.obj `if test -f 'sf_rint.c'; then $(CYGPATH_W) 'sf_rint.c'; else $(CYGPATH_W) '$(srcdir)/sf_rint.c'; fi`
-
-lib_a-sf_round.o: sf_round.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_round.o `test -f 'sf_round.c' || echo '$(srcdir)/'`sf_round.c
-
-lib_a-sf_round.obj: sf_round.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_round.obj `if test -f 'sf_round.c'; then $(CYGPATH_W) 'sf_round.c'; else $(CYGPATH_W) '$(srcdir)/sf_round.c'; fi`
-
-lib_a-sf_trunc.o: sf_trunc.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_trunc.o `test -f 'sf_trunc.c' || echo '$(srcdir)/'`sf_trunc.c
-
-lib_a-sf_trunc.obj: sf_trunc.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_trunc.obj `if test -f 'sf_trunc.c'; then $(CYGPATH_W) 'sf_trunc.c'; else $(CYGPATH_W) '$(srcdir)/sf_trunc.c'; fi`
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-am
-all-am: Makefile $(LIBRARIES) $(DATA)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-generic clean-noinstLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-tags dvi dvi-am \
- html html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am
-
-objectlist.awk.in: $(noinst_LTLIBRARIES)
- -rm -f objectlist.awk.in
- for i in `ls *.lo` ; \
- do \
- echo $$i `pwd`/$$i >> objectlist.awk.in ; \
- done
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/newlib/libm/machine/aarch64/aclocal.m4 b/newlib/libm/machine/aarch64/aclocal.m4
deleted file mode 100644
index 18dab02aa..000000000
--- a/newlib/libm/machine/aarch64/aclocal.m4
+++ /dev/null
@@ -1,1012 +0,0 @@
-# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.6], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.6])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 9
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 12
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 16
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
-# 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_MAINTAINER_MODE([DEFAULT-MODE])
-# ----------------------------------
-# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless `enable' is passed literally.
-# For symmetry, `disable' may be passed as well. Anyway, the user
-# can override the default with the --enable/--disable switch.
-AC_DEFUN([AM_MAINTAINER_MODE],
-[m4_case(m4_default([$1], [disable]),
- [enable], [m4_define([am_maintainer_other], [disable])],
- [disable], [m4_define([am_maintainer_other], [enable])],
- [m4_define([am_maintainer_other], [enable])
- m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode's default is 'disable' unless 'enable' is passed
- AC_ARG_ENABLE([maintainer-mode],
-[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
- AC_MSG_RESULT([$USE_MAINTAINER_MODE])
- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST([MAINT])dnl
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([../../../acinclude.m4])
diff --git a/newlib/libm/machine/aarch64/configure b/newlib/libm/machine/aarch64/configure
deleted file mode 100755
index 7f4d0d6df..000000000
--- a/newlib/libm/machine/aarch64/configure
+++ /dev/null
@@ -1,4748 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for newlib 2.0.0.
-#
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='newlib'
-PACKAGE_TARNAME='newlib'
-PACKAGE_VERSION='2.0.0'
-PACKAGE_STRING='newlib 2.0.0'
-PACKAGE_BUGREPORT=''
-PACKAGE_URL=''
-
-ac_unique_file="Makefile.am"
-ac_subst_vars='LTLIBOBJS
-LIBOBJS
-sys_dir
-machine_dir
-libm_machine_dir
-lpfx
-aext
-oext
-OBJEXT
-USE_LIBTOOL_FALSE
-USE_LIBTOOL_TRUE
-ELIX_LEVEL_4_FALSE
-ELIX_LEVEL_4_TRUE
-ELIX_LEVEL_3_FALSE
-ELIX_LEVEL_3_TRUE
-ELIX_LEVEL_2_FALSE
-ELIX_LEVEL_2_TRUE
-ELIX_LEVEL_1_FALSE
-ELIX_LEVEL_1_TRUE
-ELIX_LEVEL_0_FALSE
-ELIX_LEVEL_0_TRUE
-LDFLAGS
-NO_INCLUDE_LIST
-NEWLIB_CFLAGS
-CCASFLAGS
-CCAS
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-READELF
-RANLIB
-AR
-AS
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-CC
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-newlib_basedir
-MAY_SUPPLY_SYSCALLS_FALSE
-MAY_SUPPLY_SYSCALLS_TRUE
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_multilib
-enable_target_optspace
-enable_malloc_debugging
-enable_newlib_multithread
-enable_newlib_iconv
-enable_newlib_elix_level
-enable_newlib_io_float
-enable_newlib_supplied_syscalls
-enable_dependency_tracking
-enable_maintainer_mode
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CCAS
-CCASFLAGS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures newlib 2.0.0 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/newlib]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of newlib 2.0.0:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-multilib build many library versions (default)
- --enable-target-optspace optimize for space
- --enable-malloc-debugging indicate malloc debugging requested
- --enable-newlib-multithread enable support for multiple threads
- --enable-newlib-iconv enable iconv library support
- --enable-newlib-elix-level supply desired elix library level (1-4)
- --disable-newlib-io-float disable printf/scanf family float support
- --disable-newlib-supplied-syscalls disable newlib from supplying syscalls
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
-
-Some influential environment variables:
- CCAS assembler compiler command (defaults to CC)
- CCASFLAGS assembler compiler flags (defaults to CFLAGS)
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-newlib configure 2.0.0
-generated by GNU Autoconf 2.68
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by newlib $as_me 2.0.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-ac_aux_dir=
-for ac_dir in ../../../.. "$srcdir"/../../../..; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../../.. \"$srcdir\"/../../../.." "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-am__api_version='1.11'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "${enableval}" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error $? "bad value ${enableval} for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-# Check whether --enable-target-optspace was given.
-if test "${enable_target_optspace+set}" = set; then :
- enableval=$enable_target_optspace; case "${enableval}" in
- yes) target_optspace=yes ;;
- no) target_optspace=no ;;
- *) as_fn_error $? "bad value ${enableval} for target-optspace option" "$LINENO" 5 ;;
- esac
-else
- target_optspace=
-fi
-
-# Check whether --enable-malloc-debugging was given.
-if test "${enable_malloc_debugging+set}" = set; then :
- enableval=$enable_malloc_debugging; case "${enableval}" in
- yes) malloc_debugging=yes ;;
- no) malloc_debugging=no ;;
- *) as_fn_error $? "bad value ${enableval} for malloc-debugging option" "$LINENO" 5 ;;
- esac
-else
- malloc_debugging=
-fi
-
-# Check whether --enable-newlib-multithread was given.
-if test "${enable_newlib_multithread+set}" = set; then :
- enableval=$enable_newlib_multithread; case "${enableval}" in
- yes) newlib_multithread=yes ;;
- no) newlib_multithread=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-multithread option" "$LINENO" 5 ;;
- esac
-else
- newlib_multithread=yes
-fi
-
-# Check whether --enable-newlib-iconv was given.
-if test "${enable_newlib_iconv+set}" = set; then :
- enableval=$enable_newlib_iconv; if test "${newlib_iconv+set}" != set; then
- case "${enableval}" in
- yes) newlib_iconv=yes ;;
- no) newlib_iconv=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-iconv option" "$LINENO" 5 ;;
- esac
- fi
-else
- newlib_iconv=${newlib_iconv}
-fi
-
-# Check whether --enable-newlib-elix-level was given.
-if test "${enable_newlib_elix_level+set}" = set; then :
- enableval=$enable_newlib_elix_level; case "${enableval}" in
- 0) newlib_elix_level=0 ;;
- 1) newlib_elix_level=1 ;;
- 2) newlib_elix_level=2 ;;
- 3) newlib_elix_level=3 ;;
- 4) newlib_elix_level=4 ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-elix-level option" "$LINENO" 5 ;;
- esac
-else
- newlib_elix_level=0
-fi
-
-# Check whether --enable-newlib-io-float was given.
-if test "${enable_newlib_io_float+set}" = set; then :
- enableval=$enable_newlib_io_float; case "${enableval}" in
- yes) newlib_io_float=yes ;;
- no) newlib_io_float=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-io-float option" "$LINENO" 5 ;;
- esac
-else
- newlib_io_float=yes
-fi
-
-# Check whether --enable-newlib-supplied-syscalls was given.
-if test "${enable_newlib_supplied_syscalls+set}" = set; then :
- enableval=$enable_newlib_supplied_syscalls; case "${enableval}" in
- yes) newlib_may_supply_syscalls=yes ;;
- no) newlib_may_supply_syscalls=no ;;
- *) as_fn_error $? "bad value ${enableval} for newlib-supplied-syscalls option" "$LINENO" 5 ;;
- esac
-else
- newlib_may_supply_syscalls=yes
-fi
-
- if test x${newlib_may_supply_syscalls} = xyes; then
- MAY_SUPPLY_SYSCALLS_TRUE=
- MAY_SUPPLY_SYSCALLS_FALSE='#'
-else
- MAY_SUPPLY_SYSCALLS_TRUE='#'
- MAY_SUPPLY_SYSCALLS_FALSE=
-fi
-
-
-
-test -z "${with_target_subdir}" && with_target_subdir=.
-
-if test "${srcdir}" = "."; then
- if test "${with_target_subdir}" != "."; then
- newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
- else
- newlib_basedir="${srcdir}/${with_multisrctop}../../.."
- fi
-else
- newlib_basedir="${srcdir}/../../.."
-fi
-
-
-
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='newlib'
- VERSION='2.0.0'
-
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-# FIXME: We temporarily define our own version of AC_PROG_CC. This is
-# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
-# are probably using a cross compiler, which will not be able to fully
-# link an executable. This should really be fixed in autoconf
-# itself.
-
-
-
-
-
-
-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU C" >&5
-$as_echo_n "checking whether we are using GNU C... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_c_compiler_gnu=yes
-else
- ac_cv_c_compiler_gnu=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-
-if test $ac_cv_c_compiler_gnu = yes; then
- GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AS="${ac_tool_prefix}as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AS"; then
- ac_ct_AS=$AS
- # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AS"; then
- ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AS="as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AS" = x; then
- AS=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AS=$ac_ct_AS
- fi
-else
- AS="$ac_cv_prog_AS"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AR" = x; then
- AR=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
-set dummy ${ac_tool_prefix}readelf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_READELF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$READELF"; then
- ac_cv_prog_READELF="$READELF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_READELF="${ac_tool_prefix}readelf"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-READELF=$ac_cv_prog_READELF
-if test -n "$READELF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
-$as_echo "$READELF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_READELF"; then
- ac_ct_READELF=$READELF
- # Extract the first word of "readelf", so it can be a program name with args.
-set dummy readelf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_READELF+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_READELF"; then
- ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_READELF="readelf"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
-if test -n "$ac_ct_READELF"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
-$as_echo "$ac_ct_READELF" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_READELF" = x; then
- READELF=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- READELF=$ac_ct_READELF
- fi
-else
- READELF="$ac_cv_prog_READELF"
-fi
-
-
-
-
-# Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13. */
-ac_given_INSTALL=$INSTALL
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-# By default we simply use the C compiler to build assembly code.
-
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-
-
-
-
-# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
-# at least currently, we never actually build a program, so we never
-# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
-# fails, because we are probably configuring with a cross compiler
-# which can't create executables. So we include AC_EXEEXT to keep
-# automake happy, but we don't execute it, since we don't care about
-# the result.
-if false; then
-
- dummy_var=1
-fi
-
-. ${newlib_basedir}/configure.host
-
-newlib_cflags="${newlib_cflags} -fno-builtin"
-
-NEWLIB_CFLAGS=${newlib_cflags}
-
-
-NO_INCLUDE_LIST=${noinclude}
-
-
-LDFLAGS=${ldflags}
-
-
- if test x${newlib_elix_level} = x0; then
- ELIX_LEVEL_0_TRUE=
- ELIX_LEVEL_0_FALSE='#'
-else
- ELIX_LEVEL_0_TRUE='#'
- ELIX_LEVEL_0_FALSE=
-fi
-
- if test x${newlib_elix_level} = x1; then
- ELIX_LEVEL_1_TRUE=
- ELIX_LEVEL_1_FALSE='#'
-else
- ELIX_LEVEL_1_TRUE='#'
- ELIX_LEVEL_1_FALSE=
-fi
-
- if test x${newlib_elix_level} = x2; then
- ELIX_LEVEL_2_TRUE=
- ELIX_LEVEL_2_FALSE='#'
-else
- ELIX_LEVEL_2_TRUE='#'
- ELIX_LEVEL_2_FALSE=
-fi
-
- if test x${newlib_elix_level} = x3; then
- ELIX_LEVEL_3_TRUE=
- ELIX_LEVEL_3_FALSE='#'
-else
- ELIX_LEVEL_3_TRUE='#'
- ELIX_LEVEL_3_FALSE=
-fi
-
- if test x${newlib_elix_level} = x4; then
- ELIX_LEVEL_4_TRUE=
- ELIX_LEVEL_4_FALSE='#'
-else
- ELIX_LEVEL_4_TRUE='#'
- ELIX_LEVEL_4_FALSE=
-fi
-
-
- if test x${use_libtool} = xyes; then
- USE_LIBTOOL_TRUE=
- USE_LIBTOOL_FALSE='#'
-else
- USE_LIBTOOL_TRUE='#'
- USE_LIBTOOL_FALSE=
-fi
-
-
-# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we
-# use oext, which is set in configure.host based on the target platform.
-OBJEXT=${oext}
-
-
-
-
-
-
-
-
-
-
-
-ac_config_files="$ac_config_files Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
-t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then
- as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_0_TRUE}" && test -z "${ELIX_LEVEL_0_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_0\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_1_TRUE}" && test -z "${ELIX_LEVEL_1_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_1\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_2_TRUE}" && test -z "${ELIX_LEVEL_2_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_2\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_3_TRUE}" && test -z "${ELIX_LEVEL_3_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_3\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ELIX_LEVEL_4_TRUE}" && test -z "${ELIX_LEVEL_4_FALSE}"; then
- as_fn_error $? "conditional \"ELIX_LEVEL_4\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then
- as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -p'
- fi
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by newlib $as_me 2.0.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-newlib config.status 2.0.0
-configured by $0, generated by GNU Autoconf 2.68,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h | --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-
-eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/newlib/libm/machine/aarch64/configure.in b/newlib/libm/machine/aarch64/configure.in
deleted file mode 100644
index c5705228d..000000000
--- a/newlib/libm/machine/aarch64/configure.in
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl This is the newlib/libm/machine/aarch64 configure.in file.
-dnl Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.59)
-AC_INIT([newlib],[NEWLIB_VERSION])
-AC_CONFIG_SRCDIR([Makefile.am])
-
-dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
-AC_CONFIG_AUX_DIR(../../../..)
-
-NEWLIB_CONFIGURE(../../..)
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/newlib/libm/machine/aarch64/s_ceil.c b/newlib/libm/machine/aarch64/s_ceil.c
deleted file mode 100644
index 747c6bee0..000000000
--- a/newlib/libm/machine/aarch64/s_ceil.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_ceil.c -- define ceil
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-ceil (double x)
-{
- double result;
- asm ( "frintp\t%d0, %d1" : "=w" (result) : "w" (x) );
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_floor.c b/newlib/libm/machine/aarch64/s_floor.c
deleted file mode 100644
index 06634061d..000000000
--- a/newlib/libm/machine/aarch64/s_floor.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_floor.c -- define floor
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-floor (double x)
-{
- double result;
- asm ("frintm\t%d0, %d1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_fma.c b/newlib/libm/machine/aarch64/s_fma.c
deleted file mode 100644
index d457ad24e..000000000
--- a/newlib/libm/machine/aarch64/s_fma.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_fma.c -- define fma
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-fma (double x, double y, double z)
-{
- double result;
- asm ("fmadd\t%d0, %d1, %d2, %d3" : "=w" (result) : "w" (x), "w" (y), "w" (z));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_fmax.c b/newlib/libm/machine/aarch64/s_fmax.c
deleted file mode 100644
index 8616a4eb3..000000000
--- a/newlib/libm/machine/aarch64/s_fmax.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_fmax.c -- define fmax
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-fmax (double x, double y)
-{
- double result;
- asm ("fmaxnm\t%d0, %d1, %d2" : "=w" (result) : "w" (x), "w" (y));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_fmin.c b/newlib/libm/machine/aarch64/s_fmin.c
deleted file mode 100644
index 367a1e18b..000000000
--- a/newlib/libm/machine/aarch64/s_fmin.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_fmin.c -- define fmin
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-fmin (double x, double y)
-{
- double result;
- asm ("fminnm\t%d0, %d1, %d2" : "=w" (result) : "w" (x), "w" (y));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_llrint.c b/newlib/libm/machine/aarch64/s_llrint.c
deleted file mode 100644
index fd28b0e80..000000000
--- a/newlib/libm/machine/aarch64/s_llrint.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* s_llrint.c -- define llrint
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-long long int
-llrint (double x)
-{
- long long int result;
- double temp;
- asm ("frintx\t%d1, %d2\n\t"
- "fcvtzs\t%x0, %d1"
- : "=r" (result), "=w" (temp) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_llround.c b/newlib/libm/machine/aarch64/s_llround.c
deleted file mode 100644
index 231c7e710..000000000
--- a/newlib/libm/machine/aarch64/s_llround.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_llround.c -- define llround
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-long long int
-llround (double x)
-{
- long long int result;
- asm ("fcvtas\t%x0, %d1" : "=r" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_lrint.c b/newlib/libm/machine/aarch64/s_lrint.c
deleted file mode 100644
index fda83b19b..000000000
--- a/newlib/libm/machine/aarch64/s_lrint.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* s_lrint.c -- define lrint
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-long int
-lrint (double x)
-{
- long int result;
- double temp;
- asm ("frintx\t%d1, %d2\n\t"
- "fcvtzs\t%x0, %d1"
- : "=r" (result), "=w" (temp) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_lround.c b/newlib/libm/machine/aarch64/s_lround.c
deleted file mode 100644
index 72a8f0207..000000000
--- a/newlib/libm/machine/aarch64/s_lround.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_lround.c -- define lround
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-long int
-lround (double x)
-{
- long int result;
- asm ("fcvtas\t%x0, %d1" : "=r" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_nearbyint.c b/newlib/libm/machine/aarch64/s_nearbyint.c
deleted file mode 100644
index b097554ba..000000000
--- a/newlib/libm/machine/aarch64/s_nearbyint.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_nearbyint.c -- define nearbyint
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-nearbyint (double x)
-{
- double result;
- asm ("frinti\t%d0, %d1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_rint.c b/newlib/libm/machine/aarch64/s_rint.c
deleted file mode 100644
index 1e96afa34..000000000
--- a/newlib/libm/machine/aarch64/s_rint.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_rint.c -- define rint
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-rint (double x)
-{
- double result;
- asm ("frintx\t%d0, %d1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_round.c b/newlib/libm/machine/aarch64/s_round.c
deleted file mode 100644
index f363a6f10..000000000
--- a/newlib/libm/machine/aarch64/s_round.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_round.c -- define round
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-round (double x)
-{
- double result;
- asm ("frinta\t%d0, %d1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/s_trunc.c b/newlib/libm/machine/aarch64/s_trunc.c
deleted file mode 100644
index 98dca6ac8..000000000
--- a/newlib/libm/machine/aarch64/s_trunc.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* s_trunc.c -- define trunc
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-double
-trunc (double x)
-{
- double result;
- asm ("frintz\t%d0, %d1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_ceil.c b/newlib/libm/machine/aarch64/sf_ceil.c
deleted file mode 100644
index b9171ab14..000000000
--- a/newlib/libm/machine/aarch64/sf_ceil.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_ceil.c -- define ceilf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-ceilf (float x)
-{
- float result;
- asm ( "frintp\t%s0, %s1" : "=w" (result) : "w" (x) );
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_floor.c b/newlib/libm/machine/aarch64/sf_floor.c
deleted file mode 100644
index a63377d26..000000000
--- a/newlib/libm/machine/aarch64/sf_floor.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_floor.c -- define floorf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-floorf (float x)
-{
- float result;
- asm ( "frintm\t%s0, %s1" : "=w" (result) : "w" (x) );
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_fma.c b/newlib/libm/machine/aarch64/sf_fma.c
deleted file mode 100644
index 9d4f79f2a..000000000
--- a/newlib/libm/machine/aarch64/sf_fma.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_fma.c -- define fmaf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-fmaf (float x, float y, float z)
-{
- float result;
- asm ("fmadd\t%s0, %s1, %s2, %s3" : "=w" (result) : "w" (x), "w" (y), "w" (z));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_fmax.c b/newlib/libm/machine/aarch64/sf_fmax.c
deleted file mode 100644
index 3800d2bb2..000000000
--- a/newlib/libm/machine/aarch64/sf_fmax.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_fmax.c -- define fmaxf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-fmaxf (float x, float y)
-{
- float result;
- asm ("fmaxnm\t%s0, %s1, %s2" : "=w" (result) : "w" (x), "w" (y));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_fmin.c b/newlib/libm/machine/aarch64/sf_fmin.c
deleted file mode 100644
index aa4ca28ca..000000000
--- a/newlib/libm/machine/aarch64/sf_fmin.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_fmin.c -- define fminf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-fminf (float x, float y)
-{
- float result;
- asm ("fminnm\t%s0, %s1, %s2" : "=w" (result) : "w" (x), "w" (y));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_llrint.c b/newlib/libm/machine/aarch64/sf_llrint.c
deleted file mode 100644
index 226208872..000000000
--- a/newlib/libm/machine/aarch64/sf_llrint.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* sf_llrint.c -- define llrintf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-long long int
-llrintf (float x)
-{
- long long int result;
- float temp;
- asm ("frintx\t%s1, %s2\n\t"
- "fcvtzs\t%x0, %s1"
- : "=r" (result), "=w" (temp) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_llround.c b/newlib/libm/machine/aarch64/sf_llround.c
deleted file mode 100644
index 6d2c93ac0..000000000
--- a/newlib/libm/machine/aarch64/sf_llround.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_llround.c -- define llroundf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-long long int
-llroundf (float x)
-{
- long long int result;
- asm ("fcvtas\t%x0, %s1" : "=r" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_lrint.c b/newlib/libm/machine/aarch64/sf_lrint.c
deleted file mode 100644
index d1f327a67..000000000
--- a/newlib/libm/machine/aarch64/sf_lrint.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* sf_lrint.c -- define lrintf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-long int
-lrintf (float x)
-{
- long int result;
- float temp;
- asm ("frintx\t%s1, %s2\n\t"
- "fcvtzs\t%x0, %s1"
- : "=r" (result), "=w" (temp) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_lround.c b/newlib/libm/machine/aarch64/sf_lround.c
deleted file mode 100644
index 858b2f064..000000000
--- a/newlib/libm/machine/aarch64/sf_lround.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_lround.c -- define lroundf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-long int
-lroundf (float x)
-{
- long int result;
- asm ("fcvtas\t%x0, %s1" : "=r" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_nearbyint.c b/newlib/libm/machine/aarch64/sf_nearbyint.c
deleted file mode 100644
index b7c8a67d6..000000000
--- a/newlib/libm/machine/aarch64/sf_nearbyint.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_nearbyint.c -- define nearbyintf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-nearbyintf (float x)
-{
- float result;
- asm ("frinti\t%s0, %s1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_rint.c b/newlib/libm/machine/aarch64/sf_rint.c
deleted file mode 100644
index adcb35c53..000000000
--- a/newlib/libm/machine/aarch64/sf_rint.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_rint.c -- define rintf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-rintf (float x)
-{
- float result;
- asm ("frintx\t%s0, %s1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_round.c b/newlib/libm/machine/aarch64/sf_round.c
deleted file mode 100644
index 788bbfdb2..000000000
--- a/newlib/libm/machine/aarch64/sf_round.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_round.c -- define roundf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-roundf (float x)
-{
- float result;
- asm ("frinta\t%s0, %s1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/newlib/libm/machine/aarch64/sf_trunc.c b/newlib/libm/machine/aarch64/sf_trunc.c
deleted file mode 100644
index 3df7db8e4..000000000
--- a/newlib/libm/machine/aarch64/sf_trunc.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* sf_trunc.c -- define truncf
- Copyright (c) 2011, 2012 ARM Ltd. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the company may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-#include <math.h>
-
-float
-truncf (float x)
-{
- float result;
- asm ("frintz\t%s0, %s1" : "=w" (result) : "w" (x));
- return result;
-}
diff --git a/winsup/cygserver/ChangeLog b/winsup/cygserver/ChangeLog
index 76b6c27db..a29903af4 100644
--- a/winsup/cygserver/ChangeLog
+++ b/winsup/cygserver/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details.
+
2012-11-27 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.in: Remove old from CFLAGS and move C*FLAGS so that they can
diff --git a/winsup/cygserver/ChangeLog.64bit b/winsup/cygserver/ChangeLog.64bit
new file mode 100644
index 000000000..7ab21bf54
--- /dev/null
+++ b/winsup/cygserver/ChangeLog.64bit
@@ -0,0 +1,87 @@
+2013-03-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * msg.cc (client_request_msg::serve): Revert change to refuse 64 bit
+ processes on 32 bit systems.
+ * sem.cc (client_request_sem::serve): Ditto.
+ * shm.cc (client_request_shm::serve): Ditto.
+
+2013-03-01 Corinna Vinschen <corinna@vinschen.de>
+
+ * client.cc: Revert changes to handle 32 bit processes on 64 bit
+ systems.
+ * sysv_msg.cc: Ditto.
+ * sysv_sem.cc: Ditto.
+ * sysv_shm.cc: Ditto.
+
+2013-02-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (cygserver.exe): Make cygwin_build a tooldir (-B instead
+ of -L) to support bootstrapping.
+
+2013-02-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * configure: Regenerate to fix wrong ac_unique_file dependency.
+
+2012-12-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * sysv_msg.cc (conv_timespec32_to_timespec): Move implementation to
+ cygserver_ipc.h.
+ (conv_timespec_to_timespec32): Ditto.
+ (conv_msqid_ds32_to_msqid_ds): Drop and move code into copyin_msqid_ds.
+ (conv_msqid_ds_to_msqid_ds32): Drop and move code into copyout_msqid_ds.
+ * sysv_sem.cc (copyin_semid_ds): New inline function on Cygwin.
+ (copyout_semid_ds): Ditto.
+ (__semctl): Use a conditional arg_size value rather than a fixed
+ sizeof(real_arg) throughout, to accommodate 64/32 bit conversion.
+ Use copyout_semid_ds and copyin_semid_ds to copy semid_ds
+ structures from cygserver to client and vice versa on Cygwin.
+ * sysv_shm.cc (copyin_shmid_ds): New inline function on Cygwin.
+ (copyout_shmid_ds): Ditto.
+ (shmctl): Use copyout_shmid_ds and copyin_shmid_ds to copy shmid_ds
+ structures from cygserver to client and vice versa on Cygwin.
+
+2012-12-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * client.cc (client_request::header_t::header_t): Accommodate changes
+ to msglen member.
+ (client_request::handle_request): Ditto.
+ (client_request::client_request): Zero out entire parameter block.
+ Explain why.
+ * sysv_msg.cc (conv_timespec32_to_timespec): New inline function on
+ 64 bit Cygwin.
+ (conv_timespec_to_timespec32): Ditto.
+ (conv_msqid_ds32_to_msqid_ds): Ditto.
+ (conv_msqid_ds_to_msqid_ds32): Ditto.
+ (copyin_msqid_ds): New inline function on Cygwin.
+ (copyout_msqid_ds): Ditto.
+ (msgctl): Use copyout_msqid_ds and copyin_msqid_ds to copy msqid_ds
+ structures from cygserver to client and vice versa on Cygwin.
+ (msgsnd): Special case copyin of msg_type on 64 bit Cygwin.
+ (msgrcv): Special case copyout of msg_type on 64 bit Cygwin.
+
+2012-12-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * bsd_helper.cc (tunable_int_fetch): Convert 2nd parameter to
+ int32_t.
+ * bsd_helper.h (tunable_int_fetch): Fix declaration accordingly.
+ * bsd_log.cc (log_level): Change type to int32_t.
+ * bsd_log.h (log_level): Fix declaration accordingly.
+ * bsd_mutex.cc (msgmni): Change type to int32_t.
+ (semmni): Ditto.
+ * cygserver.cc: Fix debug output to be target agnostic. Use same
+ style throughout.
+ * msg.cc (client_request_msg::serve): Refuse to serve 64 bit processes
+ from 32 bit cygserver.
+ * sem.cc (client_request_sem::serve): Ditto.
+ * shm.cc (client_request_shm::serve): Ditto.
+ * sysv_shm.cc (shm_delete_mapping): Mark size as unused to make gcc
+ happy.
+ (kern_shmat): Ditto with flags.
+ * process.h (class process): Change type of _cleaning_up member to LONG.
+ * threaded_queue.h (class threaded_queue): Ditto for _workers_count.
+
+2012-08-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * configure.in: Add AC_NO_EXECUTABLES to allow bootstrap.
+ * configure: Regenerate.
+
diff --git a/winsup/cygserver/Makefile.in b/winsup/cygserver/Makefile.in
index e98dea2e6..e2fe30992 100644
--- a/winsup/cygserver/Makefile.in
+++ b/winsup/cygserver/Makefile.in
@@ -71,7 +71,7 @@ libclean:
fullclean: clean libclean
cygserver.exe: $(CYGWIN_LIB) $(OBJS) $(CYGWIN_OBJS)
- $(CXX) -o $@ ${wordlist 2,999,$^} -static -static-libgcc -L$(cygwin_build) -lntdll
+ $(CXX) -o $@ ${wordlist 2,999,$^} -static -static-libgcc -B$(cygwin_build) -lntdll
$(cygwin_build)/%.o: $(cygwin_source)/%.cc
@$(MAKE) -C $(@D) $(@F)
diff --git a/winsup/cygserver/bsd_helper.cc b/winsup/cygserver/bsd_helper.cc
index 7c6d23a60..718c587c3 100644
--- a/winsup/cygserver/bsd_helper.cc
+++ b/winsup/cygserver/bsd_helper.cc
@@ -655,7 +655,7 @@ tunable_param_init (const char *config_file, bool force)
}
void
-tunable_int_fetch (const char *name, long *tunable_target)
+tunable_int_fetch (const char *name, int32_t *tunable_target)
{
tun_struct *s;
for (s = &tunable_params[0]; s->name; ++s)
diff --git a/winsup/cygserver/bsd_helper.h b/winsup/cygserver/bsd_helper.h
index 045898573..bc8d22810 100644
--- a/winsup/cygserver/bsd_helper.h
+++ b/winsup/cygserver/bsd_helper.h
@@ -1,6 +1,6 @@
/* bsd_helper.h: Helps integrating BSD kernel code
- Copyright 2003 Red Hat, Inc.
+ Copyright 2003, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -60,7 +60,7 @@ vm_object_t vm_object_duplicate (struct thread *td, vm_object_t object);
void vm_object_deallocate (vm_object_t object);
void tunable_param_init (const char *, bool);
-void tunable_int_fetch (const char *, long *);
+void tunable_int_fetch (const char *, int32_t *);
void tunable_bool_fetch (const char *, tun_bool_t *);
#endif /* _BSD_HELPER_H */
diff --git a/winsup/cygserver/bsd_log.cc b/winsup/cygserver/bsd_log.cc
index 78dcdb00c..18dc1a53b 100644
--- a/winsup/cygserver/bsd_log.cc
+++ b/winsup/cygserver/bsd_log.cc
@@ -1,6 +1,6 @@
/* bsd_log.cc
- Copyright 2003, 2004 Red Hat Inc.
+ Copyright 2003, 2004, 2012 Red Hat Inc.
This file is part of Cygwin.
@@ -14,7 +14,7 @@ details. */
#include <stdio.h>
#include <stdlib.h>
-long log_level = 8; /* Illegal value. Don't change! */
+int32_t log_level = 8; /* Illegal value. Don't change! */
tun_bool_t log_debug = TUN_UNDEF;
tun_bool_t log_syslog = TUN_UNDEF;
tun_bool_t log_stderr = TUN_UNDEF;
diff --git a/winsup/cygserver/bsd_log.h b/winsup/cygserver/bsd_log.h
index 48573182a..0027d4ff5 100644
--- a/winsup/cygserver/bsd_log.h
+++ b/winsup/cygserver/bsd_log.h
@@ -1,6 +1,6 @@
/* bsd_log.h: Helps integrating BSD kernel code
- Copyright 2003 Red Hat, Inc.
+ Copyright 2003, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -13,7 +13,7 @@ details. */
#include <sys/types.h>
#include <sys/syslog.h>
-extern long log_level;
+extern int32_t log_level;
extern tun_bool_t log_debug;
extern tun_bool_t log_syslog;
extern tun_bool_t log_stderr;
diff --git a/winsup/cygserver/bsd_mutex.cc b/winsup/cygserver/bsd_mutex.cc
index d4cad5678..a13cfe07d 100644
--- a/winsup/cygserver/bsd_mutex.cc
+++ b/winsup/cygserver/bsd_mutex.cc
@@ -1,6 +1,6 @@
/* bsd_mutex.cc
- Copyright 2003, 2004, 2005, 2007 Red Hat Inc.
+ Copyright 2003, 2004, 2005, 2007, 2012 Red Hat Inc.
This file is part of Cygwin.
@@ -285,8 +285,8 @@ msleep_init (void)
msleep_glob_evt = CreateEvent (NULL, TRUE, FALSE, NULL);
if (!msleep_glob_evt)
panic ("CreateEvent in msleep_init failed: %lu", GetLastError ());
- long msgmni = support_msgqueues ? msginfo.msgmni : 0;
- long semmni = support_semaphores ? seminfo.semmni : 0;
+ int32_t msgmni = support_msgqueues ? msginfo.msgmni : 0;
+ int32_t semmni = support_semaphores ? seminfo.semmni : 0;
TUNABLE_INT_FETCH ("kern.ipc.msgmni", &msgmni);
TUNABLE_INT_FETCH ("kern.ipc.semmni", &semmni);
debug ("Try allocating msgmni (%d) + semmni (%d) msleep records",
diff --git a/winsup/cygserver/client.cc b/winsup/cygserver/client.cc
index dfa88d09b..63ce421c9 100644
--- a/winsup/cygserver/client.cc
+++ b/winsup/cygserver/client.cc
@@ -1,6 +1,6 @@
/* client.cc
- Copyright 2001, 2002, 2003, 2004, 2008, 2009 Red Hat Inc.
+ Copyright 2001, 2002, 2003, 2004, 2008, 2009, 2012, 2013 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@@ -115,11 +115,11 @@ client_request_attach_tty::send (transport_layer_base * const conn)
}
client_request::header_t::header_t (const request_code_t request_code,
- const size_t msglen)
- : msglen (msglen),
- request_code (request_code)
+ const size_t len)
+ : request_code (request_code)
{
assert (request_code >= 0 && request_code < CYGSERVER_REQUEST_LAST);
+ msglen = len;
}
// FIXME: also check write and read result for -1.
diff --git a/winsup/cygserver/cygserver.cc b/winsup/cygserver/cygserver.cc
index 8b3fd4c45..bf78e9daf 100644
--- a/winsup/cygserver/cygserver.cc
+++ b/winsup/cygserver/cygserver.cc
@@ -1,6 +1,6 @@
/* cygserver.cc
- Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2011 Red Hat Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2011, 2012 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@@ -51,13 +51,13 @@ setup_privileges ()
rc = OpenProcessToken (GetCurrentProcess () , TOKEN_ALL_ACCESS , &hToken) ;
if (!rc)
{
- debug ("error opening process token (%lu)", GetLastError ());
+ debug ("error opening process token (err %u)", GetLastError ());
return false;
}
rc = LookupPrivilegeValue (NULL, SE_DEBUG_NAME, &sPrivileges.Privileges[0].Luid);
if (!rc)
{
- debug ("error getting privilege luid (%lu)", GetLastError ());
+ debug ("error getting privilege luid (err %u)", GetLastError ());
ret_val = false;
goto out;
}
@@ -66,7 +66,7 @@ setup_privileges ()
rc = AdjustTokenPrivileges (hToken, FALSE, &sPrivileges, 0, NULL, NULL) ;
if (!rc)
{
- debug ("error adjusting privilege level. (%lu)", GetLastError ());
+ debug ("error adjusting privilege level. (err %u)", GetLastError ());
ret_val = false;
goto out;
}
@@ -106,8 +106,8 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
0, bInheritHandle,
DUPLICATE_SAME_ACCESS))
{
- log (LOG_ERR, "error getting handle(%u) to server (%lu)",
- (unsigned int)from_handle, GetLastError ());
+ log (LOG_ERR, "error getting handle(%p) to server (err %u)",
+ from_handle, GetLastError ());
goto out;
}
} else
@@ -119,7 +119,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
| DACL_SECURITY_INFORMATION),
sd, sizeof (sd_buf), &bytes_needed))
{
- log (LOG_ERR, "error getting handle SD (%lu)", GetLastError ());
+ log (LOG_ERR, "error getting handle SD (err %u)", GetLastError ());
goto out;
}
@@ -128,8 +128,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
if (!AccessCheck (sd, from_process_token, access, &access_mapping,
&ps, &ps_len, &access, &status))
{
- log (LOG_ERR, "error checking access rights (%lu)",
- GetLastError ());
+ log (LOG_ERR, "error checking access rights (err %u)", GetLastError ());
goto out;
}
@@ -143,7 +142,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
to_process, to_handle_ptr,
access, bInheritHandle, 0))
{
- log (LOG_ERR, "error getting handle to client (%lu)", GetLastError ());
+ log (LOG_ERR, "error getting handle to client (err %u)", GetLastError ());
goto out;
}
@@ -191,8 +190,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn,
if (!from_process_handle)
{
- log (LOG_ERR, "error opening `from' process, error = %lu",
- GetLastError ());
+ log (LOG_ERR, "error opening `from' process (err %u)", GetLastError ());
error_code (EACCES);
return;
}
@@ -204,8 +202,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn,
if (!to_process_handle)
{
- log (LOG_ERR, "error opening `to' process, error = %lu",
- GetLastError ());
+ log (LOG_ERR, "error opening `to' process (err %u)", GetLastError ());
CloseHandle (from_process_handle);
error_code (EACCES);
return;
@@ -228,7 +225,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn,
TRUE,
&token_handle);
- debug ("opened thread token, rc=%lu", rc);
+ debug ("opened thread token, rc=%u", rc);
if (!conn->revert_to_self ())
{
CloseHandle (from_process_handle);
@@ -239,8 +236,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn,
if (!rc)
{
- log (LOG_ERR, "error opening thread token, error = %lu",
- GetLastError ());
+ log (LOG_ERR, "error opening thread token (err %u)", GetLastError ());
CloseHandle (from_process_handle);
CloseHandle (to_process_handle);
error_code (EACCES);
@@ -264,7 +260,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn,
from_master,
&req.from_master, TRUE) != 0)
{
- log (LOG_ERR, "error duplicating from_master handle, error = %lu",
+ log (LOG_ERR, "error duplicating from_master handle (err %u)",
GetLastError ());
error_code (EACCES);
}
@@ -276,7 +272,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn,
to_master,
&req.to_master, TRUE) != 0)
{
- log (LOG_ERR, "error duplicating to_master handle, error = %lu",
+ log (LOG_ERR, "error duplicating to_master handle (err %u)",
GetLastError ());
error_code (EACCES);
}
@@ -285,9 +281,8 @@ client_request_attach_tty::serve (transport_layer_base *const conn,
CloseHandle (to_process_handle);
CloseHandle (token_handle);
- debug ("%lu(%lu, %lu) -> %lu(%lu,%lu)",
- req.master_pid, from_master, to_master,
- req.pid, req.from_master, req.to_master);
+ debug ("%u(%p, %p) -> %u(%p,%p)", req.master_pid, from_master, to_master,
+ req.pid, req.from_master, req.to_master);
return;
}
@@ -374,7 +369,7 @@ server_submission_loop::request_loop ()
*/
if (!SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST + 1))
if (!SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST))
- debug ("failed to raise accept thread priority, error = %lu",
+ debug ("failed to raise accept thread priority (err %u)",
GetLastError ());
while (_running)
@@ -393,7 +388,7 @@ server_submission_loop::request_loop ()
if (!conn && errno == EINTR)
{
if (!SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_NORMAL))
- debug ("failed to reset thread priority, error = %lu",
+ debug ("failed to reset thread priority (err %u)",
GetLastError ());
Sleep (0);
@@ -401,7 +396,7 @@ server_submission_loop::request_loop ()
THREAD_PRIORITY_HIGHEST + 1))
if (!SetThreadPriority (GetCurrentThread (),
THREAD_PRIORITY_HIGHEST))
- debug ("failed to raise thread priority, error = %lu",
+ debug ("failed to raise thread priority (err %u)",
GetLastError ());
}
if (conn)
@@ -534,9 +529,9 @@ main (const int argc, char *argv[])
const char opts[] = "c:deEf:hl:mp:qr:sSVyY";
- long cleanup_threads = 0;
- long request_threads = 0;
- long process_cache_size = 0;
+ int32_t cleanup_threads = 0;
+ int32_t request_threads = 0;
+ int32_t process_cache_size = 0;
bool shutdown = false;
const char *config_file = DEF_CONFIG_FILE;
bool force_config_file = false;
diff --git a/winsup/cygserver/msg.cc b/winsup/cygserver/msg.cc
index 87df87310..c92e698b0 100644
--- a/winsup/cygserver/msg.cc
+++ b/winsup/cygserver/msg.cc
@@ -1,6 +1,6 @@
/* msg.cc: Single unix specification IPC interface for Cygwin.
- Copyright 2003, 2004 Red Hat, Inc.
+ Copyright 2003, 2004, 2012 Red Hat, Inc.
This file is part of Cygwin.
diff --git a/winsup/cygserver/process.h b/winsup/cygserver/process.h
index 4702d2818..3de11b6f8 100644
--- a/winsup/cygserver/process.h
+++ b/winsup/cygserver/process.h
@@ -1,6 +1,6 @@
/* process.h
- Copyright 2001, 2002, 2003, 2004, 2005 Red Hat Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005, 2012 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
@@ -103,7 +103,7 @@ private:
const DWORD _winpid;
HANDLE _hProcess;
HANDLE _signal_arrived;
- long _cleaning_up;
+ LONG _cleaning_up;
DWORD _exit_status; // Set in the constructor and in exit_code ().
cleanup_routine *_routines_head;
/* used to prevent races-on-delete */
diff --git a/winsup/cygserver/sem.cc b/winsup/cygserver/sem.cc
index 37d894ef9..55cd6e51e 100644
--- a/winsup/cygserver/sem.cc
+++ b/winsup/cygserver/sem.cc
@@ -1,6 +1,6 @@
/* sem.cc: Single unix specification IPC interface for Cygwin.
- Copyright 2003, 2004 Red Hat, Inc.
+ Copyright 2003, 2004, 2012 Red Hat, Inc.
This file is part of Cygwin.
diff --git a/winsup/cygserver/shm.cc b/winsup/cygserver/shm.cc
index 38f2d2ee5..3be0d15f4 100644
--- a/winsup/cygserver/shm.cc
+++ b/winsup/cygserver/shm.cc
@@ -1,6 +1,6 @@
/* shm.cc: Single unix specification IPC interface for Cygwin.
- Copyright 2003, 2004 Red Hat, Inc.
+ Copyright 2003, 2004, 2012 Red Hat, Inc.
This file is part of Cygwin.
diff --git a/winsup/cygserver/sysv_shm.cc b/winsup/cygserver/sysv_shm.cc
index 1a7271f87..4578c53a2 100644
--- a/winsup/cygserver/sysv_shm.cc
+++ b/winsup/cygserver/sysv_shm.cc
@@ -258,7 +258,7 @@ shm_delete_mapping(struct vmspace *vm, struct shmmap_state *shmmap_s)
{
struct shmid_ds *shmseg;
int segnum, result;
- size_t size;
+ size_t size __attribute__ ((unused));
GIANT_REQUIRED;
@@ -335,7 +335,7 @@ int
kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg)
{
struct proc *p = td->td_proc;
- int i, flags;
+ int i, flags __attribute__ ((unused));
struct shmid_ds *shmseg;
struct shmmap_state *shmmap_s = NULL;
#ifndef __CYGWIN__
@@ -512,7 +512,7 @@ done2:
return (EINVAL);
#endif
}
-#endif /* __CYGWIN__ */
+#endif /* !__CYGWIN__ */
#ifndef _SYS_SYSPROTO_H_
struct shmctl_args {
diff --git a/winsup/cygserver/threaded_queue.h b/winsup/cygserver/threaded_queue.h
index 0c3f9913a..e17f90434 100644
--- a/winsup/cygserver/threaded_queue.h
+++ b/winsup/cygserver/threaded_queue.h
@@ -1,6 +1,6 @@
/* threaded_queue.h
- Copyright 2001, 2002, 2003 Red Hat Inc.
+ Copyright 2001, 2002, 2003, 2012 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
@@ -50,7 +50,7 @@ public:
void add (queue_request *);
private:
- long _workers_count;
+ LONG _workers_count;
bool _running;
queue_submission_loop *_submitters_head;
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ed76cc61e..95ae6367b 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,365 @@
+2013-06-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * posix.sgml (std-notes): Fix typo.
+
+2013-06-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_disk_file.cc (fhandler_disk_file::pread): Skip to non-atomic
+ code if mandatory locking is used on this descriptor. Explain why.
+ (fhandler_disk_file::pwrite): Ditto.
+ * posix.sgml (std-notes): Extend description of file locking.
+
+2013-06-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * exceptions.cc (_cygtls::handle_SIGCONT): Simplify loop waiting for
+ sig_handle_tty_stop to wake up. Make sure to unlock before calling
+ yield to avoid starvation of sig_handle_tty_stop. Add comments.
+ * miscfuncs.cc (yield): Explain why yield should never be called under
+ _cygtls::lock conditions. Call SleepEx with 1ms timeout. Explain why.
+
+2013-06-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 20.
+
+2013-06-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.cc (fhandler_base::lock): Move to flock.cc.
+ (fhandler_base::fixup_after_exec): Reset mandatory_locking.
+ * fhandler.h (class fhandler_base): Add mandatory_locking status flag.
+ Add mandatory_locking accessor methods. Accommodate change throughout.
+ (fhandler_base::mand_lock): Declare.
+ (class fhandler_disk_file): Drop in favor of new status flag.
+ * (fhandler_disk_file::fcntl): Call need_fork_fixup if mandatory_locking
+ flag gets set.
+ * flock.cc (fhandler_base::lock): Define here.
+ (flock): Handle mandatory_locking.
+ (lockf): Ditto.
+ (fhandler_base::mand_lock): Define.
+
+2013-06-03 Corinna Vinschen <corinna@vinschen.de>
+
+ * sigproc.cc (exit_thread): Allow to exit the thread while running
+ global dtors. Explain why.
+
+2013-06-02 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc (CancelSynchronousIo): Define.
+ * fcntl.cc (fcntl64): Drop handling of locking commands.
+ * fhandler.h (class fhandler_disk_file): Add mandatory_locking.
+ (fhandler_disk_file::fcntl): Declare.
+ (fhandler_disk_file::mand_lock): Declare.
+ * fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file):
+ Initialize mandatory_locking.
+ (fhandler_disk_file::fcntl): New method. Handle F_LCK_MANDATORY and
+ locking commands.
+ (fhandler_disk_file::dup): Duplicate mandatory_locking. Fix a bug
+ when duplicating prw_handle failed.
+ (fhandler_disk_file::fixup_after_fork): Reset mandatory_locking.
+ * flock.cc (fhandler_disk_file::lock): Add comment.
+ (struct lock_parms): New struct to pass parameters to blocking_lock_thr
+ thread function.
+ (blocking_lock_thr): New thread function.
+ (fhandler_disk_file::mand_lock): New methof implementing mandatory
+ locking with Windows semantics.
+ * ntdll.h (NtLockFile): Declare.
+ (NtUnlockFile): Declare.
+ * include/fcntl.h: Fix a comment.
+ (F_LCK_MANDATORY): Define. Add lengthy comment to explain.
+
+2013-06-02 Corinna Vinschen <corinna@vinschen.de>
+
+ * exceptions.cc (exception::handle): Resurrect accidentally lost
+ patch from 2009-07-22: Set si_addr according to POSIX for SIGSEGV.
+
+2013-05-31 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/sys/socket.h: Move SHUT_xx definitions from here...
+ * include/cygwin/socket.h: ...to here.
+
+2013-05-31 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/if.h: Include cygwin/socket.h rather than sys/socket.h
+ to avoid circular dependency resulting in bogus compile time warnings.
+
+2013-05-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_procsys.cc (fhandler_procsys::read): Just call
+ fhandler_base::raw_read from here. Drop comment.
+ (fhandler_procsys::write): Drop comment.
+
+2013-05-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * dll_init.cc (dll_list::topsort): Fix early-return condition to
+ accommodate process with all runtime loaded DLLs already dlclosed
+ at fork time.
+ * gendef (_sigfe_maybe): Fix code handling early return if we don't
+ have a tls, broken on 2013-05-21.
+
+2013-05-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (DEFS): Unused, remove.
+ (COMPILE.cc): Move -mno-use-libstdc-wrappers flag from here...
+ ($(TEST_DLL_NAME)): ...to here since it's a link time flag.
+
+2013-05-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * pinfo.cc (pinfo::status_exit): Enhance comment.
+
+2013-05-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * environ.cc (win_env::add_cache): Set the Windows environment variable
+ using wide chars to make sure native chars don't get scrambled.
+ * environ.h (build_env): Fix formatting in declaration.
+ * pinfo.cc (pinfo::status_exit): Handle STATUS_NO_MEMORY. Explain why.
+
+2013-05-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * fork.cc (frok::parent): Always set CREATE_UNICODE_ENVIRONMENT flag.
+ Explain why.
+
+2013-05-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * fork.cc (frok::parent): Call CreateProcessW with command line set
+ to the parent command line. Change comment to explain why.
+
+2013-05-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Fix datatype of
+ stacksize to SIZE_T. Cast to SIZE_T in pointer arithmetic. Slightly
+ enhance output in case of a fatal error.
+ * fork.cc (frok::parent): Always set ch.stackaddr to DeallocationStack
+ value of current thread to help stack reservation in
+ child_info_fork::alloc_stack_hard_way along. Simplify subsequent code
+ storing stack values in ch. Print guardsize in hex, too.
+
+2013-05-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * environ.cc (set_winsymlinks): Handle "winsymlinks:nativestrict"
+ option. On pre-Vista warn the user if the "winsymlinks:native*" option
+ is set.
+ * globals.cc (enum winsym_t): Add WSYM_nativestrict.
+ * path.cc (symlink_native): Don't create native symlink if target
+ does not exist. Explain why. Improve comments.
+ (symlink_worker): Change AFS symlink handling to WSYM_nativestrict.
+ Handle WSYM_nativestrict throughout. Change condition for bail out
+ to wsym_type == WSYM_nativestrict. Add comment. Fix formatting.
+ * shared_info.h (CURR_USER_MAGIC): Change to reflect change in
+ class user_info.
+ (class user_info): Add member warned_nonativesyms.
+
+2013-05-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * spinlock.h (ULONG): Replace LONG operator with ULONG to accommodate
+ the fact that CURR_SHARED_MAGIC and USER_SHARED_MAGIC are unsigned
+ values.
+ * shared.cc (shared_info::initialize): Drop explicit cast here.
+
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (DLL_OFILES): Add arc4random.o.
+ * common.din: Export arc4random, arc4random_addrandom, arc4random_buf,
+ arc4random_stir and arc4random_uniform.
+ * mktemp.cc (arc4random): Remove static replacement function.
+ * posix.sgml (std-bsd): Add arc4random functions.
+ * include/cygwin/stdlib.h: Declare arc4random functions.
+ * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
+ * libc/arc4random.cc: New file implementing arc4random functions taken
+ from FreeBSD.
+
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * globals.cc (__isthreaded): New global variable. Explain what it's
+ used for.
+ * miscfuncs.cc (thread_wrapper): Set __isthreaded to 1 here.
+
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.h (class fhandler_dev_random): Change type of pseudo to
+ uint32_t to make sure it's 32 bit on all supported platforms.
+
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ x86_64 only:
+ * gendef (_sigfe_maybe): Drop pushing %r12, use %r10 instead since we
+ don't call yield anymore.
+ (_sigfe): Ditto.
+ (_sigbe): Ditto.
+
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/base64.c: New file.
+ * Makefile.in (DLL_OFILES): Add base64.o.
+ * common.din: Export __b64_ntop and __b64_pton.
+ * posix.sgml (std-bsd): Add __b64_ntop and __b64_pton.
+ * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
+
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * syscalls.cc (open): Only return ENOTDIR if file exists.
+
+2013-05-16 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * sigproc.cc (sig_hold): Delete.
+ (sigheld): Delete.
+ (sig_send): Eliminate special-case __SIGHOLD handling.
+ (wait_sig): Just flag when signals are on hold and add them to the
+ queue rather than stalling the wait_sig loop. Clear the flag when
+ __SIGNOHOLD is specified.
+
+2013-05-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (devices_CFLAGS): Drop -Os.
+
+2013-05-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (localtime_CFLAGS): Define as -fwrapv since localtime
+ code requires int overflows to be fully defined.
+ * localtime.cc: Align a bit more to upstream code.
+
+2013-05-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * grp.cc (get_groups): Convert to void function.
+ (initgroups32): Accommodate the aforementioned change.
+ (getgrouplist): Ditto.
+
+2013-05-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * grp.cc (get_groups): Never return error. Always create a group list,
+ even if it's empty.
+
+2013-05-13 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * include/cygwin/version.h: Bump api minor number to reflect previous
+ change.
+
+2013-05-13 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * i686.din: Remove _strtold.
+ * x86_64.din: Move strtold definition...
+ * common.din: ...to here.
+
+2013-05-07 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * fhandler_tty.cc (fhandler_pty_common::__acquire_output_mutex): Never
+ wait an INFINITE amount of time. Instead default to 1/10 second.
+ (fhandler_pty_slave::open): Just default to INFINITE wait rather than
+ (now) waiting longer than other similar calls.
+
+2013-05-03 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * spawn.cc (ILLEGAL_SIG_FUNC_PTR): New define.
+ (system_call_handle): Rename from system_call_cleanup.
+ (is_system_call): New convenience method.
+ (system_call_handle::system_call_handle): Use ILLEGAL_SIG_FUNC_PTR
+ rather than cast. Call sig_send here rather than in caller.
+ Initialize oldint.
+ (system_call_handle::arm): New function pulled from constructor.
+ (~system_call_handle::system_call_handle): Use is_system_call().
+ (child_info_spawn::worker): Use system_call_handle to set up for system
+ call early. Use arm call prior to waiting for child to properly set up
+ signal handling. Move comment closer to code it is commenting on.
+
+2013-05-01 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * resource.cc (setrlimit): Use consistent commenting style. Return
+ EINVAL when rlim_cur > rlim_max.
+
+2013-04-30 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ Throughout, (mainly in fhandler*) fix remaining gcc 4.7 mismatch
+ warnings between regparm definitions and declarations.
+ * smallprint.cc (__small_vswprintf): Conditionalize declaration and
+ setting of l_opt for only x86_64.
+ * spawn.cc (child_info_spawn::worker): Remove unused 'pid' variable.
+ * thread.cc (verifyable_object_isvalid): Temporarily define as
+ non-inline with gcc 4.7+, regardless of target.
+
+2013-04-30 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * gendef: Fix sigfe.s typo.
+
+2013-04-30 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * spawn.cc (system_call_cleanup): Rename from pthread_cleanup. Extend
+ functionality.
+ (system_call_cleanup::system_call_cleanup): Set up signals like
+ system() requires. Unblock previously-blocked signal handling.
+ (system_call_cleanup::~system_call_cleanup): Restore signal handling
+ after system().
+ (child_info_spawn::worker): Put signals on hold and use
+ system_call_cleanup class to set and restore signals rather than doing
+ it prior to to running the program. Remove the ill-conceived
+ pthread_cleanup stuff.
+
+2013-04-30 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * exceptions.cc (cygwin_exception::dumpstack): Guard against wild
+ pointer dereference.
+ (CYG_EXC_CONTINUE_EXECUTION): Define based on standard Windows
+ definition.
+ (CYG_EXC_CONTINUE_SEARCH): Ditto.
+ (exception::handle): Move andreas detection earlier. Make comment
+ clearer.
+ (signal_exit): Set core-dumped flag.
+
+2013-04-30 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * i686.din: New file.
+ * x86_64.din: New file.
+ * common.din: New file.
+ * cygwin.din: Delete.
+ * cygwin64.din: Delete.
+ * gendef: Rework to take options rather than using positional
+ parameters. Accept multiple files as input.
+ * Makefile.in: Rework to allow multiple .din files as input to gendef.
+ * configure.in: Change names of .din files to be expressively target
+ specific.
+ * aclocal.m4: Regenerate.
+ * configure: Ditto.
+
+2013-04-29 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * autoload.cc (CreateSymbolicLinkW): Rename from CreateSymbolicLink.
+
+2013-04-26 Corinna Vinschen <corinna@vinschen.de>
+
+ * fcntl.cc (fcntl): Define as export alias for fcntl64 on x86_64.
+
+2013-04-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc (CreateSymbolicLink): Define.
+ * environ.cc (set_winsymlinks): Set allow_winsymlinks.
+ (parse_thing): Change "winsymlinks" to set by function.
+ * globals.cc (enum winsym_t): Define.
+ (allow_winsymlinks): Define as winsym_t.
+ (ro_u_afs): New R/O Unicode string.
+ * mount.cc (fs_info::update): Fix comment. Handle AFS.
+ (fs_names): Add "afs".
+ * mount.h (enum fs_info_type): Add afs.
+ (class fs_info): Implement afs.
+ * path.cc (symlink): Drop third parameter in call to symlink_worker.
+ (symlink_nfs): New function.
+ (symlink_native): New function.
+ (symlink_worker): Drop third argument. Handle native symlink type by
+ calling symlink_native. Move code to handle NFS to symlink_nfs. Fix
+ formatting. Slightly restructure code.
+ * path.h (class path_conv): Add fs_is_afs method.
+ (symlink_worker): Declare here.
+ * security.h: Define privilege constants as unsigned int instead of as
+ unsigned long.
+ * syscalls.cc (mknod_worker): Set third parameter in symlink_worker
+ call to WSYM_lnk.
+ * winsup.h (symlink_worker): Drop declaration here.
+
+2013-04-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin64.din (_setjmp): Export.
+ (_longjmp): Export.
+
+2013-04-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details.
+
2013-04-22 Corinna Vinschen <corinna@vinschen.de>
* include/sys/queue.h: Delete in favor of more complete newlib file.
diff --git a/winsup/cygwin/ChangeLog.64bit b/winsup/cygwin/ChangeLog.64bit
new file mode 100644
index 000000000..3d91c9a4c
--- /dev/null
+++ b/winsup/cygwin/ChangeLog.64bit
@@ -0,0 +1,1877 @@
+2013-04-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ * include/stdint.h (INTPTR_MAX): Fix missing parenthesis.
+
+2013-04-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_tty.cc (fhandler_pty_slave::write): Change type of towrite to
+ ssize_t.
+ (fhandler_pty_slave::read): Ditto for totalread.
+
+2013-04-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * net.cc (fdsock): Raise send/recv buffer sizes for x86_64. Extend
+ comment.
+ (cygwin_setsockopt): Fix condition and syscall_printf.
+
+2013-04-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Fix typo in
+ debug_printf.
+ (fhandler_base_overlapped::raw_read): Handle size difference between
+ DWORD and {s}size_t platform-independently.
+ (fhandler_base_overlapped::raw_write): Ditto. Fix typo in comment.
+
+2013-04-10 Corinna Vinschen <corinna@vinschen.de>
+
+ * Reinstantiate ptmalloc3.
+ * configure.ac (MALLOC_OFILES): Drop here.
+ * configure: Regenerate.
+ * Makefile.in (MALLOC_OFILES): Set to fixed value here.
+ * cygmalloc.h (HAVE_MORECORE): Define.
+ * malloc.cc (init_user_mstate): Don't disable MORECORE if building
+ with ONLY_MSPACES.
+
+2013-04-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * mount.cc (MINIMAL_WIN_NTFS_FLAGS): Fix comment.
+
+2013-04-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * Throughout fix -Wextra warnings. Ignore regex files and gmon.c.
+
+2013-04-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_socket.cc (fhandler_socket::send_internal): Change type of
+ local variable res to ssize_t.
+ * net.cc (cygwin_sendto): Fix local variable res, containing return
+ value, to be ssize_t as well.
+ (cygwin_recvfrom): Ditto.
+ (cygwin_recv): Ditto.
+ (cygwin_send): Ditto.
+ (cygwin_recvmsg): Ditto.
+ (cygwin_sendmsg): Ditto.
+ * syscalls.cc (write): Ditto.
+ (writev): Ditto.
+ * pipe.cc (fhandler_pipe::open): Fix type when reading handle value to
+ accommodate 32 bit compiler.
+
+2013-04-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Use %lu as
+ format specifier to match HANDLE size.
+ * net.cc (cygwin_sendto): Fix return type to be ssize_t. Change
+ syscall_printf return type format specifier to %lR.
+ (cygwin_recvfrom): Ditto.
+ (cygwin_recv): Ditto.
+ (cygwin_send): Ditto.
+ (cygwin_recvmsg): Ditto.
+ (cygwin_sendmsg): Ditto.
+ * smallprint.cc (__small_vsprintf): Handle `l' for %R, too.
+ (__small_vswprintf): Ditto.
+ * syscalls.cc (read): Change syscall_printf return type format specifier
+ to %lR.
+ (readv): Ditto.
+ (pread): Ditto.
+ (write): Ditto.
+ (writev): Ditto.
+ (pwrite): Ditto.
+ (lseek64): Enhance comment.
+
+2013-04-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * pipe.cc (fhandler_pipe::open): Fix format specifier and type when
+ reading handle value.
+ (fhandler_pipe::get_proc_fd_name): Use same format specifier as in
+ fhandler_pipe::open.
+
+2013-04-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.cc (_csbrk): Move down in file, right in front of _cmalloc.
+
+2013-04-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.h (struct _cmalloc_entry): Define b as unsigned rather than
+ DWORD.
+ (NBUCKETS): Define here as constant value.
+ (struct init_cygheap): Add bucket_val member. Define size of bucket_val
+ and buckets using NBUCKETS.
+ * cygheap.cc (NBUCKETS): Drop definition here.
+ (cygheap_init): Initialize cygheap->bucket_val. Add comment to explain
+ what we do and why.
+ (_cmalloc): Simplify bit bucket search using cygheap->bucket_val. Drop
+ local variable sz. Fetch size of block from cygheap->bucket_val.
+ (_cfree): Define b as unsigned.
+ (_crealloc): Fetch size of block from cygheap->bucket_val.
+
+2013-04-02 Алексей Павлов <alexpux@gmail.com>
+
+ * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Add missed
+ ampersand.
+
+2013-03-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * lc_msg.h: Regenerate from F18 glibc 2.16-28. In the first place this
+ fixes fi_FI and adds ta_LK (new in Windows 8).
+ * nlsfuncs.cc (LocaleNameToLCID): Drop unneeded declaration.
+
+2013-03-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc: Drop old comment.
+ * hookapi.cc (PEHeaderFromHModule): Return PIMAGE_NT_HEADERS.
+ (rvadelta): Convert to function and merge in rvadelta_get.
+ (remap): New function to have code for remapping big executables
+ only once.
+ (find_first_notloaded_dll): Simplify. Don't handle different
+ architecture at all. Call remap.
+ (hook_or_detect_cygwin): Ditto.
+
+2013-03-28 Kai Tietz <ktietz@redhat.com>
+
+ * include/cygwin/config.h (___getreent): Harden against aggressive
+ compiler optimization.
+
+2013-03-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin64.din: Reinstantiate definition of __srget and __srget_r.
+
+2013-03-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in ($(LIB_NAME)): Make sure to rebuild when cygwin.def file
+ has been changed.
+ * cygwin64.din: Remove more underscored symbols.
+ (getdelim): Add missing define in favor of unneeded __getline.
+ (getline): Ditto.
+
+2013-03-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_console.cc
+ (fhandler_console::create_invisible_console_workaround): Fix comment.
+ * wincap.cc: Throughout, remove unused has_console_handle_problem
+ wincapc members.
+ * wincap.h (struct wincaps): Remove has_console_handle_problem.
+
+2013-03-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * net.cc (cygwin_gethostbyname): Revert accidental checkin of change
+ added for debugging.
+
+2013-03-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * net.cc (struct win64_servent): Define for x86_64. Explain why.
+ (WIN_SERVENT): Define for all targets.
+ (dup_ent): Use WIN_SERVENT to access critical servent members
+ throughout.
+
+2013-03-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * sysconf.cc (sca): Change build environment values according to
+ architecture.
+ (csa): Ditto.
+
+2013-03-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * ntdll.h (STATUS_NETWORK_OPEN_RESTRICTION): Define.
+ (STATUS_SYMLINK_CLASS_DISABLED): Define.
+ * path.cc (symlink_info::check): Handle STATUS_NETWORK_OPEN_RESTRICTION
+ and STATUS_SYMLINK_CLASS_DISABLED status codes. Explain why.
+
+2013-03-22 Kai Tietz <ktietz@redhat.com>
+
+ * gendef: Use pause instead of calling yield throughout in x86_64 code.
+
+2013-03-20 Ken Brown <kbrown@cornell.edu>
+
+ * include/sys/resource.h (RLIM_INFINITY): Define wordsize agnostic.
+
+2013-03-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ * lib/_cygwin_crt0_common.cc: Fix mangled operator new names for x86_64.
+
+2013-03-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * exceptions.cc (stack_info::init): Don't attempt to dereference NULL
+ framep.
+ (exception::handle): On x86_64, if Rbp is NULL, use Rsp as frame
+ pointer.
+
+2013-03-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef (sigdelayed): Make sure to align the stack since sigdelayed
+ can be called with or without aligned stack. Save and restore all
+ CPU registers.
+
+2013-03-18 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.sc.in: Fix comment.
+ * dcrt0.cc (child_info_fork::handle_fork): Revert patch from 2013-03-15.
+
+2013-03-17 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin64.din (strlwr): Export.
+
+2013-03-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * Revert previous patch. For some reason perl doesn't like it.
+
+2013-03-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.h (CYGTLS_PADSIZE): Reduce to 8000 on x86_64.
+ * tlsoffsets64.h: Regenerate.
+
+2013-03-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * dcrt0.cc (child_info_fork::handle_fork): Call
+ _pei386_runtime_relocator first thing, before copying parent data and
+ bss segment. Tweak comment to explain why.
+
+2013-03-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef (_sigfe): 16-byte align xmm0 storage and use movdqa.
+ (_sigbe): Fix alignment before calling yield. Use movdqa to save and
+ restore xmm0.
+ (sigdelayed): Use movdqa to save and restore xmm0.
+ (_ZN7_cygtls4lockEv): Change absolute values to hex.
+ (stabilize_sig_stack): Ditto.
+ (setjmp): Add comment to explain usage of movdqu.
+ (__sjfault): Ditto.
+ (__ljfault): Ditto.
+ (longjmp): Ditto. Access return value using 32 bit opcodes only.
+ * miscfuncs.cc (thread_wrapper): Don't attempt to copy exception
+ handler list on x86_64.
+
+2013-03-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc (.#dllname_info): Call _std_dll_init on x86_64 bit, too.
+ (INIT_WRAPPER): Change to accommodate the change of the init functions
+ from sysv_abit to ms_abi. Fix preceeding comment accordingly. Add
+ SEH information and comments.
+ (std_dll_init): Drop leading underscore on x86_64. Drop sysv_abi
+ comment.
+ (wsock_init): Ditto.
+ (LoadDLLprime): Drop surrounding ifdef to accommodate above underscore
+ juggling.
+
+2013-03-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef (_sigfe): Save float arguments as well before calling yield.
+ (_sigbe): Move saving %rax from prologue to just before the yield call.
+ Save %xmm0 register, too.
+ (sigdelayed): Add comment. Save %xmm0 register, too, before calling
+ yield.
+
+2013-03-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_tty.cc (fhandler_pty_master::setup): Add
+ PIPE_REJECT_REMOTE_CLIENTS to pipe mode on systems supporting it. Add
+ FILE_FLAG_FIRST_PIPE_INSTANCE to pipe open mode.
+ * pipe.cc (fhandler_pipe::create): Ditto. Fix subsequent comment
+ accordingly.
+ * wincap.h (wincaps::has_pipe_reject_remote_clients): New element.
+ * wincap.cc: Implement above element throughout.
+ * winlean.h (PIPE_REJECT_REMOTE_CLIENTS): Temporarily define until
+ Mingw64 headers define it.
+
+2013-03-14 Corinna Vinschen <corinna@vinschen.de>
+
+ Remove more old cruft. Remove Windows NT4 and 2000 from comments
+ throughout, unless it still makes sense.
+ * dlfcn.cc (dlopen): Drop W2K-only code to make loaded DLL persistent.
+ * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Drop code
+ trying to use information from NtQueryVolumeInformationFile.
+ * fhandler_socket.cc (fhandler_socket::close): Drop code snippet
+ disabled since 2008.
+ * mount.cc (MINIMAL_WIN_NTFS_FLAGS): Add flag values set on all
+ NTFS since Windows XP.
+ (get_volume_path_names_for_volume_name): Remove.
+ (dos_drive_mappings::dos_drive_mappings): Call Win32 function
+ GetVolumePathNamesForVolumeNameW directly.
+ * path.cc (file_get_fnoi): Drop test for NT4-only return code.
+ * sched.cc: Add FIXME to global comment. Reformat comments throughout.
+ * spawn.cc (child_info_spawn::worker): Just call official IsProcessInJob
+ function rather than to test undocumented TEB member.
+ * winlean.h: Drop Mingw32-related defines.
+ * include/limits.h (PTHREAD_KEYS_MAX): Raise value to reflect minimum
+ value available on XP and later.
+
+2013-03-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * Revert to old malloc.
+ * mmap.cc (MMAP_STORAGE_LOW): Set higher. Add comment.
+ (MMAP_STORAGE_HIGH): Add comment.
+ (class mmap_allocator): Change comment. Add mmap_current_low member.
+ (mmap_allocator::mmap_allocator): Define default constructor.
+ (mmap_allocator::alloc): Change to a round-robin mechanism. Add or
+ change comments accordingly.
+
+2013-03-13 Kai Tietz <ktietz@redhat.com>
+ Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef (_sigfe): Save arguments before calling yield so they don't
+ get clobbered. Explain why.
+
+2013-03-12 Ken Brown <kbrown@cornell.edu>
+
+ * include/a.out.h: Fix up for x86_64.
+
+2013-03-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * smallprint.cc (rnarg): Fix cast to print negative values correctly.
+
+2013-03-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.cc (fhandler_base::raw_read): Replace accidentally left in
+ Win32 error codes with equivalent status codes.
+
+2013-03-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygmalloc.h: Include regparm.h rather than defining __reg{1,2,3} here.
+ * ptmalloc3.cc (__malloc_initialized): Define as type LONG on Cygwin
+ and include windows.h.
+ (ptmalloc_init): Set __malloc_initialized on Cygwin using
+ InterlockedCompareExchange and carefully check for concurrency
+ situation.
+
+2013-03-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef: Add SEH information to sigfe entry points, as well as to
+ _sigfe and _sigbe.
+
+2013-03-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * heap.cc (heap_init): Fix setting reserved_size value when using
+ ptmalloc3 to avoid too much pagefile pressure at fork time.
+
+2013-03-05 Corinna Vinschen <corinna@vinschen.de>
+
+ For x86_64 target:
+ * dll_init.cc (dll::init): Don't set p.envptr.
+ (update_envptrs): Disable entirely.
+ * dll_init.h (struct per_module): Disable envptr.
+ * environ.h (update_envptrs): Change to empty macro.
+
+2013-03-05 Corinna Vinschen <corinna@vinschen.de>
+
+ For x86_64 target:
+ * Makefile.in (COMMON_CFLAGS): Add -mcmodel=small to create smaller
+ footprint.
+ * cygwin64.din (__cygwin_environ): Drop export. Only export environ
+ as alias to __cygwin_environ.
+ * dcrt0.cc (dll_crt0_1): Call main with __cygwin_environ as parameter.
+ (_dll_crt0): Don't set main_environ.
+ (cygwin_dll_init): Don't create local variable envp and don't set
+ user_data->envptr.
+ * dll_init.cc (dll_list::alloc): Don't assert.
+ * dll_init.h (per_module::operator =): Don't set envptr.
+ * environ.cc (cur_environ): Disable.
+ * environ.h (main_environ): Don't define.
+ (cur_environ): Change to macro.
+ * globals.cc (main_environ): Don't initialize.
+ (struct per_process): Drop envptr.
+ * perprocess.h (SIZEOF_PER_PROCESS): Set to 41*8 to accommodate size
+ change of struct per_process.
+ * include/sys/cygwin.h (struct per_process): Drop envptr.
+ * lib/_cygwin_crt0_common.cc (environ): Drop declaration.
+ (_cygwin_crt0_common): Don't set u->envptr.
+
+2013-03-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ * cygwin64.din: Fix mangled operator new names for size_t==long.
+ * libstdcxx_wrapper.cc: Ditto for x86_64.
+
+2013-03-01 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc (AttachConsole): Remove.
+ (GetModuleHandleExW): Remove.
+ (GetSystemWow64DirectoryW): Remove.
+ (GetVolumePathNamesForVolumeNameW): Remove.
+ * exceptions.cc (cygwin_stackdump): Always call RtlCaptureContext.
+ (exception::handle): Drop accidentally left in debugging statement.
+ Always call RtlCaptureContext.
+ (sigpacket::process): Always call RtlCaptureContext for current thread.
+ * fhandler_disk_file.cc (fstatvfs): Drop code using
+ FileFsSizeInformation.
+ (struct __DIR_cache): Remove comment.
+ (fhandler_disk_file::rewinddir): Drop W2K-only code.
+ * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Don't
+ check for old OS. Extend a comment.
+ * fhandler_mem.cc (fhandler_dev_mem::open): Drop NT4 and W2K from
+ debug output.
+ * fhandler_proc.cc (format_proc_partitions): Drop Pre-XP considerations.
+ * fhandler_procnet.cc (fhandler_procnet::exists): Ditto.
+ (fhandler_procnet::readdir): Ditto.
+ (format_procnet_ifinet6): Ditto.
+ * fhandler_socket.cc (fhandler_socket::recvmsg): Ditto.
+ * fhandler_tape.cc (mtinfo_drive::get_status): Ditto.
+ * init.cc (dll_entry): Drop W2K-only code.
+ * net.cc (get_ifs): Rename from get_xp_ifs.
+ (get_2k_ifs): Remove.
+ (getifaddrs): Always call get_ifs.
+ (get_ifconf): Ditto.
+ (if_nametoindex): Drop Pre-XP considerations.
+ (load_ipv6_funcs): Ditto. Fix preceeding comment.
+ * sec_auth.cc (lsaauth): Drop code handling fake_login_sid.
+ * sec_helper.cc (fake_logon_sid): Remove.
+ (set_cygwin_privileges): Fix uncommented statement to drop pre-XP
+ considerations.
+ * security.h (fake_logon_sid): Drop declaration.
+ * shared.cc (shared_info::init_obcaseinsensitive): Drop W2K-only code.
+ * wincap.cc: Throughout, remove setting all deprecated wincapc members.
+ (wincap_minimal): Set to wincap_xpsp2.
+ (wincap_2000): Remove.
+ (wincap_2000sp4): Remove.
+ (wincap_xp): Remove.
+ (wincap_xpsp1): Remove.
+ (wincapc::init): Drop OS 5.0 and pre-SP2 XP.
+ * wincap.h (struct wincaps): Remove the following members:
+ has_create_global_privilege, has_ioctl_storage_get_media_types_ex,
+ has_disk_ex_ioctls, has_buggy_restart_scan, needs_logon_sid_in_sid_list,
+ has_gaa_prefixes, has_recvmsg, has_stack_size_param_is_a_reservation,
+ kernel_is_always_casesensitive, has_rtl_capture_context.
+
+2013-03-01 Corinna Vinschen <corinna@vinschen.de>
+
+ * exceptions.cc (rtl_unwind): Convert to macro doing nothing on x86_64.
+ (exception::handle): Drop creating frame variable on x86_64.
+ * wincap.cc (wincap_2000sp4): Set has_rtl_capture_context to false.
+
+2013-03-01 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygserver.h (struct header_t): Revert msglen to simple member.
+ Drop accessor methods.
+ * cygserver_ipc.h (struct proc): Drop enforced 4 byte struct packing.
+ Remove members for 64<->32 bit IPC. Revert to original member order.
+ (ipc_set_proc_info): Remove 64<->32 handling.
+ (conv_timespec32_to_timespec): Delete.
+ (conv_timespec_to_timespec32): Delete.
+ * pinfo.h (struct win_heap_info): Remove.
+ * shm.cc (fixup_shms_after_fork): Revert parent initialization.
+ * winlean.h: Remove _TYPE64_CLR and _TYPE64_SET macros. Remove
+ usage throughout code.
+ * include/cygwin/ipc.h: Drop 64<->32 bit helper structures.
+ * include/cygwin/msg.h: Ditto. Drop enforced 4 byte struct packing.
+ * include/cygwin/sem.h: Ditto.
+ * include/cygwin/shm.h: Ditto.
+ * include/cygwin/sysproto.h: Drop enforced 4 byte struct packing.
+
+2013-02-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * pseudo-reloc.cc (do_pseudo_reloc): Add test to check for invalid 32
+ bit relocation in 64 bit code. Only test when building without
+ optimization.
+
+2013-02-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * exceptions.cc (_cygtls::signal_debugger): Raise size of sigmsg buffer
+ on x86_64.
+ * tlsoffsets64.h: Regenerate.
+
+2013-02-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/signal.h (struct ucontext): Add missing fields from
+ Windows CONTEXT definition. Define oldmask as 64 bit type.
+
+-- post-ptmalloc3 tag
+
+2013-02-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * configure.ac (MALLOC_OFILES): Add ptmalloc3.o.
+ * configure: Regenerate.
+ * cygmalloc.h: Declare pt* functions rather than dl* functions.
+ (mmap64): Declare.
+ (mmap): Define as mmap64.
+ (__malloc_lock): Drop macro.
+ (__malloc_unlock): Ditto.
+ (MSPACES): Define.
+ (ONLY_MSPACES): Define.
+ * debug.h: Include malloc.h rather than otherwise unused dlmalloc.h.
+ * fork.cc (frok::parent): Drop malloc locking since that's performed
+ by malloc_atfork now.
+ * heap.cc (heap_init): Accommodate the fact that there's a chance
+ that no heap space has been allocated at fork time.
+ * malloc-private.h: New file from ptmalloc3, having malloc-machine.h
+ and malloc-2.8.3.h folded in.
+ * malloc.cc: Replaced by new file from ptmalloc3.
+ * malloc_wrapper.cc: Throughout, remove malloc locks and call pt*
+ functions rather than dl* functions.
+ * pinfo.cc (winpids::set): Drop malloc locking.
+ * ptmalloc3.cc: New file from ptmalloc3.
+
+-- pre-ptmalloc3 tag
+
+2013-02-26 Corinna Vinschen <corinna@vinschen.de>
+
+ * exception.h (_except_list): Don't define on x86_64.
+ (class exception): Don't define members el and save on x86_64.
+ (exception::~exception): Don't define on x86_64.
+ * exceptions.cc (signal_exit): Fix typo in condition.
+
+2013-02-25 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin64.din: Remove all deprecated cygwin32_foo and cygwin_foo
+ path conversion functions.
+ * path.cc: Disable aforementioned functions on x86_64.
+ * include/sys/cygwin.h: Don't declare aforementioned functions on
+ x86_64.
+
+2013-02-25 Corinna Vinschen <corinna@vinschen.de>
+
+ * exception.h (class exception): Add handler_installed member.
+ Change parameters to handle method to match high-level exception
+ handler calls.
+ (exception::exception): On x86_64, install exception handler only
+ once. Explain what we do.
+ * exceptions.cc (_AFMT): Change to only 11 digits on x86_64.
+ (cygwin_exception::dump_exception): Print Rip with only 11 digits.
+ Print 64 bit registers with 0-padding.
+ (class stack_info): Add members c and hist on x86_64.
+ (stack_info::init): Take PCONTEXT rather than bool as third parameter.
+ Tweak code accordingly. Initialize c and hist on x86_64.
+ (stack_info::walk): Add implementation for x86_64. Drop unneeded
+ #ifndef in 32 bit code.
+ (cygwin_exception::dumpstack): Call thestack.init with context as
+ parameter. Change header output for x86_64.
+ (cygwin_stackdump): Prefer RtlCaptureContext over GetThreadContext.
+ (CYG_EXC_CONTINUE_EXECUTION): Define generic definition matching all
+ platforms.
+ (CYG_EXC_CONTINUE_SEARCH): Ditto.
+ (exception::handler_installed): Define here.
+ (exception::handle): Define according to declaration in exception.h.
+ Create 32 bit parameters as local variable on 64 bit. Change all
+ return statements to use generic definitions. Simplify setting framep
+ on x86_64. Disable setting frame-based exception handler on x86_64.
+ Fix formatting of klog output for x86_64.
+ (signal_exit): Create context for cygwin_exception creation.
+ (sigpacket::process): Prefer RtlCaptureContext over GetThreadContext.
+ * wincap.h (wincaps::has_rtl_capture_context): New element.
+ * wincap.cc: Implement above element throughout.
+
+2013-02-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+ Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.din (_get_osfhandle): Make main export. Define get_osfhandle
+ from here.
+ * cygwin64.din (_get_osfhandle): Rename from get_osfhandle.
+ (_setmode): Rename from setmode.
+ * include/io.h: Ditto. Define unprefixed names with preprocessor
+ macros for backwards source compatibility.
+ (access): Remove.
+ * syscalls.cc (_setmode): Rename from setmode.
+ (cygwin_setmode): Call _setmode.
+ (_get_osfhandle): Rename from get_osfhandle.
+
+2013-02-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (target_cpu): Define. Check for target_cpu rather than
+ target_alias for conditional compilation issues.
+ (toolopts): Change --target into --cpu option and use $target_cpu as
+ argument.
+ ($(DEF_FILE)): Call gendef with $(target_cpu) as argument, rather than
+ with $(target_alias).
+ * gendef: Accommodate change from --target to --cpu option.
+ * mkimport: Ditto.
+ * speclib: Ditto.
+
+2013-02-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ * cygserver_ipc (class ipc_retval): Add ssize_t member to anonymous
+ union.
+ (ipc_retval::operator =): Add ssize_t variant for x86_64.
+ * fhandler_floppy.cc (fhandler_dev_floppy::raw_write): Change return
+ type to ssize_t to match fhandler.h.
+ * fhandler_socket.cc (fhandler_socket::readv): Ditto.
+ (fhandler_socket::write): Ditto.
+ (fhandler_socket::writev): Ditto.
+ (fhandler_socket::sendmsg): Ditto.
+
+2013-02-18 Corinna Vinschen <corinna@vinschen.de>
+
+ * localtime.cc: Add comment.
+
+2013-02-18 Corinna Vinschen <corinna@vinschen.de>
+
+ * localtime.cc: Throughout, pull up to latest code from NetBSD.
+
+2013-02-18 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.cc (fhandler_base::raw_read): Rearrange code to use
+ NtReadFile and to fix problem using pointer to wrongly sized variable
+ on x86_64.
+ (fhandler_base::read): Drop redundant code.
+ * fhandler_disk_file.cc (fhandler_disk_file::pread): Fix function
+ to not read the information twice. Handle STATUS_END_OF_FILE.
+
+2013-02-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ * Makefile.in (libcygwin.a): Move --target flag from here...
+ (toolopts): to here, to be used by both mkimport and speclib.
+ * speclib: Omit leading underscore in symbol names on x86_64.
+
+2013-02-17 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.sc.in (.gnu_debuglink_overlay): Drop "64" in dbg file name.
+
+2013-02-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * nfs.h: Make sure packing of NFS fattr3 struct is 4 byte.
+ (struct nfs_timestruc_t): Define.
+ (struct fattr3): Define timestamps as type struct nfs_timestruc_t.
+ * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Copy
+ each timestruc_t component separately to accommodate different size.
+
+2013-02-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (toollibdir): Remove. Revert to using tooldir instead.
+ * configure.ac (DLL_NAME): Set to cygwin1.dll in x86_64 case, too.
+ * configure: Regenerate.
+ * cygwin.sc.in (SEARCH_DIR): Align to 32 bit search dir, use lib, rather
+ than lib64.
+ * cygwin64.din (LIBRARY): Set name to cygwin1.dll.
+ * fhandler_process.cc (struct heap_info): Drop win_heap_info class
+ and revert code to former heap_info implementation.
+ (format_process_maps): Define heaps back to heap_info
+ * hookapi.cc (hook_or_detect_cygwin): Add shortcut so the code does
+ not search executable for being a Cygwin executable, if the architecture
+ is not matching the current Cygwin. Always use for "cygwin1.dll".
+ * pinfo.cc (commune_process): Drop PICOM_HEAP_INFO code.
+ (_pinfo::commune_request): Ditto.
+ (_pinfo::win_heap_info): Remove.
+ * pinfo.h (enum picom): Remove PICOM_HEAP_INFO.
+
+2013-02-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc (two_addr_t): Use __uint64_t as type for the i686
+ version, analogue to __uint128_t for x86_64.
+ (INIT_WRAPPER): New x86_64 macro to install a sysv_abi function wrapper
+ for the DLL init functions. Add long comment to explain why this is
+ necessary. Create wrapper for std_dll_init and wsock_init.
+ (std_dll_init): Rename with leading underscore on x86_64 and take
+ calling function as argument. Disable overwriting return address on
+ stack for x86_64.
+ (wsock_init): Ditto.
+
+2013-02-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (toollibdir): Define build and target dependent.
+ (install-libs): Use $(toollibdir) rather than $(tooldir)/lib.
+ (uninstall-libs): Ditto.
+ (uninstall-man): Use $(DESTDIR)$(mandir) as in install-man, rather
+ than $(tooldir)/man.
+
+2013-02-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * heap.cc (eval_start_address): Move heap to 0x6:00000000. Change
+ comment to explain why.
+ * mmap.cc (MMAP_STORAGE_LOW): Accommodate above change.
+
+2013-02-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_floppy.cc (fhandler_dev_floppy::open): Cast second parameter
+ in roundup2 to same size as first parameter to make sure mask size is
+ correct.
+ * fhandler_process.cc (format_process_maps): Ditto.
+ * fhandler_raw.cc (fhandler_dev_raw::dup): Ditto.
+ * hookapi.cc (find_first_notloaded_dll): Add cast.
+ * spawn.cc (av::fixup): Ditto.
+ * wincap.h: Add comment to explain the following change.
+ (wincapc::page_size): Return size_t.
+ (wincapc::allocation_granularity): Ditto.
+
+ * mmap.cc: Throughout, accommodate the fact that AT_ROUND_TO_PAGE isn't
+ support on 64 bit at all.
+ (class mmap_allocator): New class to allocate mmap slots on x86_64.
+ (mmap_alloc): Define global instant of mmap_allocator.
+ (mmap64): Call mmap_alloc.alloc on x86_64.
+
+2013-02-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef (longjmp): Fix indirect addressing in x86_64 setjmp.
+
+2013-02-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin64.din: Add missing symbols.
+ * mkimport: Make sure to use and test against platform dependent
+ "imp" prefix.
+
+2013-02-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.sc.in (.rdata): Add .rdata_cygwin_nocopy subsection.
+ (.cygheap): Raise size to 3 Megs on x86_64.
+ * dcrt0.cc (dll_crt0_0): Drop call to init_global_security.
+ * dtable.cc (std_consts): Drop NO_COPY.
+ * errno.cc (errmap): Drop NO_COPY, constify instead.
+ (_sys_errlist): Drop NO_COPY.
+ * fhandler_clipboard.cc (CYGWIN_NATIVE): Ditto.
+ * fhandler_console.cc (keytable): Drop NO_COPY, constify instead.
+ * grp.cc (null_ptr): Make NO_COPY_RO.
+ * heap.cc (eval_start_address): Fix comment.
+ * localtime.cc (wildabbr): Make NO_COPY_RO.
+ (gmt): Ditto.
+ * miscfuncs.cc (case_folded_lower): Drop NO_COPY.
+ (case_folded_upper): Ditto.
+ (isalpha_array): Ditto.
+ (nice_to_winprio): Ditto for priority.
+ (class thread_allocator): New class to allocate thread stack on x86_64.
+ (thr_alloc): Define global NO_COPY instant of thread_allocator.
+ (CygwinCreateThread): Call thr_alloc.alloc on x86_64 to reserve stack.
+ * net.cc (errmap): Drop NO_COPY, constify instead.
+ (host_errmap): Ditto.
+ * netdb.cc (SPACE): Drop NO_COPY.
+ * sec_helper.cc (null_sdp): Static NO_COPY_RO definition of null SD.
+ (sec_none): Define NO_COPY_RO, define content statically.
+ (sec_none_nih): Ditto.
+ (sec_all): Ditto.
+ (sec_all_nih): Ditto.
+ (get_null_sd): Remove.
+ (init_global_security): Remove.
+ * security.cc (file_mapping): Define NO_COPY_RO.
+ (check_registry_access): Ditto for reg_mapping.
+ * spawn.cc (exe_suffixes): Drop NO_COPY, constify instead.
+ (dll_suffixes): Drop unused, disabled definition and comment.
+ * strsig.cc (sys_sigabbrev): Drop NO_COPY_INIT.
+ (sys_siglist): Ditto.
+ * syscalls.cc (def_shells): Drop NO_COPY.
+ * winsup.h (NO_COPY_RO): Define to place variable in
+ .rdata_cygwin_nocopy section.
+ (init_global_security): Drop declaration.
+
+2013-02-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_process.cc (win_heap_info::~win_heap_info): Only try to free
+ heap_vm_chunks if it's not NULL.
+ * pinfo.h (struct commune_result): Change type of n to DWORD.
+ * pinfo.cc (_pinfo::commune_request): Change type of n to DWORD to
+ fix subsequent sizeof test after reading from commune pipe on x86_64.
+ Raise read timeout to match write timeout.
+
+2013-02-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygserver_ipc.h (ipc_retval::operator =): Disable size_t variant
+ on x86_64 since type is identical to vm_offset_t.
+
+2013-02-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * regparm.h: New file to define platform dependent regparm attributes.
+ Define all of them empty if __CYGMAGIC__ is defined.
+ * cygerrno.h: Include regparm.h instead of defining _reg[123] here.
+ * winsup.h: Ditto.
+ * cygmagic: Define __CYGMAGIC__ to help generate same result on all
+ platforms.
+
+2013-02-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin64.din (BASE): Set to 0x180040000.
+ (_fe_dfl_env): Remove useless symbol.
+ (_fe_nomask_env): Remove useless symbol.
+ (exit): Add missing symbol.
+ (setmode): Ditto.
+ * gendef (longjmp): Convert all displacements to hex for readability.
+ Change all movaps instructions to movdqu to accommodate unaligned
+ access to 128 bit values.
+
+2013-02-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * pseudo-reloc.cc (do_pseudo_reloc): Enable 64 bit code for x86_64
+ Cygwin.
+
+2013-02-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * miscfuncs.cc (RtlFillMemory): Declare.
+ (RtlCopyMemory): Declare.
+ (memset): Just call RtlFillMemory.
+ (memcpy): Just call RtlCopyMemory.
+ * mmap.cc (class mmap_record): Drop enforced packing. Reorder members
+ to allow tight packing on 32 as well as on 64 bit.
+ * include/sys/dirent.h: Don't enforced structure packing on x86_64.
+ (__DIRENT_COOKIE): Use different value on 64 bit.
+
+2013-02-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef (fefunc): Fix incorrect pc-relative jmp instruction.
+ (_sigfe): Fix offset to return address on stack. Add and fix comments.
+ (_sigbe): Fix stack alignment when creating spill area for call to
+ yield. Add and fix comments.
+ (sigdelayed): Add fake push to make sure stack is aligned correctly.
+ Use fake stack alignment on exit to store return address and call ret,
+ rather than jmp. Fix comments.
+ (_cygtls::lock): Only create and destroy spill area when really calling
+ yield.
+
+2013-02-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc (LoadDLLfuncEx3): Adjust address computation required
+ by latest change to the 64 bit code.
+ * cygmalloc.h (MALLOC_ALIGNMENT): Set to 16 on x86_64.
+ * cygtls.h: Set struct alignment to 8 on x86_64. Move inclusion of
+ other header files outside of alignment-enforced code area. Drop
+ inclusion of security.h entirely.
+ (_cygtls::get_signal_arrived): Use NULL SECURITY_ATTRIBUTES rather than
+ &sec_none_nih.
+ * gendef (_cygtls::lock): Fix stack alignment.
+ * heap.cc (page_const): Change type to ptrdiff_t, otherwise negation
+ operator in pround creates broken bitmask.
+ * shared.cc (page_const): Add cast to ptrdiff_t.
+ * tlsoffsets64.h: Regenerate.
+
+2013-01-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in ($(LIB_NAME)): Add --target option to mkimport call.
+ * gendef: Drop -w option. Make callto sigfe function pc-relative
+ on x86_64.
+ * miscfuncs.cc (__import_address): Drop comment and misguide attempt
+ to handle absolute addressing in x86_64 mode.
+ * mkimport: Add --target option. Handle x86_64 target, especially
+ create pc-relative jmp calls.
+
+2013-01-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.h: Cleanup x86_64 related comment.
+ (_tlsbase): Change return type to PVOID.
+ (_tlstop): Ditto.
+ (_my_tls): Accommodate above change.
+ * dcrt0.cc (child_info_fork::alloc_stack): Revert previous patch, but
+ keep cast to PVOID.
+ (dll_crt0_1): Ditto.
+ * exception.h: Define _exception_list as _EXCEPTION_REGISTRATION_RECORD
+ on x86_64.
+ (_except_list): Define in terms of NtCurrentTeb() on x86_64.
+ * miscfuncs.cc (__import_address): Handle 32 bit absolute addressing
+ in IAT on x86_64.
+ * include/cygwin/config.h (___getreent): New inline function on
+ x86_64. Define __getreent in terms of ___getreent on x86_64. Fix
+ comment accordingly.
+
+2013-01-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.h (_tlsbase): Temporary workaround for GCC bug.
+ (_tlsbase): Ditto.
+ * cygwin64.din: Set BASE temporariliy to address < 32 bit to workaround
+ GDB bug.
+ * dcrt0.cc (child_info_fork::alloc_stack): Temporary workaround for GCC
+ bug.
+ (dll_crt0_1): Ditto.
+ * miscfuncs.cc (memset): Temporary workaround missing MSABI function in
+ newlib.
+ (memcpy): Ditto.
+ * include/cygwin/config.h (__getreent): Drop definition for x86_64 to
+ workaround GCC bug.
+
+2013-01-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * winbase.h (ilockcmpexch): Define always.
+ (InterlockedCompareExchange): Ditto.
+ (ilockcmpexch64): Define for x86_64.
+ (InterlockedCompareExchange64): Ditto.
+ (InterlockedCompareExchangePointer): Define in terms of
+ InterlockedCompareExchange64 on x86_64.
+
+2013-01-29 Kai Tietz <ktietz@redhat.com>
+
+ * cygwin.sc.in: Fix ctors and dtors filler and zero-terminator for
+ 64 bit.
+
+2013-01-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (TEST_DLL_NAME): Fix to use correct name per target.
+ * gendef (fefunc): Resurrect accidentally dropped 32 bit code.
+
+2013-01-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * heap.cc (eval_start_address): Change address and comment for 64 bit.
+ (eval_initial_heap_size): Change return type to SIZE_T. Use different
+ values for 64 bit.
+
+2013-01-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef: Add missing setjmp/longjmp functionality, still untested.
+
+2013-01-25 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.sc.in: Accommodate extra .text, .pdata, and .xdata section on
+ 64 bit.
+ * cygwin64.din: Set BASE to 0x200040000 to start shared sections at
+ 0x200000000.
+ * gendef: Second cut 64 bit assembler functionality, still untested.
+
+2013-01-25 Kai Tietz <ktietz@redhat.com>
+
+ * autoload.cc (LoadDLLfuncEx3): Adjust assembler for x64 to avoid
+ relocations.
+ (noload): Likewise.
+
+2013-01-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * gendef: First cut 64 bit assembler functionality, untested.
+
+2013-01-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (speclib): Exclude main symbol.
+ (NEW_FUNCTIONS): Set to empty for x86_64.
+ ($(DEF_FILE)): Call gendef with target_alias as additional parameter.
+ * configure.ac (DLL_ENTRY): Drop leading underscore for x86_64.
+ * configure: Regenerate.
+ * cygwin.sc.in: Drop _SYM usage for __data_start__, __data_end__,
+ __bss_start__, and __bss_end__.
+ * cygwin64.din: Remove all fast-call math function entry points.
+ (_alloca): Define as __alloca.
+ (_dll_crt0): Drop 32 bit stdcall specifier.
+ (dll_entry): Ditto.
+ (dll_noncygwin_dllcrt0): Remove.
+ (getpwduid): Remove.
+ (lacl): Remove.
+ * dcrt0.cc (dll_data_start): Define for x86_64.
+ (dll_data_end): Ditto.
+ (dll_bss_start): Ditto.
+ (dll_bss_end): Ditto.
+ * gendef: Handle new target argument. Handle 64 bit target.
+ Add preliminiary empty function definitions for 64 bit to allow linking.
+ * winsup.h: Define linker data and bss section symbols with
+ additional underscore for x86_64.
+ * lib/_cygwin_crt0_common.cc (__image_base__): Define for 64 bit and
+ map to _image_base__ via macro.
+ (_cygwin_crt0_common): Fix setting data and bss section borders on
+ x86_64.
+
+2013-01-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * miscfuncs.cc (__import_address): Fix address computation for 64 bit.
+
+2013-01-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * dcrt0.cc (_cygwin_exit_return): Define to allow usage of same C
+ symbol name independent of target.
+ * perprocess.h (SIZEOF_PER_PROCESS): Define for x86_64.
+ * include/sys/cygwin.h (struct per_process): Tweak definition for
+ x86_64.
+
+2013-01-18 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/config.h (__SYMBOL_PREFIX): Define.
+ (_SYMSTR): Define.
+ * child_info.h (spawn_info): Use _SYMSTR macro to define assembler
+ symbol.
+ (fork_info): Ditto.
+ * libstdcxx_wrapper.cc: Ditto, throughout.
+ * winsup.h (dll_crt0): Ditto.
+ * include/cygwin/time.h (daylight): Ditto.
+ (timezone): Ditto.
+ * lib/_cygwin_crt0_common.cc: Ditto, throughout.
+
+2013-01-17 Corinna Vinschen <corinna@vinschen.de>
+
+ * child_info.h (spawn_info): Define asm symbol without leading
+ underscore for x86_64.
+ (fork_info): Ditto.
+ * cygwin.sc.in (__CONCAT1): Define.
+ (__CONCAT): Define.
+ (_SYM): Define.
+ (_data_start__): Define using _SYM macro to accommodate multiple
+ platforms.
+ (_data_end__): Ditto.
+ (_bss_start__): Ditto.
+ (_bss_end__): Ditto.
+ (_cygheap_start): Ditto.
+ (_cygheap_end): Ditto.
+
+2013-01-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/config.h (_tlsbase): Define for x86_64.
+
+2012-12-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.sc.in (.gnu_debuglink_overlay): Accommodate longer dbg file
+ name on 64 bit.
+
+2012-12-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * pinfo.h (enum picom): Add PICOM_HEAP_INFO.
+ (_pinfo::win_heap_info): Declare.
+ (struct win_heap_info): Rename from heap_info and define here. Change
+ to accommodate 64 bit.
+ * fhandler_process.cc (struct win_heap_info): Just implement here.
+ (win_heap_info::gen_heap_info): New method.
+ (format_process_maps): Accommodate above changes. Add FIXME comment
+ to explain 32->64 bit problem with VirtualQueryEx.
+ * pinfo.cc (commune_process): Handle PICOM_HEAP_INFO.
+ (_pinfo::commune_request): Ditto.
+ (_pinfo::win_heap_info): New method.
+
+2012-12-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.sc.in (OUTPUT_FORMAT): Fix typo in 64 bit code.
+ * spawn.cc (av::fixup): Drop '!!' to keep argument to set_cygexec a
+ void *.
+
+2012-12-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (TLSOFFSETS_H): Let configure fill in. Change all
+ occurence of tlsoffsets.h to $(TLSOFFSETS_H).
+ $(srcdir)/$(TLSOFFSETS_H): Add @CONFIG_DIR@ as parameter to
+ gentls_offsets so the script knows the target CPU.
+ * configure.ac (TLSOFFSETS_H): Set according to target.
+ * configure: Regenerate.
+ * gentls_offsets: Handle x86_64 as target. Add FIXME comment. Unlink
+ all temporary files.
+ * tlsoffsets64.h: New file.
+
+2012-12-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (DLL_NAME): Let configure fill in.
+ (DIN_FILE): Ditto. Change all occurence of cygwin.din to $(DIN_FILE).
+ * configure.ac (DLL_NAME): Set according to target.
+ (DIN_FILE): Ditto.
+ * configure: Regenerate.
+ * cygwin64.din: New file.
+
+2012-12-10 Corinna Vinschen <corinna@vinschen.de>
+
+ * posix_ipc.cc: Enforce 4 byte alignment on all structs used in the
+ message queue file.
+ (struct mq_fattr): Fixed size mq_attr structure as stored in file.
+ (struct mq_hdr): Change to have same size on 32 and 64 bit. Add
+ mqh_magic to allow check for old message queue file.
+ (struct msg_hdr): Change to have same size on 32 and 64 bit. Change
+ type of mqh_attr to struct mq_fattr.
+ (struct mq_info): Change to have same size on 32 and 64 bit.
+ (mq_open): Add check for maximum mq_maxmsg and mq_msgsize values which
+ still fit into 32 bit values. Set mqh_magic in file to MQI_MAGIC.
+ Check mqh_magic value on existing file to detect old message queue file.
+ (mq_getattr): Change type of local attr variable to struct mq_fattr.
+ (mq_setattr): Ditto.
+ (_mq_send): Ditto.
+ (_mq_receive): Ditto.
+ (mq_close): Ditto.
+
+2012-12-10 Corinna Vinschen <corinna@vinschen.de>
+
+ * hookapi.cc (hook_or_detect_cygwin): Only check for one cygwin DLL
+ file name depending on executable target type. Return value indicating
+ executable target type. Change comment accordingly.
+ * path.h (enum path_types): Add FIXME comment to definition of
+ PATH_OPEN. Add PATH_64BITEXEC.
+ (iscygexec32): New method.
+ (iscygexec64): New method.
+ (set_cygexec): Implement additionally with void * parameter to be able
+ to set PATH_64BITEXEC if required.
+
+2012-12-10 Corinna Vinschen <corinna@vinschen.de>
+
+ * Throughout, fix format string of debug printf and api_fatal calls
+ to work in 32 and 64 bit environment, as well as to honor signedness.
+ Use %y instead of 0x%x.
+ * fhandler.h (class fhandler_dev_mem): Change type of mem_size from
+ DWORD to SIZE_T.
+ * fhandler_mem.cc: Throughout, cast mem_size in comparisons to make
+ GCC happy.
+ * fhandler_process.cc (format_process_maps): Change type of ret_len
+ to SIZE_T.
+ (get_mem_values): Ditto for n and length.
+ * mmap.cc (MapView): Ditto for commitsize and viewsize.
+ (class mmap_record): Ditto for len. Use SIZE_T througout for memory
+ size in method args and return types.
+ * ntdll.h (NtLockVirtualMemory): Fix type of memory size parameters
+ to SIZE_T.
+ (NtMapViewOfSection): Ditto.
+ (NtQueryVirtualMemory): Ditto.
+ (NtUnlockVirtualMemory): Ditto.
+ (RtlFreeHeap): Change type of first parameter to HANDLE.
+ * shm.cc (shmat): Change type of viewsize to SIZE_T.
+ * timer.cc (timer_thread): Change type of sleep_ms to LONG.
+ (ualarm): Drop casts to unsigned int in timer value computation.
+
+2012-12-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygserver_ipc.h (conv_timespec32_to_timespec): Implement here.
+ (conv_timespec_to_timespec32): Ditto.
+ * include/cygwin/ipc.h (struct _ts32): Define here.
+ * include/cygwin/msg.h: Enforce 4 byte alignment on all structs.
+ (struct _ts32): Move definition to include/cygwin/ipc.h.
+ (struct _msqid_ds32): Drop member comments.
+ * include/cygwin/sem.h: Enforce 4 byte alignment on all structs.
+ (struct _semid_ds32): Define on 64 bit in _KERNEL mode.
+ * include/cygwin/shm.h: Enforce 4 byte alignment on all structs.
+ (struct _shmid_ds32): Define on 64 bit in _KERNEL mode.
+ (struct shminfo): Enhance coment on shmall member.
+ (struct shm_info): Convert type of all members to int32_t.
+ * include/cygwin/sysproto.h (struct semctl_args): Change definition to
+ use the same structure on 32 and 64 bit.
+ (struct semop_args): Ditto.
+ (struct shmat_args): Ditto.
+ (struct shmctl_args): Ditto.
+ (struct shmdt_args): Ditto.
+ (struct shmget_args): Ditto.
+
+2012-12-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygserver.h (struct client_request::header_t): Change definition of
+ msglen to use the same structure on 32 and 64 bit. Add read and write
+ accessors. Change type of error_code to int.
+ (class client_request): Align accessor methods to above change.
+ * cygserver_ipc.h (ipc_set_proc_info): Use _TYPE64_CLR macros.
+ * winlean.h (_TYPE64_CLR): New macro.
+ (_TYPE64_SET): Ditto.
+ * include/cygwin/msg.h (struct _ts32): Define on 64 bit in _KERNEL mode.
+ (struct _msqid_ds32): Ditto. Add comment to explain why.
+ * include/cygwin/sysproto.h: Enforce 4 byte alignment on all structs.
+ (struct msgctl_args): Change definition to use the same structure on
+ 32 and 64 bit.
+ (struct msgrcv_args): Ditto.
+ (struct msgsnd_args): Ditto.
+
+2012-12-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * shm.cc (fixup_shms_after_fork): Fix initialization of local variable
+ parent.
+
+2012-12-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * winlean.h (_TYPE64): Define.
+ * cygserver_ipc.h (struct proc): Rearrange to use same structure on
+ 32 and 64 bit. Add member is_64bit.
+ (ipc_set_proc_info): Change accordingly.
+
+2012-12-04 Kai Tietz <ktietz@redhat.com>
+
+ * child_info.h (child_info): Re-type magic to DWORD.
+
+2012-12-03 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.h (CYGTLS_PADSIZE): Change comment noting alignment has to
+ be 16 bytes on x86_64.
+
+2012-12-03 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in: Add rule to build cygwin.sc dynamically using the
+ target compiler.
+ * cygwin.sc.in: Rename from cygwin.sc. Make OUTPUT_FORMAT and
+ SEARCH_DIR dependent on target CPU. Add extra alignment and .xdata
+ section on x86_64. Keep up with latest dwarf debug section changes.
+
+2012-11-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * miscfuncs.cc (thread_wrapper): Use PVOID instead of VOID *.
+ Fix stack alignment before calling VirtualFree. Fix comments.
+
+2012-11-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc (wsock_init): Drop vendor info debug printout. It's
+ undefined since Wsock version 2.
+
+2012-11-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc: Extend leading comment to describe the 64 bit
+ implementation as well.
+ (LoadDLLprime): Define for x86_64.
+ (LoadDLLfuncEx3): Ditto.
+ (dll_func_load): Ditto.
+ (struct dll_info): Use target-agnostic type for load_state.
+ (struct func_info): Add func_addr member on x86_64.
+ (two_addr_t): New type to be twice the size of an address on either
+ target.
+ (union retchain): Use target-agnostic type for low and high,
+ use two_addr_t as type for ll member.
+ (std_dll_init): Define as SYSV ABI function on x86_64. Explain why.
+ Change return type to two_addr_t. Add casts as necessary. Convert
+ assembler code to tweak return address into C code.
+ (wsock_init): Ditto. Drop leading underscore in LoadDLLprime
+ macro call on x86_64.
+ (GetAdaptersAddresses): Define using LoadDLLfunc since it's not called
+ on pre-XP anyway.
+ (AttachConsole): Don't define on x86_64.
+ (GetModuleHandleExW): Ditto.
+ (GetSystemWow64DirectoryW): Ditto.
+ (GetVolumePathNamesForVolumeNameW): Ditto.
+
+2012-11-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/sys/strace.h: Include sys/types.h for pid_t.
+
+2012-11-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.h (CYGTLS_PADSIZE): Define for 64 bit. Add FIXME comment.
+ * profil.c: Replace usage of network types with types as documented
+ in Linux, throughout.
+ (get_thrpc): Fix access to instruction pointer for x86_64.
+ * profil.h: Include stdin.t.h. Replace usage of network types with
+ types as documented in Linux, throughout.
+ * config/x86_64/profile.h (mcount): Use unsigned long rather than
+ __uintptr_t.
+
+2012-11-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygmalloc.h (dlmalloc): Change unsigned in declaration to size_t.
+ (dlrealloc): Ditto.
+ * wait.cc (wait4): Cast second parameter in proc_subproc call to
+ uintptr_t.
+
+2012-11-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * thread.cc (verifyable_object_isvalid): Temporarily define as
+ non-inline on x86_64 to workaround compiler bug.
+
+2012-11-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_netdrive.cc: Use UINT32_MAX rather than UINT_MAX to make
+ absolutely clear that we mean the 32 bit maximum.
+ * fhandler_socket.cc: Ditto.
+ * pinfo.cc: Ditto with INT32_MAX.
+ * select.cc (fd_mask): Drop gratuitious definition.
+ (sizeof_fd_set): Cast to size_t.
+ * shared.cc (pround): Cast to ptrdiff_t.
+ * strace.cc (strace::activate): Fix format string.
+ (strace::write_childpid): Take pid_t as parameter.
+ * include/sys/strace.h (strace::write_childpid): Change declaration
+ accordingly.
+ * sync.cc (muto::init): Cast in call to InterlockedExchangePointer to
+ make compiler happy.
+ * sync.h (class muto): De-const name.
+ * syslog.cc (try_connect_syslogd): Take size_t as third argument.
+ (vsyslog): Convert len to size_t.
+ * thread.cc: Use {U}INT32_MAX rather than {U}LONG_MAX. Througout change
+ types used in Windows calls to matching Windows types.
+ (pthread::cancel): Fix access to instruction pointer for x86_64.
+ (pthread_attr_getstack): Cast to ptrdiff_t for pointer arithmetic.
+ * thread.h: Throughout convert 'long' types to uint32_t or LONG.
+
+2012-11-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/acl.h (struct __acl32): Drop. Use struct acl or
+ aclent_t throughout instead.
+ * sec_acl.cc (aclcheck32): Mark currently unused variables as unused.
+ (lacl32): Disable on x86_64.
+ (acl): Alias to acl32 on x86_64.
+ (facl): Alias to facl32 on x86_64.
+ (aclcheck): Alias to aclcheck32 on x86_64.
+ (aclsort): Alias to aclsort32 on x86_64.
+ (acltomode): Alias to acltomode32 on x86_64.
+ (aclfrommode): Alias to aclfrommode32 on x86_64.
+ (acltopbits): Alias to acltopbits32 on x86_64.
+ (aclfrompbits): Alias to aclfrompbits32 on x86_64.
+ (acltotext): Alias to acltotext32 on x86_64.
+ (aclfromtext): Alias to aclfromtext32 on x86_64.
+ * resource.cc (getrlimit): Use correct cast to rlim_t rather than DWORD.
+ * sched.cc (sched_setparam): Drop ThreadPriority and all code setting
+ it.
+
+2012-11-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_process.cc (format_process_stat): Add comment to explain
+ the WOW64 problems concerning the BasePriority value. Fix format
+ string in __small_sprintf call.
+ * ntdll.h: Mark more native structures as tested on 64 bit.
+ (enum _EVENT_TYPE): Drop definition.
+ (enum _TIMER_TYPE): Ditto.
+ (enum _SECTION_INHERIT): Drop __MINGW64_VERSION_MAJOR guard.
+
+2012-11-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * ntdll.h: Mark more native structures as tested on 64 bit.
+ (struct _FILE_BOTH_DIR_INFORMATION): Rename from
+ _FILE_BOTH_DIRECTORY_INFORMATION as per WDK documentation.
+ * fhandler_disk_file.cc: Accommodate aforementioned structure name
+ change.
+ * path.cc: Ditto.
+
+2012-11-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.h (class fcwd_access_t): Remove wrong alignment attribute from
+ Buffer member of FAST_CWD_OLD structure. Add comment that everything
+ has been tested.
+ * ntdll.h: Mark more native structures as tested on 64 bit.
+
+2012-11-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.h (class fcwd_access_t): Add alignment attribute to Buffer
+ member of FAST_CWD_* structures to work on 64 bit.
+ * path.cc (symlink_info::check_shortcut): Add cast to avoid compiler
+ warning.
+ (cygwin_conv_path_list): Drop ununsed variable.
+ (peek32): Define with int32_t cast on 64 bit to allow easier fetching
+ of instruction pointer relative addresses.
+ (find_fast_cwd_pointer): Add new implementation for x86_64.
+ Tweak a comment in 32 bit version.
+
+2012-11-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * dlfcn.cc (dlopen): Change cast to accommodate type change in ntdll.h
+ * fhandler_process.cc (thread_info::thread_info): Change type of local
+ variable size to ULONG to match NtQuerySystemInformation call.
+ Add cast to avoid compiler warnings.
+ (get_process_state): Add cast to avoid compiler warnings. Accommodate
+ name change of NextEntryOffset member of PSYSTEM_PROCESS_INFORMATION
+ structure.
+ * mmap.cc: Add casts to avoid compiler warnings.
+ (mlock): Change type of local variables min and max to match
+ GetProcessWorkingSetSize call.
+ * nlsfuncs.cc (__collate_range_cmp): Add casts to avoid compiler
+ warnings.
+ * ntdll.h: Drop accommodations for Mingw32. Fix a couple of formatting
+ glitches. Add a comment to all structures explicitely tested on 64 bit.
+ (SYSTEM_INFORMATION_CLASS): Change SystemProcessesAndThreadsInformation
+ to SystemProcessInformation and SystemProcessorTimes to
+ SystemProcessorPerformanceInformation to match MSDN.
+ (SYSTEM_BASIC_INFORMATION): Fix member types to match 64 bit.
+ (SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION): Rename from
+ SYSTEM_PROCESSOR_TIMES to use official name from MSDN. Accommodate
+ throughout. Drop unneeded align attribute.
+ (VM_COUNTERS): Fix member types to match 64 bit.
+ (SYSTEM_PROCESS_INFORMATION): Rename from SYSTEM_PROCESSES to use
+ official name from MSDN. Fix member types to match 64 bit. Change
+ member names to match MSDN and Mingw64. Accommodate throughout.
+ (IO_STATUS_BLOCK): Change to use MSDN definition.
+ (SYSTEM_TIMEOFDAY_INFORMATION): Rename from
+ SYSTEM_TIME_OF_DAY_INFORMATION to use official name from MSDN.
+ Accommodate throughout. Add Reserved1 area per MSDN.
+ (LDR_DATA_TABLE_ENTRY): Add comment for future reference. Change
+ type of LoadCount to USHORT.
+ (PEB_LDR_DATA): Change type of Initialized to BOOLEAN. Add comment for
+ future reference.
+ (PEB): Fix member types to match 64 bit.
+ (GDI_TEB_BATCH): New type.
+ (TEB): Fix member types to match 64 bit.
+ (PROCESS_BASIC_INFORMATION): Ditto.
+ (MEMORY_WORKING_SET_LIST): Ditto.
+ (SharedUserData): Change comment to note the fact that the address
+ is valid on 32 and 64 bit.
+ * pinfo.cc (winpids::enum_processes): Add cast to avoid compiler
+ warnings.
+ * select.cc (pipe_data_available): Add braces in initalization of an
+ IO_STATUS_BLOCK to match new definition.
+ * wincap.h (class wincapc): Change type of wow64 to ULONG_PTR to match
+ MSDN description.
+ (wincapc::is_wow64): Convert return value explicitely to bool.
+ * wow64.cc (wow64_test_for_64bit_parent): Change type of wow64 to
+ ULONG_PTR to match MSDN description. Add a cast to avoid compiler
+ warning.
+ * regex/engine.c: Avoid compiler warnings about unused and potentially
+ uninitialized variables.
+ * regex/regcomp.c: Ditto. Drop unnecessary definition of LCID.
+
+2012-11-11 Corinna Vinschen <corinna@vinschen.de>
+
+ * pinfo.cc (_pinfo::commune_request): Accommodate the fact that LONG_MAX
+ does not match sizeof LONG.
+
+2012-11-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * miscfuncs.cc (case_folded_lower): Change to unsigned char to avoid
+ compiler warnings.
+ (case_folded_upper): Ditto.
+ (thread_wrapper): Add assembler code for x86_64.
+ * winsup.h (case_folded_lower): Change to unsigned char.
+ (case_folded_upper): Ditto.
+ (cyg_tolower): Add cast to avoid compiler warnings.
+ (cyg_toupper): Add cast to avoid compiler warnings.
+
+2012-11-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * tty.h (class tty): Store from_master and to_master HANDLEs in
+ unions to make sure the storage is 64 bit compatible. Add comment to
+ explain why.
+ (from_master): Convert to read accessor method.
+ (to_master): Ditto.
+ (set_from_master): New method to store HANDLE value 64 bit clean.
+ (set_to_master): Ditto.
+ * fhandler_tty.cc: Fix debug printfs to work in 64 bit mode as well.
+ Change usage of from_master and to_master throughout to accommodate
+ aforementioned change.
+ * fhandler_termios.cc (fhandler_termios::ioctl): Add cast to avoid
+ compiler warning.
+
+2012-11-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.h (struct user_heap_info): Change type of chunk to SIZE_T.
+ Remove unused slop member.
+ * fork.cc (fork): Rename esp to stackp. Add 64 bit asm expression to
+ fetch stack pointer.
+ (child_copy): Use platform independent types.
+ * heap.cc (eval_start_address): Add comment. Disable 3GB code on 64 bit.
+ (eval_initial_heap_size): Use platform independent types. Fix debug
+ printf format strings.
+ (sbrk): Add comment. Change argument type according to newlib
+ definition. Use platform independent types. Drop unneeded else and
+ move comment to the right spot.
+ * hookapi.cc (PEHeaderFromHModule): Return PVOID. Add comment to
+ explain why. Add bool parameter to return if target executable is
+ 64 bit or not.
+ (rvadelta_get): New inline function to fetch section address platform
+ independent.
+ (rvadelta32, rvadelta64): Platform dependent wrappers.
+ (rvadelta): Change to macro calling the platform dependent rvadelta
+ wrappers.
+ (putmem): Define platform dependent THUNK_FUNC_TYPE and use throughout.
+ (RedirectIAT): Add comment.
+ (get_export): Add comment.
+ (find_first_notloaded_dll): Allow to fetch information in a platform
+ and target independent way.
+ (hook_or_detect_cygwin): Ditto. Recognize the cyg64win1.dll file name
+ as well.
+ * kernel32.cc (CreateFileMappingW): Cast to avoid compiler warning.
+
+ * fhandler.h (class fhandler_dev_tape): Replace mt_evt with an
+ OVERLAPPED structure ov.
+ * mtinfo.h (class mtinfo_part): Define members as int32_t rather than
+ long. Change member function declarations accordingly.
+ (class mtinfo_drive): Ditto. Store OVERLAPPED pointer rather than
+ holding the full structure. Add comment to explain why.
+ * fhandler_tape.cc: Accommodate above changes throughout.
+
+2012-11-08 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_socket.cc (fhandler_socket::ioctl): Don't use __ms_u_long
+ directly. Rather only use it on 64 bit. Add comment to explain the
+ problem.
+
+2012-11-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_socket.cc: Throughout, fix casts to work on 64 bit. Move
+ calls to pthread_testcancel to upper syscall level for consistency.
+ Move read, readv, write, and writev methods to keep together with
+ equivalent recv and send methods.
+ (fhandler_socket::read): Compute WSAMSG buffer on 64 bit to overcome
+ type restriction of WSABUF len member.
+ (fhandler_socket::recvfrom): Ditto.
+ (fhandler_socket::write): Ditto.
+ (fhandler_socket::sendto): Ditto.
+ (fhandler_socket::sendmsg): Restructure for readability.
+ * net.cc (cygwin_sendto): Call pthread_testcancel here.
+ (cygwin_recvfrom): Ditto.
+ (cygwin_connect): Ditto.
+ (cygwin_accept): Ditto.
+ (cygwin_recv): Ditto.
+ (cygwin_send): Ditto.
+ (cygwin_recvmsg): Ditto.
+ (cygwin_sendmsg): Ditto.
+
+2012-11-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_process.cc (heap_info::heap_info): Add comment to explain a
+ TODO item.
+
+2012-11-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_procsysvipc.cc (format_procsysvipc_msg): Fix printf format
+ string for 32 bit as well.
+
+2012-11-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_procsysvipc.cc (format_procsysvipc_msg): Fix printf format
+ string for 64 bit.
+ * fhandler_registry.cc (fhandler_registry::readdir): Fix cast.
+ * fhandler_serial.cc (ibuf): Avoid compiler warning.
+ * include/cygwin/ipc.h: Include stdint.h.
+ * include/cygwin/msg.h (msgqnum_t): Define as uint32_t.
+ (msglen_t): Ditto.
+ (struct msginfo): Convert all long members to int32_t.
+ (struct msg_info): Ditto.
+ * include/cygwin/sem.h (struct seminfo): Ditto.
+ * include/cygwin/shm.h (shmatt_t): Define as uint32_t.
+ (struct shmid_ds): Define shm_segsz as uint32_t.
+ (struct shminfo): Convert all long members to int32_t.
+
+2012-11-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * ntdll.h (PDI_WOW64_MODULES): Define.
+ (struct _DEBUG_BUFFER): Fix definition to work on 32 and 64 bit.
+ (struct _DEBUG_HEAP_INFORMATION): Ditto.
+ (struct _DEBUG_HEAP_BLOCK): Ditto.
+
+2012-11-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_process.cc: Fix debug printf calls to be type safe.
+ Add casts to avoid compiler warnings.
+ (get_mem_values): Avoid using ULONG_MAX since it's NOT matching
+ ULONG on 64 bit.
+ * fhandler_procnet.cc (fhandler_procnet::open): Fix syscall_printf call
+ to be type safe.
+ (format_procnet_ifinet6): Add cast to avoid compiler warnings.
+ * ntdll.h (struct _DEBUG_HEAP_BLOCK): Change Address to ULONG_PTR.
+
+ * include/bits/wordsize.h: Fix __WORDSIZE definition for x86_64.
+ Add __WORDSIZE_COMPAT32 as on Linux.
+ * include/inttypes.h: Include bits/wordsize.h. Use __WORDSIZE check
+ where appropriate.
+ * include/limits.h: Include bits/wordsize.h.
+ (CHAR_BIT): Change definition to rely on default
+ compiler definition.
+ (LONG_BIT): Ditto.
+ (WORD_BIT): Ditto.
+ (__LONG_MAX__): Use __WORDSIZE check.
+ (RTSIG_MAX): Ditto.
+ * include/stdint.h: Include bits/wordsize.h. Use __WORDSIZE check
+ where appropriate.
+ * include/cygwin/signal.h: Ditto.
+ * include/cygwin/types.h: Ditto.
+
+ * include/asm/byteorder.h (__ntohl): Use bswap instruction, available
+ since i486.
+ (__ntohs): Fix constraint to work on 64 bit CPU as well.
+
+2012-11-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * cpuid.h (can_set_flag): Implement for x86_64.
+ * fhandler.h (class fhandler_dev_raw): Define devbuf members taking
+ numerical values as DWORD, rather than size_t.
+ * fhandler_dsp.cc: Fix debug printf calls to be type safe.
+ (waveOut_callback): Align parameter types to latest MSDN description.
+ (waveIn_callback): Ditto.
+ (fhandler_dev_dsp::Audio_out::start): Change casts in call to
+ waveOutOpen according to MSDN.
+ (fhandler_dev_dsp::Audio_out::parsewav): Fix a cast.
+ (fhandler_dev_dsp::Audio_in::start): Change casts in call to
+ waveInOpen according to MSDN.
+ * fhandler_floppy.cc: Fix debug printf calls to be type safe.
+ (fhandler_dev_floppy::ioctl): Add casts to be on the safe side.
+ * fhandler_proc.cc: Fix debug printf calls to be type safe.
+
+2012-10-31 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygthread.cc: Fix usage of %p in debug printfs, throughout.
+ * dcrt0.cc: Ditto.
+ * dtable.cc: Ditto.
+ * errno.cc: Ditto.
+ * exceptions.cc: Ditto.
+ * fhandler.cc: Ditto.
+ * fhandler_console.cc: Ditto.
+ * fhandler_disk_file.cc: Ditto.
+
+ * fhandler_clipboard.cc (cygnativeformat): Define as UINT.
+ (fhandler_dev_clipboard::read): Ditto for local format variable.
+ Use casts to compare off_t with size_t value.
+ * fhandler_console.cc (fhandler_console::ioctl): Avoid compiler
+ warnings.
+ * fhandler_disk_file.cc (fhandler_disk_file::opendir): Fix cast.
+ * include/sys/dirent.h (struct __DIR): Define __d_internal as uintptr_t,
+ rather than unsigned int.
+
+2012-10-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * fcntl.cc (fcntl64): Make arg an intptr_t. Add comment to explain a
+ potential type problem. Fix syscall_printf.
+ (_fcntl): Make arg an intptr_t.
+ * fhandler.cc (fhandler_base::fcntl): Ditto.
+ * fhandler_socket.cc (fhandler_socket::fcntl): Ditto.
+ * fhandler.h: Align declarations.
+
+2012-10-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * dtable.cc: Use %y rather than 0x%x.
+ * exceptions.cc: Ditto.
+
+2012-10-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * smallprint.cc (__small_vsprintf): Add 'y' and 'Y' conversion.
+ Add description to comment.
+ (__small_vswprintf): Align behaviour to __small_vsprintf.
+
+2012-10-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * external.cc (get_cygdrive_info): Return uintptr_t rather than DWORD.
+ (check_ntsec): Return bool.
+ (cygwin_internal): Return uintptr_t. Accommodate throughout.
+ * include/sys/cygwin.h (cygwin_internal): Align declaration.
+
+2012-10-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/signal.h (NSIG): Define differently for x86_64 and
+ i686. Change FIXME comment accordingly.
+ (SIGRTMAX): Define in terms of NSIG.
+ * include/limits.h (RTSIG_MAX): Define for x86_64.
+ * strsig.cc (__signals_common): Hold all signals available on both
+ platforms.
+ (__signals): Define differently for x86_64 and i686.
+
+2012-10-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * dll_init.cc: Fix debug printf to be type-safe.
+ * dtable.cc: Ditto.
+
+2012-10-26 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.cc (_cygtls::remove): Fix debug printf to be type-safe.
+ * dcrt0.cc: Ditto, throughout.
+ * include/sys/cygwin.h (struct per_process): Define magic_biscuit,
+ dll_major and dll_minor as uint32_t.
+
+2012-10-26 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.h (struct init_cygheap): Define sthreads as uint32_t.
+
+2012-10-26 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.cc: Fix debug printfs to work in 64 bit mode as well,
+ throughout.
+ (nthreads): Define as uint32_t to make always 4 byte. Accommodate
+ throughout.
+ (threadlist_ix): Ditto.
+
+2012-10-26 Corinna Vinschen <corinna@vinschen.de>
+
+ * exception.h (stackdump): Change first parameter to PUINT_PTR.
+ * exceptions.cc: Define cpu specific macros _GR, _AFMT and _ADDR.
+ Use throughout to avoid ifdef's. Fix debug printfs to work in
+ 64 bit mode as well, throughout.
+ (status_info): Define member code as NTSTATUS. Add casts where
+ necessary throughout.
+ (dump_exception): Dump all x86_64 registers if building for it.
+ (class stack_info): Define dummy_frame as PUINT_PTR.
+ (stack_info::init): Change first parameter to PUINT_PTR. Rename
+ ebp to framep for CPU independent naming. Drop debp macro.
+ (stack_info::walk): Rename ebp to framep for CPU independent naming.
+ Disable WOW64 hack in 64 bit mode.
+ (stackdump): Change first parameter to PUINT_PTR. Rename ebp to framep
+ for CPU independent naming.
+ (_cygtls::inside_kernel): Ignore system_wow64_directory on 64 bit.
+ (rtl_unwind): Redefine for x86_64 cpu.
+ (_except_list): Drop redundant definition.
+ (_cygtls::copy_context): Just use __COPY_CONTEXT_SIZE.
+ * sigproc.cc (_cygtls::signal_exit): Conditionalize stackdump call per
+ cpu.
+ * smallprint.cc (__small_vsprintf): Fix up for 64 bit. Handle 'l' size
+ modifier in 'd', 'o', 'u', 'x' conversion to print "long" values on a
+ per cpu base. Add 'O' conversion. Change comment accrdingly.
+ * include/cygwin/signal.h (struct _uc_fpxreg): Define for 64 bit.
+ (struct _uc_xmmreg): Ditto.
+ (struct _fpstate): Ditto.
+ (struct ucontext): Ditto.
+ (struct _uc_fpreg): Define for 32 bit.
+ (struct _fpstate): Use struct _uc_fpreg for _st. Use explicit sized
+ types.
+ (struct ucontext): Use explicit sized types.
+ (__COPY_CONTEXT_SIZE): Cast safely.
+ (sigset_t): Define as __uint64_t on 64 bit. Add FIXME comment in 32
+ bit case.
+
+2012-10-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * smallprint.cc (rnarg): Make type-safe.
+ (rnargLL): Ditto.
+ (__small_vsprintf): Add comment to document meaning of each possible
+ conversion. Fix 'p' conversion for 64 bit.
+
+2012-10-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * globals.cc: Redefine _RDATA as "const", if not already defined.
+ Apply extern "C" linkage to the R/O UNICODE_STRINGs and cygwin_props.
+ Change comments to explain new method.
+ * winsup.h (_RDATA): Define as empty string and only if including
+ globals.h.
+ (cygwin_finished_initializing): Drop redundant declaration.
+
+2012-10-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * dtable.cc (dtable::get_debugger_info): Raise size of buf to allow
+ 64 bit values. Call sprintf in a type-safe manner.
+
+2012-10-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * dll_init.cc (reserve_at): Use PVOID rather than DWORD as type for
+ pointer parameters and return type.
+ (release_at): Ditto.
+ (dll_list::load_after_fork_impl): Fix format strings. Call reserve_at
+ without casts to DWORD.
+ (struct dllcrt0_info): Change type of res to PVOID.
+ (dll_dllcrt0): Return PVOID rather than int.
+ (dll_dllcrt0_1): Accommodate type change of dllcrt0_info::res.
+ (dll_noncygwin_dllcrt0): Disable on 64 bit. Add a cast for 32 bit.
+ * dll_init.h (struct pefile): Drop 32 bit decoration from Windows
+ types.
+ * ntdll.h (struct _DEBUG_HEAP_INFORMATION): Define Base as UINT_PTR.
+ (struct _DEBUG_MODULE_INFORMATION): Define Reserved and Base as
+ UINT_PTR.
+ * winsup.h (dll_dllcrt0): Declare as PVOID.
+ (dll_noncygwin_dllcrt0): Don't declare on 64 bit.
+ * include/cygwin/cygwin_dll.h (cygwin_attach_dll): Declare as PVOID.
+ (cygwin_detach_dll): Declare with PVOID parameter.
+ (dll_index): Declare as PVOID.
+ (_cygwin_dll_entry): Accommodate type change of dll_index.
+ * lib/crt0.h (dll_dllcrt0): Declare as PVOID.
+ * lib/cygwin_attach_dll.c (cygwin_attach_dll): Define PVOID.
+
+2012-10-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * dcrt0.cc (init_windows_system_directory): Disable setting
+ system_wow64_directory{_length} on 64 bit.
+ (dll_crt0_0): Disable WOW64-specific code on 64 bit.
+ (_dll_crt0): Ditto.
+ * globals.cc (system_wow64_directory): Don't define on 64 bit.
+ (system_wow64_directory_length): Ditto.
+ * wincap.cc (wincapc::init): On 64 bit, always set wow64 to 0 and
+ related bool values to false.
+ * wow64.cc: Disable entire code on 64 bit.
+ * wow64.h: Ditto.
+
+2012-10-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.h (__stack_t): Define as uintptr_t.
+ * dcrt0.cc (child_info_fork::alloc_stack): Conditionalize assembler
+ code on a per-CPU base. Rename esp to stackp.
+ (get_cygwin_startup_info): Cast pointers to uintptr_t in
+ multiple_cygwin_problem call. Minor formatting change.
+ (_dll_crt0): Conditionalize assembler code on a per-CPU base.
+ (multiple_cygwin_problem): Change parameters from unsigned to uintptr_t.
+ * winsup.h (multiple_cygwin_problem): Change declaration accordingly.
+ * pinfo.h (pinfo::reattach): Cast 2nd argument in proc_subproc call
+ to uintptr_t.
+ (pinfo::remember): Ditto.
+ * sigproc.cc (proc_subproc): Change 2nd parameter to uintptr_t to allow
+ pointer values.
+ * sigproc.h (proc_subproc): Change declaration accordingly.
+ * include/sys/cygwin.h (per_process_overwrite): Use offsetof to compute
+ value.
+
+2012-10-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.cc (N0): Remove.
+ (N): Ditto.
+ (to_cmalloc): Use offsetof to compute value.
+ (tocygheap): Use offsetof to compute value.
+
+2012-10-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.h (_tlsbase): Define for __x86_64__.
+ (_tlstop): Ditto.
+ * exception.h (exception_list): Ditto.
+
+2012-10-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.cc (to_cmalloc): Fix pointer cast.
+ (nextpage): Ditto. Base definition on roundup2.
+ (allocsize): Cast to SIZE_T.
+ (_csbrk): Drop granmask. Define adjsbs SIZE_T as 2nd parameter to
+ VirtualAlloc.
+ (tocygheap): Fix pointer cast.
+
+2012-10-18 Corinna Vinschen <corinna@vinschen.de>
+
+ Avoid various type ambiguity problems showing up in the 64 bit case:
+ * cygheap.h (cygheap_user::set_sid): Convert to void.
+ (cygheap_user::set_saved_sid): Ditto.
+ * devices.h (struct device): Drop operator int& and DWORD& entirely.
+ Throughout, use dev_t or fh_devices instead.
+ * devices.cc: Regenerate.
+ * fhandler.h (class fhandler_base): Convert _refcnt member to LONG.
+ (fhandler_base::inc_refcnt): Return LONG.
+ (fhandler_base::dec_refcnt): Ditto.
+ (fhandler_base::get_major): Return _major_t.
+ (fhandler_base::get_minor): Return _minor_t.
+ (fhandler_base::get_unit): Delete. Throughout, use get_minor instead
+ of get_unit.
+ (fhandler_socket::get_socket): Use SOCKET rather than int. Only define
+ if __INSIDE_CYGWIN_NET__ is defined.
+ (fhandler_pty_slave::get_unit): Drop declaration.
+ * fhandler_procnet.cc: Include Windows headers early.
+ * fhandler_socket.cc: Ditto.
+ * fhandler_tty.cc (fhandler_pty_slave::get_unit): Remove.
+ * path.h (path_conv::get_device): Rename from get_devn and change return
+ type to dev_t. Accommodate throughout.
+ (path_conv::get_unitn): Remove unused method.
+ * pinfo.h (class pinfo): Drop operator== for int case.
+ (pinfo::operator!): Define.
+ * poll.cc: Don't define __INSIDE_CYGWIN_NET__.
+ * syscalls.cc (getpgid): Replace use of pinfo::operator== with
+ pinfo::operator!.
+ * tty.h (tty_min::setntty): Convert 2nd parameter to _minor_t.
+ * tty.h (tty_min::getntty): Change return type to dev_t.
+ (tty_min::get_minor): Rename from get_unit. Change return type to
+ _minor_t.
+
+2012-08-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/mntent.h: Don't include paths.h and don't define macros if
+ _NOMNTENT_MACROS is set.
+
+2012-08-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * advapi32.cc (DuplicateTokenEx): Make ?: expression type-safe.
+ * ntdll.h (KAFFINITY): Don't define if building with Mingw64 headers.
+ * thread.cc: Throughout drop casts in calls to Interlocked functions.
+ * thread.h (class fast_mutex): Ditto. Define lock_counter as LONG.
+ (class pthread_mutex): Define lock_counter as LONG.
+ (struct MTinterface): Define threadcount as LONG.
+
+2012-08-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * configure.in: Add AC_NO_EXECUTABLES to allow bootstrap.
+ Add x86_64 to allowed cpu types.
+ * configure: Regenerate.
+ * config/x86_64/profile.h: New file.
+
+2012-08-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * thread.cc (semaphore::_fixup_after_fork): Fix Win32 error output in
+ api_fatal call.
+
+2012-08-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * mkvers.sh: Drop reference to w32api includes.
+
+2012-08-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/stat.h (struct __stat64): Drop entirely in favor of
+ struct stat. Accommodate throughout Cygwin.
+ * include/cygwin/types.h: Throughout, drop current, internal types
+ used since Cygwin 1.5 with the base type they have been used for.
+ Throughout, define types based on bitsize-specific types where
+ appropriate. Accommodate throughout Cygwin.
+ * include/sys/cygwin.h: Drop __uid32_t and __gid32_t in favor of
+ uid_t and gid_t. Define uid/gid types based on bitsize-specific types.
+ (struct external_pinfo): Accommodate above change.
+ * cygtls.h (struct _local_storage): Drop unused members grp and
+ namearray,
+ * tlsoffsets.h: Regenerate.
+ * devices.h (_dev_t): Drop definition. Use dev_t throughout instead.
+ * devices.cc: Regenerate.
+
+ Probably temporary patch to drop unneeded functionality on x86_64:
+ * fcntl.cc (_fcntl): Alias to fcntl64 on x86_64.
+ * glob.cc (CYGWIN_gl_stat): Simplify on x86_64.
+ * grp.cc (grp32togrp16): Don't define on x86_64.
+ (getgrgid): Alias to getgrgid32 on x86_64.
+ (getgrnam): Alias to getgrnam32 on x86_64.
+ (getgrent): Alias to getgrent32 on x86_64.
+ (getgroups): Alias to getgroups32 on x86_64.
+ (initgroups): Alias to initgroups32 on x86_64.
+ (setgroups): Alias to setgroups32 on x86_64.
+ * mmap.cc (mmap): Alias to mmap64 on x86_64.
+ * passwd.cc (getpwuid): Alias to getpwuid32 on x86_64.
+ (getpwuid_r): Alias to getpwuid_r32 on x86_64.
+ (getpwduid): Don't define on x86_64.
+ * syscalls.cc (lseek): Alias to lseek64 on x86_64.
+ (_lseek): Alias to lseek64 on x86_64.
+ (chown): Alias to chown32 on x86_64.
+ (lchown): Alias to lchown32 on x86_64.
+ (fchown): Alias to fchown32 on x86_64.
+ (stat64_to_stat32): Don't define on x86_64.
+ (fstat): Alias to fstat64 on x86_64.
+ (_fstat_r): Alias to _fstat64_r on x86_64.
+ (stat): Alias to stat64 on x86_64.
+ (_stat_r): Alias to _stat64_r on x86_64.
+ (lstat): Alias to lstat64 on x86_64.
+ (ftruncate): Alias to ftruncate64 on x86_64.
+ (truncate): Alias to truncate64 on x86_64.
+ (seteuid): Alias to seteuid32 on x86_64.
+ (setuid): Alias to setuid32 on x86_64.
+ (setreuid): Alias to setreuid32 on x86_64.
+ (setegid): Alias to setegid32 on x86_64.
+ (setgid): Alias to setgid32 on x86_64.
+ (setregid): Alias to setregid32 on x86_64.
+ * uinfo.cc (getuid): Alias to getuid32 on x86_64.
+ (getgid): Alias to getgid32 on x86_64.
+ (geteuid): Alias to geteuid32 on x86_64.
+ (getegid): Alias to getegid32 on x86_64.
+ * winsup.h (ILLEGAL_UID16): Don't define on x86_64.
+ (ILLEGAL_GID16): Ditto.
+ (uid16touid32): Don't declare on x86_64.
+ (gid16togid32): Don't declare on x86_64.
+
+2012-08-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (TEST_DLL_NAME): Use -nostdlib flag unconditionally.
+
+2012-08-10 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.sc: Add default w32api search dirs.
+ * Makefile.in (DLL_IMPORTS); Just use -l syntax.
+ (TEST_DLL_NAME): Drop DLL_IMPORTS dependency.
+
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index 56c910a69..acb327e69 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -31,6 +31,7 @@ export CCWRAP_DIRAFTER_HEADERS:=@windows_headers@
VPATH+=$(CONFIG_DIR) $(srcdir)/regex $(srcdir)/lib $(srcdir)/libc
+target_cpu:=@target_cpu@
target_alias:=@target_alias@
build_alias:=@build_alias@
host_alias:=@host_alias@
@@ -73,10 +74,12 @@ CRT0:=$(cygwin_build)/crt0.o
# --enable options from configure
#
MT_SAFE:=@MT_SAFE@
-DEFS:=@DEFS@
CCEXTRA=
COMMON_CFLAGS=-MMD ${$(*F)_CFLAGS} -Werror -fmerge-constants -ftracer $(CCEXTRA)
-COMPILE.cc+=${COMMON_CFLAGS} -mno-use-libstdc-wrappers
+ifeq ($(target_cpu),x86_64)
+COMMON_CFLAGS+=-mcmodel=small
+endif
+COMPILE.cc+=${COMMON_CFLAGS}
COMPILE.c+=${COMMON_CFLAGS}
AR:=@AR@
@@ -110,23 +113,26 @@ RUNTESTFLAGS =
# native rebuilding issues (we don't want the build tools to see a partially
# built cygwin.dll and attempt to use it instead of the old one).
-DLL_NAME:=cygwin1.dll
-TEST_DLL_NAME:=cygwin0.dll
+DLL_NAME:=@DLL_NAME@
+TEST_DLL_NAME:=${patsubst %1.dll,%0.dll,@DLL_NAME@}
TEST_LIB_NAME:=libcygwin0.a
STATIC_LIB_NAME:=libcygwin_s.a
+DIN_FILE=@DIN_FILE@ common.din
DEF_FILE:=cygwin.def
+TLSOFFSETS_H:=@TLSOFFSETS_H@
DLL_ENTRY:=@DLL_ENTRY@
LIBGMON_A:=libgmon.a
CYGWIN_START:=crt0.o
GMON_START:=gcrt0.o
-toolopts:=--ar=${AR} --as=${AS} --nm=${NM} --objcopy=${OBJCOPY}
+toolopts:=--cpu=${target_cpu} --ar=${AR} --as=${AS} --nm=${NM} --objcopy=${OBJCOPY}
speclib=\
${srcdir}/speclib ${toolopts} \
--exclude='cygwin' \
--exclude='(?i:dll)' \
--exclude='reloc' \
+ --exclude='^main$$' \
--exclude='^_main$$' \
$^
@@ -143,15 +149,15 @@ EXTRA_DLL_OFILES:=${addsuffix .o,${basename ${notdir ${wildcard $(CONFIG_DIR)/*.
EXTRA_OFILES:=
-MALLOC_OFILES:=@MALLOC_OFILES@
+MALLOC_OFILES:=malloc.o
DLL_IMPORTS:=${shell $(CC) -print-file-name=w32api/libkernel32.a} ${shell $(CC) -print-file-name=w32api/libntdll.a}
MT_SAFE_OBJECTS:=
#
-DLL_OFILES:=advapi32.o assert.o autoload.o bsdlib.o ctype.o cxx.o cygheap.o \
- cygthread.o cygtls.o cygwait.o cygxdr.o dcrt0.o debug.o devices.o \
- dir.o dlfcn.o dll_init.o dtable.o environ.o errno.o exceptions.o \
+DLL_OFILES:=advapi32.o arc4random.o assert.o autoload.o base64.o bsdlib.o ctype.o \
+ cxx.o cygheap.o cygthread.o cygtls.o cygwait.o cygxdr.o dcrt0.o debug.o \
+ devices.o dir.o dlfcn.o dll_init.o dtable.o environ.o errno.o exceptions.o \
exec.o external.o fcntl.o fenv.o fhandler.o fhandler_clipboard.o \
fhandler_console.o fhandler_dev.o fhandler_disk_file.o fhandler_dsp.o \
fhandler_fifo.o fhandler_floppy.o fhandler_mailslot.o fhandler_mem.o \
@@ -193,6 +199,9 @@ endif #PREPROCESS
GMON_OFILES:=gmon.o mcount.o profil.o
+ifeq ($(target_cpu),x86_64)
+NEW_FUNCTIONS:=
+else
NEW_FUNCTIONS:=$(addprefix --replace=,\
acl=_acl32 \
aclcheck=_aclcheck32 \
@@ -245,6 +254,7 @@ NEW_FUNCTIONS:=$(addprefix --replace=,\
tmpfile=_tmpfile64 \
truncate=_truncate64 \
)
+endif
API_VER:=$(srcdir)/include/cygwin/version.h
@@ -260,7 +270,7 @@ cygthread_CFLAGS:=-fomit-frame-pointer
cygtls_CFLAGS:=-fomit-frame-pointer
cygwait_CFLAGS=-fomit-frame-pointer
delqueue_CFLAGS:=-fomit-frame-pointer
-devices_CFLAGS:=-fomit-frame-pointer -Os
+devices_CFLAGS:=-fomit-frame-pointer
dir_CFLAGS:=-fomit-frame-pointer
dlfcn_CFLAGS:=-fomit-frame-pointer
dll_init_CFLAGS:=-fomit-frame-pointer
@@ -292,6 +302,7 @@ fhandler_zero_CFLAGS:=-fomit-frame-pointer
flock_CFLAGS:=-fomit-frame-pointer
grp_CFLAGS:=-fomit-frame-pointer
libstdcxx_wrapper_CFLAGS:=-fomit-frame-pointer
+localtime_CFLAGS:=-fwrapv
malloc_CFLAGS:=-fomit-frame-pointer -O3
malloc_wrapper_CFLAGS:=-fomit-frame-pointer
miscfuncs_CFLAGS:=-fomit-frame-pointer
@@ -390,20 +401,20 @@ uninstall-headers:
uninstall-man:
cd $(srcdir); \
for i in `find . -type f -name '*.2'`; do \
- rm -f $(tooldir)/man/man2/`basename $$i` ; \
+ rm -f $(DESTDIR)$(mandir)/man2/`basename $$i` ; \
done; \
for i in `find . -type f -name '*.3'`; do \
- rm -f $(tooldir)/man/man3/`basename $$i` ; \
+ rm -f $(DESTDIR)$(mandir)/man3/`basename $$i` ; \
done; \
for i in `find . -type f -name '*.5'`; do \
- rm -f $(tooldir)/man/man5/`basename $$i` ; \
+ rm -f $(DESTDIR)$(mandir)/man5/`basename $$i` ; \
done; \
for i in `find . -type f -name '*.7'`; do \
- rm -f $(tooldir)/man/man7/`basename $$i` ; \
+ rm -f $(DESTDIR)$(mandir)/man7/`basename $$i` ; \
done
clean:
- -rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc winver_stamp *.exe *.d *stamp* *_magic.h sigfe.s cygwin.def globals.h $(srcdir)/tlsoffsets.h $(srcdir)/devices.cc
+ -rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc winver_stamp *.exe *.d *stamp* *_magic.h sigfe.s cygwin.def globals.h $(srcdir)/$(TLSOFFSETS_H) $(srcdir)/devices.cc
-@$(MAKE) -C ${cygserver_blddir} libclean
maintainer-clean realclean: clean
@@ -411,10 +422,15 @@ maintainer-clean realclean: clean
@echo "it deletes files that may require special tools to rebuild."
-rm -fr configure
+# Rule to build LDSCRIPT
+$(LDSCRIPT): $(LDSCRIPT).in
+ $(CC) -E - -P < $^ -o $@
# Rule to build cygwin.dll
$(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(LIBSERVER) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp
- $(CXX) $(CXXFLAGS) -L${WINDOWS_LIBDIR} -Wl,--gc-sections $(nostdlib) -Wl,-T$(firstword $^) -static \
+ $(CXX) $(CXXFLAGS) \
+ -mno-use-libstdc-wrappers -L${WINDOWS_LIBDIR} \
+ -Wl,--gc-sections $(nostdlib) -Wl,-T$(firstword $^) -static \
-Wl,--heap=0 -Wl,--out-implib,cygdll.a -shared -o $@ \
-e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \
$(MALLOC_OBJ) $(LIBSERVER) $(LIBM) $(LIBC) \
@@ -423,8 +439,8 @@ $(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(LIBSERVER) $(LIBC) $(LIB
@ln -f $@ new-$(DLL_NAME)
# Rule to build libcygwin.a
-$(LIB_NAME): $(LIBCOS) | $(TEST_DLL_NAME)
- ${srcdir}/mkimport ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $^
+$(LIB_NAME): $(DEF_FILE) $(LIBCOS) | $(TEST_DLL_NAME)
+ ${srcdir}/mkimport ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $(wordlist 2,99,$^)
${STATIC_LIB_NAME}: mkstatic ${TEST_DLL_NAME}
perl -d $< -x ${EXCLUDE_STATIC_OFILES} --library=${LIBC} --library=${LIBM} --ar=${AR} $@ cygwin.map
@@ -446,9 +462,6 @@ dll_ofiles: $(DLL_OFILES)
$(LIBGMON_A): $(GMON_OFILES) $(GMON_START)
$(AR) rcv $(LIBGMON_A) $(GMON_OFILES)
-$(API_VER): $(srcdir)/cygwin.din
- @echo Error: Version info is older than DLL API!
-
version.cc winver.o: winver_stamp
@ :
@@ -500,14 +513,14 @@ winver_stamp: mkvers.sh include/cygwin/version.h winver.rc $(DLL_OFILES)
$(COMPILE.cc) -c -o version.o version.cc && \
touch $@
-Makefile: cygwin.din ${srcdir}/Makefile.in
+Makefile: ${srcdir}/Makefile.in
/bin/sh ./config.status
-$(DEF_FILE): gendef cygwin.din $(srcdir)/tlsoffsets.h
- $^ $@ sigfe.s
+$(DEF_FILE): gendef $(srcdir)/$(TLSOFFSETS_H) $(DIN_FILE)
+ $(word 1,$^) --cpu=${target_cpu} --output-def=$@ --tlsoffsets=$(word 2,$^) $(wordlist 3,99,$^)
-$(srcdir)/tlsoffsets.h: gentls_offsets cygtls.h
- $^ $@ $(COMPILE.cc) -c
+$(srcdir)/$(TLSOFFSETS_H): gentls_offsets cygtls.h
+ $^ $@ @CONFIG_DIR@ $(COMPILE.cc) -c
sigfe.s: $(DEF_FILE)
@[ -s $@ ] || \
diff --git a/winsup/cygwin/aclocal.m4 b/winsup/cygwin/aclocal.m4
index 5985aa9a1..c48aad01d 100644
--- a/winsup/cygwin/aclocal.m4
+++ b/winsup/cygwin/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.12.6 -*- Autoconf -*-
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/winsup/cygwin/advapi32.cc b/winsup/cygwin/advapi32.cc
index 3cf8aea11..07d26e710 100644
--- a/winsup/cygwin/advapi32.cc
+++ b/winsup/cygwin/advapi32.cc
@@ -43,7 +43,7 @@ DuplicateTokenEx (HANDLE tok, DWORD access, LPSECURITY_ATTRIBUTES sec_attr,
OBJECT_ATTRIBUTES attr =
{ sizeof attr, NULL, NULL,
(sec_attr && sec_attr->bInheritHandle) ? OBJ_INHERIT : 0U,
- (sec_attr ? sec_attr->lpSecurityDescriptor : NULL), &sqos };
+ sec_attr ? sec_attr->lpSecurityDescriptor : NULL, &sqos };
NTSTATUS status = NtDuplicateToken (tok, access, &attr, FALSE, type, new_tok);
DEFAULT_NTSTATUS_TO_BOOL_RETURN
}
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 3e61f837f..75771a2b6 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -32,34 +32,60 @@ bool NO_COPY wsock_started;
*
* So, immediately following the the call to one of the above routines
* we have:
- * DLL info (4 bytes) Pointer to a block of information concerning
+ * DLL info (4/8 bytes) Pointer to a block of information concerning
* the DLL (see below).
* DLL args (4 bytes) The number of arguments pushed on the stack by
* the call. If this is an odd value then this
* is a flag that non-existence of this function
* is not a fatal error
+ * func addr (8 bytes) (64 bit ONLY!)
+ * Address of the actual Win32 function. For the
+ * reason why this is necessary, see the below
+ * description of the load_state.
* func name (n bytes) asciz string containing the name of the function
* to be loaded.
*
* The DLL info block consists of the following
- * load_state (4 bytes) Pointer to a word containing the routine used
+ * load_state (4/8 bytes) Pointer to a word containing the routine used
* to eventually invoke the function. Initially
- * points to an init function which loads the
- * DLL, gets the process's load address,
- * changes the contents here to point to the
- * function address, and changes the call *(%eax)
- * to a jmp func. If the initialization has been
- * done, only the load part is done.
- * DLL handle (4 bytes) The handle to use when loading the DLL.
+ * points to an init function which loads the DLL,
+ * gets the process's load address, changes the contents
+ * here to point to the function address, and changes
+ * the address argument of the initial jmp call.
+ * On 64 bit, the jmp is not tweaked directly. Rather,
+ * the address of the Win32 function is stored in the
+ * aforementioned Win32 function address slot and fetched
+ * there for a jmp *%rax call. This indirection is
+ * necessary to workaround the lack of a jmp opcode with
+ * offset values > 32 bit. If the initialization has
+ * been done, only the load part is done.
+ * DLL handle (4/8 bytes) The handle to use when loading the DLL.
* DLL locker (4 bytes) Word to use to avoid multi-thread access during
* initialization.
- * extra init (4 bytes) Extra initialization function.
+ * extra init (4/8 bytes) Extra initialization function.
* DLL name (n bytes) asciz string containing the name of the DLL.
*/
/* LoadDLLprime is used to prime the DLL info information, providing an
additional initialization routine to call prior to calling the first
function. */
+#ifdef __x86_64__
+#define LoadDLLprime(dllname, init_also, no_resolve_on_fork) __asm__ (" \n\
+.ifndef " #dllname "_primed \n\
+ .section .data_cygwin_nocopy,\"w\" \n\
+ .align 8 \n\
+."#dllname "_info: \n\
+ .quad _std_dll_init \n\
+ .quad " #no_resolve_on_fork " \n\
+ .long -1 \n\
+ .align 8 \n\
+ .quad " #init_also " \n\
+ .string16 \"" #dllname ".dll\" \n\
+ .text \n\
+ .set " #dllname "_primed, 1 \n\
+.endif \n\
+");
+#else
#define LoadDLLprime(dllname, init_also, no_resolve_on_fork) __asm__ (" \n\
.ifndef " #dllname "_primed \n\
.section .data_cygwin_nocopy,\"w\" \n\
@@ -74,6 +100,7 @@ bool NO_COPY wsock_started;
.set " #dllname "_primed, 1 \n\
.endif \n\
");
+#endif
/* Create a "decorated" name */
#define mangle(name, n) #name "@" #n
@@ -88,6 +115,32 @@ bool NO_COPY wsock_started;
LoadDLLfuncEx3(name, n, dllname, notimp, err, 0)
/* Main DLL setup stuff. */
+#ifdef __x86_64__
+#define LoadDLLfuncEx3(name, n, dllname, notimp, err, no_resolve_on_fork) \
+ LoadDLLprime (dllname, dll_func_load, no_resolve_on_fork) \
+ __asm__ (" \n\
+ .section ." #dllname "_autoload_text,\"wx\" \n\
+ .global " #name " \n\
+ .global _win32_" #name " \n\
+ .align 16 \n\
+" #name ": \n\
+_win32_" #name ": \n\
+ movq 3f(%rip),%rax \n\
+ jmp *%rax \n\
+1:movq 2f(%rip),%rax \n\
+ push %rbp # Keep 16 byte aligned \n\
+ push %r9 \n\
+ push %r8 \n\
+ push %rdx \n\
+ push %rcx \n\
+ call *(%rax) \n\
+2:.quad ." #dllname "_info \n\
+ .long (" #n "+" #notimp ") | (((" #err ") & 0xff) <<16) \n\
+3:.quad 1b \n\
+ .asciz \"" #name "\" \n\
+ .text \n\
+");
+#else
#define LoadDLLfuncEx3(name, n, dllname, notimp, err, no_resolve_on_fork) \
LoadDLLprime (dllname, dll_func_load, no_resolve_on_fork) \
__asm__ (" \n\
@@ -106,6 +159,7 @@ _win32_" mangle (name, n) ": \n\
.asciz \"" #name "\" \n\
.text \n\
");
+#endif
/* DLL loader helper functions used during initialization. */
@@ -121,6 +175,69 @@ extern "C" void dll_chain () __asm__ ("dll_chain");
extern "C" {
+#ifdef __x86_64__
+__asm__ (" \n\
+ .section .rdata,\"r\" \n\
+msg1: \n\
+ .ascii \"couldn't dynamically determine load address for '%s' (handle %p), %E\\0\"\n\
+ \n\
+ .text \n\
+ .p2align 4,,15 \n\
+noload: \n\
+ movq 40(%rsp),%rdx # Get the address of the information block\n\
+ movl 8(%rdx),%eax # Should we 'ignore' the lack \n\
+ test $1,%eax # of this function? \n\
+ jz 1f # Nope. \n\
+ andl $0xffff0000,%eax# upper word (== desired return value) \n\
+ movl %eax,32(%rsp) # Save for later (in shadow space) \n\
+ movl $127,%ecx # ERROR_PROC_NOT_FOUND \n\
+ call SetLastError # Set it \n\
+ movl 32(%rsp),%eax # Get back return value \n\
+ sarl $16,%eax # swap to low order word \n\
+ addq $40,%rsp # Revert stack \n\
+ pop %r10 # Drop pointer to 'return address' \n\
+ pop %rcx # Restore arg registers \n\
+ pop %rdx \n\
+ pop %r8 \n\
+ pop %r9 \n\
+ pop %rbp # ...and restore frame pointer \n\
+ ret # Return \n\
+1: \n\
+ movq (%rdx),%rax # Handle value \n\
+ movq 8(%rax),%r8 \n\
+ lea 20(%rdx),%rdx # Location of name of function \n\
+ lea msg1(%rip),%rcx # The message \n\
+ call api_fatal # Print message. Never returns \n\
+ \n\
+ .globl dll_func_load \n\
+dll_func_load: \n\
+ movq (%rsp),%rdx # 'Return address' contains load info \n\
+ movq (%rdx),%rcx # Where handle lives \n\
+ movq 8(%rcx),%rcx # Address of Handle to DLL \n\
+ addq $20,%rdx # Address of name of function to load \n\
+ subq $40,%rsp # Shadow space + 8 byte for alignment \n\
+ call GetProcAddress # Load it \n\
+ test %rax,%rax # Success? \n\
+ jne gotit # Yes \n\
+ jmp noload # Issue an error or return \n\
+gotit: \n\
+ addq $40,%rsp # Revert stack \n\
+ pop %r10 # Pointer to 'return address' \n\
+ movq %rax,12(%r10) # Move absolute address to address slot \n\
+ subq $25,%r10 # Point to jmp \n\
+ pop %rcx # Restore arg registers \n\
+ pop %rdx \n\
+ pop %r8 \n\
+ pop %r9 \n\
+ pop %rbp # ...and restore frame pointer \n\
+ jmp *%r10 # Jump to actual function \n\
+ \n\
+ .global dll_chain \n\
+dll_chain: \n\
+ push %rax # Restore 'return address' \n\
+ jmp *%rdx # Jump to next init function \n\
+");
+#else
__asm__ (" \n\
.text \n\
msg1: \n\
@@ -177,13 +294,14 @@ dll_chain: \n\
pushl %eax # Restore 'return address' \n\
jmp *%edx # Jump to next init function \n\
");
+#endif
/* C representations of the two info blocks described above.
FIXME: These structures confuse gdb for some reason. GDB can print
the whole structure but has problems with the name field? */
struct dll_info
{
- DWORD load_state;
+ UINT_PTR load_state;
HANDLE handle;
LONG here;
void (*init) ();
@@ -194,14 +312,22 @@ struct func_info
{
struct dll_info *dll;
LONG decoration;
+#ifdef __x86_64__
+ UINT_PTR func_addr;
+#endif
char name[];
};
/* Mechanism for setting up info for passing to dll_chain routines. */
+#ifdef __x86_64__
+typedef __uint128_t two_addr_t;
+#else
+typedef __uint64_t two_addr_t;
+#endif
union retchain
{
- struct {long high; long low;};
- long long ll;
+ struct {uintptr_t high; uintptr_t low;};
+ two_addr_t ll;
};
@@ -228,10 +354,56 @@ dll_load (HANDLE& handle, WCHAR *name)
#define RETRY_COUNT 10
/* The standard DLL initialization routine. */
-__attribute__ ((used, noinline)) static long long
+#ifdef __x86_64__
+
+/* On x86_64, we need assembler wrappers for std_dll_init and wsock_init.
+ In the x86_64 ABI it's no safe bet that frame[1] (aka 8(%rbp)) contains
+ the return address. Consequentially, if we try to overwrite frame[1]
+ with the address of dll_chain, we end up with a scrambled stack, the
+ result depending on the optimization settings and the current frame of
+ mind of the compiler. So for x86_64, we disable overwriting the return
+ address in the real std_dll_init/wsock_init function, but rather do this
+ in the wrapper, after return from the function, when we exactly know
+ where the original return address is stored on the stack. */
+
+#define INIT_WRAPPER(func) \
+__asm__ (" \n\
+ .text \n\
+ .p2align 4,,15 \n\
+ .seh_proc _" #func " \n\
+_" #func ": \n\
+ pushq %rbp \n\
+ .seh_pushreg %rbp \n\
+ movq %rsp,%rbp \n\
+ .seh_setframe %rbp,0 \n\
+ subq $0x20,%rsp \n\
+ .seh_stackalloc 32 \n\
+ .seh_endprologue \n\
+ movq 0x28(%rsp),%rcx # return address as parameter \n\
+ call " #func " \n\
+ movdqa %xmm0,0x10(%rsp) # 128 bit return value in xmm0 \n\
+ movq 0x10(%rsp),%rax # copy over to %rax and %rdx \n\
+ movq 0x18(%rsp),%rdx \n\
+ leaq dll_chain(%rip),%rcx # load address of dll_chain \n\
+ movq %rcx,0x28(%rsp) # and overwrite return address \n\
+ addq $0x20,%rsp \n\
+ popq %rbp \n\
+ ret \n\
+ .seh_endproc \n\
+");
+
+INIT_WRAPPER (std_dll_init)
+
+__attribute__ ((used, noinline)) static two_addr_t
+std_dll_init (struct func_info *func)
+#else
+__attribute__ ((used, noinline)) static two_addr_t
std_dll_init ()
+#endif
{
+#ifndef __x86_64__
struct func_info *func = (struct func_info *) __builtin_return_address (0);
+#endif
struct dll_info *dll = func->dll;
retchain ret;
@@ -284,26 +456,38 @@ std_dll_init ()
}
/* Set "arguments" for dll_chain. */
- ret.low = (long) dll->init;
- ret.high = (long) func;
+ ret.low = (uintptr_t) dll->init;
+ ret.high = (uintptr_t) func;
InterlockedDecrement (&dll->here);
+#ifndef __x86_64__
/* Kludge alert. Redirects the return address to dll_chain. */
- __asm__ __volatile__ (" \n\
- movl $dll_chain,4(%ebp) \n\
- ");
+ uintptr_t *volatile frame = (uintptr_t *) __builtin_frame_address (0);
+ frame[1] = (uintptr_t) dll_chain;
+#endif
return ret.ll;
}
/* Initialization function for winsock stuff. */
WSADATA NO_COPY wsadata;
-static long long __attribute__ ((used, noinline))
+
+#ifdef __x86_64__
+/* See above comment preceeding std_dll_init. */
+INIT_WRAPPER (wsock_init)
+
+__attribute__ ((used, noinline)) static two_addr_t
+wsock_init (struct func_info *func)
+#else
+__attribute__ ((used, noinline)) static two_addr_t
wsock_init ()
+#endif
{
static LONG NO_COPY here = -1L;
+#ifndef __x86_64__
struct func_info *func = (struct func_info *) __builtin_return_address (0);
+#endif
struct dll_info *dll = func->dll;
while (InterlockedIncrement (&here))
@@ -330,23 +514,23 @@ wsock_init ()
debug_printf ("szSystemStatus %s", wsadata.szSystemStatus);
debug_printf ("iMaxSockets %d", wsadata.iMaxSockets);
debug_printf ("iMaxUdpDg %d", wsadata.iMaxUdpDg);
- debug_printf ("lpVendorInfo %d", wsadata.lpVendorInfo);
wsock_started = 1;
}
}
+#ifndef __x86_64__
/* Kludge alert. Redirects the return address to dll_chain. */
- __asm__ __volatile__ (" \n\
- movl $dll_chain,4(%ebp) \n\
- ");
+ uintptr_t *volatile frame = (uintptr_t *) __builtin_frame_address (0);
+ frame[1] = (uintptr_t) dll_chain;
+#endif
InterlockedDecrement (&here);
volatile retchain ret;
/* Set "arguments for dll_chain. */
- ret.low = (long) dll_func_load;
- ret.high = (long) func;
+ ret.low = (uintptr_t) dll_func_load;
+ ret.high = (uintptr_t) func;
return ret.ll;
}
@@ -383,19 +567,16 @@ LoadDLLfunc (ReportEventW, 36, advapi32)
LoadDLLfunc (DnsQuery_A, 24, dnsapi)
LoadDLLfunc (DnsRecordListFree, 8, dnsapi)
-// 50 = ERROR_NOT_SUPPORTED. Returned if OS doesn't support iphlpapi funcs
-LoadDLLfuncEx2 (GetAdaptersAddresses, 20, iphlpapi, 1, 50)
+LoadDLLfunc (GetAdaptersAddresses, 20, iphlpapi)
LoadDLLfunc (GetIfEntry, 4, iphlpapi)
LoadDLLfunc (GetIpAddrTable, 12, iphlpapi)
LoadDLLfunc (GetIpForwardTable, 12, iphlpapi)
LoadDLLfunc (GetNetworkParams, 8, iphlpapi)
LoadDLLfunc (GetUdpTable, 12, iphlpapi)
-LoadDLLfuncEx (AttachConsole, 4, kernel32, 1)
-LoadDLLfuncEx (GetModuleHandleExW, 12, kernel32, 1)
+LoadDLLfuncEx (CancelSynchronousIo, 4, kernel32, 1)
+LoadDLLfunc (CreateSymbolicLinkW, 12, kernel32)
LoadDLLfuncEx (GetNamedPipeClientProcessId, 8, kernel32, 1)
-LoadDLLfuncEx (GetSystemWow64DirectoryW, 8, kernel32, 1)
-LoadDLLfuncEx (GetVolumePathNamesForVolumeNameW, 16, kernel32, 1)
LoadDLLfunc (LocaleNameToLCID, 8, kernel32)
LoadDLLfunc (WNetCloseEnum, 4, mpr)
diff --git a/winsup/cygwin/automode.c b/winsup/cygwin/automode.c
index f047d4724..6951bfd6b 100644
--- a/winsup/cygwin/automode.c
+++ b/winsup/cygwin/automode.c
@@ -1,6 +1,6 @@
/* automode.c
- Copyright 2000, 2001, 2010 Red Hat, Inc.
+ Copyright 2000, 2001, 2010, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,7 +14,9 @@ details. */
extern int _fmode;
void
-cygwin_premain0 (int argc, char **argv, struct per_process *myself)
+cygwin_premain0 (int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)),
+ struct per_process *myself __attribute__ ((unused)))
{
static struct __cygwin_perfile pf[] =
{
diff --git a/winsup/cygwin/binmode.c b/winsup/cygwin/binmode.c
index f97ad0080..d4673d17d 100644
--- a/winsup/cygwin/binmode.c
+++ b/winsup/cygwin/binmode.c
@@ -1,6 +1,6 @@
/* binmode.c
- Copyright 2000, 2001, 2010 Red Hat, Inc.
+ Copyright 2000, 2001, 2010, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,7 +14,9 @@ details. */
extern int _fmode;
void
-cygwin_premain0 (int argc, char **argv, struct per_process *myself)
+cygwin_premain0 (int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)),
+ struct per_process *myself __attribute__ ((unused)))
{
_fmode &= ~_O_TEXT;
_fmode |= _O_BINARY;
diff --git a/winsup/cygwin/child_info.h b/winsup/cygwin/child_info.h
index 17da88ec6..70cfd5433 100644
--- a/winsup/cygwin/child_info.h
+++ b/winsup/cygwin/child_info.h
@@ -35,7 +35,7 @@ enum child_status
#define EXEC_MAGIC_SIZE sizeof(child_info)
/* Change this value if you get a message indicating that it is out-of-sync. */
-#define CURR_CHILD_INFO_MAGIC 0xe399543U
+#define CURR_CHILD_INFO_MAGIC 0x93737edaU
#define NPROCS 256
@@ -55,7 +55,7 @@ public:
DWORD msv_count; // zeroed on < W2K3, set to pseudo-count on Vista
DWORD cb; // size of this record
DWORD intro; // improbable string
- unsigned long magic; // magic number unique to child_info
+ DWORD magic; // magic number unique to child_info
unsigned short type; // type of record, exec, spawn, fork
init_cygheap *cygheap;
void *cygheap_max;
@@ -190,6 +190,6 @@ void __stdcall init_child_info (DWORD, child_info *, HANDLE);
extern "C" {
extern child_info *child_proc_info;
-extern child_info_spawn *spawn_info asm ("_child_proc_info");
-extern child_info_fork *fork_info asm ("_child_proc_info");
+extern child_info_spawn *spawn_info asm (_SYMSTR (child_proc_info));
+extern child_info_fork *fork_info asm (_SYMSTR (child_proc_info));
}
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/common.din
index c1e2e9ac0..913bf939e 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/common.din
@@ -1,183 +1,176 @@
-LIBRARY "cygwin1.dll" BASE=0x61000000
-
-EXPORTS
+# Exported variables
__argc DATA
__argv DATA
-_check_for_executable DATA
__check_rhosts_file DATA
-_ctype_ DATA
__ctype_ptr__ DATA
-__cygwin_environ DATA
__cygwin_user_data DATA
+__mb_cur_max DATA
+__progname DATA
+__rcmd_errstr DATA
+_check_for_executable DATA
+_ctype_ DATA
_daylight DATA
+_impure_ptr DATA
+_sys_errlist DATA
+_sys_nerr DATA
+_timezone DATA
+_tzname DATA
error_message_count DATA
error_one_per_line DATA
error_print_progname DATA
-_fe_dfl_env DATA
-_fe_nomask_env DATA
h_errno DATA
-_impure_ptr DATA
in6addr_any DATA
in6addr_loopback DATA
-__mb_cur_max DATA
optarg DATA
opterr DATA
optind DATA
optopt DATA
optreset DATA
-__progname DATA
program_invocation_name DATA
program_invocation_short_name DATA
-__rcmd_errstr DATA
reent_data DATA
sys_errlist = _sys_errlist DATA
-_sys_errlist DATA
sys_nerr = _sys_nerr DATA
-_sys_nerr DATA
sys_sigabbrev DATA
sys_siglist DATA
-_timezone DATA
-_tzname DATA
+
+# Exported functions
_Exit SIGFE
+__assert NOSIGFE
+__assert_func NOSIGFE
+__assertfail NOSIGFE
+__b64_ntop NOSIGFE
+__b64_pton NOSIGFE
+__dn_comp SIGFE
+__dn_expand SIGFE
+__dn_skipname SIGFE
+__eprintf SIGFE
+__errno NOSIGFE
+__fpclassifyd NOSIGFE
+__fpclassifyf NOSIGFE
+__fpurge SIGFE
+__getreent NOSIGFE
+__infinity NOSIGFE
+__isinfd NOSIGFE
+__isinff NOSIGFE
+__isnand NOSIGFE
+__isnanf NOSIGFE
+__locale_mb_cur_max NOSIGFE
+__main NOSIGFE
+__opendir_with_d_ino SIGFE
+__res_close SIGFE
+__res_init SIGFE
+__res_mkquery SIGFE
+__res_nclose SIGFE
+__res_ninit SIGFE
+__res_nmkquery SIGFE
+__res_nquery SIGFE
+__res_nquerydomain SIGFE
+__res_nsearch SIGFE
+__res_nsend SIGFE
+__res_query SIGFE
+__res_querydomain SIGFE
+__res_search SIGFE
+__res_send SIGFE
+__res_state SIGFE
+__signbitd NOSIGFE
+__signbitf NOSIGFE
+__signgam NOSIGFE
+__srget SIGFE
+__srget_r SIGFE
+__swbuf SIGFE
+__swbuf_r SIGFE
+__wrap__ZdaPv NOSIGFE # void operator delete[](void *p) throw()
+__wrap__ZdaPvRKSt9nothrow_t NOSIGFE # void operator delete[](void *p, const std::nothrow_t &nt) throw()
+__wrap__ZdlPv NOSIGFE # void operator delete(void *p) throw()
+__wrap__ZdlPvRKSt9nothrow_t NOSIGFE # void operator delete(void *p, const std::nothrow_t &nt) throw()
+__xdrrec_getrec SIGFE
+__xdrrec_setnonblock SIGFE
+__xpg_strerror_r SIGFE
+_exit SIGFE
+_feinitialise NOSIGFE
+_fscanf_r SIGFE
+_get_osfhandle SIGFE
+_longjmp = longjmp NOSIGFE
+_pipe SIGFE
+_pthread_cleanup_pop SIGFE
+_pthread_cleanup_push SIGFE
+_setjmp = setjmp NOSIGFE
+_setmode = cygwin_setmode SIGFE
a64l NOSIGFE
abort NOSIGFE
-_abort = abort NOSIGFE
abs NOSIGFE
-_abs = abs NOSIGFE
accept = cygwin_accept SIGFE
accept4 SIGFE
access SIGFE
-_access = access SIGFE
acl SIGFE
-_acl = acl SIGFE
-_acl32 = acl32 SIGFE
aclcheck NOSIGFE
-_aclcheck = aclcheck NOSIGFE
-_aclcheck32 = aclcheck32 NOSIGFE
aclfrommode SIGFE
-_aclfrommode = aclfrommode SIGFE
-_aclfrommode32 = aclfrommode32 SIGFE
aclfrompbits SIGFE
-_aclfrompbits = aclfrompbits SIGFE
-_aclfrompbits32 = aclfrompbits32 SIGFE
aclfromtext SIGFE
-_aclfromtext = aclfromtext SIGFE
-_aclfromtext32 = aclfromtext32 SIGFE
aclsort SIGFE
-_aclsort = aclsort SIGFE
-_aclsort32 = aclsort32 SIGFE
acltomode SIGFE
-_acltomode = acltomode SIGFE
-_acltomode32 = acltomode32 SIGFE
acltopbits SIGFE
-_acltopbits = acltopbits SIGFE
-_acltopbits32 = acltopbits32 SIGFE
acltotext SIGFE
-_acltotext = acltotext SIGFE
-_acltotext32 = acltotext32 SIGFE
acos NOSIGFE
-_acos = acos NOSIGFE
acosf NOSIGFE
-_acosf = acosf NOSIGFE
acosh NOSIGFE
-_acosh = acosh NOSIGFE
acoshf NOSIGFE
-_acoshf = acoshf NOSIGFE
alarm SIGFE
-_alarm = alarm SIGFE
-_alloca NOSIGFE
alphasort NOSIGFE
-_alphasort = alphasort NOSIGFE
+arc4random NOSIGFE
+arc4random_addrandom NOSIGFE
+arc4random_buf NOSIGFE
+arc4random_stir NOSIGFE
+arc4random_uniform NOSIGFE
argz_add SIGFE
-__argz_add = argz_add SIGFE
argz_add_sep SIGFE
-__argz_add_sep = argz_add_sep SIGFE
argz_append SIGFE
-__argz_append = argz_append SIGFE
argz_count NOSIGFE
-__argz_count = argz_count NOSIGFE
argz_create SIGFE
-__argz_create = argz_create SIGFE
argz_create_sep SIGFE
-__argz_create_sep = argz_create_sep SIGFE
argz_delete SIGFE
-__argz_delete = argz_delete SIGFE
argz_extract NOSIGFE
-__argz_extract = argz_extract NOSIGFE
argz_insert SIGFE
-__argz_insert = argz_insert SIGFE
argz_next NOSIGFE
-__argz_next = argz_next NOSIGFE
argz_replace SIGFE
-__argz_replace = argz_replace SIGFE
argz_stringify NOSIGFE
-__argz_stringify = argz_stringify NOSIGFE
asctime SIGFE
-_asctime = asctime SIGFE
asctime_r SIGFE
-_asctime_r = asctime_r SIGFE
asin NOSIGFE
-_asin = asin NOSIGFE
asinf NOSIGFE
-_asinf = asinf NOSIGFE
asinh NOSIGFE
-_asinh = asinh NOSIGFE
asinhf NOSIGFE
-_asinhf = asinhf NOSIGFE
asnprintf SIGFE
asprintf SIGFE
-_asprintf = asprintf SIGFE
-asprintf_r = _asprintf_r SIGFE
-_asprintf_r SIGFE
-__assert NOSIGFE
-__assert_func NOSIGFE
-__assertfail NOSIGFE
atan NOSIGFE
-_atan = atan NOSIGFE
atan2 NOSIGFE
-_atan2 = atan2 NOSIGFE
atan2f NOSIGFE
-_atan2f = atan2f NOSIGFE
atanf NOSIGFE
-_atanf = atanf NOSIGFE
atanh NOSIGFE
-_atanh = atanh NOSIGFE
atanhf NOSIGFE
-_atanhf = atanhf NOSIGFE
atexit = cygwin_atexit SIGFE
-_atexit = cygwin_atexit SIGFE
atof SIGFE
-_atof = atof SIGFE
atoff SIGFE
-_atoff = atoff SIGFE
atoi NOSIGFE
-_atoi = atoi NOSIGFE
atol NOSIGFE
-_atol = atol NOSIGFE
atoll NOSIGFE
basename NOSIGFE
bcmp NOSIGFE
-_bcmp = bcmp NOSIGFE
bcopy NOSIGFE
-_bcopy = bcopy NOSIGFE
bind = cygwin_bind SIGFE
bindresvport = cygwin_bindresvport SIGFE
bindresvport_sa = cygwin_bindresvport_sa SIGFE
bsearch NOSIGFE
-_bsearch = bsearch NOSIGFE
btowc NOSIGFE
bzero NOSIGFE
-_bzero = bzero NOSIGFE
cabs NOSIGFE
-_cabs = cabs NOSIGFE
cabsf NOSIGFE
-_cabsf = cabsf NOSIGFE
cacos NOSIGFE
cacosf NOSIGFE
cacosh NOSIGFE
cacoshf NOSIGFE
calloc SIGFE
-_calloc = calloc SIGFE
canonicalize_file_name SIGFE
carg NOSIGFE
cargf NOSIGFE
@@ -190,17 +183,13 @@ catanf NOSIGFE
catanh NOSIGFE
catanhf NOSIGFE
cbrt NOSIGFE
-_cbrt = cbrt NOSIGFE
cbrtf NOSIGFE
-_cbrtf = cbrtf NOSIGFE
ccos NOSIGFE
ccosf NOSIGFE
ccosh NOSIGFE
ccoshf NOSIGFE
ceil NOSIGFE
-_ceil = ceil NOSIGFE
ceilf NOSIGFE
-_ceilf = ceilf NOSIGFE
cexp NOSIGFE
cexpf NOSIGFE
cfgetispeed NOSIGFE
@@ -210,21 +199,14 @@ cfsetispeed SIGFE
cfsetospeed SIGFE
cfsetspeed SIGFE
chdir SIGFE
-_chdir = chdir SIGFE
chmod SIGFE
-_chmod = chmod SIGFE
chown SIGFE
-_chown = chown SIGFE
-_chown32 = chown32 SIGFE
chroot SIGFE
-_chroot = chroot SIGFE
cimag NOSIGFE
cimagf NOSIGFE
cleanup_glue NOSIGFE
clearerr SIGFE
-_clearerr = clearerr SIGFE
clock SIGFE
-_clock = clock SIGFE
clock_getcpuclockid SIGFE
clock_getres SIGFE
clock_gettime SIGFE
@@ -234,26 +216,18 @@ clock_settime SIGFE
clog NOSIGFE
clogf NOSIGFE
close SIGFE
-_close = close SIGFE
closedir SIGFE
-_closedir = closedir SIGFE
closelog SIGFE
confstr NOSIGFE
conj NOSIGFE
conjf NOSIGFE
connect = cygwin_connect SIGFE
copysign NOSIGFE
-_copysign = copysign NOSIGFE
copysignf NOSIGFE
-_copysignf = copysignf NOSIGFE
cos NOSIGFE
-_cos = cos NOSIGFE
cosf NOSIGFE
-_cosf = cosf NOSIGFE
cosh NOSIGFE
-_cosh = cosh NOSIGFE
coshf NOSIGFE
-_coshf = coshf NOSIGFE
cpow NOSIGFE
cpowf NOSIGFE
cproj NOSIGFE
@@ -261,7 +235,6 @@ cprojf NOSIGFE
creal NOSIGFE
crealf NOSIGFE
creat SIGFE
-_creat = creat SIGFE
csin NOSIGFE
csinf NOSIGFE
csinh NOSIGFE
@@ -274,240 +247,109 @@ ctanh NOSIGFE
ctanhf NOSIGFE
ctermid SIGFE
ctime SIGFE
-_ctime = ctime SIGFE
ctime_r SIGFE
-_ctime_r = ctime_r SIGFE
cuserid NOSIGFE
-_cuserid = cuserid NOSIGFE
cwait SIGFE
-_cwait = cwait SIGFE
-cygwin32_attach_handle_to_fd = cygwin_attach_handle_to_fd SIGFE
-cygwin32_conv_to_full_posix_path = cygwin_conv_to_full_posix_path SIGFE
-cygwin32_conv_to_full_win32_path = cygwin_conv_to_full_win32_path SIGFE
-cygwin32_conv_to_posix_path = cygwin_conv_to_posix_path SIGFE
-cygwin32_conv_to_win32_path = cygwin_conv_to_win32_path SIGFE
-cygwin32_detach_dll = cygwin_detach_dll SIGFE_MAYBE
-cygwin32_internal = cygwin_internal SIGFE
-cygwin32_posix_path_list_p = cygwin_posix_path_list_p NOSIGFE
-cygwin32_posix_to_win32_path_list = cygwin_posix_to_win32_path_list SIGFE
-cygwin32_posix_to_win32_path_list_buf_size = cygwin_posix_to_win32_path_list_buf_size SIGFE
-cygwin32_split_path = cygwin_split_path NOSIGFE
-cygwin32_win32_to_posix_path_list = cygwin_win32_to_posix_path_list SIGFE
-cygwin32_win32_to_posix_path_list_buf_size = cygwin_win32_to_posix_path_list_buf_size SIGFE
-cygwin32_winpid_to_pid = cygwin_winpid_to_pid SIGFE
cygwin_attach_handle_to_fd SIGFE
cygwin_conv_path SIGFE
cygwin_conv_path_list SIGFE
-cygwin_conv_to_full_posix_path SIGFE
-cygwin_conv_to_full_win32_path SIGFE
-cygwin_conv_to_posix_path SIGFE
-cygwin_conv_to_win32_path SIGFE
cygwin_create_path SIGFE
cygwin_detach_dll SIGFE_MAYBE
cygwin_dll_init NOSIGFE
cygwin_internal NOSIGFE
cygwin_logon_user SIGFE
cygwin_posix_path_list_p NOSIGFE
-cygwin_posix_to_win32_path_list SIGFE
-cygwin_posix_to_win32_path_list_buf_size SIGFE
cygwin_set_impersonation_token SIGFE
cygwin_split_path NOSIGFE
cygwin_stackdump SIGFE
cygwin_umount SIGFE
-cygwin_win32_to_posix_path_list SIGFE
-cygwin_win32_to_posix_path_list_buf_size SIGFE
cygwin_winpid_to_pid SIGFE
daemon SIGFE
difftime NOSIGFE
-_difftime = difftime NOSIGFE
dirfd SIGFE
-_dirfd = dirfd SIGFE
dirname NOSIGFE
div NOSIGFE
-_div = div NOSIGFE
dlclose SIGFE
dlerror NOSIGFE
dlfork NOSIGFE
-_dll_crt0@0 NOSIGFE
dll_crt0__FP11per_process NOSIGFE # dll_crt0(per_process *)
dll_dllcrt0 NOSIGFE
-dll_entry@12 NOSIGFE
-dll_noncygwin_dllcrt0 NOSIGFE
dlopen SIGFE
dlsym SIGFE
dn_comp = __dn_comp SIGFE
-__dn_comp SIGFE
dn_expand = __dn_expand SIGFE
-__dn_expand SIGFE
dn_skipname = __dn_skipname SIGFE
-__dn_skipname SIGFE
dprintf SIGFE
drand48 NOSIGFE
-_drand48 = drand48 NOSIGFE
drem NOSIGFE
-_drem = drem NOSIGFE
dremf NOSIGFE
-_dremf = dremf NOSIGFE
dup SIGFE
-_dup = dup SIGFE
dup2 SIGFE
-_dup2 = dup2 SIGFE
dup3 SIGFE
eaccess = euidaccess SIGFE
ecvt SIGFE
-_ecvt = ecvt SIGFE
ecvtbuf SIGFE
-_ecvtbuf = ecvtbuf SIGFE
ecvtf SIGFE
-_ecvtf = ecvtf SIGFE
endgrent NOSIGFE
-_endgrent = endgrent NOSIGFE
endhostent NOSIGFE
endmntent NOSIGFE
-_endmntent = endmntent NOSIGFE
endprotoent = cygwin_endprotoent SIGFE
endpwent NOSIGFE
-_endpwent = endpwent NOSIGFE
endservent = cygwin_endservent SIGFE
endusershell SIGFE
endutent SIGFE
-_endutent = endutent SIGFE
endutxent SIGFE
envz_add SIGFE
-__envz_add = envz_add SIGFE
envz_entry NOSIGFE
-__envz_entry = envz_entry NOSIGFE
envz_get NOSIGFE
-__envz_get = envz_get NOSIGFE
envz_merge SIGFE
-__envz_merge = envz_merge SIGFE
envz_remove SIGFE
-__envz_remove = envz_remove SIGFE
envz_strip SIGFE
-__envz_strip = envz_strip SIGFE
-__eprintf SIGFE
erand48 NOSIGFE
-_erand48 = erand48 NOSIGFE
erf NOSIGFE
-_erf = erf NOSIGFE
erfc NOSIGFE
-_erfc = erfc NOSIGFE
erfcf NOSIGFE
-_erfcf = erfcf NOSIGFE
erff NOSIGFE
-_erff = erff NOSIGFE
err SIGFE
-__errno NOSIGFE
error SIGFE
error_at_line SIGFE
errx SIGFE
euidaccess SIGFE
execl SIGFE
-_execl = execl SIGFE
execle SIGFE
-_execle = execle SIGFE
execlp SIGFE
-_execlp = execlp SIGFE
execv SIGFE
-_execv = execv SIGFE
execve SIGFE
-_execve = execve SIGFE
execvp SIGFE
-_execvp = execvp SIGFE
execvpe SIGFE
exit = cygwin_exit SIGFE
-_exit SIGFE
exp NOSIGFE
-_exp = exp NOSIGFE
exp10 NOSIGFE
exp10f NOSIGFE
exp2 NOSIGFE
exp2f NOSIGFE
expf NOSIGFE
-_expf = expf NOSIGFE
expm1 NOSIGFE
-_expm1 = expm1 NOSIGFE
expm1f NOSIGFE
-_expm1f = expm1f NOSIGFE
-_f_atan2 NOSIGFE
-__f_atan2 = _f_atan2 NOSIGFE
-_f_atan2f NOSIGFE
-__f_atan2f = _f_atan2f NOSIGFE
-_f_exp NOSIGFE
-__f_exp = _f_exp NOSIGFE
-_f_expf NOSIGFE
-__f_expf = _f_expf NOSIGFE
-_f_frexp NOSIGFE
-__f_frexp = _f_frexp NOSIGFE
-_f_frexpf NOSIGFE
-__f_frexpf = _f_frexpf NOSIGFE
-_f_ldexp NOSIGFE
-__f_ldexp = _f_ldexp NOSIGFE
-_f_ldexpf NOSIGFE
-__f_ldexpf = _f_ldexpf NOSIGFE
-_f_llrint NOSIGFE
-_f_llrintf NOSIGFE
-_f_llrintl NOSIGFE
-_f_log NOSIGFE
-__f_log = _f_log NOSIGFE
-_f_log10 NOSIGFE
-__f_log10 = _f_log10 NOSIGFE
-_f_log10f NOSIGFE
-__f_log10f = _f_log10f NOSIGFE
-_f_logf NOSIGFE
-__f_logf = _f_logf NOSIGFE
-_f_lrint NOSIGFE
-_f_lrintf NOSIGFE
-_f_lrintl NOSIGFE
-_f_pow NOSIGFE
-__f_pow = _f_pow NOSIGFE
-_f_powf NOSIGFE
-__f_powf = _f_powf NOSIGFE
-_f_rint NOSIGFE
-_f_rintf NOSIGFE
-_f_rintl NOSIGFE
-_f_tan NOSIGFE
-__f_tan = _f_tan NOSIGFE
-_f_tanf NOSIGFE
-__f_tanf = _f_tanf NOSIGFE
fabs NOSIGFE
-_fabs = fabs NOSIGFE
fabsf NOSIGFE
-_fabsf = fabsf NOSIGFE
faccessat SIGFE
facl SIGFE
-_facl = facl SIGFE
-_facl32 = facl32 SIGFE
fchdir SIGFE
-_fchdir = fchdir SIGFE
fchmod SIGFE
-_fchmod = fchmod SIGFE
fchmodat SIGFE
fchown SIGFE
-_fchown = fchown SIGFE
-_fchown32 = fchown32 SIGFE
fchownat SIGFE
fclose SIGFE
-_fclose = fclose SIGFE
fcloseall SIGFE
-_fcloseall = fcloseall SIGFE
-fcloseall_r = _fcloseall_r SIGFE
-_fcloseall_r SIGFE
fcntl SIGFE
-_fcntl = fcntl SIGFE
-_fcntl64 = fcntl64 SIGFE
fcvt SIGFE
-_fcvt = fcvt SIGFE
fcvtbuf SIGFE
-_fcvtbuf = fcvtbuf SIGFE
fcvtf SIGFE
-_fcvtf = fcvtf SIGFE
fdatasync SIGFE
fdim NOSIGFE
fdimf NOSIGFE
fdopen SIGFE
-_fdopen = fdopen SIGFE
-_fdopen64 = fdopen64 SIGFE
fdopendir SIGFE
feclearexcept NOSIGFE
fedisableexcept NOSIGFE
@@ -518,12 +360,9 @@ fegetexceptflag NOSIGFE
fegetprec NOSIGFE
fegetround NOSIGFE
feholdexcept SIGFE
-_feinitialise NOSIGFE
feof SIGFE
-_feof = feof SIGFE
feraiseexcept SIGFE
ferror SIGFE
-_ferror = ferror SIGFE
fesetenv SIGFE
fesetexceptflag SIGFE
fesetprec NOSIGFE
@@ -532,34 +371,22 @@ fetestexcept NOSIGFE
feupdateenv SIGFE
fexecve SIGFE
fflush SIGFE
-_fflush = fflush SIGFE
ffs NOSIGFE
-_ffs = ffs NOSIGFE
fgetc SIGFE
-_fgetc = fgetc SIGFE
fgetpos SIGFE
-_fgetpos = fgetpos SIGFE
-_fgetpos64 = fgetpos64 SIGFE
fgets SIGFE
-_fgets = fgets SIGFE
fgetwc SIGFE
fgetws SIGFE
fgetxattr SIGFE
fileno SIGFE
-_fileno = fileno SIGFE
finite NOSIGFE
-_finite = finite NOSIGFE
finitef NOSIGFE
-_finitef = finitef NOSIGFE
fiprintf SIGFE
-_fiprintf = fiprintf SIGFE
flistxattr SIGFE
flock SIGFE
flockfile SIGFE
floor NOSIGFE
-_floor = floor NOSIGFE
floorf NOSIGFE
-_floorf = floorf NOSIGFE
fma NOSIGFE
fmaf NOSIGFE
fmax NOSIGFE
@@ -568,79 +395,42 @@ fmemopen SIGFE
fmin NOSIGFE
fminf NOSIGFE
fmod NOSIGFE
-_fmod = fmod NOSIGFE
fmodf NOSIGFE
-_fmodf = fmodf NOSIGFE
fnmatch NOSIGFE
-_fnmatch = fnmatch NOSIGFE
fopen SIGFE
-_fopen = fopen SIGFE
-_fopen64 = fopen64 SIGFE
fopencookie SIGFE
fork SIGFE
-_fork = fork SIGFE
forkpty SIGFE
fpathconf SIGFE
-__fpclassifyd NOSIGFE
-__fpclassifyf NOSIGFE
fprintf SIGFE
-_fprintf = fprintf SIGFE
fpurge SIGFE
-__fpurge SIGFE
fputc SIGFE
-_fputc = fputc SIGFE
fputs SIGFE
-_fputs = fputs SIGFE
fputwc SIGFE
fputws SIGFE
fread SIGFE
-_fread = fread SIGFE
free SIGFE
-_free = free SIGFE
freeaddrinfo = cygwin_freeaddrinfo SIGFE
freeifaddrs SIGFE
fremovexattr SIGFE
freopen SIGFE
-_freopen = freopen SIGFE
-_freopen64 = freopen64 SIGFE
frexp NOSIGFE
-_frexp = frexp NOSIGFE
frexpf NOSIGFE
-_frexpf = frexpf NOSIGFE
fscanf SIGFE
-_fscanf = fscanf SIGFE
-fscanf_r = _fscanf_r SIGFE
-_fscanf_r SIGFE
fseek SIGFE
-_fseek = fseek SIGFE
fseeko SIGFE
-_fseeko = fseeko SIGFE
-_fseeko64 = fseeko64 SIGFE
fsetpos SIGFE
-_fsetpos = fsetpos SIGFE
-_fsetpos64 = fsetpos64 SIGFE
fsetxattr SIGFE
fstat SIGFE
-_fstat = fstat SIGFE
-_fstat64 = fstat64 SIGFE
fstatat SIGFE
fstatfs SIGFE
-_fstatfs = fstatfs SIGFE
fstatvfs SIGFE
fsync SIGFE
-_fsync = fsync SIGFE
ftell SIGFE
-_ftell = ftell SIGFE
ftello SIGFE
-_ftello = ftello SIGFE
-_ftello64 = ftello64 SIGFE
ftime SIGFE
-_ftime = ftime SIGFE
ftok SIGFE
-_ftok = ftok SIGFE
ftruncate SIGFE
-_ftruncate = ftruncate SIGFE
-_ftruncate64 = ftruncate64 SIGFE
ftrylockfile SIGFE
fts_children SIGFE
fts_close SIGFE
@@ -659,131 +449,78 @@ futimesat SIGFE
fwide SIGFE
fwprintf SIGFE
fwrite SIGFE
-_fwrite = fwrite SIGFE
fwscanf SIGFE
gai_strerror = cygwin_gai_strerror NOSIGFE
gamma NOSIGFE
-_gamma = gamma NOSIGFE
gamma_r NOSIGFE
-_gamma_r = gamma_r NOSIGFE
gammaf NOSIGFE
-_gammaf = gammaf NOSIGFE
gammaf_r NOSIGFE
-_gammaf_r = gammaf_r NOSIGFE
gcvt SIGFE
-_gcvt = gcvt SIGFE
gcvtf SIGFE
-_gcvtf = gcvtf SIGFE
get_avphys_pages SIGFE
get_current_dir_name SIGFE
get_nprocs SIGFE
get_nprocs_conf SIGFE
-get_osfhandle SIGFE
-_get_osfhandle = get_osfhandle SIGFE
get_phys_pages SIGFE
getaddrinfo = cygwin_getaddrinfo SIGFE
getc SIGFE
-_getc = getc SIGFE
getc_unlocked SIGFE
-_getc_unlocked = getc_unlocked SIGFE
getchar SIGFE
-_getchar = getchar SIGFE
getchar_unlocked SIGFE
-_getchar_unlocked = getchar_unlocked SIGFE
getcwd SIGFE
-_getcwd = getcwd SIGFE
getdelim = __getdelim SIGFE
-__getdelim SIGFE
getdomainname SIGFE
-_getdomainname = getdomainname SIGFE
getdtablesize NOSIGFE
-_getdtablesize = getdtablesize NOSIGFE
getegid NOSIGFE
-_getegid = getegid NOSIGFE
-_getegid32 = getegid32 NOSIGFE
getenv NOSIGFE
-_getenv = getenv NOSIGFE
geteuid NOSIGFE
-_geteuid = geteuid NOSIGFE
-_geteuid32 = geteuid32 NOSIGFE
getgid NOSIGFE
-_getgid = getgid NOSIGFE
-_getgid32 = getgid32 NOSIGFE
getgrent SIGFE
-_getgrent = getgrent SIGFE
-_getgrent32 = getgrent32 SIGFE
getgrgid SIGFE
-_getgrgid = getgrgid SIGFE
-_getgrgid32 = getgrgid32 SIGFE
getgrgid_r SIGFE
getgrnam SIGFE
-_getgrnam = getgrnam SIGFE
-_getgrnam32 = getgrnam32 SIGFE
getgrnam_r SIGFE
getgrouplist SIGFE
getgroups SIGFE
-_getgroups = getgroups SIGFE
-_getgroups32 = getgroups32 SIGFE
gethostbyaddr = cygwin_gethostbyaddr SIGFE
gethostbyname = cygwin_gethostbyname SIGFE
gethostbyname2 SIGFE
gethostid SIGFE
gethostname = cygwin_gethostname SIGFE
-_gethostname = cygwin_gethostname SIGFE
getifaddrs SIGFE
getitimer SIGFE
getline = __getline SIGFE
-__getline SIGFE
getlogin NOSIGFE
-_getlogin = getlogin NOSIGFE
getlogin_r NOSIGFE
getmntent SIGFE
-_getmntent = getmntent SIGFE
getmntent_r SIGFE
getmode SIGFE
-_getmode = getmode SIGFE
getnameinfo = cygwin_getnameinfo SIGFE
getopt SIGFE
getopt_long SIGFE
getopt_long_only SIGFE
getpagesize SIGFE
-_getpagesize = getpagesize SIGFE
getpass SIGFE
-_getpass = getpass SIGFE
getpeereid SIGFE
getpeername = cygwin_getpeername SIGFE
getpgid SIGFE
getpgrp SIGFE
-_getpgrp = getpgrp SIGFE
getpid NOSIGFE
-_getpid = getpid NOSIGFE
getppid NOSIGFE
-_getppid = getppid NOSIGFE
getpriority SIGFE
getprogname NOSIGFE
getprotobyname = cygwin_getprotobyname SIGFE
getprotobynumber = cygwin_getprotobynumber SIGFE
getprotoent = cygwin_getprotoent SIGFE
getpt SIGFE
-getpwduid NOSIGFE
-_getpwduid = getpwduid NOSIGFE
getpwent SIGFE
-_getpwent = getpwent SIGFE
getpwnam SIGFE
-_getpwnam = getpwnam SIGFE
getpwnam_r SIGFE
getpwuid SIGFE
-_getpwuid = getpwuid SIGFE
-_getpwuid32 = getpwuid32 SIGFE
getpwuid_r SIGFE
-_getpwuid_r32 = getpwuid_r32 SIGFE
-__getreent NOSIGFE
getrlimit SIGFE
-_getrlimit = getrlimit SIGFE
getrusage SIGFE
-_getrusage = getrusage SIGFE
gets SIGFE
-_gets = gets SIGFE
getservbyname = cygwin_getservbyname SIGFE
getservbyport = cygwin_getservbyport SIGFE
getservent = cygwin_getservent SIGFE
@@ -792,33 +529,24 @@ getsockname = cygwin_getsockname SIGFE
getsockopt = cygwin_getsockopt SIGFE
getsubopt NOSIGFE
gettimeofday SIGFE
-_gettimeofday = gettimeofday SIGFE
getuid NOSIGFE
-_getuid = getuid NOSIGFE
-_getuid32 = getuid32 NOSIGFE
getusershell SIGFE
getutent SIGFE
-_getutent = getutent SIGFE
getutid SIGFE
-_getutid = getutid SIGFE
getutline SIGFE
getutxent SIGFE
getutxid SIGFE
getutxline SIGFE
getw SIGFE
-_getw = getw SIGFE
getwc SIGFE
getwchar SIGFE
getwd SIGFE
-_getwd = getwd SIGFE
getxattr SIGFE
glob SIGFE
glob_pattern_p
globfree SIGFE
gmtime SIGFE
-_gmtime = gmtime SIGFE
gmtime_r SIGFE
-_gmtime_r = gmtime_r SIGFE
grantpt NOSIGFE
hcreate SIGFE
hcreate_r SIGFE
@@ -829,25 +557,18 @@ hsearch SIGFE
hsearch_r SIGFE
hstrerror = cygwin_hstrerror NOSIGFE
htonl NOSIGFE
-_htonl = htonl NOSIGFE
htons NOSIGFE
-_htons = htons NOSIGFE
hypot NOSIGFE
-_hypot = hypot NOSIGFE
hypotf NOSIGFE
-_hypotf = hypotf NOSIGFE
if_freenameindex SIGFE
if_indextoname SIGFE
if_nameindex SIGFE
if_nametoindex SIGFE
ilogb NOSIGFE
-_ilogb = ilogb NOSIGFE
ilogbf NOSIGFE
-_ilogbf = ilogbf NOSIGFE
imaxabs = llabs NOSIGFE
imaxdiv = lldiv NOSIGFE
index NOSIGFE
-_index = index NOSIGFE
inet_addr = cygwin_inet_addr SIGFE
inet_aton = cygwin_inet_aton SIGFE
inet_makeaddr NOSIGFE
@@ -857,57 +578,31 @@ inet_ntoa = cygwin_inet_ntoa SIGFE
inet_ntop = cygwin_inet_ntop SIGFE
inet_pton = cygwin_inet_pton SIGFE
infinity NOSIGFE
-_infinity = infinity NOSIGFE
-__infinity NOSIGFE
infinityf NOSIGFE
-_infinityf = infinityf NOSIGFE
initgroups SIGFE
-_initgroups32 = initgroups32 SIGFE
initstate NOSIGFE
insque NOSIGFE
ioctl SIGFE
-_ioctl = ioctl SIGFE
iprintf SIGFE
-_iprintf = iprintf SIGFE
iruserok SIGFE
iruserok_sa SIGFE
isalnum NOSIGFE
-_isalnum = isalnum NOSIGFE
isalpha NOSIGFE
-_isalpha = isalpha NOSIGFE
isascii NOSIGFE
-_isascii = isascii NOSIGFE
isatty SIGFE
-_isatty = isatty SIGFE
isblank NOSIGFE
iscntrl NOSIGFE
-_iscntrl = iscntrl NOSIGFE
isdigit NOSIGFE
-_isdigit = isdigit NOSIGFE
isgraph NOSIGFE
-_isgraph = isgraph NOSIGFE
isinf NOSIGFE
-_isinf = isinf NOSIGFE
-__isinfd NOSIGFE
isinff NOSIGFE
-_isinff = isinff NOSIGFE
-__isinff NOSIGFE
islower NOSIGFE
-_islower = islower NOSIGFE
isnan NOSIGFE
-_isnan = isnan NOSIGFE
-__isnand NOSIGFE
isnanf NOSIGFE
-_isnanf = isnanf NOSIGFE
-__isnanf NOSIGFE
isprint NOSIGFE
-_isprint = isprint NOSIGFE
ispunct NOSIGFE
-_ispunct = ispunct NOSIGFE
isspace NOSIGFE
-_isspace = isspace NOSIGFE
isupper NOSIGFE
-_isupper = isupper NOSIGFE
iswalnum NOSIGFE
iswalpha NOSIGFE
iswblank NOSIGFE
@@ -922,179 +617,109 @@ iswspace NOSIGFE
iswupper NOSIGFE
iswxdigit NOSIGFE
isxdigit NOSIGFE
-_isxdigit = isxdigit NOSIGFE
j0 NOSIGFE
-_j0 = j0 NOSIGFE
j0f NOSIGFE
-_j0f = j0f NOSIGFE
j1 NOSIGFE
-_j1 = j1 NOSIGFE
j1f NOSIGFE
-_j1f = j1f NOSIGFE
jn NOSIGFE
-_jn = jn NOSIGFE
jnf NOSIGFE
-_jnf = jnf NOSIGFE
jrand48 NOSIGFE
-_jrand48 = jrand48 NOSIGFE
kill SIGFE
-_kill = kill SIGFE
killpg SIGFE
l64a NOSIGFE
labs NOSIGFE
-_labs = labs NOSIGFE
-lacl SIGFE
-_lacl = lacl SIGFE
lchown SIGFE
-_lchown = lchown SIGFE
-_lchown32 = lchown32 SIGFE
lcong48 NOSIGFE
-_lcong48 = lcong48 NOSIGFE
ldexp NOSIGFE
-_ldexp = ldexp NOSIGFE
ldexpf NOSIGFE
-_ldexpf = ldexpf NOSIGFE
ldiv NOSIGFE
-_ldiv = ldiv NOSIGFE
lfind NOSIGFE
lgamma NOSIGFE
-_lgamma = lgamma NOSIGFE
lgamma_r NOSIGFE
-_lgamma_r = lgamma_r NOSIGFE
lgammaf NOSIGFE
-_lgammaf = lgammaf NOSIGFE
lgammaf_r NOSIGFE
-_lgammaf_r = lgammaf_r NOSIGFE
lgetxattr SIGFE
link SIGFE
-_link = link SIGFE
linkat SIGFE
listen = cygwin_listen SIGFE
listxattr SIGFE
llabs NOSIGFE
lldiv NOSIGFE
llistxattr SIGFE
-llrint = _f_llrint NOSIGFE
-llrintf = _f_llrintf NOSIGFE
-llrintl = _f_llrintl NOSIGFE
llround NOSIGFE
llroundf NOSIGFE
-__locale_mb_cur_max NOSIGFE
localeconv NOSIGFE
-_localeconv = localeconv NOSIGFE
localtime SIGFE
-_localtime = localtime SIGFE
localtime_r SIGFE
-_localtime_r = localtime_r SIGFE
lockf SIGFE
log NOSIGFE
-_log = log NOSIGFE
log10 NOSIGFE
-_log10 = log10 NOSIGFE
log10f NOSIGFE
-_log10f = log10f NOSIGFE
log1p NOSIGFE
-_log1p = log1p NOSIGFE
log1pf NOSIGFE
-_log1pf = log1pf NOSIGFE
log2 NOSIGFE
log2f NOSIGFE
logb NOSIGFE
-_logb = logb NOSIGFE
logbf NOSIGFE
-_logbf = logbf NOSIGFE
logf NOSIGFE
-_logf = logf NOSIGFE
login SIGFE
login_tty SIGFE
logout SIGFE
logwtmp SIGFE
longjmp NOSIGFE
-_longjmp = longjmp NOSIGFE
lrand48 NOSIGFE
-_lrand48 = lrand48 NOSIGFE
lremovexattr SIGFE
-lrint = _f_lrint NOSIGFE
-lrintf = _f_lrintf NOSIGFE
-lrintl = _f_lrintl NOSIGFE
lround NOSIGFE
lroundf NOSIGFE
lsearch NOSIGFE
lseek SIGFE
-_lseek = lseek SIGFE
-_lseek64 = lseek64 SIGFE
lsetxattr SIGFE
lstat SIGFE
-_lstat = lstat SIGFE
-_lstat64 = lstat64 SIGFE
lutimes SIGFE
-__main NOSIGFE
madvise = posix_madvise SIGFE
mallinfo SIGFE
malloc SIGFE
-_malloc = malloc SIGFE
malloc_stats SIGFE
malloc_trim SIGFE
malloc_usable_size SIGFE
mallopt SIGFE
matherr NOSIGFE
-_matherr = matherr NOSIGFE
mblen NOSIGFE
-_mblen = mblen NOSIGFE
mbrlen NOSIGFE
mbrtowc NOSIGFE
mbsinit NOSIGFE
mbsnrtowcs NOSIGFE
mbsrtowcs NOSIGFE
mbstowcs NOSIGFE
-_mbstowcs = mbstowcs NOSIGFE
mbtowc NOSIGFE
-_mbtowc = mbtowc NOSIGFE
memalign SIGFE
memccpy NOSIGFE
-_memccpy = memccpy NOSIGFE
memchr NOSIGFE
-_memchr = memchr NOSIGFE
memcmp NOSIGFE
-_memcmp = memcmp NOSIGFE
memcpy NOSIGFE
-_memcpy = memcpy NOSIGFE
memmem NOSIGFE
memmove NOSIGFE
-_memmove = memmove NOSIGFE
mempcpy NOSIGFE
-__mempcpy = mempcpy NOSIGFE
memrchr NOSIGFE
memset NOSIGFE
-_memset = memset NOSIGFE
mkdir SIGFE
-_mkdir = mkdir SIGFE
mkdirat SIGFE
mkdtemp SIGFE
mkfifo SIGFE
mkfifoat SIGFE
mknod SIGFE
-_mknod = mknod SIGFE
-_mknod32 = mknod32 SIGFE
mknodat SIGFE
mkostemp SIGFE
mkostemps SIGFE
mkstemp SIGFE
-_mkstemp = mkstemp SIGFE
mkstemps SIGFE
mktemp SIGFE
-_mktemp = mktemp SIGFE
mktime SIGFE
-_mktime = mktime SIGFE
mlock SIGFE
mmap SIGFE
-_mmap64 = mmap64 SIGFE
modf NOSIGFE
-_modf = modf NOSIGFE
modff NOSIGFE
-_modff = modff NOSIGFE
mount SIGFE
-_mount = mount SIGFE
mprotect SIGFE
mq_close SIGFE
mq_getattr SIGFE
@@ -1115,73 +740,46 @@ msync SIGFE
munlock SIGFE
munmap SIGFE
nan NOSIGFE
-_nan = nan NOSIGFE
nanf NOSIGFE
-_nanf = nanf NOSIGFE
nanosleep SIGFE
-_nanosleep = nanosleep SIGFE
nearbyint NOSIGFE
nearbyintf NOSIGFE
nextafter NOSIGFE
-_nextafter = nextafter NOSIGFE
nextafterf NOSIGFE
-_nextafterf = nextafterf NOSIGFE
nftw SIGFE
nice SIGFE
-_nice = nice SIGFE
nl_langinfo SIGFE
-_nl_langinfo = nl_langinfo SIGFE
nrand48 NOSIGFE
-_nrand48 = nrand48 NOSIGFE
ntohl NOSIGFE
-_ntohl = ntohl NOSIGFE
ntohs NOSIGFE
-_ntohs = ntohs NOSIGFE
on_exit SIGFE
open SIGFE
-_open = open SIGFE
-_open64
open_memstream SIGFE
open_wmemstream SIGFE
openat SIGFE
opendir SIGFE
-__opendir_with_d_ino SIGFE
openlog SIGFE
-_openlog = openlog SIGFE
openpty SIGFE
pathconf SIGFE
-_pathconf = pathconf SIGFE
pause SIGFE
pclose SIGFE
-_pclose = pclose SIGFE
perror SIGFE
-_perror = perror SIGFE
pipe SIGFE
-_pipe SIGFE
pipe2 SIGFE
poll SIGFE
-_poll = poll SIGFE
popen SIGFE
-_popen = popen SIGFE
posix_fadvise SIGFE
posix_fallocate SIGFE
posix_madvise SIGFE
posix_memalign SIGFE
posix_openpt SIGFE
-posix_regcomp = regcomp SIGFE
-posix_regerror = regerror SIGFE
-posix_regexec = regexec SIGFE
-posix_regfree = regfree SIGFE
pow NOSIGFE
-_pow = pow NOSIGFE
pow10 NOSIGFE
pow10f NOSIGFE
powf NOSIGFE
-_powf = powf NOSIGFE
ppoll SIGFE
pread SIGFE
printf SIGFE
-_printf = printf SIGFE
pselect SIGFE
psiginfo SIGFE
psignal SIGFE
@@ -1207,8 +805,6 @@ pthread_attr_setstack SIGFE
pthread_attr_setstackaddr SIGFE
pthread_attr_setstacksize SIGFE
pthread_cancel SIGFE
-_pthread_cleanup_pop SIGFE
-_pthread_cleanup_push SIGFE
pthread_cond_broadcast SIGFE
pthread_cond_destroy SIGFE
pthread_cond_init SIGFE
@@ -1274,58 +870,42 @@ pthread_setschedprio SIGFE
pthread_setspecific SIGFE
pthread_sigmask SIGFE
pthread_sigqueue SIGFE
-pthread_suspend SIGFE
pthread_spin_destroy SIGFE
pthread_spin_init SIGFE
pthread_spin_lock SIGFE
pthread_spin_trylock SIGFE
pthread_spin_unlock SIGFE
+pthread_suspend SIGFE
pthread_testcancel SIGFE
pthread_yield = sched_yield SIGFE
ptsname SIGFE
ptsname_r SIGFE
putc SIGFE
-_putc = putc SIGFE
putc_unlocked SIGFE
-_putc_unlocked = putc_unlocked SIGFE
putchar SIGFE
-_putchar = putchar SIGFE
putchar_unlocked SIGFE
-_putchar_unlocked = putchar_unlocked SIGFE
putenv SIGFE
-_putenv = putenv SIGFE
puts SIGFE
-_puts = puts SIGFE
pututline SIGFE
-_pututline = pututline SIGFE
pututxline SIGFE
putw SIGFE
-_putw = putw SIGFE
putwc SIGFE
putwchar SIGFE
pwrite SIGFE
qsort NOSIGFE
-_qsort = qsort NOSIGFE
raise SIGFE
-_raise = raise SIGFE
rand NOSIGFE
-_rand = rand NOSIGFE
rand_r NOSIGFE
random NOSIGFE
rcmd = cygwin_rcmd SIGFE
rcmd_af = cygwin_rcmd_af SIGFE
read SIGFE
-_read = read SIGFE
readdir SIGFE
-_readdir = readdir SIGFE
readdir_r SIGFE
readlink SIGFE
-_readlink = readlink SIGFE
readlinkat SIGFE
readv SIGFE
-_readv = readv SIGFE
realloc SIGFE
-_realloc = realloc SIGFE
reallocf SIGFE
realpath SIGFE
recv = cygwin_recv SIGFE
@@ -1336,84 +916,49 @@ regerror SIGFE
regexec SIGFE
regfree SIGFE
remainder NOSIGFE
-_remainder = remainder NOSIGFE
remainderf NOSIGFE
-_remainderf = remainderf NOSIGFE
remove SIGFE
-_remove = remove SIGFE
removexattr SIGFE
remque NOSIGFE
remquo NOSIGFE
remquof NOSIGFE
rename SIGFE
-_rename = rename SIGFE
renameat SIGFE
res_close = __res_close SIGFE
-__res_close SIGFE
res_init = __res_init SIGFE
-__res_init SIGFE
res_mkquery = __res_mkquery SIGFE
-__res_mkquery SIGFE
res_nclose = __res_nclose SIGFE
-__res_nclose SIGFE
res_ninit = __res_ninit SIGFE
-__res_ninit SIGFE
res_nmkquery = __res_nmkquery SIGFE
-__res_nmkquery SIGFE
res_nquery = __res_nquery SIGFE
-__res_nquery SIGFE
res_nquerydomain = __res_nquerydomain SIGFE
-__res_nquerydomain SIGFE
res_nsearch = __res_nsearch SIGFE
-__res_nsearch SIGFE
res_nsend = __res_nsend SIGFE
-__res_nsend SIGFE
res_query = __res_query SIGFE
-__res_query SIGFE
res_querydomain = __res_querydomain SIGFE
-__res_querydomain SIGFE
res_search = __res_search SIGFE
-__res_search SIGFE
res_send = __res_send SIGFE
-__res_send SIGFE
-__res_state SIGFE
revoke SIGFE
rewind SIGFE
-_rewind = rewind SIGFE
rewinddir SIGFE
-_rewinddir = rewinddir SIGFE
rexec = cygwin_rexec SIGFE
rindex NOSIGFE
-_rindex = rindex NOSIGFE
-rint = _f_rint NOSIGFE
-rintf = _f_rintf NOSIGFE
-rintl = _f_rintl NOSIGFE
rmdir SIGFE
-_rmdir = rmdir SIGFE
round NOSIGFE
roundf NOSIGFE
rresvport = cygwin_rresvport SIGFE
rresvport_af = cygwin_rresvport_af SIGFE
ruserok SIGFE
sbrk SIGFE
-_sbrk = sbrk SIGFE
scalb NOSIGFE
-_scalb = scalb NOSIGFE
scalbf NOSIGFE
-_scalbf = scalbf NOSIGFE
scalbln NOSIGFE
scalblnf NOSIGFE
scalbn NOSIGFE
-_scalbn = scalbn NOSIGFE
scalbnf NOSIGFE
-_scalbnf = scalbnf NOSIGFE
scandir SIGFE
-_scandir = scandir SIGFE
scandirat SIGFE
scanf SIGFE
-_scanf = scanf SIGFE
-scanf_r = _scanf_r SIGFE
-_scanf_r SIGFE
sched_get_priority_max SIGFE
sched_get_priority_min SIGFE
sched_getparam SIGFE
@@ -1423,12 +968,8 @@ sched_setparam SIGFE
sched_setscheduler SIGFE
sched_yield SIGFE
seed48 NOSIGFE
-_seed48 = seed48 NOSIGFE
seekdir SIGFE
-_seekdir = seekdir SIGFE
-_seekdir64 = seekdir64 SIGFE
select = cygwin_select SIGFE
-_select = cygwin_select SIGFE
sem_close SIGFE
sem_destroy SIGFE
sem_getvalue SIGFE
@@ -1446,84 +987,42 @@ send = cygwin_send SIGFE
sendmsg = cygwin_sendmsg SIGFE
sendto = cygwin_sendto SIGFE
setbuf SIGFE
-_setbuf = setbuf SIGFE
setbuffer SIGFE
setdtablesize SIGFE
-_setdtablesize = setdtablesize SIGFE
setegid SIGFE
-_setegid = setegid SIGFE
-_setegid32 = setegid32 SIGFE
setenv SIGFE
-_setenv = setenv SIGFE
seteuid SIGFE
-_seteuid = seteuid SIGFE
-_seteuid32 = seteuid32 SIGFE
setgid SIGFE
-_setgid = setgid SIGFE
-_setgid32 = setgid32 SIGFE
setgrent NOSIGFE
-_setgrent = setgrent NOSIGFE
setgroups SIGFE
-_setgroups = setgroups SIGFE
-_setgroups32 = setgroups32 SIGFE
sethostent NOSIGFE
setitimer SIGFE
setjmp NOSIGFE
-_setjmp = setjmp NOSIGFE
setlinebuf SIGFE
setlocale NOSIGFE
-_setlocale = setlocale NOSIGFE
setlogmask NOSIGFE
setmntent SIGFE
-_setmntent = setmntent SIGFE
-setmode = cygwin_setmode SIGFE
-_setmode = cygwin_setmode SIGFE
setpassent NOSIGFE
-_setpassent = setpassent NOSIGFE
setpgid SIGFE
-_setpgid = setpgid SIGFE
setpgrp SIGFE
-_setpgrp = setpgrp SIGFE
setpriority SIGFE
setprogname NOSIGFE
setprotoent = cygwin_setprotoent SIGFE
setpwent NOSIGFE
-_setpwent = setpwent NOSIGFE
setregid SIGFE
-_setregid = setregid SIGFE
-setregid32 SIGFE
-_setregid32 = setregid32 SIGFE
setreuid SIGFE
-_setreuid = setreuid SIGFE
-setreuid32 SIGFE
-_setreuid32 = setreuid32 SIGFE
setrlimit SIGFE
-_setrlimit = setrlimit SIGFE
setservent = cygwin_setservent SIGFE
setsid SIGFE
-_setsid = setsid SIGFE
setsockopt = cygwin_setsockopt SIGFE
setstate NOSIGFE
settimeofday SIGFE
-_settimeofday = settimeofday SIGFE
setuid SIGFE
-_setuid = setuid SIGFE
-_setuid32 = setuid32 SIGFE
setusershell SIGFE
setutent SIGFE
-_setutent = setutent SIGFE
setutxent SIGFE
setvbuf SIGFE
-_setvbuf = setvbuf SIGFE
setxattr SIGFE
-sexecl = sexecve_is_bad SIGFE
-sexecle = sexecve_is_bad SIGFE
-sexeclp = sexecve_is_bad SIGFE
-sexeclpe = sexecve_is_bad SIGFE
-sexecp = sexecve_is_bad SIGFE
-sexecv = sexecve_is_bad SIGFE
-sexecve = sexecve_is_bad SIGFE
-sexecvpe = sexecve_is_bad SIGFE
shm_open SIGFE
shm_unlink SIGFE
shmat SIGFE
@@ -1541,9 +1040,6 @@ sigignore SIGFE
siginterrupt SIGFE
sigismember SIGFE
signal SIGFE
-__signbitd NOSIGFE
-__signbitf NOSIGFE
-__signgam NOSIGFE
significand NOSIGFE
significandf NOSIGFE
sigpause SIGFE
@@ -1556,170 +1052,95 @@ sigsuspend SIGFE
sigwait SIGFE
sigwaitinfo SIGFE
sin NOSIGFE
-_sin = sin NOSIGFE
sincos NOSIGFE
sincosf NOSIGFE
sinf NOSIGFE
-_sinf = sinf NOSIGFE
sinh NOSIGFE
-_sinh = sinh NOSIGFE
sinhf NOSIGFE
-_sinhf = sinhf NOSIGFE
siprintf SIGFE
-_siprintf = siprintf SIGFE
sleep SIGFE
-_sleep = sleep SIGFE
snprintf SIGFE
-_snprintf = snprintf SIGFE
socket = cygwin_socket SIGFE
socketpair SIGFE
spawnl SIGFE
-_spawnl = spawnl SIGFE
spawnle SIGFE
-_spawnle = spawnle SIGFE
spawnlp SIGFE
-_spawnlp = spawnlp SIGFE
spawnlpe SIGFE
-_spawnlpe = spawnlpe SIGFE
spawnv SIGFE
-_spawnv = spawnv SIGFE
spawnve SIGFE
-_spawnve = spawnve SIGFE
spawnvp SIGFE
-_spawnvp = spawnvp SIGFE
spawnvpe SIGFE
-_spawnvpe = spawnvpe SIGFE
sprintf SIGFE
-_sprintf = sprintf SIGFE
sqrt NOSIGFE
-_sqrt = sqrt NOSIGFE
sqrtf NOSIGFE
-_sqrtf = sqrtf NOSIGFE
srand NOSIGFE
-_srand = srand NOSIGFE
srand48 NOSIGFE
-_srand48 = srand48 NOSIGFE
srandom NOSIGFE
-__srget SIGFE
-__srget_r SIGFE
sscanf SIGFE
-_sscanf = sscanf SIGFE
-sscanf_r = _sscanf_r SIGFE
-_sscanf_r SIGFE
stat SIGFE
-_stat = stat SIGFE
-_stat64 = stat64 SIGFE
statfs SIGFE
-_statfs = statfs SIGFE
statvfs SIGFE
stpcpy NOSIGFE
stpncpy NOSIGFE
strcasecmp NOSIGFE
-_strcasecmp = strcasecmp NOSIGFE
strcasestr NOSIGFE
strcat NOSIGFE
-_strcat = strcat NOSIGFE
strchr NOSIGFE
-_strchr = strchr NOSIGFE
strchrnul NOSIGFE
strcmp NOSIGFE
-_strcmp = strcmp NOSIGFE
strcoll NOSIGFE
-_strcoll = strcoll NOSIGFE
strcpy NOSIGFE
-_strcpy = strcpy NOSIGFE
strcspn NOSIGFE
-_strcspn = strcspn NOSIGFE
strdup SIGFE
-_strdup = strdup SIGFE
strerror SIGFE
-_strerror = strerror SIGFE
strerror_r SIGFE
-_strerror_r = strerror_r SIGFE
strfmon SIGFE
strftime SIGFE
-_strftime = strftime SIGFE
strlcat NOSIGFE
-_strlcat = strlcat NOSIGFE
strlcpy NOSIGFE
-_strlcpy = strlcpy NOSIGFE
strlen NOSIGFE
-_strlen = strlen NOSIGFE
strlwr NOSIGFE
-_strlwr = strlwr NOSIGFE
strncasecmp NOSIGFE
-_strncasecmp = strncasecmp NOSIGFE
strncat NOSIGFE
-_strncat = strncat NOSIGFE
strncmp NOSIGFE
-_strncmp = strncmp NOSIGFE
strncpy NOSIGFE
-_strncpy = strncpy NOSIGFE
strndup SIGFE
strnlen NOSIGFE
strpbrk NOSIGFE
-_strpbrk = strpbrk NOSIGFE
strptime SIGFE
-_strptime = strptime SIGFE
strrchr NOSIGFE
-_strrchr = strrchr NOSIGFE
strsep NOSIGFE
-_strsep = strsep NOSIGFE
strsignal SIGFE
strspn NOSIGFE
-_strspn = strspn NOSIGFE
strstr NOSIGFE
-_strstr = strstr NOSIGFE
strtod SIGFE
-_strtod = strtod SIGFE
-strtodf = strtof SIGFE
-_strtodf = strtof SIGFE
strtof SIGFE
strtoimax = strtoll NOSIGFE
strtok NOSIGFE
-_strtok = strtok NOSIGFE
strtok_r NOSIGFE
-_strtok_r = strtok_r NOSIGFE
strtol NOSIGFE
-_strtol = strtol NOSIGFE
-_strtold SIGFE
+strtold = _strtold SIGFE
strtoll NOSIGFE
-_strtoll = strtoll NOSIGFE
strtosigno NOSIGFE
strtoul NOSIGFE
-_strtoul = strtoul NOSIGFE
strtoull NOSIGFE
-_strtoull = strtoull NOSIGFE
strtoumax = strtoull NOSIGFE
strupr NOSIGFE
-_strupr = strupr NOSIGFE
strxfrm NOSIGFE
-_strxfrm = strxfrm NOSIGFE
swab NOSIGFE
-_swab = swab NOSIGFE
-__swbuf SIGFE
-__swbuf_r SIGFE
swprintf SIGFE
swscanf SIGFE
symlink SIGFE
-_symlink = symlink SIGFE
symlinkat SIGFE
sync SIGFE
sysconf SIGFE
-_sysconf = sysconf SIGFE
sysinfo SIGFE
syslog SIGFE
-_syslog = syslog SIGFE
system SIGFE
-_system = system SIGFE
tan NOSIGFE
-_tan = tan NOSIGFE
tanf NOSIGFE
-_tanf = tanf NOSIGFE
tanh NOSIGFE
-_tanh = tanh NOSIGFE
tanhf NOSIGFE
-_tanhf = tanhf NOSIGFE
tcdrain SIGFE
tcflow SIGFE
tcflush SIGFE
@@ -1732,15 +1153,11 @@ tcsetpgrp SIGFE
tdelete SIGFE
tdestroy NOSIGFE
telldir SIGFE
-_telldir = telldir SIGFE
-_telldir64 = telldir64 SIGFE
tempnam SIGFE
-_tempnam = tempnam SIGFE
tfind NOSIGFE
tgamma NOSIGFE
tgammaf NOSIGFE
time SIGFE
-_time = time SIGFE
timegm NOSIGFE
timelocal SIGFE
timer_create SIGFE
@@ -1748,101 +1165,60 @@ timer_delete SIGFE
timer_gettime SIGFE
timer_settime SIGFE
times SIGFE
-_times = times SIGFE
timezone SIGFE
tmpfile SIGFE
-_tmpfile = tmpfile SIGFE
-_tmpfile64 = tmpfile64 SIGFE
tmpnam SIGFE
-_tmpnam = tmpnam SIGFE
toascii NOSIGFE
-_toascii = toascii NOSIGFE
tolower NOSIGFE
-_tolower = tolower NOSIGFE
toupper NOSIGFE
-_toupper = toupper NOSIGFE
towctrans NOSIGFE
towlower NOSIGFE
towupper NOSIGFE
trunc NOSIGFE
truncate SIGFE
-_truncate = truncate SIGFE
-_truncate64 = truncate64 SIGFE
truncf NOSIGFE
tsearch SIGFE
ttyname SIGFE
-_ttyname = ttyname SIGFE
ttyname_r SIGFE
ttyslot NOSIGFE
twalk NOSIGFE
tzset SIGFE
-_tzset = tzset SIGFE
ualarm SIGFE
-_ualarm = ualarm SIGFE
umask NOSIGFE
-_umask = umask NOSIGFE
umount SIGFE
-_umount = umount SIGFE
uname SIGFE
-_uname = uname SIGFE
ungetc SIGFE
-_ungetc = ungetc SIGFE
ungetwc SIGFE
unlink SIGFE
-_unlink = unlink SIGFE
unlinkat SIGFE
unlockpt NOSIGFE
unsetenv SIGFE
-_unsetenv = unsetenv SIGFE
updwtmp SIGFE
updwtmpx SIGFE
usleep SIGFE
-_usleep = usleep SIGFE
utime SIGFE
-_utime = utime SIGFE
utimensat SIGFE
utimes SIGFE
-_utimes = utimes SIGFE
utmpname SIGFE
-_utmpname = utmpname SIGFE
utmpxname SIGFE
valloc SIGFE
vasnprintf SIGFE
vasprintf SIGFE
-_vasprintf = vasprintf SIGFE
-vasprintf_r = _vasprintf_r SIGFE
-_vasprintf_r SIGFE
vdprintf SIGFE
verr SIGFE
verrx SIGFE
vfiprintf SIGFE
-_vfiprintf = vfiprintf SIGFE
vfork SIGFE
-_vfork = vfork SIGFE
vfprintf SIGFE
-_vfprintf = vfprintf SIGFE
vfscanf SIGFE
-_vfscanf = vfscanf SIGFE
-vfscanf_r = _vfscanf_r SIGFE
-_vfscanf_r SIGFE
vfwprintf SIGFE
vfwscanf SIGFE
vhangup SIGFE
-_vhangup = vhangup SIGFE
vprintf SIGFE
-_vprintf = vprintf SIGFE
vscanf SIGFE
-_vscanf = vscanf SIGFE
-vscanf_r = _vscanf_r SIGFE
-_vscanf_r SIGFE
vsnprintf SIGFE
-_vsnprintf = vsnprintf SIGFE
vsprintf SIGFE
-_vsprintf = vsprintf SIGFE
vsscanf SIGFE
-_vsscanf = vsscanf SIGFE
-vsscanf_r = _vsscanf_r SIGFE
-_vsscanf_r SIGFE
vswprintf SIGFE
vswscanf SIGFE
vsyslog SIGFE
@@ -1851,11 +1227,9 @@ vwarnx SIGFE
vwprintf SIGFE
vwscanf SIGFE
wait SIGFE
-_wait = wait SIGFE
wait3 SIGFE
wait4 SIGFE
waitpid SIGFE
-_waitpid = waitpid SIGFE
warn SIGFE
warnx SIGFE
wcpcpy NOSIGFE
@@ -1865,7 +1239,6 @@ wcscasecmp NOSIGFE
wcscat NOSIGFE
wcschr NOSIGFE
wcscmp NOSIGFE
-_wcscmp = wcscmp NOSIGFE
wcscoll NOSIGFE
wcscpy NOSIGFE
wcscspn NOSIGFE
@@ -1874,7 +1247,6 @@ wcsftime SIGFE
wcslcat NOSIGFE
wcslcpy NOSIGFE
wcslen NOSIGFE
-_wcslen = wcslen NOSIGFE
wcsncasecmp NOSIGFE
wcsncat NOSIGFE
wcsncmp NOSIGFE
@@ -1893,7 +1265,6 @@ wcstok NOSIGFE
wcstol NOSIGFE
wcstoll NOSIGFE
wcstombs NOSIGFE
-_wcstombs = wcstombs NOSIGFE
wcstoul NOSIGFE
wcstoull NOSIGFE
wcstoumax = wcstoull NOSIGFE
@@ -1901,7 +1272,6 @@ wcswidth NOSIGFE
wcsxfrm NOSIGFE
wctob NOSIGFE
wctomb NOSIGFE
-_wctomb = wctomb NOSIGFE
wctrans NOSIGFE
wctype NOSIGFE
wcwidth NOSIGFE
@@ -1914,9 +1284,7 @@ wordexp NOSIGFE
wordfree NOSIGFE
wprintf SIGFE
write SIGFE
-_write = write SIGFE
writev SIGFE
-_writev = writev SIGFE
wscanf SIGFE
xdr_array SIGFE
xdr_bool SIGFE
@@ -1964,21 +1332,10 @@ xdrrec_create SIGFE
xdrrec_endofrecord SIGFE
xdrrec_eof SIGFE
xdrrec_skiprecord SIGFE
-__xdrrec_getrec SIGFE
-__xdrrec_setnonblock SIGFE
xdrstdio_create SIGFE
-__xpg_strerror_r SIGFE
y0 NOSIGFE
y0f NOSIGFE
y1 NOSIGFE
y1f NOSIGFE
yn NOSIGFE
ynf NOSIGFE
-__wrap__ZdaPv NOSIGFE # void operator delete[](void *p) throw()
-__wrap__ZdaPvRKSt9nothrow_t NOSIGFE # void operator delete[](void *p, const std::nothrow_t &nt) throw()
-__wrap__ZdlPv NOSIGFE # void operator delete(void *p) throw()
-__wrap__ZdlPvRKSt9nothrow_t NOSIGFE # void operator delete(void *p, const std::nothrow_t &nt) throw()
-__wrap__Znaj NOSIGFE # void *operator new[](std::size_t sz) throw (std::bad_alloc)
-__wrap__ZnajRKSt9nothrow_t NOSIGFE # void *operator new[](std::size_t sz, const std::nothrow_t &nt) throw()
-__wrap__Znwj NOSIGFE # void *operator new(std::size_t sz) throw (std::bad_alloc)
-__wrap__ZnwjRKSt9nothrow_t NOSIGFE # void *operator new(std::size_t sz, const std::nothrow_t &nt) throw()
diff --git a/winsup/cygwin/configure b/winsup/cygwin/configure
index 87d97b55a..e60f85846 100755
--- a/winsup/cygwin/configure
+++ b/winsup/cygwin/configure
@@ -1,11 +1,9 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68.
+# Generated by GNU Autoconf 2.69.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -134,6 +132,31 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -211,21 +235,25 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
@@ -327,6 +355,14 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -448,6 +484,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
@@ -482,16 +522,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -503,28 +543,8 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -566,10 +586,12 @@ ac_no_link=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
CONFIG_DIR
+TLSOFFSETS_H
+DIN_FILE
DEF_DLL_ENTRY
DLL_ENTRY
+DLL_NAME
LIBSERVER
-MALLOC_OFILES
configure_args
SET_MAKE
WINDRES
@@ -1128,8 +1150,6 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1375,9 +1395,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1505,7 +1525,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -1951,7 +1971,7 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -2142,7 +2162,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2182,7 +2202,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2235,7 +2255,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2276,7 +2296,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -2334,7 +2354,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2378,7 +2398,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2900,8 +2920,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3014,7 +3033,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3058,7 +3077,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3463,7 +3482,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="${ac_tool_prefix}ar"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3503,7 +3522,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="ar"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3555,7 +3574,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AS="${ac_tool_prefix}as"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3595,7 +3614,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AS="as"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3647,7 +3666,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3687,7 +3706,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3739,7 +3758,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LD="${ac_tool_prefix}ld"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3779,7 +3798,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LD="ld"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3831,7 +3850,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_NM="${ac_tool_prefix}nm"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3871,7 +3890,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NM="nm"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3923,7 +3942,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3963,7 +3982,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJCOPY="objcopy"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4015,7 +4034,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4055,7 +4074,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4107,7 +4126,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4147,7 +4166,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4199,7 +4218,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4239,7 +4258,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4291,7 +4310,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4331,7 +4350,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_WINDRES="windres"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4410,14 +4429,23 @@ esac
fi
-MALLOC_OFILES=malloc.o
-
case "$target_cpu" in
- i?86) DLL_ENTRY="_dll_entry@12"
+ i?86)
+ DLL_NAME="cygwin1.dll"
+ DLL_ENTRY="_dll_entry@12"
DEF_DLL_ENTRY="dll_entry@12"
+ DIN_FILE="i686.din"
+ TLSOFFSETS_H="tlsoffsets.h"
CONFIG_DIR="i386" ;;
+ x86_64)
+ DLL_NAME="cygwin1.dll"
+ DLL_ENTRY="dll_entry"
+ DEF_DLL_ENTRY="dll_entry"
+ DIN_FILE="x86_64.din"
+ TLSOFFSETS_H="tlsoffsets64.h"
+ CONFIG_DIR="x86_64" ;;
*) as_fn_error $? "Invalid target processor \"$target_cpu\"" "$LINENO" 5 ;;
esac
@@ -4437,6 +4465,8 @@ configure_args=$(/usr/bin/expr "$configure_args" : 'X \(.*\)')
+
+
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
@@ -4846,16 +4876,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -4915,28 +4945,16 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -4958,7 +4976,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -5020,10 +5038,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -5112,7 +5130,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
diff --git a/winsup/cygwin/configure.ac b/winsup/cygwin/configure.ac
index 0796e6391..f59a5ae32 100644
--- a/winsup/cygwin/configure.ac
+++ b/winsup/cygwin/configure.ac
@@ -55,8 +55,6 @@ no) ;;
esac
])
-MALLOC_OFILES=malloc.o
-
dnl The only time we might want to transform the install names
dnl is for unix x cygwin. Otherwise we don't. For now we don't
dnl transform names.
@@ -73,16 +71,29 @@ dnl fi
dnl fi
case "$target_cpu" in
- i?86) DLL_ENTRY="_dll_entry@12"
+ i?86)
+ DLL_NAME="cygwin1.dll"
+ DLL_ENTRY="_dll_entry@12"
DEF_DLL_ENTRY="dll_entry@12"
+ DIN_FILE="i686.din"
+ TLSOFFSETS_H="tlsoffsets.h"
CONFIG_DIR="i386" ;;
+ x86_64)
+ DLL_NAME="cygwin1.dll"
+ DLL_ENTRY="dll_entry"
+ DEF_DLL_ENTRY="dll_entry"
+ DIN_FILE="x86_64.din"
+ TLSOFFSETS_H="tlsoffsets64.h"
+ CONFIG_DIR="x86_64" ;;
*) AC_MSG_ERROR(Invalid target processor \"$target_cpu\") ;;
esac
AC_CONFIGURE_ARGS
-AC_SUBST(MALLOC_OFILES)
AC_SUBST(LIBSERVER)
+AC_SUBST(DLL_NAME)
AC_SUBST(DLL_ENTRY)
AC_SUBST(DEF_DLL_ENTRY)
+AC_SUBST(DIN_FILE)
+AC_SUBST(TLSOFFSETS_H)
AC_SUBST(CONFIG_DIR)
AC_OUTPUT(Makefile)
diff --git a/winsup/cygwin/cpuid.h b/winsup/cygwin/cpuid.h
index 998bbbf91..ff353227e 100644
--- a/winsup/cygwin/cpuid.h
+++ b/winsup/cygwin/cpuid.h
@@ -12,10 +12,31 @@ cpuid (unsigned *a, unsigned *b, unsigned *c, unsigned *d, unsigned in)
: "a" (in));
}
+#ifdef __x86_64__
extern inline bool
-can_set_flag (unsigned flag)
+can_set_flag (register unsigned long flag)
{
- unsigned r1, r2;
+ register unsigned long r1, r2;
+ asm("pushfq\n"
+ "popq %0\n"
+ "movq %0, %1\n"
+ "xorq %2, %0\n"
+ "pushq %0\n"
+ "popfq\n"
+ "pushfq\n"
+ "popq %0\n"
+ "pushq %1\n"
+ "popfq\n"
+ : "=&r" (r1), "=&r" (r2)
+ : "ir" (flag)
+ );
+ return ((r1 ^ r2) & flag) != 0;
+}
+#else
+extern inline bool
+can_set_flag (register unsigned flag)
+{
+ register unsigned r1, r2;
asm("pushfl\n"
"popl %0\n"
"movl %0, %1\n"
@@ -31,5 +52,6 @@ can_set_flag (unsigned flag)
);
return ((r1 ^ r2) & flag) != 0;
}
+#endif
#endif // !CPUID_H
diff --git a/winsup/cygwin/cygerrno.h b/winsup/cygwin/cygerrno.h
index 64a32ddbd..337dd75fc 100644
--- a/winsup/cygwin/cygerrno.h
+++ b/winsup/cygwin/cygerrno.h
@@ -12,16 +12,7 @@ details. */
#ifndef _CYGERRNO_H
#define _CYGERRNO_H
#include <errno.h>
-
-#ifndef __reg1
-# define __reg1 __stdcall __attribute__ ((regparm (1)))
-#endif
-#ifndef __reg2
-# define __reg2 __stdcall __attribute__ ((regparm (2)))
-#endif
-#ifndef __reg3
-# define __reg3 __stdcall __attribute__ ((regparm (3)))
-#endif
+#include "regparm.h"
void __reg3 seterrno_from_win_error (const char *file, int line, DWORD code);
void __reg3 seterrno_from_nt_status (const char *file, int line, NTSTATUS status);
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 90873215b..bb926118f 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -27,6 +27,7 @@
#include "ntdll.h"
#include <unistd.h>
#include <wchar.h>
+#include <sys/param.h>
static mini_cygheap NO_COPY cygheap_dummy =
{
@@ -60,13 +61,11 @@ public:
};
muto NO_COPY tls_sentry::lock;
-static NO_COPY size_t nthreads;
+static NO_COPY uint32_t nthreads;
#define THREADLIST_CHUNK 256
-#define NBUCKETS (sizeof (cygheap->buckets) / sizeof (cygheap->buckets[0]))
-#define N0 ((_cmalloc_entry *) NULL)
-#define to_cmalloc(s) ((_cmalloc_entry *) (((char *) (s)) - (unsigned) (N0->data)))
+#define to_cmalloc(s) ((_cmalloc_entry *) (((char *) (s)) - offsetof (_cmalloc_entry, data)))
#define CFMAP_OPTIONS (SEC_RESERVE | PAGE_READWRITE)
#define MVMAP_OPTIONS (FILE_MAP_WRITE)
@@ -116,47 +115,6 @@ init_cygheap::close_ctty ()
cygheap->ctty = NULL;
}
-#define nextpage(x) ((char *) (((DWORD) ((char *) x + granmask)) & ~granmask))
-#define allocsize(x) ((DWORD) nextpage (x))
-#ifdef DEBUGGING
-#define somekinda_printf debug_printf
-#else
-#define somekinda_printf malloc_printf
-#endif
-
-static void *__stdcall
-_csbrk (int sbs)
-{
- void *prebrk = cygheap_max;
- size_t granmask = wincap.allocation_granularity () - 1;
- char *newbase = nextpage (prebrk);
- cygheap_max = (char *) cygheap_max + sbs;
- if (!sbs || (newbase >= cygheap_max) || (cygheap_max <= _cygheap_end))
- /* nothing to do */;
- else
- {
- if (prebrk <= _cygheap_end)
- newbase = _cygheap_end;
-
- DWORD adjsbs = allocsize ((char *) cygheap_max - newbase);
- if (adjsbs && !VirtualAlloc (newbase, adjsbs, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE))
- {
- MEMORY_BASIC_INFORMATION m;
- if (!VirtualQuery (newbase, &m, sizeof m))
- system_printf ("couldn't get memory info, %E");
- somekinda_printf ("Couldn't reserve/commit %d bytes of space for cygwin's heap, %E",
- adjsbs);
- somekinda_printf ("AllocationBase %p, BaseAddress %p, RegionSize %p, State %p\n",
- m.AllocationBase, m.BaseAddress, m.RegionSize, m.State);
- __seterrno ();
- cygheap_max = (char *) cygheap_max - sbs;
- return NULL;
- }
- }
-
- return prebrk;
-}
-
/* Use absolute path of cygwin1.dll to derive the Win32 dir which
is our installation_root. Note that we can't handle Cygwin installation
root dirs of more than 4K path length. I assume that's ok...
@@ -261,6 +219,21 @@ cygheap_init ()
sizeof (*cygheap));
cygheap_max = cygheap;
_csbrk (sizeof (*cygheap));
+ /* Initialize bucket_val. The value is the max size of a block
+ fitting into the bucket. The values are powers of two and their
+ medians: 12, 16, 24, 32, 48, 64, ... On 64 bit, start with 24 to
+ accommodate bigger size of struct cygheap_entry.
+ With NBUCKETS == 40, the maximum block size is 6291456/12582912.
+ The idea is to have better matching bucket sizes (not wasting
+ space) without trading in performance compared to the old powers
+ of 2 method. */
+#ifdef __x86_64__
+ unsigned sz[2] = { 16, 24 }; /* sizeof cygheap_entry == 16 */
+#else
+ unsigned sz[2] = { 8, 12 }; /* sizeof cygheap_entry == 8 */
+#endif
+ for (unsigned b = 1; b < NBUCKETS; b++, sz[b & 1] <<= 1)
+ cygheap->bucket_val[b] = sz[b & 1];
/* Default locale settings. */
cygheap->locale.mbtowc = __utf8_mbtowc;
cygheap->locale.wctomb = __utf8_wctomb;
@@ -276,6 +249,47 @@ cygheap_init ()
cygheap->init_tls_list ();
}
+#define nextpage(x) ((char *) roundup2 ((uintptr_t) (x), \
+ wincap.allocation_granularity ()))
+#define allocsize(x) ((SIZE_T) nextpage (x))
+#ifdef DEBUGGING
+#define somekinda_printf debug_printf
+#else
+#define somekinda_printf malloc_printf
+#endif
+
+static void *__stdcall
+_csbrk (int sbs)
+{
+ void *prebrk = cygheap_max;
+ char *newbase = nextpage (prebrk);
+ cygheap_max = (char *) cygheap_max + sbs;
+ if (!sbs || (newbase >= cygheap_max) || (cygheap_max <= _cygheap_end))
+ /* nothing to do */;
+ else
+ {
+ if (prebrk <= _cygheap_end)
+ newbase = _cygheap_end;
+
+ SIZE_T adjsbs = allocsize ((char *) cygheap_max - newbase);
+ if (adjsbs && !VirtualAlloc (newbase, adjsbs, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE))
+ {
+ MEMORY_BASIC_INFORMATION m;
+ if (!VirtualQuery (newbase, &m, sizeof m))
+ system_printf ("couldn't get memory info, %E");
+ somekinda_printf ("Couldn't reserve/commit %ld bytes of space for cygwin's heap, %E",
+ adjsbs);
+ somekinda_printf ("AllocationBase %p, BaseAddress %p, RegionSize %lx, State %x\n",
+ m.AllocationBase, m.BaseAddress, m.RegionSize, m.State);
+ __seterrno ();
+ cygheap_max = (char *) cygheap_max - sbs;
+ return NULL;
+ }
+ }
+
+ return prebrk;
+}
+
/* Copyright (C) 1997, 2000 DJ Delorie */
static void *__reg1 _cmalloc (unsigned size);
@@ -285,11 +299,13 @@ static void *__reg1
_cmalloc (unsigned size)
{
_cmalloc_entry *rvc;
- unsigned b, sz;
+ unsigned b;
- /* Calculate "bit bucket" and size as a power of two. */
- for (b = 3, sz = 8; sz && sz < size; b++, sz <<= 1)
+ /* Calculate "bit bucket". */
+ for (b = 1; b < NBUCKETS && cygheap->bucket_val[b] < size; b++)
continue;
+ if (b >= NBUCKETS)
+ return NULL;
cygheap_protect.acquire ();
if (cygheap->buckets[b])
@@ -300,7 +316,8 @@ _cmalloc (unsigned size)
}
else
{
- rvc = (_cmalloc_entry *) _csbrk (sz + sizeof (_cmalloc_entry));
+ rvc = (_cmalloc_entry *) _csbrk (cygheap->bucket_val[b]
+ + sizeof (_cmalloc_entry));
if (!rvc)
{
cygheap_protect.release ();
@@ -320,7 +337,7 @@ _cfree (void *ptr)
{
cygheap_protect.acquire ();
_cmalloc_entry *rvc = to_cmalloc (ptr);
- DWORD b = rvc->b;
+ unsigned b = rvc->b;
rvc->ptr = cygheap->buckets[b];
cygheap->buckets[b] = (char *) rvc;
cygheap_protect.release ();
@@ -334,7 +351,7 @@ _crealloc (void *ptr, unsigned size)
newptr = _cmalloc (size);
else
{
- unsigned oldsize = 1 << to_cmalloc (ptr)->b;
+ unsigned oldsize = cygheap->bucket_val[to_cmalloc (ptr)->b];
if (size <= oldsize)
return ptr;
newptr = _cmalloc (size);
@@ -351,8 +368,7 @@ _crealloc (void *ptr, unsigned size)
#define sizeof_cygheap(n) ((n) + sizeof (cygheap_entry))
-#define N ((cygheap_entry *) NULL)
-#define tocygheap(s) ((cygheap_entry *) (((char *) (s)) - (int) (N->data)))
+#define tocygheap(s) ((cygheap_entry *) (((char *) (s)) - offsetof (cygheap_entry, data)))
inline static void *
creturn (cygheap_types x, cygheap_entry * c, unsigned len, const char *fn = NULL)
@@ -600,12 +616,12 @@ init_cygheap::remove_tls (_cygtls *t, DWORD wait)
tls_sentry here (wait);
if (here.acquired ())
{
- for (size_t i = 0; i < nthreads; i++)
+ for (uint32_t i = 0; i < nthreads; i++)
if (t == threadlist[i])
{
if (i < --nthreads)
threadlist[i] = threadlist[nthreads];
- debug_only_printf ("removed %p element %d", this, i);
+ debug_only_printf ("removed %p element %u", this, i);
break;
}
}
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h
index b51076472..ed645b7d6 100644
--- a/winsup/cygwin/cygheap.h
+++ b/winsup/cygwin/cygheap.h
@@ -18,7 +18,7 @@ struct _cmalloc_entry
{
union
{
- DWORD b;
+ unsigned b;
char *ptr;
};
struct _cmalloc_entry *prev;
@@ -97,11 +97,11 @@ class cygheap_user
cygsid effec_cygsid; /* buffer for user's SID */
cygsid saved_cygsid; /* Remains intact even after impersonation */
public:
- __uid32_t saved_uid; /* Remains intact even after impersonation */
- __gid32_t saved_gid; /* Ditto */
- __uid32_t real_uid; /* Remains intact on seteuid, replaced by setuid */
- __gid32_t real_gid; /* Ditto */
- user_groups groups; /* Primary and supp SIDs */
+ uid_t saved_uid; /* Remains intact even after impersonation */
+ gid_t saved_gid; /* Ditto */
+ uid_t real_uid; /* Remains intact on seteuid, replaced by setuid */
+ gid_t real_gid; /* Ditto */
+ user_groups groups; /* Primary and supp SIDs */
/* token is needed if set(e)uid should be called. It can be set by a call
to `set_impersonation_token()'. */
@@ -153,8 +153,8 @@ public:
const char *p = env_domain ("USERDOMAIN=", sizeof ("USERDOMAIN=") - 1);
return (p == almost_null) ? NULL : p;
}
- BOOL set_sid (PSID new_sid) {return (BOOL) (effec_cygsid = new_sid);}
- BOOL set_saved_sid () { return (BOOL) (saved_cygsid = effec_cygsid); }
+ void set_sid (PSID new_sid) { effec_cygsid = new_sid;}
+ void set_saved_sid () { saved_cygsid = effec_cygsid; }
PSID sid () { return effec_cygsid; }
PSID saved_sid () { return saved_cygsid; }
const char *ontherange (homebodies what, struct passwd * = NULL);
@@ -216,9 +216,10 @@ enum fcwd_version_t {
minimal locking and it's much more multi-thread friendly. Presumably
it minimizes contention when accessing the CWD.
The class fcwd_access_t is supposed to encapsulate the gory implementation
- details depending on OS version from the calling functions. */
+ details depending on OS version from the calling functions.
+ The layout of all structures has been tested on 32 and 64 bit. */
class fcwd_access_t {
- /* This is the layout used in Windows 8 developer preview. */
+ /* This is the layout used in Windows 8. */
struct FAST_CWD_8 {
LONG ReferenceCount; /* Only release when this is 0. */
HANDLE DirectoryHandle;
@@ -227,7 +228,7 @@ class fcwd_access_t {
UNICODE_STRING Path; /* Path's Buffer member always refers
to the following Buffer array. */
LONG FSCharacteristics; /* Taken from FileFsDeviceInformation */
- WCHAR Buffer[MAX_PATH];
+ WCHAR Buffer[MAX_PATH] __attribute ((aligned (8)));
};
/* This is the layout used in Windows 7 and Vista. */
struct FAST_CWD_7 {
@@ -238,7 +239,7 @@ class fcwd_access_t {
LONG ReferenceCount; /* Only release when this is 0. */
ULONG OldDismountCount; /* Reflects the system DismountCount
at the time the CWD has been set. */
- WCHAR Buffer[MAX_PATH];
+ WCHAR Buffer[MAX_PATH] __attribute ((aligned (8)));
};
/* This is the old FAST_CWD structure up to the patch from KB 2393802,
release in February 2011. */
@@ -349,8 +350,7 @@ struct user_heap_info
void *ptr;
void *top;
void *max;
- unsigned chunk;
- unsigned slop;
+ SIZE_T chunk;
};
struct hook_chain
@@ -365,10 +365,13 @@ struct mini_cygheap
cygheap_locale locale;
};
+#define NBUCKETS 40
+
struct init_cygheap: public mini_cygheap
{
_cmalloc_entry *chain;
- char *buckets[32];
+ unsigned bucket_val[NBUCKETS];
+ char *buckets[NBUCKETS];
WCHAR installation_root[PATH_MAX];
UNICODE_STRING installation_key;
WCHAR installation_key_buf[18];
@@ -387,7 +390,7 @@ struct init_cygheap: public mini_cygheap
fhandler_termios *ctty; /* Current tty */
struct _cygtls **threadlist;
- size_t sthreads;
+ uint32_t sthreads;
pid_t pid; /* my pid */
struct { /* Equivalent to using LIST_HEAD. */
struct inode_t *lh_first;
diff --git a/winsup/cygwin/cygmagic b/winsup/cygwin/cygmagic
index 90d1e5733..b94529109 100755
--- a/winsup/cygwin/cygmagic
+++ b/winsup/cygwin/cygmagic
@@ -1,7 +1,7 @@
#!/bin/sh
# cygmagic - Generate "magic numbers" from a structure.
#
-# Copyright 2001, 2002, 2005 Red Hat, Inc.
+# Copyright 2001, 2002, 2005, 2013 Red Hat, Inc.
#
# This file is part of Cygwin.
#
@@ -24,7 +24,7 @@ sumit() {
while [ -n "$1" ]; do
define=$1; shift
struct=$1; shift
- sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sumit | awk '{printf "0x%xU", $1}'`
+ sum=`$gcc -D__CYGMAGIC__ -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sumit | awk '{printf "0x%xU", $1}'`
echo "#define $define $sum"
curr=`sed -n "s/^#[ ]*define CURR_$define[ ][ ]*\([^ ][^ ]*\)/\1/p" $file`
[ "$curr" != "$sum" ] && echo "*** WARNING WARNING WARNING WARNING WARNING ***
diff --git a/winsup/cygwin/cygmalloc.h b/winsup/cygwin/cygmalloc.h
index bf3a6237b..092e2f695 100644
--- a/winsup/cygwin/cygmalloc.h
+++ b/winsup/cygwin/cygmalloc.h
@@ -11,18 +11,11 @@ details. */
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef __reg1
-# define __reg1 __stdcall __attribute__ ((regparm (1)))
-#endif
-#ifndef __reg2
-# define __reg2 __stdcall __attribute__ ((regparm (2)))
-#endif
-#ifndef __reg3
-# define __reg3 __stdcall __attribute__ ((regparm (3)))
-#endif
+#include "regparm.h"
+
void __reg1 dlfree (void *p);
-void __reg1 *dlmalloc (unsigned size);
-void __reg2 *dlrealloc (void *p, unsigned size);
+void __reg1 *dlmalloc (size_t size);
+void __reg2 *dlrealloc (void *p, size_t size);
void __reg2 *dlcalloc (size_t nmemb, size_t size);
void __reg2 *dlmemalign (size_t alignment, size_t bytes);
void __reg1 *dlvalloc (size_t bytes);
@@ -31,8 +24,14 @@ int __reg1 dlmalloc_trim (size_t);
int __reg2 dlmallopt (int p, int v);
void dlmalloc_stats ();
+#ifdef __x86_64__
+#define MALLOC_ALIGNMENT ((size_t)16U)
+#endif
+
#ifndef __INSIDE_CYGWIN__
extern "C" void __set_ENOMEM ();
+void *mmap64 (void *, size_t, int, int, int, off_t);
+#define mmap mmap64
# define MALLOC_FAILURE_ACTION __set_ENOMEM ()
# define USE_DL_PREFIX 1
#else
diff --git a/winsup/cygwin/cygserver.h b/winsup/cygwin/cygserver.h
index b549ed006..8bcc271f3 100644
--- a/winsup/cygwin/cygserver.h
+++ b/winsup/cygwin/cygserver.h
@@ -1,6 +1,6 @@
/* cygserver.h
- Copyright 2001, 2002, 2003, 2004, 2008 Red Hat Inc.
+ Copyright 2001, 2002, 2003, 2004, 2008, 2012, 2013 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@@ -61,7 +61,7 @@ protected:
union
{
request_code_t request_code;
- ssize_t error_code;
+ int error_code;
};
header_t () {};
@@ -80,8 +80,8 @@ public:
request_code_t request_code () const { return _header.request_code; }
- ssize_t error_code () const { return _header.error_code; };
- void error_code (ssize_t error_code) { _header.error_code = error_code; };
+ int error_code () const { return _header.error_code; };
+ void error_code (int error_code) { _header.error_code = error_code; };
size_t msglen () const { return _header.msglen; };
void msglen (size_t len) { _header.msglen = len; };
diff --git a/winsup/cygwin/cygserver_ipc.h b/winsup/cygwin/cygserver_ipc.h
index d99f47647..260415044 100644
--- a/winsup/cygwin/cygserver_ipc.h
+++ b/winsup/cygwin/cygserver_ipc.h
@@ -1,6 +1,6 @@
/* cygserver_ipc.h
- Copyright 2002, 2003, 2004, 2012 Red Hat, Inc.
+ Copyright 2002, 2003, 2004, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -22,10 +22,10 @@ struct vmspace {
struct proc {
pid_t cygpid;
DWORD winpid;
- __uid32_t uid;
- __gid32_t gid;
+ uid_t uid;
+ gid_t gid;
int gidcnt;
- __gid32_t *gidlist;
+ gid_t *gidlist;
bool is_admin;
struct vmspace *p_vmspace;
HANDLE signal_arrived;
@@ -52,7 +52,8 @@ class ipc_retval {
private:
union {
int i;
- unsigned int u;
+ ssize_t ssz;
+ size_t sz;
vm_offset_t off;
vm_object_t obj;
};
@@ -63,8 +64,15 @@ public:
operator int () const { return i; }
int operator = (int ni) { return i = ni; }
- operator unsigned int () const { return u; }
- unsigned int operator = (unsigned int nu) { return u = nu; }
+#ifndef __x86_64__
+ /* On x86_64: size_t == vm_offset_t == unsigned long */
+ operator size_t () const { return sz; }
+ size_t operator = (size_t nsz) { return sz = nsz; }
+#else
+ /* On i686: ssize_t == long == int */
+ operator ssize_t () const { return ssz; }
+ ssize_t operator = (ssize_t nssz) { return ssz = nssz; }
+#endif
operator vm_offset_t () const { return off; }
vm_offset_t operator = (vm_offset_t noff) { return off = noff; }
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index 325b7e879..e48a73e54 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -72,7 +72,7 @@ cygthread::stub (VOID *arg)
else
{
info->stack_ptr = &arg;
- debug_printf ("thread '%s', id %p, stack_ptr %p", info->name (), info->id, info->stack_ptr);
+ debug_printf ("thread '%s', id %y, stack_ptr %p", info->name (), info->id, info->stack_ptr);
if (!info->ev)
{
info->ev = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
@@ -165,7 +165,7 @@ new (size_t)
/* available */
#ifdef DEBUGGING
if (info->__name)
- api_fatal ("name not NULL? %s, id %p, i %d", info->__name, info->id, info - threads);
+ api_fatal ("name not NULL? %s, id %y, i %ld", info->__name, info->id, info - threads);
#endif
goto out;
}
@@ -197,7 +197,7 @@ cygthread::async_create (ULONG_PTR arg)
void
cygthread::create ()
{
- thread_printf ("name %s, id %p, this %p", __name, id, this);
+ thread_printf ("name %s, id %y, this %p", __name, id, this);
HANDLE htobe;
if (h)
{
@@ -206,7 +206,7 @@ cygthread::create ()
while (!thread_sync)
yield ();
SetEvent (thread_sync);
- thread_printf ("activated name '%s', thread_sync %p for id %p", __name, thread_sync, id);
+ thread_printf ("activated name '%s', thread_sync %p for id %y", __name, thread_sync, id);
htobe = h;
}
else
@@ -215,8 +215,8 @@ cygthread::create ()
htobe = CreateThread (&sec_none_nih, 0, is_freerange ? simplestub : stub,
this, 0, &id);
if (!htobe)
- api_fatal ("CreateThread failed for %s - %p<%p>, %E", __name, h, id);
- thread_printf ("created name '%s', thread %p, id %p", __name, h, id);
+ api_fatal ("CreateThread failed for %s - %p<%y>, %E", __name, h, id);
+ thread_printf ("created name '%s', thread %p, id %y", __name, h, id);
#ifdef DEBUGGING
terminated = false;
#endif
@@ -257,7 +257,7 @@ cygthread::name (DWORD tid)
res = "main";
else
{
- __small_sprintf (_my_tls.locals.unknown_thread_name, "unknown (%p)", tid);
+ __small_sprintf (_my_tls.locals.unknown_thread_name, "unknown (%y)", tid);
res = _my_tls.locals.unknown_thread_name;
}
return res;
@@ -296,7 +296,7 @@ bool
cygthread::terminate_thread ()
{
bool terminated = true;
- debug_printf ("thread '%s', id %p, inuse %d, stack_ptr %p", __name, id, inuse, stack_ptr);
+ debug_printf ("thread '%s', id %y, inuse %d, stack_ptr %p", __name, id, inuse, stack_ptr);
while (inuse && !stack_ptr)
yield ();
@@ -354,7 +354,7 @@ cygthread::detach (HANDLE sigwait)
bool signalled = false;
bool thread_was_reset = false;
if (!inuse)
- system_printf ("called detach but inuse %d, thread %p?", inuse, id);
+ system_printf ("called detach but inuse %d, thread %y?", inuse, id);
else
{
DWORD res;
@@ -429,7 +429,7 @@ cygthread::detach (HANDLE sigwait)
::SetThreadPriority (hth, prio);
}
- thread_printf ("%s returns %d, id %p", sigwait ? "WFMO" : "WFSO",
+ thread_printf ("%s returns %d, id %y", sigwait ? "WFMO" : "WFSO",
res, id);
if (thread_was_reset)
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc
index 80cab3516..6aebdc975 100644
--- a/winsup/cygwin/cygtls.cc
+++ b/winsup/cygwin/cygtls.cc
@@ -166,7 +166,7 @@ _cygtls::remove (DWORD wait)
if (exit_state >= ES_FINAL)
return;
- debug_printf ("wait %p", wait);
+ debug_printf ("wait %u", wait);
/* FIXME: Need some sort of atthreadexit function to allow things like
select to control this themselves. */
diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h
index 5463ed85c..d475508e2 100644
--- a/winsup/cygwin/cygtls.h
+++ b/winsup/cygwin/cygtls.h
@@ -39,7 +39,11 @@ details. */
#include "thread.h"
#endif
+#ifdef __x86_64__
+#pragma pack(push,8)
+#else
#pragma pack(push,4)
+#endif
/* Defined here to support auto rebuild of tlsoffsets.h. */
class tls_pathbuf
{
@@ -78,8 +82,6 @@ struct _local_storage
/*
Needed for the group functions
*/
- struct __group16 grp;
- char *namearray[2];
int grp_pos;
/* dlfcn.cc */
@@ -157,15 +159,13 @@ typedef struct struct_waitq
*/
/*gentls_offsets*/
-#include "cygerrno.h"
-#include "security.h"
extern "C" int __sjfault (jmp_buf);
extern "C" int __ljfault (jmp_buf, int);
/*gentls_offsets*/
-typedef __uint32_t __stack_t;
+typedef uintptr_t __stack_t;
class _cygtls
{
@@ -237,7 +237,7 @@ public:
if (wait_for_lock)
lock ();
if (!signal_arrived)
- signal_arrived = CreateEvent (&sec_none_nih, false, false, NULL);
+ signal_arrived = CreateEvent (NULL, false, false, NULL);
if (wait_for_lock)
unlock ();
}
@@ -266,13 +266,29 @@ private:
};
#pragma pack(pop)
-const int CYGTLS_PADSIZE = 12700; /* FIXME: Find some way to autogenerate
- this value */
+/* FIXME: Find some way to autogenerate this value */
+#ifdef __x86_64__
+const int CYGTLS_PADSIZE = 12800; /* Must be 16-byte aligned */
+#else
+const int CYGTLS_PADSIZE = 12700;
+#endif
+
/*gentls_offsets*/
-extern char *_tlsbase __asm__ ("%fs:4");
-extern char *_tlstop __asm__ ("%fs:8");
-#define _my_tls (*((_cygtls *) (_tlsbase - CYGTLS_PADSIZE)))
+#include "cygerrno.h"
+#include "ntdll.h"
+
+#ifdef __x86_64__
+/* When just using a "gs:X" asm for the x86_64 code, gcc wrongly creates
+ pc-relative instructions. However, NtCurrentTeb() is inline assembler
+ anyway, so using it here should be fast enough on x86_64. */
+#define _tlsbase (NtCurrentTeb()->Tib.StackBase)
+#define _tlstop (NtCurrentTeb()->Tib.StackLimit)
+#else
+extern PVOID _tlsbase __asm__ ("%fs:4");
+extern PVOID _tlstop __asm__ ("%fs:8");
+#endif
+#define _my_tls (*((_cygtls *) ((char *)_tlsbase - CYGTLS_PADSIZE)))
extern _cygtls *_main_tls;
extern _cygtls *_sig_tls;
diff --git a/winsup/cygwin/cygwin.sc b/winsup/cygwin/cygwin.sc.in
index d5f79ab6c..694e91697 100644
--- a/winsup/cygwin/cygwin.sc
+++ b/winsup/cygwin/cygwin.sc.in
@@ -1,17 +1,38 @@
+#ifdef __x86_64__
+OUTPUT_FORMAT(pei-x86-64)
+SEARCH_DIR("/usr/x86_64-pc-cygwin/lib/w32api"); SEARCH_DIR("=/usr/lib/w32api");
+#else
+#undef i386
OUTPUT_FORMAT(pei-i386)
+SEARCH_DIR("/usr/i686-pc-cygwin/lib/w32api"); SEARCH_DIR("=/usr/lib/w32api");
+#endif
+#define __CONCAT1(a,b) a##b
+#define __CONCAT(a,b) __CONCAT1(a,b)
+#define _SYM(x) __CONCAT(__USER_LABEL_PREFIX__, x)
SECTIONS
{
.text __image_base__ + __section_alignment__ :
{
*(.init)
*(.text)
+#ifdef __x86_64__
+ *(.text.*)
+#endif
*(SORT(.text$*))
*(.glue_7t)
*(.glue_7)
+#ifdef __x86_64__
+ . = ALIGN(8);
+ ___CTOR_LIST__ = .; __CTOR_LIST__ = .;
+ LONG (-1); LONG (-1); *(SORT(.ctors.*)); *(.ctors); *(.ctor); LONG (0); LONG (0);
+ ___DTOR_LIST__ = .; __DTOR_LIST__ = .;
+ LONG (-1); LONG (-1); *(SORT(.dtors.*)); *(.dtors); *(.dtor); LONG (0); LONG (0);
+#else
___CTOR_LIST__ = .; __CTOR_LIST__ = .;
LONG (-1); *(SORT(.ctors.*)); *(.ctors); *(.ctor); LONG (0);
___DTOR_LIST__ = .; __DTOR_LIST__ = .;
LONG (-1); *(SORT(.dtors.*)); *(.dtors); *(.dtor); LONG (0);
+#endif
*(.fini)
/* ??? Why is .gcc_exc here? */
*(.gcc_exc)
@@ -23,10 +44,10 @@ SECTIONS
*(.*_autoload_text);
}
/* The Cygwin DLL uses a section to avoid copying certain data
- on fork. This used to be named ".data". The linker used
+ on fork. This used to be named ".data$nocopy". The linker used
to include this between __data_start__ and __data_end__, but that
- breaks building the cygwin32 dll. Instead, we name the section
- ".data_cygwin_nocopy" and explictly include it after __data_end__. */
+ breaks building the cygwin dll. Instead, we name the section
+ ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
.data ALIGN(__section_alignment__) :
{
__data_start__ = .;
@@ -41,11 +62,18 @@ SECTIONS
*(.rdata)
*(SORT(.rdata$*))
*(.eh_frame)
+ *(.rdata_cygwin_nocopy)
}
.pdata ALIGN(__section_alignment__) :
{
- *(.pdata)
+ *(.pdata*)
+ }
+#ifdef __x86_64__
+ .xdata ALIGN(__section_alignment__) :
+ {
+ *(.xdata*)
}
+#endif
.bss ALIGN(__section_alignment__) :
{
__bss_start__ = .;
@@ -99,13 +127,17 @@ SECTIONS
SORT(*)(.idata$6)
SORT(*)(.idata$7)
. = ALIGN(16);
- __cygheap_start = ABSOLUTE(.);
+ _SYM (_cygheap_start) = ABSOLUTE(.);
}
.cygheap ALIGN(__section_alignment__) :
{
+#ifdef __x86_64__
+ . = . + (3072 * 1024);
+#else
. = . + (2048 * 1024);
+#endif
. = ALIGN(0x10000);
- __cygheap_end = ABSOLUTE(.);
+ _SYM (_cygheap_end) = ABSOLUTE(.);
}
/DISCARD/ :
{
@@ -125,6 +157,7 @@ SECTIONS
/* DWARF 1.1 and DWARF 2 */
.debug_aranges ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_aranges) }
.debug_pubnames ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_pubnames) }
+ .debug_pubtypes ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_pubtypes) }
/* DWARF 2 */
.debug_info ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_info) }
.debug_abbrev ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_abbrev) }
@@ -133,6 +166,14 @@ SECTIONS
.debug_str ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_str) }
.debug_loc ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_loc) }
.debug_macinfo ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions. */
+ .debug_weaknames ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_weaknames) }
+ .debug_funcnames ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_funcnames) }
+ .debug_typenames ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_typenames) }
+ .debug_varnames ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_varnames) }
+ .debug_macro ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_macro) }
+ /* DWARF 3. */
.debug_ranges ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_ranges) }
- .debug_pubtypes ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_pubtypes) }
+ /* DWARF 4. */
+ .debug_types ALIGN(__section_alignment__) (NOLOAD) : { *(.debug_types .gnu.linkonce.wt.*) }
}
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index c2684dee7..d435129d7 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -377,17 +377,17 @@ check_sanity_and_sync (per_process *p)
/* Complain if older than last incompatible change */
if (p->dll_major < CYGWIN_VERSION_DLL_EPOCH)
- api_fatal ("cygwin DLL and APP are out of sync -- DLL version mismatch %d < %d",
+ api_fatal ("cygwin DLL and APP are out of sync -- DLL version mismatch %u < %u",
p->dll_major, CYGWIN_VERSION_DLL_EPOCH);
/* magic_biscuit != 0 if using the old style version numbering scheme. */
if (p->magic_biscuit != SIZEOF_PER_PROCESS)
- api_fatal ("Incompatible cygwin .dll -- incompatible per_process info %d != %d",
+ api_fatal ("Incompatible cygwin .dll -- incompatible per_process info %u != %u",
p->magic_biscuit, SIZEOF_PER_PROCESS);
/* Complain if incompatible API changes made */
if (p->api_major > cygwin_version.api_major)
- api_fatal ("cygwin DLL and APP are out of sync -- API version mismatch %d > %d",
+ api_fatal ("cygwin DLL and APP are out of sync -- API version mismatch %u > %u",
p->api_major, cygwin_version.api_major);
/* This is a kludge to work around a version of _cygwin_common_crt0
@@ -405,7 +405,7 @@ void
child_info_fork::alloc_stack_hard_way (volatile char *b)
{
void *stack_ptr;
- DWORD stacksize;
+ SIZE_T stacksize;
/* First check if the requested stack area is part of the user heap
or part of a mmapped region. If so, we have been started from a
@@ -415,16 +415,19 @@ child_info_fork::alloc_stack_hard_way (volatile char *b)
&& stackbottom <= cygheap->user_heap.max)
|| is_mmapped_region ((caddr_t) stacktop, (caddr_t) stackbottom))
return;
-
/* First, try to reserve the entire stack. */
- stacksize = (char *) stackbottom - (char *) stackaddr;
+ stacksize = (SIZE_T) stackbottom - (SIZE_T) stackaddr;
if (!VirtualAlloc (stackaddr, stacksize, MEM_RESERVE, PAGE_NOACCESS))
- api_fatal ("fork: can't reserve memory for stack %p - %p, %E",
- stackaddr, stackbottom);
- stacksize = (char *) stackbottom - (char *) stacktop;
+ {
+ PTEB teb = NtCurrentTeb ();
+ api_fatal ("fork: can't reserve memory for parent stack "
+ "%p - %p, (child has %p - %p), %E",
+ stackaddr, stackbottom, teb->DeallocationStack, _tlsbase);
+ }
+ stacksize = (SIZE_T) stackbottom - (SIZE_T) stacktop;
stack_ptr = VirtualAlloc (stacktop, stacksize, MEM_COMMIT, PAGE_READWRITE);
if (!stack_ptr)
- abort ("can't commit memory for stack %p(%d), %E", stacktop, stacksize);
+ abort ("can't commit memory for stack %p(%ly), %E", stacktop, stacksize);
if (guardsize != (size_t) -1)
{
/* Allocate PAGE_GUARD page if it still fits. */
@@ -458,8 +461,12 @@ getstack (volatile char * volatile p)
void
child_info_fork::alloc_stack ()
{
- volatile char * volatile esp;
- __asm__ volatile ("movl %%esp,%0": "=r" (esp));
+ volatile char * volatile stackp;
+#ifdef __x86_64__
+ __asm__ volatile ("movq %%rsp,%0": "=r" (stackp));
+#else
+ __asm__ volatile ("movl %%esp,%0": "=r" (stackp));
+#endif
/* Make sure not to try a hard allocation if we have been forked off from
the main thread of a Cygwin process which has been started from a 64 bit
parent. In that case the _tlsbase of the forked child is not the same
@@ -471,18 +478,18 @@ child_info_fork::alloc_stack ()
&& (!wincap.is_wow64 ()
|| stacktop < (char *) NtCurrentTeb ()->DeallocationStack
|| stackbottom > _tlsbase))
- alloc_stack_hard_way (esp);
+ alloc_stack_hard_way (stackp);
else
{
char *st = (char *) stacktop - 4096;
while (_tlstop >= st)
- esp = getstack (esp);
+ stackp = getstack (stackp);
stackaddr = 0;
/* This only affects forked children of a process started from a native
64 bit process, but it doesn't hurt to do it unconditionally. Fix
StackBase in the child to be the same as in the parent, so that the
computation of _my_tls is correct. */
- _tlsbase = (char *) stackbottom;
+ _tlsbase = (PVOID) stackbottom;
}
}
@@ -546,8 +553,8 @@ get_cygwin_startup_info ()
if ((res->intro & OPROC_MAGIC_MASK) == OPROC_MAGIC_GENERIC)
multiple_cygwin_problem ("proc intro", res->intro, 0);
else if (res->cygheap != (void *) &_cygheap_start)
- multiple_cygwin_problem ("cygheap base", (DWORD) res->cygheap,
- (DWORD) &_cygheap_start);
+ multiple_cygwin_problem ("cygheap base", (uintptr_t) res->cygheap,
+ (uintptr_t) &_cygheap_start);
unsigned should_be_cb = 0;
switch (res->type)
@@ -563,7 +570,8 @@ get_cygwin_startup_info ()
if (should_be_cb != res->cb)
multiple_cygwin_problem ("proc size", res->cb, should_be_cb);
else if (sizeof (fhandler_union) != res->fhandler_union_cb)
- multiple_cygwin_problem ("fhandler size", res->fhandler_union_cb, sizeof (fhandler_union));
+ multiple_cygwin_problem ("fhandler size", res->fhandler_union_cb,
+ sizeof (fhandler_union));
if (res->isstraced ())
{
while (!being_debugged ())
@@ -572,7 +580,7 @@ get_cygwin_startup_info ()
}
break;
default:
- system_printf ("unknown exec type %d", res->type);
+ system_printf ("unknown exec type %u", res->type);
/* intentionally fall through */
case _CH_WHOOPS:
res = NULL;
@@ -583,10 +591,17 @@ get_cygwin_startup_info ()
return res;
}
+#ifdef __x86_64__
+#define dll_data_start &__data_start__
+#define dll_data_end &__data_end__
+#define dll_bss_start &__bss_start__
+#define dll_bss_end &__bss_end__
+#else
#define dll_data_start &_data_start__
#define dll_data_end &_data_end__
#define dll_bss_start &_bss_start__
#define dll_bss_end &_bss_end__
+#endif
void
child_info_fork::handle_fork ()
@@ -708,7 +723,7 @@ init_windows_system_directory ()
api_fatal ("can't find windows system directory");
windows_system_directory[windows_system_directory_length++] = L'\\';
windows_system_directory[windows_system_directory_length] = L'\0';
-
+#ifndef __x86_64__
system_wow64_directory_length =
GetSystemWow64DirectoryW (system_wow64_directory, MAX_PATH);
if (system_wow64_directory_length)
@@ -716,6 +731,7 @@ init_windows_system_directory ()
system_wow64_directory[system_wow64_directory_length++] = L'\\';
system_wow64_directory[system_wow64_directory_length] = L'\0';
}
+#endif /* !__x86_64__ */
}
}
@@ -725,7 +741,6 @@ dll_crt0_0 ()
wincap.init ();
child_proc_info = get_cygwin_startup_info ();
init_windows_system_directory ();
- init_global_security ();
initial_env ();
SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
@@ -753,12 +768,14 @@ dll_crt0_0 ()
if (!child_proc_info)
{
memory_init (true);
+#ifndef __x86_64__
/* WOW64 process on XP/64 or Server 2003/64? Check if we have been
started from 64 bit process and if our stack is at an unusual
address. Set wow64_needs_stack_adjustment if so. Problem
description in wow64_test_for_64bit_parent. */
if (wincap.wow64_has_secondary_stack ())
wow64_needs_stack_adjustment = wow64_test_for_64bit_parent ();
+#endif /* !__x86_64__ */
}
else
{
@@ -847,7 +864,7 @@ dll_crt0_1 (void *)
small_printf ("cmalloc returns %p\n", cmalloc (HEAP_STR, n));
else
{
- small_printf ("total allocated %p\n", (i - 1) * n);
+ small_printf ("total allocated %y\n", (i - 1) * n);
break;
}
}
@@ -890,8 +907,8 @@ dll_crt0_1 (void *)
this step. */
if (fork_info->stackaddr)
{
- _tlsbase = (char *) fork_info->stackbottom;
- _tlstop = (char *) fork_info->stacktop;
+ _tlsbase = (PVOID) fork_info->stackbottom;
+ _tlstop = (PVOID) fork_info->stacktop;
}
/* Not resetting _my_tls.incyg here because presumably fork will overwrite
@@ -1015,17 +1032,25 @@ dll_crt0_1 (void *)
sig_dispatch_pending (false);
_my_tls.call_signal_handler ();
_my_tls.incyg--; /* Not in Cygwin anymore */
+#ifdef __x86_64__
+ cygwin_exit (user_data->main (__argc, newargv, __cygwin_environ));
+#else
cygwin_exit (user_data->main (__argc, newargv, *user_data->envptr));
+#endif
}
__asm__ (" \n\
+ .global _cygwin_exit_return \n\
.global __cygwin_exit_return \n\
+_cygwin_exit_return: \n\
__cygwin_exit_return: \n\
+ nop \n\
");
}
extern "C" void __stdcall
_dll_crt0 ()
{
+#ifndef __x86_64__
/* Handle WOW64 process on XP/2K3 which has been started from native 64 bit
process. See comment in wow64_test_for_64bit_parent for a full problem
description. */
@@ -1056,10 +1081,11 @@ _dll_crt0 ()
/* Fall back to respawn if wow64_revert_to_original_stack fails. */
wow64_respawn_process ();
}
-#ifdef __i386__
+#endif /* !__x86_64__ */
_feinitialise ();
-#endif
+#ifndef __x86_64__
main_environ = user_data->envptr;
+#endif
if (in_forkee)
{
fork_info->alloc_stack ();
@@ -1092,12 +1118,16 @@ dll_crt0 (per_process *uptr)
extern "C" void
cygwin_dll_init ()
{
+#ifndef __x86_64__
static char **envp;
+#endif
static int _fmode;
user_data->magic_biscuit = sizeof (per_process);
+#ifndef __x86_64__
user_data->envptr = &envp;
+#endif
user_data->fmode_ptr = &_fmode;
_dll_crt0 ();
@@ -1121,7 +1151,7 @@ __main (void)
sig_dispatch_pending (true);
}
-void __stdcall
+void __reg1
do_exit (int status)
{
syscall_printf ("do_exit (%d), exit_state %d", status, exit_state);
@@ -1173,7 +1203,7 @@ do_exit (int status)
siginfo_t si = {0};
si.si_signo = -SIGHUP;
si.si_code = SI_KERNEL;
- sigproc_printf ("%d == pgrp %d, send SIG{HUP,CONT} to stopped children",
+ sigproc_printf ("%u == pgrp %u, send SIG{HUP,CONT} to stopped children",
myself->pid, myself->pgid);
kill_pgrp (myself->pgid, si);
}
@@ -1186,7 +1216,7 @@ do_exit (int status)
if (getpgrp () > 0 && myself->pid == myself->sid && real_tty_attached (myself))
{
tty *tp = cygwin_shared->tty[myself->ctty];
- sigproc_printf ("%d == sid %d, send SIGHUP to children",
+ sigproc_printf ("%u == sid %u, send SIGHUP to children",
myself->pid, myself->sid);
/* CGF FIXME: This can't be right. */
@@ -1249,7 +1279,7 @@ api_fatal (const char *fmt, ...)
}
void
-multiple_cygwin_problem (const char *what, unsigned magic_version, unsigned version)
+multiple_cygwin_problem (const char *what, uintptr_t magic_version, uintptr_t version)
{
if (_cygwin_testing && (strstr (what, "proc") || strstr (what, "cygheap")))
{
@@ -1261,9 +1291,9 @@ multiple_cygwin_problem (const char *what, unsigned magic_version, unsigned vers
return;
if (CYGWIN_VERSION_MAGIC_VERSION (magic_version) == version)
- system_printf ("%s magic number mismatch detected - %p/%p", what, magic_version, version);
+ system_printf ("%s magic number mismatch detected - %p/%ly", what, magic_version, version);
else
- api_fatal ("%s mismatch detected - %p/%p.\n\
+ api_fatal ("%s mismatch detected - %ly/%ly.\n\
This problem is probably due to using incompatible versions of the cygwin DLL.\n\
Search for cygwin1.dll using the Windows Start->Find/Search facility\n\
and delete all but the most recent version. The most recent version *should*\n\
@@ -1278,6 +1308,6 @@ void __stdcall
cygbench (const char *s)
{
if (GetEnvironmentVariableA ("CYGWIN_BENCH", NULL, 0))
- small_printf ("%05d ***** %s : %10d\n", GetCurrentProcessId (), s, strace.microseconds ());
+ small_printf ("%05u ***** %s : %10d\n", GetCurrentProcessId (), s, strace.microseconds ());
}
#endif
diff --git a/winsup/cygwin/debug.h b/winsup/cygwin/debug.h
index 4550b5cfc..627c77ed6 100644
--- a/winsup/cygwin/debug.h
+++ b/winsup/cygwin/debug.h
@@ -1,7 +1,7 @@
/* debug.h
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010
- Red Hat, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010,
+ 2013 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
@@ -11,7 +11,7 @@ details. */
#define MALLOC_CHECK do {} while (0)
#else
#include <stdlib.h>
-#include "dlmalloc.h"
+#include <malloc.h>
#define MALLOC_CHECK ({\
debug_printf ("checking malloc pool");\
mallinfo ();\
diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc
index e2a776a5b..f2694c283 100644
--- a/winsup/cygwin/devices.cc
+++ b/winsup/cygwin/devices.cc
@@ -70,7 +70,7 @@ exists_ntdev_silent (const device& dev)
static int
exists_console (const device& dev)
{
- int devn = *const_cast<device *> (&dev);
+ fh_devices devn = *const_cast<device *> (&dev);
switch (devn)
{
case FH_CONSOLE:
@@ -45845,7 +45845,7 @@ device::init ()
void
device::parse (_major_t major, _minor_t minor)
{
- _dev_t devn = FHDEV (major, minor);
+ dev_t devn = FHDEV (major, minor);
d.devn = 0;
@@ -45861,7 +45861,7 @@ device::parse (_major_t major, _minor_t minor)
}
void
-device::parse (_dev_t dev)
+device::parse (dev_t dev)
{
parse (_major (dev), _minor (dev));
}
diff --git a/winsup/cygwin/devices.h b/winsup/cygwin/devices.h
index b4886d898..bdddb8ce4 100644
--- a/winsup/cygwin/devices.h
+++ b/winsup/cygwin/devices.h
@@ -14,7 +14,6 @@ details. */
typedef unsigned short _major_t;
typedef unsigned short _minor_t;
typedef mode_t _mode_t;
-typedef __dev32_t _dev_t;
#define FHDEV(maj, min) ((((unsigned) (maj)) << (sizeof (_major_t) * 8)) | (unsigned) (min))
#define _minor(dev) ((dev) & ((1 << (sizeof (_minor_t) * 8)) - 1))
@@ -263,7 +262,7 @@ struct device
const char *name;
union __cygwin_dev
{
- _dev_t devn;
+ dev_t devn;
DWORD devn_dword;
int devn_int;
fh_devices devn_fh_devices;
@@ -281,7 +280,7 @@ struct device
static const device *lookup (const char *, unsigned int = UINT32_MAX);
void parse (const char *);
void parse (_major_t major, _minor_t minor);
- void parse (_dev_t dev);
+ void parse (dev_t dev);
void parsedisk (int, int);
inline bool setunit (unsigned n)
{
@@ -290,32 +289,31 @@ struct device
}
static void init ();
- static _major_t major (_dev_t n)
+ static _major_t major (dev_t n)
{
__cygwin_dev d;
d.devn = n;
return d.major;
}
- static _minor_t minor (_dev_t n)
+ static _minor_t minor (dev_t n)
{
__cygwin_dev d;
d.devn = n;
return d.minor;
}
- static _major_t major (int n) {return major ((_dev_t) n);}
- static _minor_t minor (int n) {return minor ((_dev_t) n);}
+ static _major_t major (int n) {return major ((dev_t) n);}
+ static _minor_t minor (int n) {return minor ((dev_t) n);}
- bool is_device (_dev_t n) const {return n == d.devn; }
- bool not_device (_dev_t n) const {return d.devn && n != d.devn; }
+ bool is_device (dev_t n) const {return n == d.devn; }
+ bool not_device (dev_t n) const {return d.devn && n != d.devn; }
_minor_t get_minor () const {return d.minor;}
_major_t get_major () const {return d.major;}
- _dev_t get_device () const {return d.devn;}
+ dev_t get_device () const {return d.devn;}
- inline operator int& () {return d.devn_int;}
inline operator fh_devices () {return d.devn_fh_devices;}
inline operator bool () {return !!d.devn_int;}
- inline operator DWORD& () {return d.devn_dword;}
+ inline operator dev_t& () {return d.devn;}
fh_devices operator = (fh_devices n) {return d.devn_fh_devices = n;}
inline void setfs (bool x) {dev_on_fs = x;}
inline bool isfs () const {return dev_on_fs || d.devn == FH_FS;}
@@ -377,9 +375,9 @@ extern const device dev_fs_storage;
(isproc_dev (devn) || devn == FH_CYGDRIVE || devn == FH_NETDRIVE)
#define iscons_dev(n) \
- ((device::major ((int) (n)) == DEV_CONS_MAJOR) \
- || (((int) n) == FH_CONSOLE) \
- || (((int) n) == FH_CONIN) \
- || (((int) n) == FH_CONOUT))
+ ((device::major ((dev_t) (n)) == DEV_CONS_MAJOR) \
+ || (((dev_t) n) == FH_CONSOLE) \
+ || (((dev_t) n) == FH_CONIN) \
+ || (((dev_t) n) == FH_CONOUT))
#define istty_slave_dev(n) (device::major (n) == DEV_PTYS_MAJOR)
diff --git a/winsup/cygwin/devices.in b/winsup/cygwin/devices.in
index 213226ae6..dd1689fc3 100644
--- a/winsup/cygwin/devices.in
+++ b/winsup/cygwin/devices.in
@@ -66,7 +66,7 @@ exists_ntdev_silent (const device& dev)
static int
exists_console (const device& dev)
{
- int devn = *const_cast<device *> (&dev);
+ fh_devices devn = *const_cast<device *> (&dev);
switch (devn)
{
case FH_CONSOLE:
@@ -207,7 +207,7 @@ device::init ()
void
device::parse (_major_t major, _minor_t minor)
{
- _dev_t devn = FHDEV (major, minor);
+ dev_t devn = FHDEV (major, minor);
d.devn = 0;
@@ -223,7 +223,7 @@ device::parse (_major_t major, _minor_t minor)
}
void
-device::parse (_dev_t dev)
+device::parse (dev_t dev)
{
parse (_major (dev), _minor (dev));
}
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index 25e55db27..478a41862 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -204,10 +204,10 @@ telldir (DIR *dir)
/* telldir was never defined using off_t in POSIX, only in early versions
of glibc. We have to keep the function in as entry point for backward
compatibility. */
-extern "C" _off64_t
+extern "C" off_t
telldir64 (DIR *dir)
{
- return (_off64_t) telldir (dir);
+ return (off_t) telldir (dir);
}
/* seekdir */
@@ -228,7 +228,7 @@ seekdir (DIR *dir, long loc)
of glibc. We have to keep the function in as entry point for backward
compatibility. */
extern "C" void
-seekdir64 (DIR *dir, _off64_t loc)
+seekdir64 (DIR *dir, off_t loc)
{
seekdir (dir, (long) loc);
}
diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc
index 0e664afca..c27adf675 100644
--- a/winsup/cygwin/dlfcn.cc
+++ b/winsup/cygwin/dlfcn.cc
@@ -1,7 +1,7 @@
/* dlfcn.cc
Copyright 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011 Red Hat, Inc.
+ 2010, 2011, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -155,33 +155,9 @@ dlopen (const char *name, int flags)
|| (ret = GetModuleHandleW (path)) != NULL)
{
ret = (void *) LoadLibraryW (path);
- if (ret && (flags & RTLD_NODELETE)
- && !GetModuleHandleExW (GET_MODULE_HANDLE_EX_FLAG_PIN, path,
- (HMODULE *) &ret))
- {
- /* Windows 2000 is missing the GetModuleHandleEx call, so we
- use a non-documented way to set the DLL to "don't free".
- This is how it works: Fetch the Windows Loader data from
- the PEB. Iterate backwards through the list of loaded
- DLLs and compare the DllBase address with the address
- returned by LoadLibrary. If they are equal we found the
- right entry. Now set the LoadCount to -1, which is the
- marker for a DLL which should never be free'd. */
- PPEB_LDR_DATA ldr = NtCurrentTeb ()->Peb->Ldr;
-
- for (PLDR_DATA_TABLE_ENTRY entry = (PLDR_DATA_TABLE_ENTRY)
- ldr->InLoadOrderModuleList.Blink;
- entry && entry->DllBase;
- entry = (PLDR_DATA_TABLE_ENTRY)
- entry->InLoadOrderLinks.Blink)
- {
- if (entry->DllBase == ret)
- {
- entry->LoadCount = (WORD) -1;
- break;
- }
- }
- }
+ if (ret && (flags & RTLD_NODELETE))
+ GetModuleHandleExW (GET_MODULE_HANDLE_EX_FLAG_PIN, path,
+ (HMODULE *) &ret);
}
/* Restore original cxx_malloc pointer. */
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 0d5b31545..c61bbdb8c 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -1,7 +1,7 @@
/* dll_init.cc
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
@@ -86,11 +86,13 @@ dll::init ()
{
int ret = 1;
+#ifndef __x86_64__
/* This should be a no-op. Why didn't we just import this variable? */
if (!p.envptr)
p.envptr = &__cygwin_environ;
else if (*(p.envptr) != __cygwin_environ)
*(p.envptr) = __cygwin_environ;
+#endif
/* Don't run constructors or the "main" if we've forked. */
if (!in_forkee)
@@ -243,7 +245,9 @@ dll_list::alloc (HINSTANCE h, per_process *p, dll_type type)
loaded_dlls++;
}
guard (false);
+#ifndef __x86_64__
assert (p->envptr != NULL);
+#endif
return d;
}
@@ -295,7 +299,7 @@ void
dll_list::topsort ()
{
/* Anything to do? */
- if (!end)
+ if (!end || end == &start)
return;
/* make sure we have all the deps available */
@@ -430,30 +434,29 @@ dll_list::init ()
covering at least _dll_size_ bytes. However, we must take care not
to clobber the dll's target address range because it often overlaps.
*/
-static DWORD
-reserve_at (const PWCHAR name, DWORD here, DWORD dll_base, DWORD dll_size)
+static PVOID
+reserve_at (const PWCHAR name, PVOID here, PVOID dll_base, DWORD dll_size)
{
DWORD size;
MEMORY_BASIC_INFORMATION mb;
- if (!VirtualQuery ((void *) here, &mb, sizeof (mb)))
- fabort ("couldn't examine memory at %08lx while mapping %W, %E",
- here, name);
+ if (!VirtualQuery (here, &mb, sizeof (mb)))
+ fabort ("couldn't examine memory at %p while mapping %W, %E", here, name);
if (mb.State != MEM_FREE)
return 0;
size = mb.RegionSize;
// don't clobber the space where we want the dll to land
- DWORD end = here + size;
- DWORD dll_end = dll_base + dll_size;
- if (dll_base < here && dll_end > here)
- here = dll_end; // the dll straddles our left edge
- else if (dll_base >= here && dll_base < end)
- end = dll_base; // the dll overlaps partly or fully to our right
-
- size = end - here;
- if (!VirtualAlloc ((void *) here, size, MEM_RESERVE, PAGE_NOACCESS))
+ caddr_t end = (caddr_t) here + size;
+ caddr_t dll_end = (caddr_t) dll_base + dll_size;
+ if (dll_base < here && dll_end > (caddr_t) here)
+ here = (PVOID) dll_end; // the dll straddles our left edge
+ else if (dll_base >= here && (caddr_t) dll_base < end)
+ end = (caddr_t) dll_base; // the dll overlaps partly or fully to our right
+
+ size = end - (caddr_t) here;
+ if (!VirtualAlloc (here, size, MEM_RESERVE, PAGE_NOACCESS))
fabort ("couldn't allocate memory %p(%d) for '%W' alignment, %E\n",
here, size, name);
return here;
@@ -461,9 +464,9 @@ reserve_at (const PWCHAR name, DWORD here, DWORD dll_base, DWORD dll_size)
/* Release the memory previously allocated by "reserve_at" above. */
static void
-release_at (const PWCHAR name, DWORD here)
+release_at (const PWCHAR name, PVOID here)
{
- if (!VirtualFree ((void *) here, 0, MEM_RELEASE))
+ if (!VirtualFree (here, 0, MEM_RELEASE))
fabort ("couldn't release memory %p for '%W' alignment, %E\n",
here, name);
}
@@ -536,7 +539,7 @@ void dll_list::load_after_fork_impl (HANDLE parent, dll* d, int retries)
dll's protective reservation from step 1
*/
if (!retries && !VirtualFree (d->handle, 0, MEM_RELEASE))
- fabort ("unable to release protective reservation for %W (%08lx), %E",
+ fabort ("unable to release protective reservation for %W (%p), %E",
d->modname, d->handle);
HMODULE h = LoadLibraryExW (d->name, NULL, DONT_RESOLVE_DLL_REFERENCES);
@@ -544,11 +547,11 @@ void dll_list::load_after_fork_impl (HANDLE parent, dll* d, int retries)
fabort ("unable to create interim mapping for %W, %E", d->name);
if (h != d->handle)
{
- sigproc_printf ("%W loaded in wrong place: %08lx != %08lx",
+ sigproc_printf ("%W loaded in wrong place: %p != %p",
d->modname, h, d->handle);
FreeLibrary (h);
- DWORD reservation = reserve_at (d->modname, (DWORD) h,
- (DWORD) d->handle, d->image_size);
+ PVOID reservation = reserve_at (d->modname, h,
+ d->handle, d->image_size);
if (!reservation)
fabort ("unable to block off %p to prevent %W from loading there",
h, d->modname);
@@ -556,12 +559,12 @@ void dll_list::load_after_fork_impl (HANDLE parent, dll* d, int retries)
if (retries < DLL_RETRY_MAX)
load_after_fork_impl (parent, d, retries+1);
else
- fabort ("unable to remap %W to same address as parent (%08lx) - try running rebaseall",
+ fabort ("unable to remap %W to same address as parent (%p) - try running rebaseall",
d->modname, d->handle);
/* once the above returns all the dlls are mapped; release
the reservation and continue unwinding */
- sigproc_printf ("releasing blocked space at %08lx", reservation);
+ sigproc_printf ("releasing blocked space at %p", reservation);
release_at (d->modname, reservation);
return;
}
@@ -577,7 +580,7 @@ void dll_list::load_after_fork_impl (HANDLE parent, dll* d, int retries)
if (d->handle == d->preferred_base)
{
if (!VirtualFree (d->handle, 0, MEM_RELEASE))
- fabort ("unable to release protective reservation for %W (%08lx), %E",
+ fabort ("unable to release protective reservation for %W (%p), %E",
d->modname, d->handle);
}
else
@@ -601,15 +604,15 @@ struct dllcrt0_info
{
HMODULE h;
per_process *p;
- int res;
+ PVOID res;
dllcrt0_info (HMODULE h0, per_process *p0): h (h0), p (p0) {}
};
-extern "C" int
+extern "C" PVOID
dll_dllcrt0 (HMODULE h, per_process *p)
{
if (dynamically_loaded)
- return 1;
+ return (PVOID) 1;
dllcrt0_info x (h, p);
dll_dllcrt0_1 (&x);
return x.res;
@@ -620,7 +623,7 @@ dll_dllcrt0_1 (VOID *x)
{
HMODULE& h = ((dllcrt0_info *) x)->h;
per_process*& p = ((dllcrt0_info *) x)->p;
- int& res = ((dllcrt0_info *) x)->res;
+ PVOID& res = ((dllcrt0_info *) x)->res;
if (p == NULL)
p = &__cygwin_user_data;
@@ -677,20 +680,21 @@ dll_dllcrt0_1 (VOID *x)
it may not be safe to call the dll's "main" since not
all of cygwin's internal structures may have been set up. */
if (!d || (!linked && !d->init ()))
- res = -1;
+ res = (PVOID) -1;
else
- res = (DWORD) d;
+ res = (PVOID) d;
}
+#ifndef __x86_64__
/* OBSOLETE: This function is obsolete and will go away in the
future. Cygwin can now handle being loaded from a noncygwin app
using the same entry point. */
-
extern "C" int
dll_noncygwin_dllcrt0 (HMODULE h, per_process *p)
{
- return dll_dllcrt0 (h, p);
+ return (int) dll_dllcrt0 (h, p);
}
+#endif /* !__x86_64__ */
extern "C" void
cygwin_detach_dll (dll *)
@@ -709,6 +713,7 @@ dlfork (int val)
dlls.reload_on_fork = val;
}
+#ifndef __x86_64__
/* Called from various places to update all of the individual
ideas of the environ block. Explain to me again why we didn't
just import __cygwin_environ? */
@@ -720,3 +725,4 @@ update_envptrs ()
*(d->p.envptr) = __cygwin_environ;
*main_environ = __cygwin_environ;
}
+#endif
diff --git a/winsup/cygwin/dll_init.h b/winsup/cygwin/dll_init.h
index 6c102c536..8127d0bb4 100644
--- a/winsup/cygwin/dll_init.h
+++ b/winsup/cygwin/dll_init.h
@@ -1,7 +1,7 @@
/* dll_init.h
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2010,
- 2011, 2012 Red Hat, Inc.
+ 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -11,7 +11,9 @@ details. */
struct per_module
{
+#ifndef __x86_64__
char ***envptr;
+#endif
void (**ctors)(void);
void (**dtors)(void);
void *data_start;
@@ -21,7 +23,9 @@ struct per_module
int (*main)(int, char **, char **);
per_module &operator = (per_process *p)
{
+#ifndef __x86_64__
envptr = p->envptr;
+#endif
ctors = p->ctors;
dtors = p->dtors;
data_start = p->data_start;
@@ -129,12 +133,12 @@ struct pefile
{
IMAGE_DOS_HEADER dos_hdr;
- char* rva (long offset) { return (char*) this + offset; }
- PIMAGE_NT_HEADERS32 pe_hdr () { return (PIMAGE_NT_HEADERS32) rva (dos_hdr.e_lfanew); }
- PIMAGE_OPTIONAL_HEADER32 optional_hdr () { return &pe_hdr ()->OptionalHeader; }
+ char* rva (ptrdiff_t offset) { return (char*) this + offset; }
+ PIMAGE_NT_HEADERS pe_hdr () { return (PIMAGE_NT_HEADERS) rva (dos_hdr.e_lfanew); }
+ PIMAGE_OPTIONAL_HEADER optional_hdr () { return &pe_hdr ()->OptionalHeader; }
PIMAGE_DATA_DIRECTORY idata_dir (DWORD which)
{
- PIMAGE_OPTIONAL_HEADER32 oh = optional_hdr ();
+ PIMAGE_OPTIONAL_HEADER oh = optional_hdr ();
return (which < oh->NumberOfRvaAndSizes)? oh->DataDirectory + which : 0;
}
};
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index e46c6c58d..b5781e8ae 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -1,7 +1,7 @@
/* dtable.cc: file descriptor support.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -31,8 +31,8 @@ details. */
#include "ntdll.h"
#include "shared_info.h"
-static const NO_COPY DWORD std_consts[] = {STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
- STD_ERROR_HANDLE};
+static const DWORD std_consts[] = {STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
+ STD_ERROR_HANDLE};
static bool handle_to_fn (HANDLE, char *);
@@ -103,7 +103,7 @@ dtable::extend (int howmuch)
size = new_size;
fds = newfds;
- debug_printf ("size %d, fds %p", size, fds);
+ debug_printf ("size %ld, fds %p", size, fds);
return 1;
}
@@ -115,8 +115,8 @@ dtable::get_debugger_info ()
{
char std[3][sizeof ("/dev/ptyNNNN")];
std[0][0] = std[1][0] = std [2][0] = '\0';
- char buf[sizeof ("cYgstd %x") + 32];
- sprintf (buf, "cYgstd %x %x %x", (unsigned) &std, sizeof (std[0]), 3);
+ char buf[sizeof ("cYgstd %x") + 64];
+ sprintf (buf, "cYgstd %p %zx %x", &std, sizeof (std[0]), 3);
OutputDebugString (buf);
for (int i = 0; i < 3; i++)
if (std[i][0])
@@ -194,7 +194,7 @@ fhandler_base *
dtable::find_archetype (device& dev)
{
for (unsigned i = 0; i < farchetype; i++)
- if (archetypes[i]->get_device () == (DWORD) dev)
+ if (archetypes[i]->get_device () == (dev_t) dev)
return archetypes[i];
return NULL;
}
@@ -482,7 +482,7 @@ fh_alloc (path_conv& pc)
fh = cnew (fhandler_console, pc.dev);
break;
default:
- switch ((DWORD) pc.dev)
+ switch ((dev_t) pc.dev)
{
case FH_CONSOLE:
case FH_CONIN:
@@ -661,7 +661,7 @@ build_fh_pc (path_conv& pc)
last_tty_dev = fh->dev ();
out:
- debug_printf ("fh %p, dev %p", fh, fh ? (DWORD) fh->dev () : 0);
+ debug_printf ("fh %p, dev %08x", fh, fh ? (dev_t) fh->dev () : 0);
return fh;
}
@@ -710,7 +710,7 @@ dtable::dup3 (int oldfd, int newfd, int flags)
fhandler_base *newfh = NULL; // = NULL to avoid an incorrect warning
MALLOC_CHECK;
- debug_printf ("dup3 (%d, %d, %p)", oldfd, newfd, flags);
+ debug_printf ("dup3 (%d, %d, %y)", oldfd, newfd, flags);
lock ();
bool do_unlock = true;
bool unlock_on_return;
@@ -736,7 +736,7 @@ dtable::dup3 (int oldfd, int newfd, int flags)
}
if ((flags & ~O_CLOEXEC) != 0)
{
- syscall_printf ("invalid flags value %x", flags);
+ syscall_printf ("invalid flags value %y", flags);
set_errno (EINVAL);
return -1;
}
@@ -778,7 +778,7 @@ done:
MALLOC_CHECK;
if (do_unlock)
unlock ();
- syscall_printf ("%R = dup3(%d, %d, %p)", res, oldfd, newfd, flags);
+ syscall_printf ("%R = dup3(%d, %d, %y)", res, oldfd, newfd, flags);
return res;
}
@@ -939,7 +939,7 @@ handle_to_fn (HANDLE h, char *posix_fn)
NTSTATUS status = NtQueryObject (h, ObjectNameInformation, ntfn, 65536, &len);
if (!NT_SUCCESS (status))
- debug_printf ("NtQueryObject failed, %p", status);
+ debug_printf ("NtQueryObject failed, %y", status);
// NT seems to do this on an unopened file
else if (!ntfn->Name.Buffer)
debug_printf ("nt->Name.Buffer == NULL");
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 0d9e42e0f..5e522b91f 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -89,6 +89,32 @@ tty_is_gone (const char *buf)
}
}
+static void
+set_winsymlinks (const char *buf)
+{
+ if (!buf || !*buf)
+ allow_winsymlinks = WSYM_lnk;
+ else if (ascii_strncasematch (buf, "lnk", 3))
+ allow_winsymlinks = WSYM_lnk;
+ /* Make sure to try native symlinks only on systems supporting them. */
+ else if (ascii_strncasematch (buf, "native", 6))
+ {
+ if (wincap.max_sys_priv () < SE_CREATE_SYMBOLIC_LINK_PRIVILEGE)
+ {
+ if (!user_shared->warned_nonativesyms)
+ {
+ small_printf ("\"winsymlinks:%s\" option detected in CYGWIN environment variable.\n"
+ "Native symlinks are not supported on Windows versions prior to\n"
+ "Windows Vista/Server 2008. This option will be ignored.\n", buf);
+ user_shared->warned_nonativesyms = 1;
+ }
+ }
+ else
+ allow_winsymlinks = ascii_strcasematch (buf + 6, "strict")
+ ? WSYM_nativestrict : WSYM_native;
+ }
+}
+
/* The structure below is used to set up an array which is used to
parse the CYGWIN environment variable or, if enabled, options from
the registry. */
@@ -121,7 +147,7 @@ static struct parse_thing
{"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}},
{"reset_com", {&reset_com}, setbool, NULL, {{false}, {true}}},
{"tty", {func: tty_is_gone}, isfunc, NULL, {{0}, {0}}},
- {"winsymlinks", {&allow_winsymlinks}, setbool, NULL, {{false}, {true}}},
+ {"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}},
{NULL, {0}, setdword, 0, {{0}, {0}}}
};
@@ -187,7 +213,7 @@ parse_options (const char *inbuf)
*k->setting.x = k->values[istrue].i;
else
*k->setting.x = strtol (eq, NULL, 0);
- debug_printf ("%s %d", k->name, *k->setting.x);
+ debug_printf ("%s %u", k->name, *k->setting.x);
break;
case setbool:
if (!istrue || !eq)
@@ -360,11 +386,11 @@ win_env::add_cache (const char *in_posix, const char *in_native)
MALLOC_CHECK;
if (immediate && cygwin_finished_initializing)
{
- char s[namelen];
- size_t n = namelen - 1;
- memcpy (s, name, n);
- s[n] = '\0';
- SetEnvironmentVariable (s, native + namelen);
+ wchar_t s[sys_mbstowcs (NULL, 0, native) + 1];
+ sys_mbstowcs (s, sizeof s, native);
+ /* Hack. Relies on affected variables only having ASCII names. */
+ s[namelen - 1] = L'\0';
+ SetEnvironmentVariableW (s, s + namelen);
}
debug_printf ("posix %s", posix);
debug_printf ("native %s", native);
@@ -1048,7 +1074,7 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
else
{
*pass_dstp = NULL;
- debug_printf ("env count %d, bytes %d", pass_envc, tl);
+ debug_printf ("env count %ld, bytes %d", pass_envc, tl);
win_env temp;
temp.reset ();
@@ -1118,6 +1144,7 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
return newenv;
}
+#ifndef __x86_64__
/* This idiocy is necessary because the early implementers of cygwin
did not seem to know about importing data variables from the DLL.
So, we have to synchronize cygwin's idea of the environment with the
@@ -1133,3 +1160,4 @@ cur_environ ()
return __cygwin_environ;
}
+#endif
diff --git a/winsup/cygwin/environ.h b/winsup/cygwin/environ.h
index 888c36625..b2d65c8bd 100644
--- a/winsup/cygwin/environ.h
+++ b/winsup/cygwin/environ.h
@@ -35,10 +35,16 @@ struct win_env
win_env * __reg3 getwinenv (const char *name, const char *posix = NULL, win_env * = NULL);
char * __reg3 getwinenveq (const char *name, size_t len, int);
+#ifdef __x86_64__
+#define update_envptrs()
+extern "C" char **__cygwin_environ;
+#define cur_environ() __cygwin_environ
+#else
void __stdcall update_envptrs ();
extern "C" char **__cygwin_environ, ***main_environ;
extern "C" char __stdcall **cur_environ ();
+#endif
char ** __reg3 build_env (const char * const *envp, PWCHAR &envblock,
- int &envc, bool need_envblock);
+ int &envc, bool need_envblock);
#define ENV_CVT -1
diff --git a/winsup/cygwin/errno.cc b/winsup/cygwin/errno.cc
index b2cbd983b..2a5f711bd 100644
--- a/winsup/cygwin/errno.cc
+++ b/winsup/cygwin/errno.cc
@@ -34,7 +34,7 @@ details. */
#define X(w, e) {ERROR_##w, #w, e}
-static NO_COPY struct
+static const struct
{
DWORD w; /* windows version of error */
const char *s; /* text of windows version */
@@ -162,7 +162,7 @@ static NO_COPY struct
};
extern "C" {
-const char *_sys_errlist[] NO_COPY_INIT =
+const char *_sys_errlist[] =
{
/* NOERROR 0 */ "No error",
/* EPERM 1 */ "Operation not permitted",
@@ -333,7 +333,7 @@ geterrno_from_win_error (DWORD code, int deferrno)
void __reg3
seterrno_from_win_error (const char *file, int line, DWORD code)
{
- syscall_printf ("%s:%d windows error %d", file, line, code);
+ syscall_printf ("%s:%d windows error %u", file, line, code);
errno = _impure_ptr->_errno = geterrno_from_win_error (code, EACCES);
}
@@ -350,7 +350,7 @@ seterrno_from_nt_status (const char *file, int line, NTSTATUS status)
{
DWORD code = RtlNtStatusToDosError (status);
SetLastError (code);
- syscall_printf ("%s:%d status %p -> windows error %d",
+ syscall_printf ("%s:%d status %y -> windows error %u",
file, line, status, code);
errno = _impure_ptr->_errno = geterrno_from_win_error (code, EACCES);
}
diff --git a/winsup/cygwin/exception.h b/winsup/cygwin/exception.h
index c14aa1614..5b11b0c00 100644
--- a/winsup/cygwin/exception.h
+++ b/winsup/cygwin/exception.h
@@ -8,35 +8,61 @@ details. */
#pragma once
+#ifdef __x86_64__
+#define _exception_list _EXCEPTION_REGISTRATION_RECORD
+#endif
+
#include <exceptions.h>
+#ifndef __x86_64__
extern exception_list *_except_list asm ("%fs:0");
+#endif
class exception
{
+#ifdef __x86_64__
+ static bool handler_installed;
+ static int handle (LPEXCEPTION_POINTERS);
+#else
exception_list el;
exception_list *save;
static int handle (EXCEPTION_RECORD *, exception_list *, CONTEXT *, void *);
+#endif
public:
exception () __attribute__ ((always_inline))
{
+#ifdef __x86_64__
+ if (!handler_installed)
+ {
+ handler_installed = true;
+ /* The unhandled exception filter goes first. It won't work if the
+ executable is debugged, but then the vectored continue handler
+ kicks in. For some reason the vectored continue handler doesn't
+ get called if no unhandled exception filter is installed. */
+ SetUnhandledExceptionFilter (handle);
+ AddVectoredContinueHandler (1, handle);
+ }
+#else
save = _except_list;
el.handler = handle;
el.prev = _except_list;
_except_list = &el;
+#endif
};
+#ifndef __x86_64__
~exception () __attribute__ ((always_inline)) { _except_list = save; }
+#endif
};
class cygwin_exception
{
- DWORD ebp;
+ PUINT_PTR framep;
PCONTEXT ctx;
EXCEPTION_RECORD *e;
void dump_exception ();
public:
- cygwin_exception (DWORD in_ebp, PCONTEXT in_ctx = NULL, EXCEPTION_RECORD *in_e = NULL):
- ebp (in_ebp), ctx (in_ctx), e (in_e) {}
+ cygwin_exception (PUINT_PTR in_framep, PCONTEXT in_ctx = NULL, EXCEPTION_RECORD *in_e = NULL):
+ framep (in_framep), ctx (in_ctx), e (in_e) {}
void dumpstack ();
PCONTEXT context () const {return ctx;}
};
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index d86635bae..aa0036a18 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -1,7 +1,7 @@
/* exceptions.cc
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -32,6 +32,17 @@ details. */
#include "ntdll.h"
#include "exception.h"
+/* Definitions for code simplification */
+#ifdef __x86_64__
+# define _GR(reg) R ## reg
+# define _AFMT "%011X"
+# define _ADDR DWORD64
+#else
+# define _GR(reg) E ## reg
+# define _AFMT "%08x"
+# define _ADDR DWORD
+#endif
+
#define CALL_HANDLER_RETRY_OUTER 10
#define CALL_HANDLER_RETRY_INNER 10
@@ -39,7 +50,7 @@ char debugger_command[2 * NT_MAX_PATH + 20];
static BOOL WINAPI ctrl_c_handler (DWORD);
-NO_COPY static struct
+static const struct
{
NTSTATUS code;
const char *name;
@@ -178,6 +189,20 @@ cygwin_exception::dump_exception ()
}
}
+#ifdef __x86_64__
+ if (exception_name)
+ small_printf ("Exception: %s at rip=%011X\r\n", exception_name, ctx->Rip);
+ else
+ small_printf ("Signal %d at rip=%011X\r\n", e->ExceptionCode, ctx->Rip);
+ small_printf ("rax=%016X rbx=%016X rcx=%016X\r\n", ctx->Rax, ctx->Rbx, ctx->Rcx);
+ small_printf ("rdx=%016X rsi=%016X rdi=%016X\r\n", ctx->Rdx, ctx->Rsi, ctx->Rdi);
+ small_printf ("r8 =%016X r9 =%016X r10=%016X\r\n", ctx->R8, ctx->R9, ctx->R10);
+ small_printf ("r11=%016X r12=%016X r13=%016X\r\n", ctx->R11, ctx->R12, ctx->R13);
+ small_printf ("r14=%016X r15=%016X\r\n", ctx->R14, ctx->R15);
+ small_printf ("rbp=%016X rsp=%016X\r\n", ctx->Rbp, ctx->Rsp);
+ small_printf ("program=%W, pid %u, thread %s\r\n",
+ myself->progname, myself->pid, cygthread::name ());
+#else
if (exception_name)
small_printf ("Exception: %s at eip=%08x\r\n", exception_name, ctx->Eip);
else
@@ -185,7 +210,9 @@ cygwin_exception::dump_exception ()
small_printf ("eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\r\n",
ctx->Eax, ctx->Ebx, ctx->Ecx, ctx->Edx, ctx->Esi, ctx->Edi);
small_printf ("ebp=%08x esp=%08x program=%W, pid %u, thread %s\r\n",
- ctx->Ebp, ctx->Esp, myself->progname, myself->pid, cygthread::name ());
+ ctx->Ebp, ctx->Esp, myself->progname, myself->pid,
+ cygthread::name ());
+#endif
small_printf ("cs=%04x ds=%04x es=%04x fs=%04x gs=%04x ss=%04x\r\n",
ctx->SegCs, ctx->SegDs, ctx->SegEs, ctx->SegFs, ctx->SegGs, ctx->SegSs);
}
@@ -196,10 +223,14 @@ class stack_info
int walk (); /* Uses the "old" method */
char *next_offset () {return *((char **) sf.AddrFrame.Offset);}
bool needargs;
- DWORD dummy_frame;
+ PUINT_PTR dummy_frame;
+#ifdef __x86_64__
+ CONTEXT c;
+ UNWIND_HISTORY_TABLE hist;
+#endif
public:
STACKFRAME sf; /* For storing the stack information */
- void init (DWORD, bool, bool); /* Called the first time that stack info is needed */
+ void init (PUINT_PTR, bool, PCONTEXT); /* Called the first time that stack info is needed */
/* Postfix ++ iterates over the stack, returning zero when nothing is left. */
int operator ++(int) { return walk (); }
@@ -213,21 +244,30 @@ static NO_COPY stack_info thestack;
/* Initialize everything needed to start iterating. */
void
-stack_info::init (DWORD ebp, bool wantargs, bool goodframe)
+stack_info::init (PUINT_PTR framep, bool wantargs, PCONTEXT ctx)
{
-# define debp ((DWORD *) ebp)
+#ifdef __x86_64__
+ memset (&hist, 0, sizeof hist);
+ if (ctx)
+ memcpy (&c, ctx, sizeof c);
+ else
+ {
+ memset (&c, 0, sizeof c);
+ c.ContextFlags = CONTEXT_ALL;
+ }
+#endif
memset (&sf, 0, sizeof (sf));
- if (!goodframe)
- sf.AddrFrame.Offset = ebp;
+ if (ctx)
+ sf.AddrFrame.Offset = (UINT_PTR) framep;
else
{
- dummy_frame = ebp;
- sf.AddrFrame.Offset = (DWORD) &dummy_frame;
+ dummy_frame = framep;
+ sf.AddrFrame.Offset = (UINT_PTR) &dummy_frame;
}
- sf.AddrReturn.Offset = debp[1];
+ if (framep)
+ sf.AddrReturn.Offset = framep[1];
sf.AddrFrame.Mode = AddrModeFlat;
needargs = wantargs;
-# undef debp
}
extern "C" void _cygwin_exit_return ();
@@ -237,26 +277,56 @@ extern "C" void _cygwin_exit_return ();
int
stack_info::walk ()
{
- char **ebp;
+#ifdef __x86_64__
+ PRUNTIME_FUNCTION f;
+ ULONG64 imagebase;
+ DWORD64 establisher;
+ PVOID hdl;
+
+ if (!c.Rip)
+ return 0;
+
+ sf.AddrPC.Offset = c.Rip;
+ sf.AddrStack.Offset = c.Rsp;
+ sf.AddrFrame.Offset = c.Rbp;
+
+ f = RtlLookupFunctionEntry (c.Rip, &imagebase, &hist);
+ if (f)
+ RtlVirtualUnwind (0, imagebase, c.Rip, f, &c, &hdl, &establisher, NULL);
+ else
+ {
+ c.Rip = *(ULONG_PTR *) c.Rsp;
+ c.Rsp += 8;
+ }
+ if (needargs && c.Rip)
+ {
+ PULONG_PTR p = (PULONG_PTR) c.Rsp;
+ for (unsigned i = 0; i < NPARAMS; ++i)
+ sf.Params[i] = p[i + 1];
+ }
+ return 1;
+#else
+ char **framep;
if ((void (*) ()) sf.AddrPC.Offset == _cygwin_exit_return)
return 0; /* stack frames are exhausted */
- if (((ebp = (char **) next_offset ()) == NULL) || (ebp >= (char **) cygwin_hmodule))
+ if (((framep = (char **) next_offset ()) == NULL)
+ || (framep >= (char **) cygwin_hmodule))
return 0;
- sf.AddrFrame.Offset = (DWORD) ebp;
+ sf.AddrFrame.Offset = (_ADDR) framep;
sf.AddrPC.Offset = sf.AddrReturn.Offset;
/* The return address always follows the stack pointer */
- sf.AddrReturn.Offset = (DWORD) *++ebp;
+ sf.AddrReturn.Offset = (_ADDR) *++framep;
if (needargs)
{
unsigned nparams = NPARAMS;
/* The arguments follow the return address */
- sf.Params[0] = (DWORD) *++ebp;
+ sf.Params[0] = (_ADDR) *++framep;
/* Hack for XP/2K3 WOW64. If the first stack param points to the
application entry point, we can only fetch one additional
parameter. Accessing anything beyond this address results in
@@ -264,16 +334,19 @@ stack_info::walk ()
if (wincap.has_restricted_stack_args () && sf.Params[0] == 0x401000)
nparams = 2;
for (unsigned i = 1; i < nparams; i++)
- sf.Params[i] = (DWORD) *++ebp;
+ sf.Params[i] = (_ADDR) *++framep;
}
-
return 1;
+#endif
}
void
cygwin_exception::dumpstack ()
{
static bool already_dumped;
+ myfault efault;
+ if (efault.faulted ())
+ return;
if (already_dumped || cygheap->rlim_core == 0Ul)
return;
@@ -285,14 +358,18 @@ cygwin_exception::dumpstack ()
int i;
- thestack.init (ebp, 1, !ctx); /* Initialize from the input CONTEXT */
+ thestack.init (framep, 1, ctx); /* Initialize from the input CONTEXT */
+#ifdef __x86_64__
+ small_printf ("Stack trace:\r\nFrame Function Args\r\n");
+#else
small_printf ("Stack trace:\r\nFrame Function Args\r\n");
+#endif
for (i = 0; i < 16 && thestack++; i++)
{
- small_printf ("%08x %08x ", thestack.sf.AddrFrame.Offset,
+ small_printf (_AFMT " " _AFMT, thestack.sf.AddrFrame.Offset,
thestack.sf.AddrPC.Offset);
for (unsigned j = 0; j < NPARAMS; j++)
- small_printf ("%s%08x", j == 0 ? " (" : ", ", thestack.sf.Params[j]);
+ small_printf ("%s" _AFMT, j == 0 ? " (" : ", ", thestack.sf.Params[j]);
small_printf (")\r\n");
}
small_printf ("End of stack trace%s\n",
@@ -309,8 +386,8 @@ _cygtls::inside_kernel (CONTEXT *cx)
return true;
memset (&m, 0, sizeof m);
- if (!VirtualQuery ((LPCVOID) cx->Eip, &m, sizeof m))
- sigproc_printf ("couldn't get memory info, pc %p, %E", cx->Eip);
+ if (!VirtualQuery ((LPCVOID) cx->_GR(ip), &m, sizeof m))
+ sigproc_printf ("couldn't get memory info, pc %p, %E", cx->_GR(ip));
size_t size = (windows_system_directory_length + 6) * sizeof (WCHAR);
PWCHAR checkdir = (PWCHAR) alloca (size);
@@ -330,12 +407,14 @@ _cygtls::inside_kernel (CONTEXT *cx)
checkdir += 4;
res = wcsncasecmp (windows_system_directory, checkdir,
windows_system_directory_length) == 0;
+#ifndef __x86_64__
if (!res && system_wow64_directory_length)
res = wcsncasecmp (system_wow64_directory, checkdir,
system_wow64_directory_length) == 0;
+#endif
}
- sigproc_printf ("pc %p, h %p, inside_kernel %d", cx->Eip, h, res);
+ sigproc_printf ("pc %p, h %p, inside_kernel %d", cx->_GR(ip), h, res);
# undef h
return res;
}
@@ -346,8 +425,8 @@ cygwin_stackdump ()
{
CONTEXT c;
c.ContextFlags = CONTEXT_FULL;
- GetThreadContext (GetCurrentThread (), &c);
- cygwin_exception exc (c.Ebp);
+ RtlCaptureContext (&c);
+ cygwin_exception exc ((PUINT_PTR) c._GR(bp), &c);
exc.dumpstack ();
}
@@ -440,9 +519,13 @@ try_to_debug (bool waitloop)
return dbg;
}
-extern "C" void WINAPI RtlUnwind (void *, void *, PEXCEPTION_RECORD, void *);
-static void __reg3 rtl_unwind (exception_list *, PEXCEPTION_RECORD) __attribute__ ((noinline, ));
-void __stdcall
+#ifdef __x86_64__
+/* Don't unwind the stack on x86_64. It's not necessary to do that from the
+ exception handler. */
+#define rtl_unwind(el,er)
+#else
+static void __reg3 rtl_unwind (exception_list *, PEXCEPTION_RECORD) __attribute__ ((noinline, regparm (3)));
+void __reg3
rtl_unwind (exception_list *frame, PEXCEPTION_RECORD e)
{
__asm__ ("\n\
@@ -460,27 +543,47 @@ rtl_unwind (exception_list *frame, PEXCEPTION_RECORD e)
popl %%ebx \n\
": : "r" (frame), "r" (e));
}
+#endif
/* Main exception handler. */
-extern exception_list *_except_list asm ("%fs:0");
+#ifdef __x86_64__
+#define CYG_EXC_CONTINUE_EXECUTION EXCEPTION_CONTINUE_EXECUTION
+#define CYG_EXC_CONTINUE_SEARCH EXCEPTION_CONTINUE_SEARCH
+
+bool exception::handler_installed NO_COPY;
+
+int
+exception::handle (LPEXCEPTION_POINTERS ep)
+#else
+#define CYG_EXC_CONTINUE_EXECUTION ExceptionContinueExecution
+#define CYG_EXC_CONTINUE_SEARCH ExceptionContinueSearch
int
exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void *)
+#endif
{
static bool NO_COPY debugging;
_cygtls& me = _my_tls;
+ if (me.andreas)
+ me.andreas->leave (); /* Return from a "san" caught fault */
+
+#ifdef __x86_64__
+ EXCEPTION_RECORD *e = ep->ExceptionRecord;
+ CONTEXT *in = ep->ContextRecord;
+#endif
+
if (debugging && ++debugging < 500000)
{
SetThreadPriority (hMainThread, THREAD_PRIORITY_NORMAL);
- return 0;
+ return CYG_EXC_CONTINUE_EXECUTION;
}
- /* If we're exiting, don't do anything here. Returning 1
- tells Windows to keep looking for an exception handler. */
+ /* If we're exiting, tell Windows to keep looking for an
+ exception handler. */
if (exit_state || e->ExceptionFlags)
- return 1;
+ return CYG_EXC_CONTINUE_SEARCH;
siginfo_t si = {};
si.si_code = SI_KERNEL;
@@ -549,7 +652,7 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
1))
{
case MMAP_NORESERVE_COMMITED:
- return 0;
+ return CYG_EXC_CONTINUE_EXECUTION;
case MMAP_RAISE_SIGBUS: /* MAP_NORESERVE page, commit failed, or
access to mmap page beyond EOF. */
si.si_signo = SIGBUS;
@@ -583,26 +686,31 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
want CloseHandle to return an error. This can be revisited
if gcc ever supports Windows style structured exception
handling. */
- return 0;
+ return CYG_EXC_CONTINUE_EXECUTION;
default:
/* If we don't recognize the exception, we have to assume that
we are doing structured exception handling, and we let
something else handle it. */
- return 1;
+ return CYG_EXC_CONTINUE_SEARCH;
}
- if (me.andreas)
- me.andreas->leave (); /* Return from a "san" caught fault */
-
- debug_printf ("In cygwin_except_handler exception %p at %p sp %p", e->ExceptionCode, in->Eip, in->Esp);
- debug_printf ("In cygwin_except_handler signal %d at %p", si.si_signo, in->Eip);
-
- DWORD *ebp = (DWORD *) in->Esp;
- for (DWORD *bpend = (DWORD *) __builtin_frame_address (0); ebp > bpend; ebp--)
- if (*ebp == in->SegCs && ebp[-1] == in->Eip)
+ debug_printf ("In cygwin_except_handler exception %y at %p sp %p", e->ExceptionCode, in->_GR(ip), in->_GR(sp));
+ debug_printf ("In cygwin_except_handler signal %d at %p", si.si_signo, in->_GR(ip));
+
+#ifdef __x86_64__
+ PUINT_PTR framep = (PUINT_PTR) in->Rbp;
+ /* Sometimes, when a stack is screwed up, Rbp tends to be NULL. In that
+ case, base the stacktrace on Rsp. In most cases, it allows to generate
+ useful stack trace. */
+ if (!framep)
+ framep = (PUINT_PTR) in->Rsp;
+#else
+ PUINT_PTR framep = (PUINT_PTR) in->_GR(sp);
+ for (PUINT_PTR bpend = (PUINT_PTR) __builtin_frame_address (0); framep > bpend; framep--)
+ if (*framep == in->SegCs && framep[-1] == in->_GR(ip))
{
- ebp -= 2;
+ framep -= 2;
break;
}
@@ -610,6 +718,7 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
We don't want any Windows magic kicking in. This top level frame
will be removed automatically after our exception handler returns. */
_except_list->handler = handle;
+#endif
if (exit_state >= ES_SIGNAL_EXIT
&& (NTSTATUS) e->ExceptionCode != STATUS_CONTROL_C_EXIT)
@@ -619,7 +728,7 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
else
{
debugging = true;
- return 0;
+ return CYG_EXC_CONTINUE_EXECUTION;
}
/* FIXME: Probably should be handled in signal processing code */
@@ -632,19 +741,25 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
error_code |= 2;
if (!me.inside_kernel (in)) /* User space */
error_code |= 4;
- klog (LOG_INFO, "%s[%d]: segfault at %08x rip %08x rsp %08x error %d",
- __progname, myself->pid, e->ExceptionInformation[1],
- in->Eip, in->Esp, error_code);
+ klog (LOG_INFO,
+#ifdef __x86_64__
+ "%s[%d]: segfault at %011X rip %011X rsp %011X error %d",
+#else
+ "%s[%d]: segfault at %08x rip %08x rsp %08x error %d",
+#endif
+ __progname, myself->pid,
+ e->ExceptionInformation[1], in->_GR(ip), in->_GR(sp),
+ error_code);
}
-
- cygwin_exception exc ((DWORD) ebp, in, e);
+ cygwin_exception exc (framep, in, e);
si.si_cyg = (void *) &exc;
- si.si_addr = (void *) in->Eip;
+ si.si_addr = (si.si_signo == SIGSEGV || si.si_signo == SIGBUS)
+ ? (void *) e->ExceptionInformation[1] : (void *) in->_GR(ip);
me.incyg++;
sig_send (NULL, si, &me); /* Signal myself */
me.incyg--;
e->ExceptionFlags = 0;
- return 0;
+ return CYG_EXC_CONTINUE_EXECUTION;
}
/* Utilities to call a user supplied exception handler. */
@@ -664,7 +779,7 @@ handle_sigsuspend (sigset_t tempmask)
sigset_t oldmask = _my_tls.sigmask; // Remember for restoration
set_signal_mask (_my_tls.sigmask, tempmask);
- sigproc_printf ("oldmask %p, newmask %p", oldmask, tempmask);
+ sigproc_printf ("oldmask %ly, newmask %ly", oldmask, tempmask);
pthread_testcancel ();
cygwait (NULL, cw_infinite, cw_cancel | cw_cancel_self | cw_sig_eintr);
@@ -730,16 +845,17 @@ _cygtls::interrupt_now (CONTEXT *cx, siginfo_t& si, void *handler,
interrupted = false;
else
{
- push ((__stack_t) cx->Eip);
+ _ADDR &ip = cx->_GR(ip);
+ push (ip);
interrupt_setup (si, handler, siga);
- cx->Eip = pop ();
+ ip = pop ();
SetThreadContext (*this, cx); /* Restart the thread in a new location */
interrupted = true;
}
return interrupted;
}
-void __stdcall
+void __reg3
_cygtls::interrupt_setup (siginfo_t& si, void *handler, struct sigaction& siga)
{
push ((__stack_t) sigdelayed);
@@ -1050,7 +1166,7 @@ set_process_mask_delta ()
else
oldmask = _my_tls.sigmask;
newmask = (oldmask | _my_tls.deltamask) & ~SIG_NONMASKABLE;
- sigproc_printf ("oldmask %p, newmask %p, deltamask %p", oldmask, newmask,
+ sigproc_printf ("oldmask %lx, newmask %lx, deltamask %lx", oldmask, newmask,
_my_tls.deltamask);
_my_tls.sigmask = newmask;
return oldmask;
@@ -1064,7 +1180,7 @@ set_signal_mask (sigset_t& setmask, sigset_t newmask)
{
newmask &= ~SIG_NONMASKABLE;
sigset_t mask_bits = setmask & ~newmask;
- sigproc_printf ("setmask %p, newmask %p, mask_bits %p", setmask, newmask,
+ sigproc_printf ("setmask %lx, newmask %lx, mask_bits %lx", setmask, newmask,
mask_bits);
setmask = newmask;
if (mask_bits)
@@ -1092,13 +1208,21 @@ signal_exit (int sig, siginfo_t *si)
case SIGTRAP:
case SIGXCPU:
case SIGXFSZ:
+ sig |= 0x80; /* Flag that we've "dumped core" */
if (try_to_debug ())
break;
if (si->si_code != SI_USER && si->si_cyg)
((cygwin_exception *) si->si_cyg)->dumpstack ();
else
{
- cygwin_exception exc (_my_tls.thread_context.ebp);
+ CONTEXT c;
+ c.ContextFlags = CONTEXT_FULL;
+ RtlCaptureContext (&c);
+#ifdef __x86_64__
+ cygwin_exception exc ((PUINT_PTR) _my_tls.thread_context.rbp, &c);
+#else
+ cygwin_exception exc ((PUINT_PTR) _my_tls.thread_context.ebp, &c);
+#endif
exc.dumpstack ();
}
break;
@@ -1107,7 +1231,10 @@ signal_exit (int sig, siginfo_t *si)
lock_process until_exit (true);
if (have_execed || exit_state > ES_PROCESS_LOCKED)
- myself.exit (sig);
+ {
+ debug_printf ("recursive exit?");
+ myself.exit (sig);
+ }
/* Starve other threads in a vain attempt to stop them from doing something
stupid. */
@@ -1126,23 +1253,16 @@ _cygtls::handle_SIGCONT ()
{
myself->stopsig = 0;
myself->process_state &= ~PID_STOPPED;
- int state = 0;
/* Carefully tell sig_handle_tty_stop to wake up. */
- while (state < 2)
- {
- lock ();
- if (sig)
- yield (); /* state <= 1 */
- else if (state)
- state++; /* state == 2 */
- else
- {
- sig = SIGCONT;
- SetEvent (signal_arrived);
- state++; /* state == 1 */
- }
- unlock ();
- }
+ lock ();
+ sig = SIGCONT;
+ SetEvent (signal_arrived);
+ /* Make sure yield doesn't run under lock condition to avoid
+ starvation of sig_handle_tty_stop. */
+ unlock ();
+ /* Wait until sig_handle_tty_stop woke up. */
+ while (sig)
+ yield ();
/* Tell wait_sig to handle any queued signals now that we're alive
again. */
sig_dispatch_pending (false);
@@ -1154,7 +1274,7 @@ _cygtls::handle_SIGCONT ()
sig_clear (SIGTTOU);
}
-int __stdcall
+int __reg1
sigpacket::process ()
{
int rc = 1;
@@ -1200,7 +1320,7 @@ sigpacket::process ()
else
tls = NULL;
}
-
+
/* !tls means no threads available to catch a signal. */
if (!tls)
{
@@ -1350,16 +1470,24 @@ _cygtls::signal_debugger (siginfo_t& si)
else
goto out;
if (incyg)
+#ifdef __x86_64__
+ c.Rip = retaddr ();
+#else
c.Eip = retaddr ();
+#endif
+ memcpy (&thread_context, pc, (&thread_context._internal -
+ (unsigned char *) &thread_context));
}
- memcpy (&thread_context, pc, (&thread_context._internal -
- (unsigned char *) &thread_context));
+#ifdef __x86_64__
+ char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING " ffffffff ffffffffffffffff")];
+#else
char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING " ffffffff ffffffff")];
- __small_sprintf (sigmsg, _CYGWIN_SIGNAL_STRING " %d %p %p", si.si_signo,
+#endif
+ __small_sprintf (sigmsg, _CYGWIN_SIGNAL_STRING " %d %y %p", si.si_signo,
thread_id, &thread_context);
OutputDebugString (sigmsg);
}
out:
- if (th)
- ResumeThread (th);
+ if (th)
+ ResumeThread (th);
}
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index 8734deed3..4dc87bf80 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -113,7 +113,7 @@ fillout_pinfo (pid_t pid, int winpid)
return &ep;
}
-static inline DWORD
+static inline uintptr_t
get_cygdrive_info (char *user, char *system, char *user_flags,
char *system_flags)
{
@@ -122,7 +122,7 @@ get_cygdrive_info (char *user, char *system, char *user_flags,
return (res == ERROR_SUCCESS) ? 1 : 0;
}
-static DWORD
+static bool
check_ntsec (const char *filename)
{
if (!filename)
@@ -200,7 +200,7 @@ exit_process (UINT status, bool useTerminateProcess)
}
-extern "C" unsigned long
+extern "C" uintptr_t
cygwin_internal (cygwin_getinfo_types t, ...)
{
va_list arg;
@@ -218,7 +218,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
break;
case CW_GETTHREADNAME:
- res = (DWORD) cygthread::name (va_arg (arg, DWORD));
+ res = (uintptr_t) cygthread::name (va_arg (arg, DWORD));
break;
case CW_SETTHREADNAME:
@@ -229,11 +229,11 @@ cygwin_internal (cygwin_getinfo_types t, ...)
break;
case CW_GETPINFO:
- res = (DWORD) fillout_pinfo (va_arg (arg, DWORD), 0);
+ res = (uintptr_t) fillout_pinfo (va_arg (arg, DWORD), 0);
break;
case CW_GETVERSIONINFO:
- res = (DWORD) cygwin_version_strings;
+ res = (uintptr_t) cygwin_version_strings;
break;
case CW_READ_V1_MOUNT_TABLES:
@@ -247,7 +247,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
Hilarity ensues if the DLL is not loaded like while the process
is forking. */
__cygwin_user_data.cxx_malloc = &default_cygwin_cxx_malloc;
- res = (DWORD) &__cygwin_user_data;
+ res = (uintptr_t) &__cygwin_user_data;
break;
case CW_PERFILE:
@@ -264,7 +264,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
break;
case CW_GETPINFO_FULL:
- res = (DWORD) fillout_pinfo (va_arg (arg, pid_t), 1);
+ res = (uintptr_t) fillout_pinfo (va_arg (arg, pid_t), 1);
break;
case CW_INIT_EXCEPTIONS:
@@ -299,7 +299,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
else
{
set_errno (ESRCH);
- res = (DWORD) -1;
+ res = (uintptr_t) -1;
}
}
break;
@@ -337,7 +337,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
size_t n;
pid_t pid = va_arg (arg, pid_t);
pinfo p (pid);
- res = (DWORD) p->cmdline (n);
+ res = (uintptr_t) p->cmdline (n);
}
break;
case CW_CHECK_NTSEC:
@@ -406,24 +406,24 @@ cygwin_internal (cygwin_getinfo_types t, ...)
const char *name = va_arg (arg, const char *);
const void *hookfn = va_arg (arg, const void *);
WORD subsys;
- res = (unsigned long) hook_or_detect_cygwin (name, hookfn, subsys);
+ res = (uintptr_t) hook_or_detect_cygwin (name, hookfn, subsys);
}
break;
case CW_ARGV:
{
child_info_spawn *ci = (child_info_spawn *) get_cygwin_startup_info ();
- res = (unsigned long) (ci ? ci->moreinfo->argv : NULL);
+ res = (uintptr_t) (ci ? ci->moreinfo->argv : NULL);
}
break;
case CW_ENVP:
{
child_info_spawn *ci = (child_info_spawn *) get_cygwin_startup_info ();
- res = (unsigned long) (ci ? ci->moreinfo->envp : NULL);
+ res = (uintptr_t) (ci ? ci->moreinfo->envp : NULL);
}
break;
case CW_DEBUG_SELF:
error_start_init (va_arg (arg, const char *));
- try_to_debug ();
+ res = try_to_debug ();
break;
case CW_SYNC_WINENV:
create_winenv (NULL);
diff --git a/winsup/cygwin/fcntl.cc b/winsup/cygwin/fcntl.cc
index d9d27f391..ea9a71a5e 100644
--- a/winsup/cygwin/fcntl.cc
+++ b/winsup/cygwin/fcntl.cc
@@ -1,7 +1,7 @@
/* fcntl.cc: fcntl syscall
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2008, 2009,
- 2010, 2011, 2012 Red Hat, Inc.
+ 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -23,7 +23,7 @@ extern "C" int
fcntl64 (int fd, int cmd, ...)
{
int res = -1;
- void *arg = NULL;
+ intptr_t arg = 0;
va_list args;
pthread_testcancel ();
@@ -37,18 +37,32 @@ fcntl64 (int fd, int cmd, ...)
if (cfd < 0)
goto done;
+ /* FIXME? All numerical args to fcntl are defined as long on Linux.
+ This relies on a really dirty trick on x86_64: A 32 bit mov to
+ a register (e.g. mov $1, %edx) always sets the high 32 bit to 0.
+ We're following the Linux lead here since the third arg to any
+ function is in a register anyway (%r8 in MS ABI). That's the easy
+ case which is covered here by always reading the arg with
+ sizeof (intptr_t) == sizeof (long) == sizeof (void*) which matches
+ all targets.
+
+ However, the POSIX standard defines all numerical args as type int.
+ If we take that literally, we had a (small) problem on 64 bit, since
+ sizeof (void*) != sizeof (int). If we would like to follow POSIX
+ more closely than Linux, we'd have to call va_arg on a per cmd basis. */
+
va_start (args, cmd);
- arg = va_arg (args, void *);
+ arg = va_arg (args, intptr_t);
va_end (args);
switch (cmd)
{
case F_DUPFD:
case F_DUPFD_CLOEXEC:
- if ((int) arg >= 0 && (int) arg < OPEN_MAX_MAX)
+ if (arg >= 0 && arg < OPEN_MAX_MAX)
{
int flags = cmd == F_DUPFD_CLOEXEC ? O_CLOEXEC : 0;
- res = cygheap->fdtab.dup3 (fd, cygheap_fdnew (((int) arg) - 1), flags);
+ res = cygheap->fdtab.dup3 (fd, cygheap_fdnew ((arg) - 1), flags);
}
else
{
@@ -56,38 +70,33 @@ fcntl64 (int fd, int cmd, ...)
res = -1;
}
break;
- case F_GETLK:
- case F_SETLK:
- case F_SETLKW:
- {
- struct __flock64 *fl = (struct __flock64 *) arg;
- fl->l_type &= F_RDLCK | F_WRLCK | F_UNLCK;
- res = cfd->lock (cmd, fl);
- }
- break;
default:
res = cfd->fcntl (cmd, arg);
break;
}
done:
- syscall_printf ("%R = fcntl(%d, %d, %p)", res, fd, cmd, arg);
+ syscall_printf ("%R = fcntl(%d, %d, %ly)", res, fd, cmd, arg);
return res;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (fcntl64, fcntl)
+EXPORT_ALIAS (fcntl64, _fcntl)
+#else
extern "C" int
_fcntl (int fd, int cmd, ...)
{
- void *arg = NULL;
+ intptr_t arg = 0;
va_list args;
struct __flock32 *src = NULL;
- struct __flock64 dst;
+ struct flock dst;
myfault efault;
if (efault.faulted (EFAULT))
return -1;
va_start (args, cmd);
- arg = va_arg (args, void *);
+ arg = va_arg (args, intptr_t);
va_end (args);
if (cmd == F_GETLK || cmd == F_SETLK || cmd == F_SETLKW)
{
@@ -97,7 +106,7 @@ _fcntl (int fd, int cmd, ...)
dst.l_start = src->l_start;
dst.l_len = src->l_len;
dst.l_pid = src->l_pid;
- arg = &dst;
+ arg = (intptr_t) &dst;
}
int res = fcntl64 (fd, cmd, arg);
if (cmd == F_GETLK)
@@ -110,4 +119,4 @@ _fcntl (int fd, int cmd, ...)
}
return res;
}
-
+#endif
diff --git a/winsup/cygwin/fenv.cc b/winsup/cygwin/fenv.cc
index 66513e9d2..5443681f9 100755
--- a/winsup/cygwin/fenv.cc
+++ b/winsup/cygwin/fenv.cc
@@ -421,8 +421,7 @@ _feinitialise (void)
/* Check for presence of SSE: invoke CPUID #1, check EDX bit 25. */
eax = 1;
__asm__ volatile ("cpuid" : "=d" (edx), "+a" (eax) :: "%ecx", "%ebx");
- /* If this flag isn't set, or if the OS doesn't support SSE (NT4, at least
- up to SP4) we'll avoid trying to execute any SSE. */
+ /* If this flag isn't set we'll avoid trying to execute any SSE. */
if ((edx & (1 << 25)) != 0)
use_sse = true;
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index ab4048b13..6c284a596 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -190,9 +190,9 @@ fhandler_base::set_flags (int flags, int supplied_bin)
{
int bin;
int fmode;
- debug_printf ("flags %p, supplied_bin %p", flags, supplied_bin);
+ debug_printf ("flags %y, supplied_bin %y", flags, supplied_bin);
if ((bin = flags & (O_BINARY | O_TEXT)))
- debug_printf ("O_TEXT/O_BINARY set in flags %p", bin);
+ debug_printf ("O_TEXT/O_BINARY set in flags %y", bin);
else if (rbinset () && wbinset ())
bin = rbinary () ? O_BINARY : O_TEXT; // FIXME: Not quite right
else if ((fmode = get_default_fmode (flags)) & O_BINARY)
@@ -216,35 +216,37 @@ fhandler_base::set_flags (int flags, int supplied_bin)
/* Cover function to ReadFile to achieve (as much as possible) Posix style
semantics and use of errno. */
-void __stdcall
-fhandler_base::raw_read (void *ptr, size_t& ulen)
+void __reg3
+fhandler_base::raw_read (void *ptr, size_t& len)
{
-#define bytes_read ulen
-
+ NTSTATUS status;
+ IO_STATUS_BLOCK io;
int try_noreserve = 1;
- DWORD len = ulen;
retry:
- ulen = (size_t) -1;
- BOOL res = ReadFile (get_handle (), ptr, len, (DWORD *) &ulen, NULL);
- if (!res)
+ status = NtReadFile (get_handle (), NULL, NULL, NULL, &io, ptr, len,
+ NULL, NULL);
+ if (NT_SUCCESS (status))
+ len = io.Information;
+ else
{
/* Some errors are not really errors. Detect such cases here. */
-
- DWORD errcode = GetLastError ();
- switch (errcode)
+ switch (status)
{
- case ERROR_BROKEN_PIPE:
+ case STATUS_END_OF_FILE:
+ case STATUS_PIPE_BROKEN:
/* This is really EOF. */
- bytes_read = 0;
+ len = 0;
break;
- case ERROR_MORE_DATA:
- /* `bytes_read' is supposedly valid. */
+ case STATUS_MORE_ENTRIES:
+ case STATUS_BUFFER_OVERFLOW:
+ /* `io.Information' is supposedly valid. */
+ len = io.Information;
break;
- case ERROR_NOACCESS:
+ case STATUS_ACCESS_VIOLATION:
if (is_at_eof (get_handle ()))
{
- bytes_read = 0;
+ len = 0;
break;
}
if (try_noreserve)
@@ -261,28 +263,26 @@ retry:
}
}
/*FALLTHRU*/
- case ERROR_INVALID_FUNCTION:
- case ERROR_INVALID_PARAMETER:
- case ERROR_INVALID_HANDLE:
+ case STATUS_INVALID_DEVICE_REQUEST:
+ case STATUS_INVALID_PARAMETER:
+ case STATUS_INVALID_HANDLE:
if (pc.isdir ())
{
set_errno (EISDIR);
- bytes_read = (size_t) -1;
+ len = (size_t) -1;
break;
}
default:
- syscall_printf ("ReadFile %s(%p) failed, %E", get_name (), get_handle ());
- __seterrno_from_win_error (errcode);
- bytes_read = (size_t) -1;
+ __seterrno_from_nt_status (status);
+ len = (size_t) -1;
break;
}
}
-#undef bytes_read
}
/* Cover function to WriteFile to provide Posix interface and semantics
(as much as possible). */
-ssize_t __stdcall
+ssize_t __reg3
fhandler_base::raw_write (const void *ptr, size_t len)
{
NTSTATUS status;
@@ -388,7 +388,7 @@ fhandler_base::fhaccess (int flags, bool effective)
return res;
}
- struct __stat64 st;
+ struct stat st;
if (fstat (&st))
goto done;
@@ -516,7 +516,7 @@ fhandler_base::open (int flags, mode_t mode)
PFILE_FULL_EA_INFORMATION p = NULL;
ULONG plen = 0;
- syscall_printf ("(%S, %p)", pc.get_nt_native_path (), flags);
+ syscall_printf ("(%S, %y)", pc.get_nt_native_path (), flags);
pc.get_object_attr (attr, *sec_none_cloexec (flags));
@@ -586,11 +586,10 @@ fhandler_base::open (int flags, mode_t mode)
}
}
- /* Starting with Windows 2000, when trying to overwrite an already
- existing file with FILE_ATTRIBUTE_HIDDEN and/or FILE_ATTRIBUTE_SYSTEM
- attribute set, CreateFile fails with ERROR_ACCESS_DENIED.
- Per MSDN you have to create the file with the same attributes as
- already specified for the file. */
+ /* Trying to overwrite an already existing file with FILE_ATTRIBUTE_HIDDEN
+ and/or FILE_ATTRIBUTE_SYSTEM attribute set, NtCreateFile fails with
+ STATUS_ACCESS_DENIED. Per MSDN you have to create the file with the
+ same attributes as already specified for the file. */
if (((flags & O_CREAT) || create_disposition == FILE_OVERWRITE)
&& has_attribute (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))
file_attributes |= pc.file_attributes ();
@@ -705,12 +704,12 @@ fhandler_base::open (int flags, mode_t mode)
res = 1;
set_open_status ();
done:
- debug_printf ("%x = NtCreateFile "
- "(%p, %x, %S, io, NULL, %x, %x, %x, %x, NULL, 0)",
+ debug_printf ("%y = NtCreateFile "
+ "(%p, %y, %S, io, NULL, %y, %y, %y, %y, NULL, 0)",
status, fh, access, pc.get_nt_native_path (), file_attributes,
shared, create_disposition, options);
- syscall_printf ("%d = fhandler_base::open(%S, %p)",
+ syscall_printf ("%d = fhandler_base::open(%S, %y)",
res, pc.get_nt_native_path (), flags);
return res;
}
@@ -723,32 +722,19 @@ done:
an \n. If last char is an \r, look ahead one more char, if \n then
modify \r, if not, remember char.
*/
-void __stdcall
+void __reg3
fhandler_base::read (void *in_ptr, size_t& len)
{
char *ptr = (char *) in_ptr;
ssize_t copied_chars = get_readahead_into_buffer (ptr, len);
- if (copied_chars)
+ if (copied_chars || !len)
{
len = (size_t) copied_chars;
goto out;
}
- len -= copied_chars;
- if (!len)
- {
- len = (size_t) copied_chars;
- goto out;
- }
-
- raw_read (ptr + copied_chars, len);
- if (!copied_chars)
- /* nothing */;
- else if ((ssize_t) len > 0)
- len += copied_chars;
- else
- len = copied_chars;
+ raw_read (ptr, len);
if (rbinary () || (ssize_t) len <= 0)
goto out;
@@ -791,24 +777,6 @@ fhandler_base::read (void *in_ptr, size_t& len)
len = dst - (char *) ptr;
-#ifndef NOSTRACE
- if (strace.active ())
- {
- char buf[16 * 6 + 1];
- char *p = buf;
-
- for (int i = 0; i < copied_chars && i < 16; ++i)
- {
- unsigned char c = ((unsigned char *) ptr)[i];
- __small_sprintf (p, " %c", c);
- p += strlen (p);
- }
- *p = '\0';
- debug_printf ("read %d bytes (%s%s)", copied_chars, buf,
- copied_chars > 16 ? " ..." : "");
- }
-#endif
-
out:
debug_printf ("returning %d, %s mode", len, rbinary () ? "binary" : "text");
}
@@ -846,7 +814,7 @@ fhandler_base::write (const void *ptr, size_t len)
if (NT_SUCCESS (status))
pc.file_attributes (pc.file_attributes ()
| FILE_ATTRIBUTE_SPARSE_FILE);
- debug_printf ("%p = NtFsControlFile(%S, FSCTL_SET_SPARSE)",
+ debug_printf ("%y = NtFsControlFile(%S, FSCTL_SET_SPARSE)",
status, pc.get_nt_native_path ());
}
}
@@ -1018,8 +986,8 @@ fhandler_base::writev (const struct iovec *const iov, const int iovcnt,
return ret;
}
-_off64_t
-fhandler_base::lseek (_off64_t offset, int whence)
+off_t
+fhandler_base::lseek (off_t offset, int whence)
{
NTSTATUS status;
IO_STATUS_BLOCK io;
@@ -1071,7 +1039,7 @@ fhandler_base::lseek (_off64_t offset, int whence)
__seterrno_from_nt_status (status);
return -1;
}
- _off64_t res = fpi.CurrentByteOffset.QuadPart;
+ off_t res = fpi.CurrentByteOffset.QuadPart;
/* When next we write(), we will check to see if *this* seek went beyond
the end of the file and if so, potentially sparsify the file. */
@@ -1087,15 +1055,15 @@ fhandler_base::lseek (_off64_t offset, int whence)
return res;
}
-ssize_t __stdcall
-fhandler_base::pread (void *, size_t, _off64_t)
+ssize_t __reg3
+fhandler_base::pread (void *, size_t, off_t)
{
set_errno (ESPIPE);
return -1;
}
-ssize_t __stdcall
-fhandler_base::pwrite (void *, size_t, _off64_t)
+ssize_t __reg3
+fhandler_base::pwrite (void *, size_t, off_t)
{
set_errno (ESPIPE);
return -1;
@@ -1262,15 +1230,8 @@ fhandler_base::ioctl (unsigned int cmd, void *buf)
return res;
}
-int
-fhandler_base::lock (int, struct __flock64 *)
-{
- set_errno (EINVAL);
- return -1;
-}
-
int __reg2
-fhandler_base::fstat (struct __stat64 *buf)
+fhandler_base::fstat (struct stat *buf)
{
if (is_fs_special ())
return fstat_fs (buf);
@@ -1310,7 +1271,7 @@ fhandler_base::fstat (struct __stat64 *buf)
return 0;
}
-int __stdcall
+int __reg2
fhandler_base::fstatvfs (struct statvfs *sfs)
{
/* If we hit this base implementation, it's some device in /dev.
@@ -1351,7 +1312,7 @@ fhandler_base::dup (fhandler_base *child, int)
GetCurrentProcess (), &nh,
0, TRUE, DUPLICATE_SAME_ACCESS))
{
- debug_printf ("dup(%s) failed, handle %x, %E",
+ debug_printf ("dup(%s) failed, handle %p, %E",
get_name (), get_handle ());
__seterrno ();
return -1;
@@ -1371,7 +1332,7 @@ fhandler_base_overlapped::dup (fhandler_base *child, int flags)
return res;
}
-int fhandler_base::fcntl (int cmd, void *arg)
+int fhandler_base::fcntl (int cmd, intptr_t arg)
{
int res;
@@ -1381,12 +1342,12 @@ int fhandler_base::fcntl (int cmd, void *arg)
res = close_on_exec () ? FD_CLOEXEC : 0;
break;
case F_SETFD:
- set_close_on_exec (((int) arg & FD_CLOEXEC) ? 1 : 0);
+ set_close_on_exec ((arg & FD_CLOEXEC) ? 1 : 0);
res = 0;
break;
case F_GETFL:
res = get_flags ();
- debug_printf ("GETFL: %p", res);
+ debug_printf ("GETFL: %y", res);
break;
case F_SETFL:
{
@@ -1395,7 +1356,7 @@ int fhandler_base::fcntl (int cmd, void *arg)
Since O_ASYNC isn't defined in fcntl.h it's currently
ignored as well. */
const int allowed_flags = O_APPEND | O_NONBLOCK_MASK;
- int new_flags = (int) arg & allowed_flags;
+ int new_flags = arg & allowed_flags;
/* Carefully test for the O_NONBLOCK or deprecated OLD_O_NDELAY flag.
Set only the flag that has been passed in. If both are set, just
record O_NONBLOCK. */
@@ -1585,6 +1546,7 @@ fhandler_base::fixup_after_exec ()
debug_printf ("here for '%s'", get_name ());
if (unique_id && close_on_exec ())
del_my_locks (after_exec);
+ mandatory_locking (false);
}
void
fhandler_base_overlapped::fixup_after_exec ()
@@ -1679,7 +1641,7 @@ fhandler_base::fchmod (mode_t mode)
}
int
-fhandler_base::fchown (__uid32_t uid, __gid32_t gid)
+fhandler_base::fchown (uid_t uid, gid_t gid)
{
if (pc.is_fs_special ())
return ((fhandler_disk_file *) this)->fhandler_disk_file::fchown (uid, gid);
@@ -1688,7 +1650,7 @@ fhandler_base::fchown (__uid32_t uid, __gid32_t gid)
}
int
-fhandler_base::facl (int cmd, int nentries, __aclent32_t *aclbufp)
+fhandler_base::facl (int cmd, int nentries, aclent_t *aclbufp)
{
int res = -1;
switch (cmd)
@@ -1745,14 +1707,14 @@ fhandler_base::fsetxattr (const char *name, const void *value, size_t size,
}
int
-fhandler_base::fadvise (_off64_t offset, _off64_t length, int advice)
+fhandler_base::fadvise (off_t offset, off_t length, int advice)
{
set_errno (EINVAL);
return -1;
}
int
-fhandler_base::ftruncate (_off64_t length, bool allow_truncate)
+fhandler_base::ftruncate (off_t length, bool allow_truncate)
{
set_errno (EINVAL);
return -1;
@@ -1966,7 +1928,7 @@ fhandler_base_overlapped::wait_overlapped (bool inres, bool writing, DWORD *byte
wores = GetOverlappedResult (h, get_overlapped (), bytes, false);
err = GetLastError ();
ResetEvent (get_overlapped ()->hEvent); /* Probably not needed but CYA */
- debug_printf ("wfres %d, wores %d, bytes %u", wfres, wores, *bytes);
+ debug_printf ("wfres %u, wores %d, bytes %u", wfres, wores, *bytes);
if (wores)
res = overlapped_success; /* operation succeeded */
else if (wfres == WAIT_OBJECT_0 + 1)
@@ -1981,7 +1943,7 @@ fhandler_base_overlapped::wait_overlapped (bool inres, bool writing, DWORD *byte
res = overlapped_nonblocking_no_data; /* more handling below */
else
{
- debug_printf ("GetOverLappedResult failed, h %p, bytes %u, %E", h, *bytes);
+ debug_printf ("GetOverlappedResult failed, h %p, bytes %u, %E", h, *bytes);
res = overlapped_error;
}
}
@@ -2041,7 +2003,7 @@ fhandler_base_overlapped::raw_read (void *ptr, size_t& len)
}
}
while (keep_looping);
- len = (size_t) nbytes;
+ len = (nbytes == (DWORD) -1) ? (size_t) -1 : (size_t) nbytes;
}
ssize_t __reg3
@@ -2051,13 +2013,13 @@ fhandler_base_overlapped::raw_write (const void *ptr, size_t len)
if (has_ongoing_io ())
{
set_errno (EAGAIN);
- nbytes = (DWORD) -1;
+ nbytes = (size_t) -1;
}
else
{
size_t chunk;
if (!max_atomic_write || len < max_atomic_write)
- chunk = len;
+ chunk = MIN (len, INT_MAX);
else if (is_nonblocking ())
chunk = len = max_atomic_write;
else
@@ -2065,7 +2027,7 @@ fhandler_base_overlapped::raw_write (const void *ptr, size_t len)
nbytes = 0;
DWORD nbytes_now = 0;
- /* Write to fd in smaller chunks, accumlating a total.
+ /* Write to fd in smaller chunks, accumulating a total.
If there's an error, just return the accumulated total
unless the first write fails, in which case return value
from wait_overlapped(). */
@@ -2095,7 +2057,7 @@ fhandler_base_overlapped::raw_write (const void *ptr, size_t len)
}
}
if (!nbytes)
- nbytes = nbytes_now;
+ nbytes = (nbytes_now == (DWORD) -1) ? (size_t) -1 : nbytes_now;
}
return nbytes;
}
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index d6c1cf656..f5e4bc0d6 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -55,7 +55,7 @@ class inode_t;
typedef struct __DIR DIR;
struct dirent;
struct iovec;
-struct __acl32;
+struct acl;
enum dirent_states
{
@@ -147,12 +147,13 @@ class fhandler_base
unsigned close_on_exec : 1; /* close-on-exec */
unsigned need_fork_fixup : 1; /* Set if need to fixup after fork. */
unsigned isclosed : 1; /* Set when fhandler is closed. */
+ unsigned mandatory_locking : 1; /* Windows mandatory locking */
public:
status_flags () :
rbinary (0), rbinset (0), wbinary (0), wbinset (0), nohandle (0),
did_lseek (0), query_open (no_query), close_on_exec (0),
- need_fork_fixup (0), isclosed (0)
+ need_fork_fixup (0), isclosed (0), mandatory_locking (0)
{}
} status, open_status;
@@ -162,8 +163,8 @@ class fhandler_base
HANDLE io_handle;
- __ino64_t ino; /* file ID or hashed filename, depends on FS. */
- long _refcnt;
+ ino_t ino; /* file ID or hashed filename, depends on FS. */
+ LONG _refcnt;
protected:
/* File open flags from open () and fcntl () calls */
@@ -182,8 +183,8 @@ class fhandler_base
HANDLE read_state;
public:
- long inc_refcnt () {return InterlockedIncrement (&_refcnt);}
- long dec_refcnt () {return InterlockedDecrement (&_refcnt);}
+ LONG inc_refcnt () {return InterlockedIncrement (&_refcnt);}
+ LONG dec_refcnt () {return InterlockedDecrement (&_refcnt);}
class fhandler_base *archetype;
int usecount;
@@ -209,10 +210,9 @@ class fhandler_base
/* Non-virtual simple accessor functions. */
void set_io_handle (HANDLE x) { io_handle = x; }
- DWORD& get_device () { return dev (); }
- DWORD get_major () { return dev ().get_major (); }
- DWORD get_minor () { return dev ().get_minor (); }
- virtual int get_unit () { return dev ().get_minor (); }
+ dev_t& get_device () { return dev (); }
+ _major_t get_major () { return dev ().get_major (); }
+ _minor_t get_minor () { return dev ().get_minor (); }
ACCESS_MASK get_access () const { return access; }
void set_access (ACCESS_MASK x) { access = x; }
@@ -248,6 +248,7 @@ class fhandler_base
IMPLEMENT_STATUS_FLAG (bool, close_on_exec)
IMPLEMENT_STATUS_FLAG (bool, need_fork_fixup)
IMPLEMENT_STATUS_FLAG (bool, isclosed)
+ IMPLEMENT_STATUS_FLAG (bool, mandatory_locking)
int get_default_fmode (int flags);
@@ -295,8 +296,8 @@ class fhandler_base
bool has_attribute (DWORD x) const {return pc.has_attribute (x);}
const char *get_name () const { return pc.normalized_path; }
const char *get_win32_name () { return pc.get_win32 (); }
- __dev32_t get_dev () { return pc.fs_serial_number (); }
- __ino64_t get_ino () { return ino ?: ino = hash_path_name (0, pc.get_nt_native_path ()); }
+ dev_t get_dev () { return pc.fs_serial_number (); }
+ ino_t get_ino () { return ino ?: ino = hash_path_name (0, pc.get_nt_native_path ()); }
long long get_unique_id () const { return unique_id; }
/* Returns name used for /proc/<pid>/fd in buf. */
virtual char *get_proc_fd_name (char *buf);
@@ -328,48 +329,49 @@ class fhandler_base
int open_fs (int, mode_t = 0);
# define archetype_usecount(n) _archetype_usecount (__PRETTY_FUNCTION__, __LINE__, (n))
int close_fs () { return fhandler_base::close (); }
- virtual int __reg2 fstat (struct __stat64 *buf);
- void __reg2 stat_fixup (struct __stat64 *buf);
- int __reg2 fstat_fs (struct __stat64 *buf);
+ virtual int __reg2 fstat (struct stat *buf);
+ void __reg2 stat_fixup (struct stat *buf);
+ int __reg2 fstat_fs (struct stat *buf);
private:
- int __reg3 fstat_helper (struct __stat64 *buf,
+ int __reg3 fstat_helper (struct stat *buf,
DWORD nNumberOfLinks);
- int __reg2 fstat_by_nfs_ea (struct __stat64 *buf);
- int __reg2 fstat_by_handle (struct __stat64 *buf);
- int __reg2 fstat_by_name (struct __stat64 *buf);
+ int __reg2 fstat_by_nfs_ea (struct stat *buf);
+ int __reg2 fstat_by_handle (struct stat *buf);
+ int __reg2 fstat_by_name (struct stat *buf);
public:
virtual int __reg2 fstatvfs (struct statvfs *buf);
int __reg2 utimens_fs (const struct timespec *);
virtual int __reg1 fchmod (mode_t mode);
- virtual int __reg2 fchown (__uid32_t uid, __gid32_t gid);
- virtual int __reg3 facl (int, int, __acl32 *);
+ virtual int __reg2 fchown (uid_t uid, gid_t gid);
+ virtual int __reg3 facl (int, int, struct acl *);
virtual ssize_t __reg3 fgetxattr (const char *, void *, size_t);
virtual int __reg3 fsetxattr (const char *, const void *, size_t, int);
- virtual int __reg3 fadvise (_off64_t, _off64_t, int);
- virtual int __reg3 ftruncate (_off64_t, bool);
+ virtual int __reg3 fadvise (off_t, off_t, int);
+ virtual int __reg3 ftruncate (off_t, bool);
virtual int __reg2 link (const char *);
virtual int __reg2 utimens (const struct timespec *);
virtual int __reg1 fsync ();
virtual int ioctl (unsigned int cmd, void *);
- virtual int fcntl (int cmd, void *);
+ virtual int fcntl (int cmd, intptr_t);
virtual char const *ttyname () { return get_name (); }
virtual void __reg3 read (void *ptr, size_t& len);
virtual ssize_t __stdcall write (const void *ptr, size_t len);
virtual ssize_t __stdcall readv (const struct iovec *, int iovcnt, ssize_t tot = -1);
virtual ssize_t __stdcall writev (const struct iovec *, int iovcnt, ssize_t tot = -1);
- virtual ssize_t __reg3 pread (void *, size_t, _off64_t);
- virtual ssize_t __reg3 pwrite (void *, size_t, _off64_t);
- virtual _off64_t lseek (_off64_t offset, int whence);
- virtual int lock (int, struct __flock64 *);
+ virtual ssize_t __reg3 pread (void *, size_t, off_t);
+ virtual ssize_t __reg3 pwrite (void *, size_t, off_t);
+ virtual off_t lseek (off_t offset, int whence);
+ virtual int lock (int, struct flock *);
+ virtual int mand_lock (int, struct flock *);
virtual int dup (fhandler_base *child, int flags);
virtual int fpathconf (int);
virtual HANDLE mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off);
+ int flags, off_t off);
virtual int munmap (HANDLE h, caddr_t addr, size_t len);
virtual int msync (HANDLE h, caddr_t addr, size_t len, int flags);
virtual bool fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
+ off_t offset, DWORD size,
void *address);
void *operator new (size_t, void *p) __attribute__ ((nothrow)) {return p;}
@@ -480,12 +482,12 @@ class fhandler_socket: public fhandler_base
int wait_for_events (const long event_mask, const DWORD flags);
void release_events ();
- pid_t sec_pid;
- __uid32_t sec_uid;
- __gid32_t sec_gid;
- pid_t sec_peer_pid;
- __uid32_t sec_peer_uid;
- __gid32_t sec_peer_gid;
+ pid_t sec_pid;
+ uid_t sec_uid;
+ gid_t sec_gid;
+ pid_t sec_peer_pid;
+ uid_t sec_peer_uid;
+ gid_t sec_peer_gid;
void af_local_set_secret (char *);
void af_local_setblocking (bool &, bool &);
void af_local_unsetblocking (bool, bool);
@@ -536,7 +538,14 @@ class fhandler_socket: public fhandler_base
public:
fhandler_socket ();
~fhandler_socket ();
- int get_socket () { return (int) get_handle(); }
+/* Originally get_socket returned an int, which is not a good idea
+ to cast a handle to on 64 bit. The right type here is very certainly
+ SOCKET instead. On the other hand, we don't want to have to include
+ winsock.h just to build fhandler.h. Therefore we define get_socket
+ now only when building network related code. */
+#ifdef __INSIDE_CYGWIN_NET__
+ SOCKET get_socket () { return (SOCKET) get_handle(); }
+#endif
fhandler_socket *is_socket () { return this; }
IMPLEMENT_STATUS_FLAG (bool, async_io)
@@ -552,7 +561,7 @@ class fhandler_socket: public fhandler_base
int accept4 (struct sockaddr *peer, int *len, int flags);
int getsockname (struct sockaddr *name, int *namelen);
int getpeername (struct sockaddr *name, int *namelen);
- int getpeereid (pid_t *pid, __uid32_t *euid, __gid32_t *egid);
+ int getpeereid (pid_t *pid, uid_t *euid, gid_t *egid);
int open (int flags, mode_t mode = 0);
void __reg3 read (void *ptr, size_t& len);
@@ -570,8 +579,8 @@ class fhandler_socket: public fhandler_base
ssize_t sendmsg (const struct msghdr *msg, int flags);
int ioctl (unsigned int cmd, void *);
- int fcntl (int cmd, void *);
- _off64_t lseek (_off64_t, int) { return 0; }
+ int fcntl (int cmd, intptr_t);
+ off_t lseek (off_t, int) { return 0; }
int shutdown (int how);
int close ();
void hclose (HANDLE) {close ();}
@@ -595,11 +604,11 @@ class fhandler_socket: public fhandler_base
void set_peer_sun_path (const char *path);
char *get_peer_sun_path () {return peer_sun_path;}
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
int __reg2 fstatvfs (struct statvfs *buf);
int __reg1 fchmod (mode_t mode);
- int __reg2 fchown (__uid32_t uid, __gid32_t gid);
- int __reg3 facl (int, int, __acl32 *);
+ int __reg2 fchown (uid_t uid, gid_t gid);
+ int __reg3 facl (int, int, struct acl *);
int __reg2 link (const char *);
fhandler_socket (void *) {}
@@ -693,7 +702,7 @@ public:
void set_popen_pid (pid_t pid) {popen_pid = pid;}
pid_t get_popen_pid () const {return popen_pid;}
- _off64_t lseek (_off64_t offset, int whence);
+ off_t lseek (off_t offset, int whence);
select_record *select_read (select_stuff *);
select_record *select_write (select_stuff *);
select_record *select_except (select_stuff *);
@@ -702,8 +711,8 @@ public:
int dup (fhandler_base *child, int);
int ioctl (unsigned int cmd, void *);
int __reg2 fstatvfs (struct statvfs *buf);
- int __reg3 fadvise (_off64_t, _off64_t, int);
- int __reg3 ftruncate (_off64_t, bool);
+ int __reg3 fadvise (off_t, off_t, int);
+ int __reg3 ftruncate (off_t, bool);
int init (HANDLE, DWORD, mode_t);
static int create (fhandler_pipe *[2], unsigned, int);
static DWORD create (LPSECURITY_ATTRIBUTES, HANDLE *, HANDLE *, DWORD,
@@ -770,7 +779,7 @@ class fhandler_mailslot : public fhandler_base_overlapped
POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &, PUNICODE_STRING, int);
public:
fhandler_mailslot ();
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
int open (int flags, mode_t mode = 0);
ssize_t __reg3 raw_write (const void *, size_t);
int ioctl (unsigned int cmd, void *);
@@ -799,10 +808,10 @@ class fhandler_dev_raw: public fhandler_base
protected:
char *devbufalloc;
char *devbuf;
- size_t devbufalign;
- size_t devbufsiz;
- size_t devbufstart;
- size_t devbufend;
+ DWORD devbufalign;
+ DWORD devbufsiz;
+ DWORD devbufstart;
+ DWORD devbufend;
struct status_flags
{
unsigned lastblk_to_read : 1;
@@ -819,7 +828,7 @@ class fhandler_dev_raw: public fhandler_base
int open (int flags, mode_t mode = 0);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
int dup (fhandler_base *child, int);
int ioctl (unsigned int cmd, void *buf);
@@ -856,7 +865,7 @@ struct part_t
class fhandler_dev_floppy: public fhandler_dev_raw
{
private:
- _off64_t drive_size;
+ off_t drive_size;
part_t *partitions;
struct status_flags
{
@@ -867,7 +876,7 @@ class fhandler_dev_floppy: public fhandler_dev_raw
IMPLEMENT_STATUS_FLAG (bool, eom_detected)
- inline _off64_t get_current_position ();
+ inline off_t get_current_position ();
int get_drive_info (struct hd_geometry *geo);
int lock_partition (DWORD to_write);
@@ -883,7 +892,7 @@ class fhandler_dev_floppy: public fhandler_dev_raw
int dup (fhandler_base *child, int);
void __reg3 raw_read (void *ptr, size_t& ulen);
ssize_t __reg3 raw_write (const void *ptr, size_t ulen);
- _off64_t lseek (_off64_t offset, int whence);
+ off_t lseek (off_t offset, int whence);
int ioctl (unsigned int cmd, void *buf);
fhandler_dev_floppy (void *) {}
@@ -907,7 +916,7 @@ class fhandler_dev_floppy: public fhandler_dev_raw
class fhandler_dev_tape: public fhandler_dev_raw
{
HANDLE mt_mtx;
- HANDLE mt_evt;
+ OVERLAPPED ov;
bool is_rewind_device () { return get_minor () < 128; }
unsigned int driveno () { return (unsigned int) get_minor () & 0x7f; }
@@ -925,9 +934,9 @@ class fhandler_dev_tape: public fhandler_dev_raw
void __reg3 raw_read (void *ptr, size_t& ulen);
ssize_t __reg3 raw_write (const void *ptr, size_t ulen);
- virtual _off64_t lseek (_off64_t offset, int whence);
+ virtual off_t lseek (off_t offset, int whence);
- virtual int __reg2 fstat (struct __stat64 *buf);
+ virtual int __reg2 fstat (struct stat *buf);
virtual int dup (fhandler_base *child, int);
virtual void fixup_after_fork (HANDLE parent);
@@ -967,27 +976,29 @@ class fhandler_disk_file: public fhandler_base
int open (int flags, mode_t mode);
int close ();
+ int fcntl (int cmd, intptr_t);
int dup (fhandler_base *child, int);
void fixup_after_fork (HANDLE parent);
- int lock (int, struct __flock64 *);
+ int lock (int, struct flock *);
+ int mand_lock (int, struct flock *);
bool isdevice () const { return false; }
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
int __reg1 fchmod (mode_t mode);
- int __reg2 fchown (__uid32_t uid, __gid32_t gid);
- int __reg3 facl (int, int, __acl32 *);
+ int __reg2 fchown (uid_t uid, gid_t gid);
+ int __reg3 facl (int, int, struct acl *);
ssize_t __reg3 fgetxattr (const char *, void *, size_t);
int __reg3 fsetxattr (const char *, const void *, size_t, int);
- int __reg3 fadvise (_off64_t, _off64_t, int);
- int __reg3 ftruncate (_off64_t, bool);
+ int __reg3 fadvise (off_t, off_t, int);
+ int __reg3 ftruncate (off_t, bool);
int __reg2 link (const char *);
int __reg2 utimens (const struct timespec *);
int __reg2 fstatvfs (struct statvfs *buf);
- HANDLE mmap (caddr_t *addr, size_t len, int prot, int flags, _off64_t off);
+ HANDLE mmap (caddr_t *addr, size_t len, int prot, int flags, off_t off);
int munmap (HANDLE h, caddr_t addr, size_t len);
int msync (HANDLE h, caddr_t addr, size_t len, int flags);
bool fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size, void *address);
+ off_t offset, DWORD size, void *address);
int mkdir (mode_t mode);
int rmdir ();
DIR __reg2 *opendir (int fd);
@@ -997,8 +1008,8 @@ class fhandler_disk_file: public fhandler_base
void rewinddir (DIR *);
int closedir (DIR *);
- ssize_t __reg3 pread (void *, size_t, _off64_t);
- ssize_t __reg3 pwrite (void *, size_t, _off64_t);
+ ssize_t __reg3 pread (void *, size_t, off_t);
+ ssize_t __reg3 pwrite (void *, size_t, off_t);
fhandler_disk_file (void *) {}
@@ -1026,7 +1037,7 @@ public:
fhandler_dev ();
int open (int flags, mode_t mode);
int close ();
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
int __reg2 fstatvfs (struct statvfs *buf);
DIR __reg2 *opendir (int fd);
int __reg3 readdir (DIR *, dirent *);
@@ -1068,7 +1079,7 @@ class fhandler_cygdrive: public fhandler_disk_file
int __reg3 readdir (DIR *, dirent *);
void rewinddir (DIR *);
int closedir (DIR *);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
int __reg2 fstatvfs (struct statvfs *buf);
fhandler_cygdrive (void *) {}
@@ -1120,7 +1131,7 @@ class fhandler_serial: public fhandler_base
int switch_modem_lines (int set, int clr);
int tcsetattr (int a, const struct termios *t);
int tcgetattr (struct termios *t);
- _off64_t lseek (_off64_t, int) { return 0; }
+ off_t lseek (off_t, int) { return 0; }
int tcflush (int);
bool is_tty () const { return true; }
void fixup_after_fork (HANDLE parent);
@@ -1190,7 +1201,7 @@ class fhandler_termios: public fhandler_base
virtual DWORD __acquire_output_mutex (const char *fn, int ln, DWORD ms) {return 1;}
virtual void __release_output_mutex (const char *fn, int ln) {}
void echo_erase (int force = 0);
- virtual _off64_t lseek (_off64_t, int);
+ virtual off_t lseek (off_t, int);
pid_t tcgetsid ();
fhandler_termios (void *) {}
@@ -1438,7 +1449,7 @@ class fhandler_pty_common: public fhandler_termios
void __release_output_mutex (const char *fn, int ln);
int close ();
- _off64_t lseek (_off64_t, int);
+ off_t lseek (off_t, int);
bool bytes_available (DWORD& n);
void set_close_on_exec (bool val);
select_record *select_read (select_stuff *);
@@ -1493,11 +1504,10 @@ class fhandler_pty_slave: public fhandler_pty_common
void fixup_after_exec ();
select_record *select_read (select_stuff *);
- int get_unit ();
virtual char const *ttyname () { return pc.dev.name; }
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
int __reg1 fchmod (mode_t mode);
- int __reg2 fchown (__uid32_t uid, __gid32_t gid);
+ int __reg2 fchown (uid_t uid, gid_t gid);
fhandler_pty_slave (void *) {}
@@ -1611,14 +1621,14 @@ class fhandler_dev_zero: public fhandler_base
int open (int flags, mode_t mode = 0);
ssize_t __stdcall write (const void *ptr, size_t len);
void __reg3 read (void *ptr, size_t& len);
- _off64_t lseek (_off64_t offset, int whence);
+ off_t lseek (off_t offset, int whence);
virtual HANDLE mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off);
+ int flags, off_t off);
virtual int munmap (HANDLE h, caddr_t addr, size_t len);
virtual int msync (HANDLE h, caddr_t addr, size_t len, int flags);
virtual bool fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
+ off_t offset, DWORD size,
void *address);
fhandler_dev_zero (void *) {}
@@ -1643,8 +1653,8 @@ class fhandler_dev_random: public fhandler_base
{
protected:
HCRYPTPROV crypt_prov;
- long pseudo;
- _off64_t dummy_offset;
+ uint32_t pseudo;
+ off_t dummy_offset;
bool crypt_gen_random (void *ptr, size_t len);
int pseudo_write (const void *ptr, size_t len);
@@ -1655,7 +1665,7 @@ class fhandler_dev_random: public fhandler_base
int open (int flags, mode_t mode = 0);
ssize_t __stdcall write (const void *ptr, size_t len);
void __reg3 read (void *ptr, size_t& len);
- _off64_t lseek (_off64_t offset, int whence);
+ off_t lseek (off_t offset, int whence);
int close ();
int dup (fhandler_base *child, int);
@@ -1680,8 +1690,8 @@ class fhandler_dev_random: public fhandler_base
class fhandler_dev_mem: public fhandler_base
{
protected:
- DWORD mem_size;
- _off64_t pos;
+ SIZE_T mem_size;
+ off_t pos;
public:
fhandler_dev_mem ();
@@ -1690,14 +1700,14 @@ class fhandler_dev_mem: public fhandler_base
int open (int flags, mode_t mode = 0);
ssize_t __stdcall write (const void *ptr, size_t ulen);
void __reg3 read (void *ptr, size_t& len);
- _off64_t lseek (_off64_t offset, int whence);
- int __reg2 fstat (struct __stat64 *buf);
+ off_t lseek (off_t offset, int whence);
+ int __reg2 fstat (struct stat *buf);
- HANDLE mmap (caddr_t *addr, size_t len, int prot, int flags, _off64_t off);
+ HANDLE mmap (caddr_t *addr, size_t len, int prot, int flags, off_t off);
int munmap (HANDLE h, caddr_t addr, size_t len);
int msync (HANDLE h, caddr_t addr, size_t len, int flags);
bool fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size, void *address);
+ off_t offset, DWORD size, void *address);
fhandler_dev_mem (void *) {}
@@ -1719,17 +1729,17 @@ class fhandler_dev_mem: public fhandler_base
class fhandler_dev_clipboard: public fhandler_base
{
- _off64_t pos;
+ off_t pos;
void *membuffer;
size_t msize;
public:
fhandler_dev_clipboard ();
int is_windows () { return 1; }
int open (int flags, mode_t mode = 0);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
ssize_t __stdcall write (const void *ptr, size_t len);
void __reg3 read (void *ptr, size_t& len);
- _off64_t lseek (_off64_t offset, int whence);
+ off_t lseek (off_t offset, int whence);
int close ();
int dup (fhandler_base *child, int);
@@ -1765,7 +1775,7 @@ class fhandler_windows: public fhandler_base
ssize_t __stdcall write (const void *ptr, size_t len);
void __reg3 read (void *ptr, size_t& len);
int ioctl (unsigned int cmd, void *);
- _off64_t lseek (_off64_t, int) { return 0; }
+ off_t lseek (off_t, int) { return 0; }
int close () { return 0; }
void set_close_on_exec (bool val);
@@ -1812,7 +1822,7 @@ class fhandler_dev_dsp: public fhandler_base
ssize_t __stdcall write (const void *ptr, size_t len);
void __reg3 read (void *ptr, size_t& len);
int ioctl (unsigned int cmd, void *);
- _off64_t lseek (_off64_t, int);
+ off_t lseek (off_t, int);
int close ();
void fixup_after_fork (HANDLE parent);
void fixup_after_exec ();
@@ -1843,8 +1853,8 @@ class fhandler_virtual : public fhandler_base
{
protected:
char *filebuf;
- _off64_t filesize;
- _off64_t position;
+ off_t filesize;
+ off_t position;
int fileid; // unique within each class
public:
@@ -1859,15 +1869,14 @@ class fhandler_virtual : public fhandler_base
int closedir (DIR *);
ssize_t __stdcall write (const void *ptr, size_t len);
void __reg3 read (void *ptr, size_t& len);
- _off64_t lseek (_off64_t, int);
+ off_t lseek (off_t, int);
int dup (fhandler_base *child, int);
int open (int flags, mode_t mode = 0);
int close ();
- int __reg2 fstat (struct stat *buf);
int __reg2 fstatvfs (struct statvfs *buf);
int __reg1 fchmod (mode_t mode);
- int __reg2 fchown (__uid32_t uid, __gid32_t gid);
- int __reg3 facl (int, int, __acl32 *);
+ int __reg2 fchown (uid_t uid, gid_t gid);
+ int __reg3 facl (int, int, struct acl *);
virtual bool fill_filebuf ();
char *get_filebuf () { return filebuf; }
void fixup_after_exec ();
@@ -1901,7 +1910,7 @@ class fhandler_proc: public fhandler_virtual
static fh_devices get_proc_fhandler (const char *path);
int open (int flags, mode_t mode = 0);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
bool fill_filebuf ();
fhandler_proc (void *) {}
@@ -1926,7 +1935,7 @@ class fhandler_procsys: public fhandler_virtual
{
public:
fhandler_procsys ();
- virtual_ftype_t __reg2 exists(struct __stat64 *buf);
+ virtual_ftype_t __reg2 exists(struct stat *buf);
virtual_ftype_t exists();
DIR __reg2 *opendir (int fd);
int __reg3 readdir (DIR *, dirent *);
@@ -1937,7 +1946,7 @@ class fhandler_procsys: public fhandler_virtual
int close ();
void __reg3 read (void *ptr, size_t& len);
ssize_t __stdcall write (const void *ptr, size_t len);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
bool fill_filebuf ();
fhandler_procsys (void *) {}
@@ -1966,7 +1975,7 @@ class fhandler_procsysvipc: public fhandler_proc
virtual_ftype_t exists();
int __reg3 readdir (DIR *, dirent *);
int open (int flags, mode_t mode = 0);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
bool fill_filebuf ();
fhandler_procsysvipc (void *) {}
@@ -1997,7 +2006,7 @@ class fhandler_netdrive: public fhandler_virtual
void rewinddir (DIR *);
int closedir (DIR *);
int open (int flags, mode_t mode = 0);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
fhandler_netdrive (void *) {}
@@ -2035,7 +2044,7 @@ class fhandler_registry: public fhandler_proc
int closedir (DIR *);
int open (int flags, mode_t mode = 0);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
bool fill_filebuf ();
int close ();
int dup (fhandler_base *child, int);
@@ -2069,7 +2078,7 @@ class fhandler_process: public fhandler_proc
int closedir (DIR *);
int __reg3 readdir (DIR *, dirent *);
int open (int flags, mode_t mode = 0);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
bool fill_filebuf ();
fhandler_process (void *) {}
@@ -2098,7 +2107,7 @@ class fhandler_procnet: public fhandler_proc
virtual_ftype_t exists();
int __reg3 readdir (DIR *, dirent *);
int open (int flags, mode_t mode = 0);
- int __reg2 fstat (struct __stat64 *buf);
+ int __reg2 fstat (struct stat *buf);
bool fill_filebuf ();
fhandler_procnet (void *) {}
diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc
index 85fa1a418..1118137c1 100644
--- a/winsup/cygwin/fhandler_clipboard.cc
+++ b/winsup/cygwin/fhandler_clipboard.cc
@@ -29,7 +29,7 @@ details. */
* changed? How does /dev/clipboard operate under (say) linux?
*/
-static const NO_COPY WCHAR *CYGWIN_NATIVE = L"CYGWIN_NATIVE_CLIPBOARD";
+static const WCHAR *CYGWIN_NATIVE = L"CYGWIN_NATIVE_CLIPBOARD";
/* this is MT safe because windows format id's are atomic */
static UINT cygnativeformat;
@@ -181,7 +181,7 @@ fhandler_dev_clipboard::write (const void *buf, size_t len)
}
int __reg2
-fhandler_dev_clipboard::fstat (struct __stat64 *buf)
+fhandler_dev_clipboard::fstat (struct stat *buf)
{
buf->st_mode = S_IFCHR | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH;
buf->st_uid = geteuid32 ();
@@ -243,7 +243,7 @@ fhandler_dev_clipboard::read (void *ptr, size_t& len)
{
cygcb_t *clipbuf = (cygcb_t *) cb_data;
- if (pos < clipbuf->len)
+ if (pos < (off_t) clipbuf->len)
{
ret = ((len > (clipbuf->len - pos)) ? (clipbuf->len - pos) : len);
memcpy (ptr, clipbuf->data + pos , ret);
@@ -267,7 +267,7 @@ fhandler_dev_clipboard::read (void *ptr, size_t& len)
wchar_t *buf = (wchar_t *) cb_data;
size_t glen = GlobalSize (hglb) / sizeof (WCHAR) - 1;
- if (pos < glen)
+ if (pos < (off_t) glen)
{
/* If caller's buffer is too small to hold at least one
max-size character, redirect algorithm to local
@@ -325,8 +325,8 @@ fhandler_dev_clipboard::read (void *ptr, size_t& len)
len = ret;
}
-_off64_t
-fhandler_dev_clipboard::lseek (_off64_t offset, int whence)
+off_t
+fhandler_dev_clipboard::lseek (off_t offset, int whence)
{
/* On reads we check this at read time, not seek time.
* On writes we use this to decide how to write - empty and write, or open, copy, empty
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index d66f3a8d7..14802790a 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -216,7 +216,7 @@ fhandler_console::setup ()
tty_min *
tty_list::get_cttyp ()
{
- _dev_t n = myself->ctty;
+ dev_t n = myself->ctty;
if (iscons_dev (n))
return fhandler_console::shared_console_info ?
&fhandler_console::shared_console_info->tty_min_state : NULL;
@@ -318,7 +318,7 @@ fhandler_console::mouse_aware (MOUSE_EVENT_RECORD& mouse_event)
|| dev_state.use_mouse >= 3));
}
-void __stdcall
+void __reg3
fhandler_console::read (void *pv, size_t& buflen)
{
push_process_state process_state (PID_TTYIN);
@@ -944,9 +944,9 @@ fhandler_console::ioctl (unsigned int cmd, void *arg)
*(int *) arg = (dev_state.metabit) ? K_METABIT : K_ESCPREFIX;
return 0;
case KDSKBMETA:
- if ((int) arg == K_METABIT)
+ if ((intptr_t) arg == K_METABIT)
dev_state.metabit = TRUE;
- else if ((int) arg == K_ESCPREFIX)
+ else if ((intptr_t) arg == K_ESCPREFIX)
dev_state.metabit = FALSE;
else
{
@@ -1013,7 +1013,7 @@ fhandler_console::output_tcsetattr (int, struct termios const *t)
int res = SetConsoleMode (get_output_handle (), flags) ? 0 : -1;
if (res)
__seterrno_from_win_error (GetLastError ());
- syscall_printf ("%d = tcsetattr(,%x) (ENABLE FLAGS %x) (lflag %x oflag %x)",
+ syscall_printf ("%d = tcsetattr(,%p) (ENABLE FLAGS %y) (lflag %y oflag %y)",
res, t, flags, t->c_lflag, t->c_oflag);
return res;
}
@@ -1075,7 +1075,7 @@ fhandler_console::input_tcsetattr (int, struct termios const *t)
res = SetConsoleMode (get_io_handle (), flags) ? 0 : -1;
if (res < 0)
__seterrno ();
- syscall_printf ("%d = tcsetattr(,%x) enable flags %p, c_lflag %p iflag %p",
+ syscall_printf ("%d = tcsetattr(,%p) enable flags %y, c_lflag %y iflag %y",
res, t, flags, t->c_lflag, t->c_iflag);
}
@@ -1126,7 +1126,7 @@ fhandler_console::tcgetattr (struct termios *t)
/* All the output bits we can ignore */
res = 0;
}
- syscall_printf ("%d = tcgetattr(%p) enable flags %p, t->lflag %p, t->iflag %p",
+ syscall_printf ("%d = tcgetattr(%p) enable flags %y, t->lflag %y, t->iflag %y",
res, t, flags, t->c_lflag, t->c_iflag);
return res;
}
@@ -2044,7 +2044,7 @@ fhandler_console::write (const void *vsrc, size_t len)
tmp_pathbuf tp;
write_buf = tp.w_get ();
- debug_printf ("%x, %d", vsrc, len);
+ debug_printf ("%p, %ld", vsrc, len);
while (src < end)
{
@@ -2211,15 +2211,15 @@ fhandler_console::write (const void *vsrc, size_t len)
}
}
- syscall_printf ("%d = fhandler_console::write(...)", len);
+ syscall_printf ("%ld = fhandler_console::write(...)", len);
return len;
}
-static struct {
+static const struct {
int vk;
const char *val[4];
-} keytable[] NO_COPY = {
+} keytable[] = {
/* NORMAL */ /* SHIFT */ /* CTRL */ /* CTRL-SHIFT */
/* Unmodified and Alt-modified keypad keys comply with linux console
SHIFT, CTRL, CTRL-SHIFT modifiers comply with xterm modifier usage */
@@ -2366,7 +2366,7 @@ fhandler_console::create_invisible_console (HWINSTA horig)
return b;
}
-/* Ugly workaround for Windows 7.
+/* Ugly workaround for Windows 7 and later.
First try to just attach to any console which may have started this
app. If that works use this as our "invisible console".
diff --git a/winsup/cygwin/fhandler_dev.cc b/winsup/cygwin/fhandler_dev.cc
index 6e9545383..48ac0b70f 100644
--- a/winsup/cygwin/fhandler_dev.cc
+++ b/winsup/cygwin/fhandler_dev.cc
@@ -68,7 +68,7 @@ fhandler_dev::close ()
}
int __reg2
-fhandler_dev::fstat (struct __stat64 *st)
+fhandler_dev::fstat (struct stat *st)
{
/* If /dev really exists on disk, return correct disk information. */
if (pc.fs_got_fs ())
@@ -81,7 +81,7 @@ fhandler_dev::fstat (struct __stat64 *st)
return 0;
}
-int __stdcall
+int __reg2
fhandler_dev::fstatvfs (struct statvfs *sfs)
{
int ret = -1, opened = 0;
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 6836f366f..018bcc981 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -44,11 +44,11 @@ class __DIR_mounts
#define __DIR_CYGDRIVE (MAX_MOUNTS+1)
#define __DIR_DEV (MAX_MOUNTS+2)
- __ino64_t eval_ino (int idx)
+ ino_t eval_ino (int idx)
{
- __ino64_t ino = 0;
+ ino_t ino = 0;
char fname[parent_dir_len + mounts[idx].Length + 2];
- struct __stat64 st;
+ struct stat st;
char *c = stpcpy (fname, parent_dir);
if (c[- 1] != '/')
@@ -76,7 +76,7 @@ public:
RtlFreeUnicodeString (&mounts[i]);
RtlFreeUnicodeString (&cygdrive);
}
- __ino64_t check_mount (PUNICODE_STRING fname, __ino64_t ino,
+ ino_t check_mount (PUNICODE_STRING fname, ino_t ino,
bool eval = true)
{
if (parent_dir_len == 1) /* root dir */
@@ -106,7 +106,7 @@ public:
}
return ino;
}
- __ino64_t check_missing_mount (PUNICODE_STRING retname = NULL)
+ ino_t check_missing_mount (PUNICODE_STRING retname = NULL)
{
for (int i = 0; i < count; ++i)
if (!found[i])
@@ -152,7 +152,7 @@ public:
};
inline bool
-path_conv::isgood_inode (__ino64_t ino) const
+path_conv::isgood_inode (ino_t ino) const
{
/* If the FS doesn't support nonambiguous inode numbers anyway, bail out
immediately. */
@@ -220,7 +220,7 @@ readdir_check_reparse_point (POBJECT_ATTRIBUTES attr)
return ret;
}
-inline __ino64_t
+inline ino_t
path_conv::get_ino_by_handle (HANDLE hdl)
{
IO_STATUS_BLOCK io;
@@ -256,7 +256,7 @@ path_conv::ndisk_links (DWORD nNumberOfLinks)
unsigned count = 0;
bool first = true;
- PFILE_BOTH_DIRECTORY_INFORMATION fdibuf = (PFILE_BOTH_DIRECTORY_INFORMATION)
+ PFILE_BOTH_DIR_INFORMATION fdibuf = (PFILE_BOTH_DIR_INFORMATION)
alloca (65536);
__DIR_mounts *dir = new __DIR_mounts (normalized_path);
while (NT_SUCCESS (NtQueryDirectoryFile (fh, NULL, NULL, NULL, &io, fdibuf,
@@ -272,9 +272,9 @@ path_conv::ndisk_links (DWORD nNumberOfLinks)
if (fdibuf->FileNameLength != 2 || fdibuf->FileName[0] != L'.')
count = 2;
}
- for (PFILE_BOTH_DIRECTORY_INFORMATION pfdi = fdibuf;
+ for (PFILE_BOTH_DIR_INFORMATION pfdi = fdibuf;
pfdi;
- pfdi = (PFILE_BOTH_DIRECTORY_INFORMATION)
+ pfdi = (PFILE_BOTH_DIR_INFORMATION)
(pfdi->NextEntryOffset ? (PBYTE) pfdi + pfdi->NextEntryOffset
: NULL))
{
@@ -319,8 +319,8 @@ path_conv::ndisk_links (DWORD nNumberOfLinks)
This returns the content of a struct fattr3 as defined in RFC 1813.
The content is the NFS equivalent of struct stat. so there's not much
to do here except for copying. */
-int __stdcall
-fhandler_base::fstat_by_nfs_ea (struct __stat64 *buf)
+int __reg2
+fhandler_base::fstat_by_nfs_ea (struct stat *buf)
{
fattr3 *nfs_attr = pc.nfsattr ();
@@ -353,14 +353,17 @@ fhandler_base::fstat_by_nfs_ea (struct __stat64 *buf)
buf->st_size = nfs_attr->size;
buf->st_blksize = PREFERRED_IO_BLKSIZE;
buf->st_blocks = (nfs_attr->used + S_BLKSIZE - 1) / S_BLKSIZE;
- buf->st_atim = nfs_attr->atime;
- buf->st_mtim = nfs_attr->mtime;
- buf->st_ctim = nfs_attr->ctime;
+ buf->st_atim.tv_sec = nfs_attr->atime.tv_sec;
+ buf->st_atim.tv_nsec = nfs_attr->atime.tv_nsec;
+ buf->st_mtim.tv_sec = nfs_attr->mtime.tv_sec;
+ buf->st_mtim.tv_nsec = nfs_attr->mtime.tv_nsec;
+ buf->st_ctim.tv_sec = nfs_attr->ctime.tv_sec;
+ buf->st_ctim.tv_nsec = nfs_attr->ctime.tv_nsec;
return 0;
}
-int __stdcall
-fhandler_base::fstat_by_handle (struct __stat64 *buf)
+int __reg2
+fhandler_base::fstat_by_handle (struct stat *buf)
{
/* Don't use FileAllInformation info class. It returns a pathname rather
than a filename, so it needs a really big buffer for no good reason
@@ -380,7 +383,7 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
status = file_get_fnoi (h, pc.fs_is_netapp (), pc.fnoi ());
if (!NT_SUCCESS (status))
{
- debug_printf ("%p = NtQueryInformationFile(%S, "
+ debug_printf ("%y = NtQueryInformationFile(%S, "
"FileNetworkOpenInformation)",
status, pc.get_nt_native_path ());
return -1;
@@ -394,7 +397,7 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
FileStandardInformation);
if (!NT_SUCCESS (status))
{
- debug_printf ("%p = NtQueryInformationFile(%S, "
+ debug_printf ("%y = NtQueryInformationFile(%S, "
"FileStandardInformation)",
status, pc.get_nt_native_path ());
return -1;
@@ -405,7 +408,7 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
FileInternalInformation);
if (!NT_SUCCESS (status))
{
- debug_printf ("%p = NtQueryInformationFile(%S, "
+ debug_printf ("%y = NtQueryInformationFile(%S, "
"FileInternalInformation)",
status, pc.get_nt_native_path ());
return -1;
@@ -417,8 +420,8 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
return fstat_helper (buf, fsi.NumberOfLinks);
}
-int __stdcall
-fhandler_base::fstat_by_name (struct __stat64 *buf)
+int __reg2
+fhandler_base::fstat_by_name (struct stat *buf)
{
NTSTATUS status;
OBJECT_ATTRIBUTES attr;
@@ -442,7 +445,7 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
| FILE_OPEN_FOR_BACKUP_INTENT
| FILE_DIRECTORY_FILE);
if (!NT_SUCCESS (status))
- debug_printf ("%p = NtOpenFile(%S)", status,
+ debug_printf ("%y = NtOpenFile(%S)", status,
pc.get_nt_native_path ());
else
{
@@ -452,7 +455,7 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
TRUE, &basename, TRUE);
NtClose (dir);
if (!NT_SUCCESS (status))
- debug_printf ("%p = NtQueryDirectoryFile(%S)", status,
+ debug_printf ("%y = NtQueryDirectoryFile(%S)", status,
pc.get_nt_native_path ());
else
ino = fdi_buf.fdi.FileId.QuadPart;
@@ -461,8 +464,8 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
return fstat_helper (buf, 1);
}
-int __stdcall
-fhandler_base::fstat_fs (struct __stat64 *buf)
+int __reg2
+fhandler_base::fstat_fs (struct stat *buf)
{
int res = -1;
int oret;
@@ -505,8 +508,8 @@ fhandler_base::fstat_fs (struct __stat64 *buf)
return res;
}
-int __stdcall
-fhandler_base::fstat_helper (struct __stat64 *buf,
+int __reg3
+fhandler_base::fstat_helper (struct stat *buf,
DWORD nNumberOfLinks)
{
IO_STATUS_BLOCK st;
@@ -531,7 +534,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
0 in the first call and size > 0 in the second call. This in turn can
affect applications like newer tar.
FIXME: Is the allocation size affected as well? */
- buf->st_size = pc.isdir () ? 0 : (_off64_t) pfnoi->EndOfFile.QuadPart;
+ buf->st_size = pc.isdir () ? 0 : (off_t) pfnoi->EndOfFile.QuadPart;
/* The number of links to a directory includes the number of subdirectories
in the directory, since all those subdirectories point to it. However,
this is painfully slow, so we do without it. */
@@ -543,7 +546,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
/* Enforce namehash as inode number on untrusted file systems. */
if (ino && pc.isgood_inode (ino))
- buf->st_ino = (__ino64_t) ino;
+ buf->st_ino = (ino_t) ino;
else
buf->st_ino = get_ino ();
@@ -651,7 +654,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
FILE_OPEN_FOR_BACKUP_INTENT
| FILE_SYNCHRONOUS_IO_NONALERT);
if (!NT_SUCCESS (status))
- debug_printf ("%p = NtOpenFile(%S)", status,
+ debug_printf ("%y = NtOpenFile(%S)", status,
pc.get_nt_native_path ());
else
{
@@ -661,7 +664,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
status = NtReadFile (h, NULL, NULL, NULL,
&io, magic, 3, &off, NULL);
if (!NT_SUCCESS (status))
- debug_printf ("%p = NtReadFile(%S)", status,
+ debug_printf ("%y = NtReadFile(%S)", status,
pc.get_nt_native_path ());
else if (has_exec_chars (magic, io.Information))
{
@@ -687,9 +690,9 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
}
done:
- syscall_printf ("0 = fstat (%S, %p) st_size=%D, st_mode=%p, st_ino=%D"
- "st_atim=%x.%x st_ctim=%x.%x "
- "st_mtim=%x.%x st_birthtim=%x.%x",
+ syscall_printf ("0 = fstat (%S, %p) st_size=%D, st_mode=%y, st_ino=%D"
+ "st_atim=%lx.%lx st_ctim=%lx.%lx "
+ "st_mtim=%lx.%lx st_birthtim=%lx.%lx",
pc.get_nt_native_path (), buf,
buf->st_size, buf->st_mode, buf->st_ino,
buf->st_atim.tv_sec, buf->st_atim.tv_nsec,
@@ -700,19 +703,18 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
}
int __reg2
-fhandler_disk_file::fstat (struct __stat64 *buf)
+fhandler_disk_file::fstat (struct stat *buf)
{
return fstat_fs (buf);
}
-int __stdcall
+int __reg2
fhandler_disk_file::fstatvfs (struct statvfs *sfs)
{
int ret = -1, opened = 0;
NTSTATUS status;
IO_STATUS_BLOCK io;
FILE_FS_FULL_SIZE_INFORMATION full_fsi;
- FILE_FS_SIZE_INFORMATION fsi;
/* We must not use the stat handle here, even if it exists. The handle
has been opened with FILE_OPEN_REPARSE_POINT, thus, in case of a volume
mount point, it points to the FS of the mount point, rather than to the
@@ -746,18 +748,18 @@ fhandler_disk_file::fstatvfs (struct statvfs *sfs)
sfs->f_fsid = pc.fs_serial_number ();
sfs->f_flag = pc.fs_flags ();
sfs->f_namemax = pc.fs_name_len ();
- /* Get allocation related information. Try to get "full" information
- first, which is only available since W2K. If that fails, try to
- retrieve normal allocation information. */
+ /* Get allocation related information. */
status = NtQueryVolumeInformationFile (fh, &io, &full_fsi, sizeof full_fsi,
FileFsFullSizeInformation);
if (NT_SUCCESS (status))
{
sfs->f_bsize = full_fsi.BytesPerSector * full_fsi.SectorsPerAllocationUnit;
sfs->f_frsize = sfs->f_bsize;
- sfs->f_blocks = full_fsi.TotalAllocationUnits.LowPart;
- sfs->f_bfree = full_fsi.ActualAvailableAllocationUnits.LowPart;
- sfs->f_bavail = full_fsi.CallerAvailableAllocationUnits.LowPart;
+ sfs->f_blocks = (fsblkcnt_t) full_fsi.TotalAllocationUnits.QuadPart;
+ sfs->f_bfree = (fsblkcnt_t)
+ full_fsi.ActualAvailableAllocationUnits.QuadPart;
+ sfs->f_bavail = (fsblkcnt_t)
+ full_fsi.CallerAvailableAllocationUnits.QuadPart;
if (sfs->f_bfree > sfs->f_bavail)
{
/* Quotas active. We can't trust TotalAllocationUnits. */
@@ -767,29 +769,13 @@ fhandler_disk_file::fstatvfs (struct statvfs *sfs)
FSCTL_GET_NTFS_VOLUME_DATA,
NULL, 0, &nvdb, sizeof nvdb);
if (!NT_SUCCESS (status))
- debug_printf ("%p = NtFsControlFile(%S, FSCTL_GET_NTFS_VOLUME_DATA)",
+ debug_printf ("%y = NtFsControlFile(%S, FSCTL_GET_NTFS_VOLUME_DATA)",
status, pc.get_nt_native_path ());
else
- sfs->f_blocks = nvdb.TotalClusters.QuadPart;
+ sfs->f_blocks = (fsblkcnt_t) nvdb.TotalClusters.QuadPart;
}
ret = 0;
}
- else
- {
- status = NtQueryVolumeInformationFile (fh, &io, &fsi, sizeof fsi,
- FileFsSizeInformation);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto out;
- }
- sfs->f_bsize = fsi.BytesPerSector * fsi.SectorsPerAllocationUnit;
- sfs->f_frsize = sfs->f_bsize;
- sfs->f_blocks = fsi.TotalAllocationUnits.LowPart;
- sfs->f_bfree = fsi.AvailableAllocationUnits.LowPart;
- sfs->f_bavail = sfs->f_bfree;
- ret = 0;
- }
out:
if (opened)
NtClose (fh);
@@ -797,7 +783,7 @@ out:
return ret;
}
-int __stdcall
+int __reg1
fhandler_disk_file::fchmod (mode_t mode)
{
extern int chmod_device (path_conv& pc, mode_t mode);
@@ -905,8 +891,8 @@ out:
return res;
}
-int __stdcall
-fhandler_disk_file::fchown (__uid32_t uid, __gid32_t gid)
+int __reg2
+fhandler_disk_file::fchown (uid_t uid, gid_t gid)
{
int oret = 0;
@@ -928,7 +914,7 @@ fhandler_disk_file::fchown (__uid32_t uid, __gid32_t gid)
mode_t attrib = 0;
if (pc.isdir ())
attrib |= S_IFDIR;
- __uid32_t old_uid;
+ uid_t old_uid;
int res = get_file_attribute (get_handle (), pc, &attrib, &old_uid, NULL);
if (!res)
{
@@ -973,8 +959,8 @@ fhandler_disk_file::fchown (__uid32_t uid, __gid32_t gid)
return res;
}
-int _stdcall
-fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp)
+int __reg3
+fhandler_disk_file::facl (int cmd, int nentries, aclent_t *aclbufp)
{
int res = -1;
int oret = 0;
@@ -999,7 +985,7 @@ cant_access_acl:
set_errno (ENOSPC);
else
{
- struct __stat64 st;
+ struct stat st;
if (!fstat (&st))
{
aclbufp[0].a_type = USER_OBJ;
@@ -1113,7 +1099,7 @@ fhandler_disk_file::fsetxattr (const char *name, const void *value, size_t size,
}
int
-fhandler_disk_file::fadvise (_off64_t offset, _off64_t length, int advice)
+fhandler_disk_file::fadvise (off_t offset, off_t length, int advice)
{
if (advice < POSIX_FADV_NORMAL || advice > POSIX_FADV_NOREUSE)
{
@@ -1156,7 +1142,7 @@ fhandler_disk_file::fadvise (_off64_t offset, _off64_t length, int advice)
}
int
-fhandler_disk_file::ftruncate (_off64_t length, bool allow_truncate)
+fhandler_disk_file::ftruncate (off_t length, bool allow_truncate)
{
int res = -1;
@@ -1197,8 +1183,8 @@ fhandler_disk_file::ftruncate (_off64_t length, bool allow_truncate)
FSCTL_SET_SPARSE, NULL, 0, NULL, 0);
if (NT_SUCCESS (status))
pc.file_attributes (pc.file_attributes ()
- | FILE_ATTRIBUTE_SPARSE_FILE);
- syscall_printf ("%p = NtFsControlFile(%S, FSCTL_SET_SPARSE)",
+ | FILE_ATTRIBUTE_SPARSE_FILE);
+ syscall_printf ("%y = NtFsControlFile(%S, FSCTL_SET_SPARSE)",
status, pc.get_nt_native_path ());
}
status = NtSetInformationFile (get_handle (), &io,
@@ -1350,7 +1336,7 @@ fhandler_base::utimens_fs (const struct timespec *tvp)
tmp[0] = (tvp[0].tv_nsec == UTIME_NOW) ? timeofday : tvp[0];
tmp[1] = (tvp[1].tv_nsec == UTIME_NOW) ? timeofday : tvp[1];
}
- debug_printf ("incoming lastaccess %08x %08x", tmp[0].tv_sec, tmp[0].tv_nsec);
+ debug_printf ("incoming lastaccess %ly %ly", tmp[0].tv_sec, tmp[0].tv_nsec);
IO_STATUS_BLOCK io;
FILE_BASIC_INFORMATION fbi;
@@ -1422,6 +1408,34 @@ fhandler_disk_file::close ()
}
int
+fhandler_disk_file::fcntl (int cmd, intptr_t arg)
+{
+ int res;
+
+ switch (cmd)
+ {
+ case F_LCK_MANDATORY:
+ mandatory_locking (!!arg);
+ need_fork_fixup (true);
+ res = 0;
+ break;
+ case F_GETLK:
+ case F_SETLK:
+ case F_SETLKW:
+ {
+ struct flock *fl = (struct flock *) arg;
+ fl->l_type &= F_RDLCK | F_WRLCK | F_UNLCK;
+ res = mandatory_locking () ? mand_lock (cmd, fl) : lock (cmd, fl);
+ }
+ break;
+ default:
+ res = fhandler_base::fcntl (cmd, arg);
+ break;
+ }
+ return res;
+}
+
+int
fhandler_disk_file::dup (fhandler_base *child, int flags)
{
fhandler_disk_file *fhc = (fhandler_disk_file *) child;
@@ -1431,7 +1445,7 @@ fhandler_disk_file::dup (fhandler_base *child, int flags)
&& !DuplicateHandle (GetCurrentProcess (), prw_handle,
GetCurrentProcess (), &fhc->prw_handle,
0, TRUE, DUPLICATE_SAME_ACCESS))
- prw_handle = NULL;
+ fhc->prw_handle = NULL;
return ret;
}
@@ -1439,6 +1453,7 @@ void
fhandler_disk_file::fixup_after_fork (HANDLE parent)
{
prw_handle = NULL;
+ mandatory_locking (false);
fhandler_base::fixup_after_fork (parent);
}
@@ -1477,7 +1492,7 @@ fhandler_base::open_fs (int flags, mode_t mode)
NtAllocateLocallyUniqueId ((PLUID) &unique_id);
out:
- syscall_printf ("%d = fhandler_disk_file::open(%S, %p)", res,
+ syscall_printf ("%d = fhandler_disk_file::open(%S, %y)", res,
pc.get_nt_native_path (), flags);
return res;
}
@@ -1538,7 +1553,7 @@ fhandler_disk_file::prw_open (bool write)
status = NtOpenFile (&prw_handle, access, &attr, &io,
FILE_SHARE_VALID_FLAGS, get_options ());
}
- debug_printf ("%x = NtOpenFile (%p, %x, %S, io, %x, %x)",
+ debug_printf ("%y = NtOpenFile (%p, %y, %S, io, %y, %y)",
status, prw_handle, access, pc.get_nt_native_path (),
FILE_SHARE_VALID_FLAGS, get_options ());
if (!NT_SUCCESS (status))
@@ -1549,17 +1564,20 @@ fhandler_disk_file::prw_open (bool write)
return 0;
}
-ssize_t __stdcall
-fhandler_disk_file::pread (void *buf, size_t count, _off64_t offset)
+ssize_t __reg3
+fhandler_disk_file::pread (void *buf, size_t count, off_t offset)
{
+ ssize_t res;
+
if ((get_flags () & O_ACCMODE) == O_WRONLY)
{
set_errno (EBADF);
return -1;
}
- /* In binary mode, we can use an atomic NtReadFile call. */
- if (rbinary ())
+ /* In binary mode, we can use an atomic NtReadFile call.
+ Windows mandatory locking semantics disallow to use another HANDLE. */
+ if (rbinary () && !mandatory_locking ())
{
extern int __stdcall is_at_eof (HANDLE h);
NTSTATUS status;
@@ -1570,7 +1588,7 @@ fhandler_disk_file::pread (void *buf, size_t count, _off64_t offset)
goto non_atomic;
status = NtReadFile (prw_handle, NULL, NULL, NULL, &io, buf, count,
&off, NULL);
- if (!NT_SUCCESS (status))
+ if (!NT_SUCCESS (status) && status != STATUS_END_OF_FILE)
{
if (pc.isdir ())
{
@@ -1598,29 +1616,31 @@ fhandler_disk_file::pread (void *buf, size_t count, _off64_t offset)
__seterrno_from_nt_status (status);
return -1;
}
+ res = io.Information; /* Valid on EOF. */
}
-
-non_atomic:
- /* Text mode stays slow and non-atomic. */
- ssize_t res;
- _off64_t curpos = lseek (0, SEEK_CUR);
- if (curpos < 0 || lseek (offset, SEEK_SET) < 0)
- res = -1;
else
{
- size_t tmp_count = count;
- read (buf, tmp_count);
- if (lseek (curpos, SEEK_SET) >= 0)
- res = (ssize_t) tmp_count;
- else
+non_atomic:
+ /* Text mode stays slow and non-atomic. */
+ off_t curpos = lseek (0, SEEK_CUR);
+ if (curpos < 0 || lseek (offset, SEEK_SET) < 0)
res = -1;
+ else
+ {
+ size_t tmp_count = count;
+ read (buf, tmp_count);
+ if (lseek (curpos, SEEK_SET) >= 0)
+ res = (ssize_t) tmp_count;
+ else
+ res = -1;
+ }
}
- debug_printf ("%d = pread(%p, %d, %d)\n", res, buf, count, offset);
+ debug_printf ("%d = pread(%p, %ld, %D)\n", res, buf, count, offset);
return res;
}
-ssize_t __stdcall
-fhandler_disk_file::pwrite (void *buf, size_t count, _off64_t offset)
+ssize_t __reg3
+fhandler_disk_file::pwrite (void *buf, size_t count, off_t offset)
{
if ((get_flags () & O_ACCMODE) == O_RDONLY)
{
@@ -1628,8 +1648,9 @@ fhandler_disk_file::pwrite (void *buf, size_t count, _off64_t offset)
return -1;
}
- /* In binary mode, we can use an atomic NtWriteFile call. */
- if (wbinary ())
+ /* In binary mode, we can use an atomic NtWriteFile call.
+ Windows mandatory locking semantics disallow to use another HANDLE. */
+ if (wbinary () && !mandatory_locking ())
{
NTSTATUS status;
IO_STATUS_BLOCK io;
@@ -1650,7 +1671,7 @@ fhandler_disk_file::pwrite (void *buf, size_t count, _off64_t offset)
non_atomic:
/* Text mode stays slow and non-atomic. */
int res;
- _off64_t curpos = lseek (0, SEEK_CUR);
+ off_t curpos = lseek (0, SEEK_CUR);
if (curpos < 0 || lseek (offset, SEEK_SET) < 0)
res = curpos;
else
@@ -1659,7 +1680,7 @@ non_atomic:
if (lseek (curpos, SEEK_SET) < 0)
res = -1;
}
- debug_printf ("%d = pwrite(%p, %d, %d)\n", res, buf, count, offset);
+ debug_printf ("%d = pwrite(%p, %ld, %D)\n", res, buf, count, offset);
return res;
}
@@ -1784,7 +1805,7 @@ fhandler_disk_file::rmdir ()
struct __DIR_cache
{
- char __cache[DIR_BUF_SIZE]; /* W2K needs this buffer 8 byte aligned. */
+ char __cache[DIR_BUF_SIZE];
ULONG __pos;
};
@@ -1827,7 +1848,7 @@ fhandler_disk_file::opendir (int fd)
dir->__d_position = 0;
dir->__flags = (get_name ()[0] == '/' && get_name ()[1] == '\0')
? dirent_isroot : 0;
- dir->__d_internal = (unsigned) new __DIR_mounts (get_name ());
+ dir->__d_internal = (uintptr_t) new __DIR_mounts (get_name ());
d_cachepos (dir) = 0;
if (!pc.iscygdrive ())
@@ -1880,10 +1901,9 @@ fhandler_disk_file::opendir (int fd)
XP when accessing directories on UDF. When trying to use it
so, NtQueryDirectoryFile returns with STATUS_ACCESS_VIOLATION.
It's not clear if the call isn't also unsupported on other
- OS/FS combinations (say, Win2K/CDFS or so). Instead of
- testing in readdir for yet another error code, let's use
- FileIdBothDirectoryInformation only on filesystems supporting
- persistent ACLs, FileBothDirectoryInformation otherwise.
+ OS/FS combinations. Instead of testing for yet another error
+ code, let's use FileIdBothDirectoryInformation only on FSes
+ supporting persistent ACLs, FileBothDirectoryInformation otherwise.
NFS clients hide dangling symlinks from directory queries,
unless you use the FileNamesInformation info class.
@@ -1935,15 +1955,15 @@ free_dir:
return res;
}
-__ino64_t __stdcall
+ino_t __reg2
readdir_get_ino (const char *path, bool dot_dot)
{
char *fname;
- struct __stat64 st;
+ struct stat st;
HANDLE hdl;
OBJECT_ATTRIBUTES attr;
IO_STATUS_BLOCK io;
- __ino64_t ino = 0;
+ ino_t ino = 0;
if (dot_dot)
{
@@ -2118,11 +2138,10 @@ fhandler_disk_file::readdir (DIR *dir, dirent *de)
FileIdBothDirectoryInformation,
FALSE, NULL, dir->__d_position == 0);
/* FileIdBothDirectoryInformation isn't supported for remote drives
- on NT4 and 2K systems, and it's also not supported on 2K at all,
- when accessing network drives on any remote OS. There are also
- hacked versions of Samba 3.0.x out there (Debian-based it seems),
- which return STATUS_NOT_SUPPORTED rather than handling this info
- class. We just fall back to using a standard directory query in
+ on NT4 and 2K systems. There are also hacked versions of
+ Samba 3.0.x out there (Debian-based it seems), which return
+ STATUS_NOT_SUPPORTED rather than handling this info class.
+ We just fall back to using a standard directory query in
this case and note this case using the dirent_get_d_ino flag. */
if (!NT_SUCCESS (status) && status != STATUS_NO_MORE_FILES
&& (status == STATUS_INVALID_LEVEL
@@ -2193,7 +2212,7 @@ go_ahead:
if (status == STATUS_NO_MORE_FILES)
/*nothing*/;
else if (!NT_SUCCESS (status))
- debug_printf ("NtQueryDirectoryFile failed, status %p, win32 error %lu",
+ debug_printf ("NtQueryDirectoryFile failed, status %y, win32 error %u",
status, RtlNtStatusToDosError (status));
else
{
@@ -2217,11 +2236,11 @@ go_ahead:
}
else
{
- FileName = ((PFILE_BOTH_DIRECTORY_INFORMATION) buf)->FileName;
+ FileName = ((PFILE_BOTH_DIR_INFORMATION) buf)->FileName;
FileNameLength =
- ((PFILE_BOTH_DIRECTORY_INFORMATION) buf)->FileNameLength;
+ ((PFILE_BOTH_DIR_INFORMATION) buf)->FileNameLength;
FileAttributes =
- ((PFILE_BOTH_DIRECTORY_INFORMATION) buf)->FileAttributes;
+ ((PFILE_BOTH_DIR_INFORMATION) buf)->FileAttributes;
}
RtlInitCountedUnicodeString (&fname, FileName, FileNameLength);
de->d_ino = d_mounts (dir)->check_mount (&fname, de->d_ino);
@@ -2319,7 +2338,7 @@ go_ahead:
res = 0;
}
- syscall_printf ("%d = readdir(%p, %p) (L\"%lS\" > \"%ls\") (attr %p > type %d)",
+ syscall_printf ("%d = readdir(%p, %p) (L\"%lS\" > \"%ls\") (attr %y > type %d)",
res, dir, &de, res ? NULL : &fname, res ? "***" : de->d_name,
FileAttributes, de->d_type);
return res;
@@ -2344,32 +2363,6 @@ void
fhandler_disk_file::rewinddir (DIR *dir)
{
d_cachepos (dir) = 0;
- if (wincap.has_buggy_restart_scan () && isremote ())
- {
- /* This works around a W2K bug. The RestartScan parameter in calls
- to NtQueryDirectoryFile on remote shares is ignored, thus
- resulting in not being able to rewind on remote shares. By
- reopening the directory, we get a fresh new directory pointer. */
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- HANDLE new_dir;
-
- pc.init_reopen_attr (&attr, get_handle ());
- status = NtOpenFile (&new_dir, SYNCHRONIZE | FILE_LIST_DIRECTORY,
- &attr, &io, FILE_SHARE_VALID_FLAGS,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_DIRECTORY_FILE);
- if (!NT_SUCCESS (status))
- debug_printf ("Unable to reopen dir %s, NT error: %p",
- get_name (), status);
- else
- {
- NtClose (get_handle ());
- set_io_handle (new_dir);
- }
- }
dir->__d_position = 0;
d_mounts (dir)->rewind ();
}
@@ -2422,7 +2415,7 @@ fhandler_cygdrive::set_drives ()
}
int
-fhandler_cygdrive::fstat (struct __stat64 *buf)
+fhandler_cygdrive::fstat (struct stat *buf)
{
fhandler_base::fstat (buf);
buf->st_ino = 2;
@@ -2431,7 +2424,7 @@ fhandler_cygdrive::fstat (struct __stat64 *buf)
return 0;
}
-int __stdcall
+int __reg2
fhandler_cygdrive::fstatvfs (struct statvfs *sfs)
{
/* Virtual file system. Just return an empty buffer with a few values
diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc
index b16606615..72256b056 100644
--- a/winsup/cygwin/fhandler_dsp.cc
+++ b/winsup/cygwin/fhandler_dsp.cc
@@ -102,8 +102,9 @@ class fhandler_dev_dsp::Audio::queue
WAVEHDR **storage_;
};
-static void CALLBACK waveOut_callback (HWAVEOUT hWave, UINT msg, DWORD instance,
- DWORD param1, DWORD param2);
+static void CALLBACK waveOut_callback (HWAVEOUT hWave, UINT msg,
+ DWORD_PTR instance, DWORD_PTR param1,
+ DWORD_PTR param2);
class fhandler_dev_dsp::Audio_out: public Audio
{
@@ -135,8 +136,9 @@ class fhandler_dev_dsp::Audio_out: public Audio
int channels_;
};
-static void CALLBACK waveIn_callback (HWAVEIN hWave, UINT msg, DWORD instance,
- DWORD param1, DWORD param2);
+static void CALLBACK waveIn_callback (HWAVEIN hWave, UINT msg,
+ DWORD_PTR instance, DWORD_PTR param1,
+ DWORD_PTR param2);
class fhandler_dev_dsp::Audio_in: public Audio
{
@@ -365,7 +367,7 @@ fhandler_dev_dsp::Audio_out::fork_fixup (HANDLE parent)
/* Null dev_.
It will be necessary to reset the queue, open the device
and create a lock when writing */
- debug_printf ("parent=0x%08x", parent);
+ debug_printf ("parent=%p", parent);
dev_ = NULL;
}
@@ -378,7 +380,7 @@ fhandler_dev_dsp::Audio_out::query (int rate, int bits, int channels)
fillFormat (&format, rate, bits, channels);
rc = waveOutOpen (NULL, WAVE_MAPPER, &format, 0L, 0L, WAVE_FORMAT_QUERY);
- debug_printf ("%d = waveOutOpen(freq=%d bits=%d channels=%d)", rc, rate, bits, channels);
+ debug_printf ("%u = waveOutOpen(freq=%d bits=%d channels=%d)", rc, rate, bits, channels);
return (rc == MMSYSERR_NOERROR);
}
@@ -400,12 +402,12 @@ fhandler_dev_dsp::Audio_out::start ()
return false;
fillFormat (&format, freq_, bits_, channels_);
- rc = waveOutOpen (&dev_, WAVE_MAPPER, &format, (DWORD) waveOut_callback,
- (DWORD) this, CALLBACK_FUNCTION);
+ rc = waveOutOpen (&dev_, WAVE_MAPPER, &format, (DWORD_PTR) waveOut_callback,
+ (DWORD_PTR) this, CALLBACK_FUNCTION);
if (rc == MMSYSERR_NOERROR)
init (bSize);
- debug_printf ("%d = waveOutOpen(freq=%d bits=%d channels=%d)", rc, freq_, bits_, channels_);
+ debug_printf ("%u = waveOutOpen(freq=%d bits=%d channels=%d)", rc, freq_, bits_, channels_);
return (rc == MMSYSERR_NOERROR);
}
@@ -416,7 +418,7 @@ fhandler_dev_dsp::Audio_out::stop (bool immediately)
MMRESULT rc;
WAVEHDR *pHdr;
- debug_printf ("dev_=%08x", (int)dev_);
+ debug_printf ("dev_=%p", dev_);
if (dev_)
{
if (!immediately)
@@ -426,15 +428,15 @@ fhandler_dev_dsp::Audio_out::stop (bool immediately)
}
rc = waveOutReset (dev_);
- debug_printf ("%d = waveOutReset()", rc);
+ debug_printf ("%u = waveOutReset()", rc);
while (Qisr2app_->recv (&pHdr))
{
rc = waveOutUnprepareHeader (dev_, pHdr, sizeof (WAVEHDR));
- debug_printf ("%d = waveOutUnprepareHeader(0x%08x)", rc, pHdr);
+ debug_printf ("%u = waveOutUnprepareHeader(%p)", rc, pHdr);
}
rc = waveOutClose (dev_);
- debug_printf ("%d = waveOutClose()", rc);
+ debug_printf ("%u = waveOutClose()", rc);
Qisr2app_->dellock ();
}
@@ -564,7 +566,7 @@ fhandler_dev_dsp::Audio_out::waitforspace ()
/* Errors are ignored here. They will probbaly cause a failure
in the subsequent PrepareHeader */
rc = waveOutUnprepareHeader (dev_, pHdr, sizeof (WAVEHDR));
- debug_printf ("%d = waveOutUnprepareHeader(0x%08x)", rc, pHdr);
+ debug_printf ("%u = waveOutUnprepareHeader(%p)", rc, pHdr);
}
pHdr_ = pHdr;
bufferIndex_ = 0;
@@ -587,7 +589,7 @@ fhandler_dev_dsp::Audio_out::sendcurrent ()
{
WAVEHDR *pHdr = pHdr_;
MMRESULT rc;
- debug_printf ("pHdr=0x%08x bytes=%d", pHdr, bufferIndex_);
+ debug_printf ("pHdr=%p bytes=%d", pHdr, bufferIndex_);
if (pHdr_ == NULL)
return false;
@@ -599,11 +601,11 @@ fhandler_dev_dsp::Audio_out::sendcurrent ()
// Send internal buffer out to the soundcard
pHdr->dwBufferLength = bufferIndex_;
rc = waveOutPrepareHeader (dev_, pHdr, sizeof (WAVEHDR));
- debug_printf ("%d = waveOutPrepareHeader(0x%08x)", rc, pHdr);
+ debug_printf ("%u = waveOutPrepareHeader(%p)", rc, pHdr);
if (rc == MMSYSERR_NOERROR)
{
rc = waveOutWrite (dev_, pHdr, sizeof (WAVEHDR));
- debug_printf ("%d = waveOutWrite(0x%08x)", rc, pHdr);
+ debug_printf ("%u = waveOutWrite(%p)", rc, pHdr);
}
if (rc == MMSYSERR_NOERROR)
return true;
@@ -617,8 +619,8 @@ fhandler_dev_dsp::Audio_out::sendcurrent ()
//------------------------------------------------------------------------
// Call back routine
static void CALLBACK
-waveOut_callback (HWAVEOUT hWave, UINT msg, DWORD instance, DWORD param1,
- DWORD param2)
+waveOut_callback (HWAVEOUT hWave, UINT msg, DWORD_PTR instance,
+ DWORD_PTR param1, DWORD_PTR param2)
{
if (msg == WOM_DONE)
{
@@ -663,7 +665,7 @@ fhandler_dev_dsp::Audio_out::parsewav (const char * &pData, int &nBytes,
setconvert (bits_ == 8 ? AFMT_U8 : AFMT_S16_LE);
// Check alignment first: A lot of the code below depends on it
- if (((int)pData & 0x3) != 0)
+ if (((uintptr_t)pData & 0x3) != 0)
return false;
if (!(pData[0] == 'R' && pData[1] == 'I'
&& pData[2] == 'F' && pData[3] == 'F'))
@@ -740,7 +742,7 @@ fhandler_dev_dsp::Audio_in::fork_fixup (HANDLE parent)
/* Null dev_.
It will be necessary to reset the queue, open the device
and create a lock when reading */
- debug_printf ("parent=0x%08x", parent);
+ debug_printf ("parent=%p", parent);
dev_ = NULL;
}
@@ -752,7 +754,7 @@ fhandler_dev_dsp::Audio_in::query (int rate, int bits, int channels)
fillFormat (&format, rate, bits, channels);
rc = waveInOpen (NULL, WAVE_MAPPER, &format, 0L, 0L, WAVE_FORMAT_QUERY);
- debug_printf ("%d = waveInOpen(freq=%d bits=%d channels=%d)", rc, rate, bits, channels);
+ debug_printf ("%u = waveInOpen(freq=%d bits=%d channels=%d)", rc, rate, bits, channels);
return (rc == MMSYSERR_NOERROR);
}
@@ -774,9 +776,9 @@ fhandler_dev_dsp::Audio_in::start (int rate, int bits, int channels)
return false;
fillFormat (&format, rate, bits, channels);
- rc = waveInOpen (&dev_, WAVE_MAPPER, &format, (DWORD) waveIn_callback,
- (DWORD) this, CALLBACK_FUNCTION);
- debug_printf ("%d = waveInOpen(rate=%d bits=%d channels=%d)", rc, rate, bits, channels);
+ rc = waveInOpen (&dev_, WAVE_MAPPER, &format, (DWORD_PTR) waveIn_callback,
+ (DWORD_PTR) this, CALLBACK_FUNCTION);
+ debug_printf ("%u = waveInOpen(rate=%d bits=%d channels=%d)", rc, rate, bits, channels);
if (rc == MMSYSERR_NOERROR)
{
@@ -792,7 +794,7 @@ fhandler_dev_dsp::Audio_in::stop ()
MMRESULT rc;
WAVEHDR *pHdr;
- debug_printf ("dev_=%08x", (int)dev_);
+ debug_printf ("dev_=%p", dev_);
if (dev_)
{
/* Note that waveInReset calls our callback for all incomplete buffers.
@@ -800,16 +802,16 @@ fhandler_dev_dsp::Audio_in::stop ()
we must not call into the wave API from the callback.
Otherwise we end up in a deadlock. */
rc = waveInReset (dev_);
- debug_printf ("%d = waveInReset()", rc);
+ debug_printf ("%u = waveInReset()", rc);
while (Qisr2app_->recv (&pHdr))
{
rc = waveInUnprepareHeader (dev_, pHdr, sizeof (WAVEHDR));
- debug_printf ("%d = waveInUnprepareHeader(0x%08x)", rc, pHdr);
+ debug_printf ("%u = waveInUnprepareHeader(%p)", rc, pHdr);
}
rc = waveInClose (dev_);
- debug_printf ("%d = waveInClose()", rc);
+ debug_printf ("%u = waveInClose()", rc);
Qisr2app_->dellock ();
}
@@ -820,11 +822,11 @@ fhandler_dev_dsp::Audio_in::queueblock (WAVEHDR *pHdr)
{
MMRESULT rc;
rc = waveInPrepareHeader (dev_, pHdr, sizeof (WAVEHDR));
- debug_printf ("%d = waveInPrepareHeader(0x%08x)", rc, pHdr);
+ debug_printf ("%u = waveInPrepareHeader(%p)", rc, pHdr);
if (rc == MMSYSERR_NOERROR)
{
rc = waveInAddBuffer (dev_, pHdr, sizeof (WAVEHDR));
- debug_printf ("%d = waveInAddBuffer(0x%08x)", rc, pHdr);
+ debug_printf ("%u = waveInAddBuffer(%p)", rc, pHdr);
}
if (rc == MMSYSERR_NOERROR)
return true;
@@ -854,7 +856,7 @@ fhandler_dev_dsp::Audio_in::init (unsigned blockSize)
}
pHdr_ = NULL;
rc = waveInStart (dev_);
- debug_printf ("%d = waveInStart(), queued=%d", rc, i);
+ debug_printf ("%u = waveInStart(), queued=%d", rc, i);
return (rc == MMSYSERR_NOERROR);
}
@@ -863,7 +865,7 @@ fhandler_dev_dsp::Audio_in::read (char *pSampleData, int &nBytes)
{
int bytes_to_read = nBytes;
nBytes = 0;
- debug_printf ("pSampleData=%08x nBytes=%d", pSampleData, bytes_to_read);
+ debug_printf ("pSampleData=%p nBytes=%d", pSampleData, bytes_to_read);
while (bytes_to_read != 0)
{ // Block till next sound has been read
if (!waitfordata ())
@@ -942,7 +944,7 @@ fhandler_dev_dsp::Audio_in::waitfordata ()
/* Errors are ignored here. They will probbaly cause a failure
in the subsequent PrepareHeader */
rc = waveInUnprepareHeader (dev_, pHdr, sizeof (WAVEHDR));
- debug_printf ("%d = waveInUnprepareHeader(0x%08x)", rc, pHdr);
+ debug_printf ("%u = waveInUnprepareHeader(%p)", rc, pHdr);
}
pHdr_ = pHdr;
bufferIndex_ = 0;
@@ -978,8 +980,8 @@ fhandler_dev_dsp::Audio_in::callback_blockfull (WAVEHDR *pHdr)
}
static void CALLBACK
-waveIn_callback (HWAVEIN hWave, UINT msg, DWORD instance, DWORD param1,
- DWORD param2)
+waveIn_callback (HWAVEIN hWave, UINT msg, DWORD_PTR instance, DWORD_PTR param1,
+ DWORD_PTR param2)
{
if (msg == WIM_DATA)
{
@@ -1039,7 +1041,7 @@ fhandler_dev_dsp::open (int flags, mode_t mode)
else
set_errno (err);
- debug_printf ("ACCMODE=0x%08x audio_in=%d audio_out=%d, err=%d",
+ debug_printf ("ACCMODE=%y audio_in=%d audio_out=%d, err=%d",
flags & O_ACCMODE, num_in, num_out, err);
return !err;
}
@@ -1050,7 +1052,7 @@ fhandler_dev_dsp::open (int flags, mode_t mode)
ssize_t __stdcall
fhandler_dev_dsp::write (const void *ptr, size_t len)
{
- debug_printf ("ptr=%08x len=%d", ptr, len);
+ debug_printf ("ptr=%p len=%ld", ptr, len);
int len_s = len;
const char *ptr_s = static_cast <const char *> (ptr);
@@ -1066,7 +1068,7 @@ fhandler_dev_dsp::write (const void *ptr, size_t len)
if (audio_out_->parsewav (ptr_s, len_s,
audiofreq_, audiobits_, audiochannels_))
- debug_printf ("=> ptr_s=%08x len_s=%d", ptr_s, len_s);
+ debug_printf ("=> ptr_s=%p len_s=%d", ptr_s, len_s);
}
else
{
@@ -1093,10 +1095,10 @@ fhandler_dev_dsp::write (const void *ptr, size_t len)
return len - len_s + written;
}
-void __stdcall
+void __reg3
fhandler_dev_dsp::read (void *ptr, size_t& len)
{
- debug_printf ("ptr=%08x len=%d", ptr, len);
+ debug_printf ("ptr=%p len=%ld", ptr, len);
if (audio_in_)
/* nothing to do */;
@@ -1129,8 +1131,8 @@ fhandler_dev_dsp::read (void *ptr, size_t& len)
audio_in_->read ((char *)ptr, (int&)len);
}
-_off64_t
-fhandler_dev_dsp::lseek (_off64_t offset, int whence)
+off_t
+fhandler_dev_dsp::lseek (off_t offset, int whence)
{
return 0;
}
@@ -1160,8 +1162,7 @@ fhandler_dev_dsp::close_audio_out (bool immediately)
int
fhandler_dev_dsp::close ()
{
- debug_printf ("audio_in=%08x audio_out=%08x",
- (int)audio_in_, (int)audio_out_);
+ debug_printf ("audio_in=%p audio_out=%p", audio_in_, audio_out_);
close_audio_in ();
close_audio_out (exit_state != ES_NOT_EXITING);
return 0;
@@ -1170,8 +1171,7 @@ fhandler_dev_dsp::close ()
int
fhandler_dev_dsp::ioctl (unsigned int cmd, void *buf)
{
- debug_printf ("audio_in=%08x audio_out=%08x",
- (int)audio_in_, (int)audio_out_);
+ debug_printf ("audio_in=%p audio_out=%p", audio_in_, audio_out_);
int *intbuf = (int *) buf;
switch (cmd)
{
@@ -1374,8 +1374,8 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *buf)
void
fhandler_dev_dsp::fixup_after_fork (HANDLE parent)
{ // called from new child process
- debug_printf ("audio_in=%08x audio_out=%08x",
- (int)audio_in_, (int)audio_out_);
+ debug_printf ("audio_in=%p audio_out=%p",
+ audio_in_, audio_out_);
if (audio_in_)
audio_in_->fork_fixup (parent);
@@ -1386,8 +1386,8 @@ fhandler_dev_dsp::fixup_after_fork (HANDLE parent)
void
fhandler_dev_dsp::fixup_after_exec ()
{
- debug_printf ("audio_in=%08x audio_out=%08x, close_on_exec %d",
- (int) audio_in_, (int) audio_out_, close_on_exec ());
+ debug_printf ("audio_in=%p audio_out=%p, close_on_exec %d",
+ audio_in_, audio_out_, close_on_exec ());
if (!close_on_exec ())
{
audio_in_ = NULL;
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 310cf828f..46a0aba58 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -274,7 +274,7 @@ fhandler_fifo::wait (HANDLE h)
}
}
-void __stdcall
+void __reg3
fhandler_fifo::raw_read (void *in_ptr, size_t& len)
{
size_t orig_len = len;
@@ -290,7 +290,7 @@ fhandler_fifo::raw_read (void *in_ptr, size_t& len)
could hang indefinitely. Maybe implement a timeout? */
if (!DisconnectNamedPipe (get_io_handle ()))
{
- debug_printf ("DisconnecttNamedPipe failed, %E");
+ debug_printf ("DisconnectNamedPipe failed, %E");
goto errno_out;
}
else if (!ConnectNamedPipe (get_io_handle (), get_overlapped ())
diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc
index bbbaf9ca5..9e4b1ce1d 100644
--- a/winsup/cygwin/fhandler_floppy.cc
+++ b/winsup/cygwin/fhandler_floppy.cc
@@ -53,7 +53,7 @@ fhandler_dev_floppy::get_drive_info (struct hd_geometry *geo)
/* Always try using the new EX ioctls first (>= XP). If not available,
fall back to trying the old non-EX ioctls.
Unfortunately the EX ioctls are not implemented in the floppy driver. */
- if (wincap.has_disk_ex_ioctls () && get_major () != DEV_FLOPPY_MAJOR)
+ if (get_major () != DEV_FLOPPY_MAJOR)
{
if (!DeviceIoControl (get_handle (),
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0,
@@ -76,95 +76,49 @@ fhandler_dev_floppy::get_drive_info (struct hd_geometry *geo)
if (!DeviceIoControl (get_handle (),
IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0,
dbuf, 256, &bytes_read, NULL))
- __seterrno ();
- else
{
- di = (DISK_GEOMETRY *) dbuf;
- if (!DeviceIoControl (get_handle (),
- IOCTL_DISK_GET_PARTITION_INFO, NULL, 0,
- pbuf, 256, &bytes_read, NULL))
- __seterrno ();
- else
- pi = (PARTITION_INFORMATION *) pbuf;
+ __seterrno ();
+ return -1;
}
+ di = (DISK_GEOMETRY *) dbuf;
+ if (!DeviceIoControl (get_handle (),
+ IOCTL_DISK_GET_PARTITION_INFO, NULL, 0,
+ pbuf, 256, &bytes_read, NULL))
+ __seterrno ();
+ else
+ pi = (PARTITION_INFORMATION *) pbuf;
}
- if (!di)
+ debug_printf ("disk geometry: (%D cyl)*(%u trk)*(%u sec)*(%u bps)",
+ di->Cylinders.QuadPart,
+ di->TracksPerCylinder,
+ di->SectorsPerTrack,
+ di->BytesPerSector);
+ bytes_per_sector = di->BytesPerSector;
+ if (pix)
{
- /* Up to Win2K, even IOCTL_DISK_GET_DRIVE_GEOMETRY fails when trying
- it on CD or DVD drives. In that case fall back to requesting
- simple file system information. */
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- FILE_FS_SIZE_INFORMATION ffsi;
-
- status = NtQueryVolumeInformationFile (get_handle (), &io, &ffsi,
- sizeof ffsi,
- FileFsSizeInformation);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- return -1;
- }
- debug_printf ("fsys geometry: (%D units)*(%u sec)*(%u bps)",
- ffsi.TotalAllocationUnits.QuadPart,
- ffsi.SectorsPerAllocationUnit,
- ffsi.BytesPerSector);
- bytes_per_sector = ffsi.BytesPerSector;
- drive_size = ffsi.TotalAllocationUnits.QuadPart
- * ffsi.SectorsPerAllocationUnit
- * ffsi.BytesPerSector;
- if (geo)
- {
- geo->heads = 1;
- geo->sectors = ffsi.SectorsPerAllocationUnit;
- geo->cylinders = ffsi.TotalAllocationUnits.LowPart;
- geo->start = 0;
- }
+ debug_printf ("partition info: offset %D length %D",
+ pix->StartingOffset.QuadPart,
+ pix->PartitionLength.QuadPart);
+ drive_size = pix->PartitionLength.QuadPart;
}
else
{
- debug_printf ("disk geometry: (%D cyl)*(%u trk)*(%u sec)*(%u bps)",
- di->Cylinders.QuadPart,
- di->TracksPerCylinder,
- di->SectorsPerTrack,
- di->BytesPerSector);
- bytes_per_sector = di->BytesPerSector;
+ debug_printf ("partition info: offset %D length %D",
+ pi->StartingOffset.QuadPart,
+ pi->PartitionLength.QuadPart);
+ drive_size = pi->PartitionLength.QuadPart;
+ }
+ if (geo)
+ {
+ geo->heads = di->TracksPerCylinder;
+ geo->sectors = di->SectorsPerTrack;
+ geo->cylinders = di->Cylinders.LowPart;
if (pix)
- {
- debug_printf ("partition info: offset %D length %D",
- pix->StartingOffset.QuadPart,
- pix->PartitionLength.QuadPart);
- drive_size = pix->PartitionLength.QuadPart;
- }
+ geo->start = pix->StartingOffset.QuadPart >> 9ULL;
else if (pi)
- {
- debug_printf ("partition info: offset %D length %D",
- pi->StartingOffset.QuadPart,
- pi->PartitionLength.QuadPart);
- drive_size = pi->PartitionLength.QuadPart;
- }
+ geo->start = pi->StartingOffset.QuadPart >> 9ULL;
else
- {
- /* Getting the partition size by using the drive geometry information
- looks wrong, but this is a historical necessity. NT4 didn't
- maintain partition information for the whole drive (aka
- "partition 0"), but returned ERROR_INVALID_HANDLE instead. That
- got fixed in W2K. */
- drive_size = di->Cylinders.QuadPart * di->TracksPerCylinder
- * di->SectorsPerTrack * di->BytesPerSector;
- }
- if (geo)
- {
- geo->heads = di->TracksPerCylinder;
- geo->sectors = di->SectorsPerTrack;
- geo->cylinders = di->Cylinders.LowPart;
- if (pix)
- geo->start = pix->StartingOffset.QuadPart >> 9ULL;
- else if (pi)
- geo->start = pi->StartingOffset.QuadPart >> 9ULL;
- else
- geo->start = 0;
- }
+ geo->start = 0;
}
debug_printf ("drive size: %D", drive_size);
@@ -180,7 +134,7 @@ fhandler_dev_floppy::read_file (void *buf, DWORD to_read, DWORD *read, int *err)
*err = 0;
if (!(ret = ReadFile (get_handle (), buf, to_read, read, 0)))
*err = GetLastError ();
- syscall_printf ("%d (err %d) = ReadFile (%d, %d, to_read %d, read %d, 0)",
+ syscall_printf ("%d (err %d) = ReadFile (%p, %p, to_read %u, read %u, 0)",
ret, *err, get_handle (), buf, to_read, *read);
return ret;
}
@@ -234,7 +188,7 @@ fhandler_dev_floppy::lock_partition (DWORD to_write)
FilePositionInformation);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtQueryInformationFile(FilePositionInformation): %p",
+ debug_printf ("NtQueryInformationFile(FilePositionInformation): %y",
status);
return FALSE;
}
@@ -268,7 +222,7 @@ fhandler_dev_floppy::lock_partition (DWORD to_write)
if (part_no >= MAX_PARTITIONS)
return FALSE;
found = TRUE;
- debug_printf ("%d %D->%D : %D->%D", part_no,
+ debug_printf ("%u %D->%D : %D->%D", part_no,
ppie->StartingOffset.QuadPart,
ppie->StartingOffset.QuadPart
+ ppie->PartitionLength.QuadPart,
@@ -305,7 +259,7 @@ fhandler_dev_floppy::lock_partition (DWORD to_write)
&io, FILE_SHARE_READ | FILE_SHARE_WRITE, 0);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtCreateFile(%W): %p", part, status);
+ debug_printf ("NtCreateFile(%W): %y", part, status);
return FALSE;
}
if (!DeviceIoControl (partitions->hdl[part_no - 1], FSCTL_LOCK_VOLUME,
@@ -349,7 +303,7 @@ fhandler_dev_floppy::write_file (const void *buf, DWORD to_write,
if (!(ret = WriteFile (get_handle (), buf, to_write, written, 0)))
*err = GetLastError ();
}
- syscall_printf ("%d (err %d) = WriteFile (%d, %d, write %d, written %d, 0)",
+ syscall_printf ("%d (err %d) = WriteFile (%p, %p, write %u, written %u, 0)",
ret, *err, get_handle (), buf, to_write, *written);
return ret;
}
@@ -377,7 +331,8 @@ fhandler_dev_floppy::open (int flags, mode_t)
Whoever uses O_DIRECT has my condolences. */
devbufsiz = MAX (16 * bytes_per_sector, 65536);
devbufalloc = new char [devbufsiz + devbufalign];
- devbuf = (char *) roundup2 ((uintptr_t) devbufalloc, devbufalign);
+ devbuf = (char *) roundup2 ((uintptr_t) devbufalloc,
+ (uintptr_t) devbufalign);
}
/* If we're not trying to access a floppy disk, make sure we're actually
@@ -418,7 +373,7 @@ fhandler_dev_floppy::dup (fhandler_base *child, int flags)
return ret;
}
-inline _off64_t
+inline off_t
fhandler_dev_floppy::get_current_position ()
{
LARGE_INTEGER off = { QuadPart: 0LL };
@@ -426,7 +381,7 @@ fhandler_dev_floppy::get_current_position ()
return off.QuadPart;
}
-void __stdcall
+void __reg3
fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen)
{
DWORD bytes_read = 0;
@@ -451,7 +406,7 @@ fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen)
if (devbufstart < devbufend)
{
bytes_to_read = MIN (len, devbufend - devbufstart);
- debug_printf ("read %d bytes from buffer (rest %d)",
+ debug_printf ("read %u bytes from buffer (rest %u)",
bytes_to_read,
devbufend - devbufstart - bytes_to_read);
memcpy (p, devbuf + devbufstart, bytes_to_read);
@@ -478,13 +433,13 @@ fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen)
tgt = devbuf;
bytes_to_read = devbufsiz;
}
- _off64_t current_position = get_current_position ();
+ off_t current_position = get_current_position ();
if (current_position + bytes_to_read >= drive_size)
bytes_to_read = drive_size - current_position;
if (!bytes_to_read)
break;
- debug_printf ("read %d bytes from pos %U %s", bytes_to_read,
+ debug_printf ("read %u bytes from pos %U %s", bytes_to_read,
current_position,
len < devbufsiz ? "into buffer" : "directly");
if (!read_file (tgt, bytes_to_read, &read2, &ret))
@@ -527,11 +482,11 @@ fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen)
}
else
{
- _off64_t current_position = get_current_position ();
+ off_t current_position = get_current_position ();
bytes_to_read = len;
if (current_position + bytes_to_read >= drive_size)
bytes_to_read = drive_size - current_position;
- debug_printf ("read %d bytes from pos %U directly", bytes_to_read,
+ debug_printf ("read %u bytes from pos %U directly", bytes_to_read,
current_position);
if (bytes_to_read && !read_file (p, bytes_to_read, &bytes_read, &ret))
{
@@ -558,7 +513,7 @@ err:
ulen = (size_t) -1;
}
-int __stdcall
+ssize_t __reg3
fhandler_dev_floppy::raw_write (const void *ptr, size_t len)
{
DWORD bytes_written = 0;
@@ -585,7 +540,7 @@ fhandler_dev_floppy::raw_write (const void *ptr, size_t len)
buffer in case we seek to an address which is not sector aligned. */
if (devbufend && devbufstart < devbufend)
{
- _off64_t current_pos = get_current_position ();
+ off_t current_pos = get_current_position ();
cplen = MIN (len, devbufend - devbufstart);
memcpy (devbuf + devbufstart, p, cplen);
LARGE_INTEGER off = { QuadPart:current_pos - devbufend };
@@ -647,7 +602,7 @@ fhandler_dev_floppy::raw_write (const void *ptr, size_t len)
}
return bytes_written;
}
-
+
/* In O_DIRECT case, just write. */
if (write_file (p, len, &bytes_written, &ret))
return bytes_written;
@@ -664,11 +619,11 @@ err:
return bytes_written ?: -1;
}
-_off64_t
-fhandler_dev_floppy::lseek (_off64_t offset, int whence)
+off_t
+fhandler_dev_floppy::lseek (off_t offset, int whence)
{
char buf[bytes_per_sector];
- _off64_t current_pos = (_off64_t) -1;
+ off_t current_pos = (off_t) -1;
LARGE_INTEGER sector_aligned_offset;
size_t bytes_left;
@@ -680,7 +635,7 @@ fhandler_dev_floppy::lseek (_off64_t offset, int whence)
else if (whence == SEEK_CUR)
{
current_pos = get_current_position ();
- _off64_t exact_pos = current_pos - (devbufend - devbufstart);
+ off_t exact_pos = current_pos - (devbufend - devbufstart);
/* Shortcut when used to get current position. */
if (offset == 0)
return exact_pos;
@@ -697,7 +652,7 @@ fhandler_dev_floppy::lseek (_off64_t offset, int whence)
/* If new position is in buffered range, adjust buffer and return */
if (devbufstart < devbufend)
{
- if (current_pos == (_off64_t) -1)
+ if (current_pos == (off_t) -1)
current_pos = get_current_position ();
if (current_pos - devbufend <= offset && offset <= current_pos)
{
@@ -749,7 +704,7 @@ fhandler_dev_floppy::ioctl (unsigned int cmd, void *buf)
if (cmd == BLKGETSIZE)
*(long *)buf = drive_size >> 9UL;
else
- *(_off64_t *)buf = drive_size;
+ *(off_t *)buf = drive_size;
break;
case BLKRRPART:
debug_printf ("BLKRRPART");
@@ -764,19 +719,19 @@ fhandler_dev_floppy::ioctl (unsigned int cmd, void *buf)
break;
case BLKSSZGET:
debug_printf ("BLKSSZGET");
- *(int *)buf = bytes_per_sector;
+ *(int *)buf = (int) bytes_per_sector;
break;
case BLKIOMIN:
debug_printf ("BLKIOMIN");
- *(int *)buf = bytes_per_sector;
+ *(int *)buf = (int) bytes_per_sector;
break;
case BLKIOOPT:
debug_printf ("BLKIOOPT");
- *(int *)buf = bytes_per_sector;
+ *(int *)buf = (int) bytes_per_sector;
break;
case BLKPBSZGET:
debug_printf ("BLKPBSZGET");
- *(int *)buf = bytes_per_sector;
+ *(int *)buf = (int) bytes_per_sector;
break;
case BLKALIGNOFF:
debug_printf ("BLKALIGNOFF");
diff --git a/winsup/cygwin/fhandler_mailslot.cc b/winsup/cygwin/fhandler_mailslot.cc
index a6cec5fd2..217e3b7ee 100644
--- a/winsup/cygwin/fhandler_mailslot.cc
+++ b/winsup/cygwin/fhandler_mailslot.cc
@@ -29,7 +29,7 @@ fhandler_mailslot::fhandler_mailslot ()
}
int __reg2
-fhandler_mailslot::fstat (struct __stat64 *buf)
+fhandler_mailslot::fstat (struct stat *buf)
{
debug_printf ("here");
@@ -146,7 +146,7 @@ fhandler_mailslot::open (int flags, mode_t mode)
return res;
}
-ssize_t __stdcall
+ssize_t __reg3
fhandler_mailslot::raw_write (const void *ptr, size_t len)
{
/* Check for 425/426 byte weirdness */
@@ -177,7 +177,7 @@ fhandler_mailslot::ioctl (unsigned int cmd, void *buf)
FileMailslotSetInformation);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtSetInformationFile (%X): %08x",
+ debug_printf ("NtSetInformationFile (%X): %p",
fmsi.ReadTimeout.QuadPart, status);
__seterrno_from_nt_status (status);
break;
diff --git a/winsup/cygwin/fhandler_mem.cc b/winsup/cygwin/fhandler_mem.cc
index e7e0d41b8..b3f8def80 100644
--- a/winsup/cygwin/fhandler_mem.cc
+++ b/winsup/cygwin/fhandler_mem.cc
@@ -37,7 +37,7 @@ fhandler_dev_mem::open (int flags, mode_t)
if (!wincap.has_physical_mem_access ())
{
set_errno (EACCES);
- debug_printf ("%s is accessible under NT4/W2K/XP only", dev ().name);
+ debug_printf ("%s is accessible under XP only", dev ().name);
return 0;
}
@@ -49,17 +49,18 @@ fhandler_dev_mem::open (int flags, mode_t)
if (NT_SUCCESS (status))
{
__seterrno_from_nt_status (status);
- debug_printf("NtQuerySystemInformation: status %p, %E", status);
+ debug_printf("NtQuerySystemInformation: status %p", status);
mem_size = 0;
}
else
- mem_size = sbi.PhysicalPageSize * sbi.NumberOfPhysicalPages;
- debug_printf ("MemSize: %d MB", mem_size >> 20);
+ mem_size = (SIZE_T) sbi.PhysicalPageSize
+ * (SIZE_T) sbi.NumberOfPhysicalPages;
+ debug_printf ("MemSize: %ld MB", mem_size >> 20);
}
else if (dev () == FH_KMEM) /* /dev/kmem - Not yet supported */
{
mem_size = 0;
- debug_printf ("KMemSize: %d MB", mem_size >> 20);
+ debug_printf ("KMemSize: %ld MB", mem_size >> 20);
}
else if (dev () == FH_PORT) /* /dev/port == First 64K of /dev/mem */
{
@@ -119,7 +120,7 @@ fhandler_dev_mem::open (int flags, mode_t)
ssize_t __stdcall
fhandler_dev_mem::write (const void *ptr, size_t ulen)
{
- if (!ulen || pos >= mem_size)
+ if (!ulen || pos >= (off_t) mem_size)
return 0;
if (!(get_access () & GENERIC_WRITE))
@@ -129,12 +130,12 @@ fhandler_dev_mem::write (const void *ptr, size_t ulen)
}
if (pos + ulen > mem_size)
- ulen = mem_size - pos;
+ ulen = (off_t) mem_size - pos;
PHYSICAL_ADDRESS phys;
NTSTATUS status;
void *viewmem = NULL;
- DWORD len = ulen + wincap.page_size () - 1;
+ SIZE_T len = ulen + wincap.page_size () - 1;
phys.QuadPart = (ULONGLONG) pos;
status = NtMapViewOfSection (get_handle (), INVALID_HANDLE_VALUE, &viewmem,
@@ -159,10 +160,10 @@ fhandler_dev_mem::write (const void *ptr, size_t ulen)
return ulen;
}
-void __stdcall
+void __reg3
fhandler_dev_mem::read (void *ptr, size_t& ulen)
{
- if (!ulen || pos >= mem_size)
+ if (!ulen || pos >= (off_t) mem_size)
{
ulen = 0;
return;
@@ -176,12 +177,12 @@ fhandler_dev_mem::read (void *ptr, size_t& ulen)
}
if (pos + ulen > mem_size)
- ulen = mem_size - pos;
+ ulen = (off_t) mem_size - pos;
PHYSICAL_ADDRESS phys;
NTSTATUS status;
void *viewmem = NULL;
- DWORD len = ulen + wincap.page_size () - 1;
+ SIZE_T len = ulen + wincap.page_size () - 1;
phys.QuadPart = (ULONGLONG) pos;
status = NtMapViewOfSection (get_handle (), INVALID_HANDLE_VALUE, &viewmem,
@@ -207,8 +208,8 @@ fhandler_dev_mem::read (void *ptr, size_t& ulen)
pos += ulen;
}
-_off64_t
-fhandler_dev_mem::lseek (_off64_t offset, int whence)
+off_t
+fhandler_dev_mem::lseek (off_t offset, int whence)
{
switch (whence)
{
@@ -221,7 +222,7 @@ fhandler_dev_mem::lseek (_off64_t offset, int whence)
break;
case SEEK_END:
- pos = mem_size;
+ pos = (off_t) mem_size;
pos += offset;
break;
@@ -230,7 +231,7 @@ fhandler_dev_mem::lseek (_off64_t offset, int whence)
return ILLEGAL_SEEK;
}
- if (pos > mem_size)
+ if (pos > (off_t) mem_size)
{
set_errno (EINVAL);
return ILLEGAL_SEEK;
@@ -240,7 +241,7 @@ fhandler_dev_mem::lseek (_off64_t offset, int whence)
}
int __reg2
-fhandler_dev_mem::fstat (struct __stat64 *buf)
+fhandler_dev_mem::fstat (struct stat *buf)
{
fhandler_base::fstat (buf);
buf->st_blksize = wincap.page_size ();
diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc
index 84e840cff..af9abcada 100644
--- a/winsup/cygwin/fhandler_netdrive.cc
+++ b/winsup/cygwin/fhandler_netdrive.cc
@@ -1,6 +1,6 @@
/* fhandler_netdrive.cc: fhandler for // and //MACHINE handling
- Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Red Hat, Inc.
+ Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -175,7 +175,7 @@ fhandler_netdrive::fhandler_netdrive ():
}
int __reg2
-fhandler_netdrive::fstat (struct __stat64 *buf)
+fhandler_netdrive::fstat (struct stat *buf)
{
const char *path = get_name ();
debug_printf ("fstat (%s)", path);
@@ -246,7 +246,7 @@ fhandler_netdrive::readdir (DIR *dir, dirent *de)
de->d_ino = readdir_get_ino (nro->lpRemoteName, false);
/* We can't trust remote inode numbers of only 32 bit. That means,
remote NT4 NTFS, as well as shares of Samba version < 3.0. */
- if (de->d_ino <= UINT_MAX)
+ if (de->d_ino <= UINT32_MAX)
de->d_ino = hash_path_name (0, nro->lpRemoteName);
}
de->d_type = DT_DIR;
@@ -318,7 +318,7 @@ fhandler_netdrive::open (int flags, mode_t mode)
set_flags ((flags & ~O_TEXT) | O_BINARY | O_DIROPEN);
set_open_status ();
out:
- syscall_printf ("%d = fhandler_netdrive::open(%p, %d)", res, flags, mode);
+ syscall_printf ("%d = fhandler_netdrive::open(%y, 0%o)", res, flags, mode);
return res;
}
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index 57a1532a2..58e628aa9 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -1,7 +1,7 @@
/* fhandler_proc.cc: fhandler for /proc virtual filesystem
- Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013
- Red Hat, Inc.
+ Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
+ 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -36,19 +36,19 @@ details. */
#define _COMPILING_NEWLIB
#include <dirent.h>
-static _off64_t format_proc_loadavg (void *, char *&);
-static _off64_t format_proc_meminfo (void *, char *&);
-static _off64_t format_proc_stat (void *, char *&);
-static _off64_t format_proc_version (void *, char *&);
-static _off64_t format_proc_uptime (void *, char *&);
-static _off64_t format_proc_cpuinfo (void *, char *&);
-static _off64_t format_proc_partitions (void *, char *&);
-static _off64_t format_proc_self (void *, char *&);
-static _off64_t format_proc_mounts (void *, char *&);
-static _off64_t format_proc_filesystems (void *, char *&);
-static _off64_t format_proc_swaps (void *, char *&);
-static _off64_t format_proc_devices (void *, char *&);
-static _off64_t format_proc_misc (void *, char *&);
+static off_t format_proc_loadavg (void *, char *&);
+static off_t format_proc_meminfo (void *, char *&);
+static off_t format_proc_stat (void *, char *&);
+static off_t format_proc_version (void *, char *&);
+static off_t format_proc_uptime (void *, char *&);
+static off_t format_proc_cpuinfo (void *, char *&);
+static off_t format_proc_partitions (void *, char *&);
+static off_t format_proc_self (void *, char *&);
+static off_t format_proc_mounts (void *, char *&);
+static off_t format_proc_filesystems (void *, char *&);
+static off_t format_proc_swaps (void *, char *&);
+static off_t format_proc_devices (void *, char *&);
+static off_t format_proc_misc (void *, char *&);
/* names of objects in /proc */
static const virt_tab_t proc_tab[] = {
@@ -185,7 +185,7 @@ fhandler_proc::fhandler_proc ():
}
int __reg2
-fhandler_proc::fstat (struct __stat64 *buf)
+fhandler_proc::fstat (struct stat *buf)
{
const char *path = get_name ();
debug_printf ("fstat (%s)", path);
@@ -377,7 +377,7 @@ success:
set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status ();
out:
- syscall_printf ("%d = fhandler_proc::open(%p, %d)", res, flags, mode);
+ syscall_printf ("%d = fhandler_proc::open(%y, 0%o)", res, flags, mode);
return res;
}
@@ -393,7 +393,7 @@ fhandler_proc::fill_filebuf ()
return false;
}
-static _off64_t
+static off_t
format_proc_version (void *, char *&destbuf)
{
tmp_pathbuf tp;
@@ -411,7 +411,7 @@ format_proc_version (void *, char *&destbuf)
return bufptr - buf;
}
-static _off64_t
+static off_t
format_proc_loadavg (void *, char *&destbuf)
{
extern int get_process_state (DWORD dwProcessId);
@@ -431,7 +431,7 @@ format_proc_loadavg (void *, char *&destbuf)
0, 0, 0, 0, 0, 0, running, pids.npids);
}
-static _off64_t
+static off_t
format_proc_meminfo (void *, char *&destbuf)
{
unsigned long long mem_total, mem_free, swap_total, swap_free;
@@ -457,12 +457,12 @@ format_proc_meminfo (void *, char *&destbuf)
swap_total >> 10, swap_free >> 10);
}
-static _off64_t
+static off_t
format_proc_uptime (void *, char *&destbuf)
{
unsigned long long uptime = 0ULL, idle_time = 0ULL;
NTSTATUS status;
- SYSTEM_TIME_OF_DAY_INFORMATION stodi;
+ SYSTEM_TIMEOFDAY_INFORMATION stodi;
/* Sizeof SYSTEM_PERFORMANCE_INFORMATION on 64 bit systems. It
appears to contain some trailing additional information from
what I can tell after examining the content.
@@ -477,7 +477,7 @@ format_proc_uptime (void *, char *&destbuf)
uptime = (stodi.CurrentTime.QuadPart - stodi.BootTime.QuadPart) / 100000ULL;
else
debug_printf ("NtQuerySystemInformation(SystemTimeOfDayInformation), "
- "status %p", status);
+ "status %y", status);
if (NT_SUCCESS (NtQuerySystemInformation (SystemPerformanceInformation,
spi, sizeof_spi, NULL)))
@@ -490,7 +490,7 @@ format_proc_uptime (void *, char *&destbuf)
idle_time / 100, long (idle_time % 100));
}
-static _off64_t
+static off_t
format_proc_stat (void *, char *&destbuf)
{
unsigned long pages_in = 0UL, pages_out = 0UL, interrupt_count = 0UL,
@@ -504,18 +504,19 @@ format_proc_stat (void *, char *&destbuf)
const size_t sizeof_spi = sizeof (SYSTEM_PERFORMANCE_INFORMATION) + 16;
PSYSTEM_PERFORMANCE_INFORMATION spi = (PSYSTEM_PERFORMANCE_INFORMATION)
alloca (sizeof_spi);
- SYSTEM_TIME_OF_DAY_INFORMATION stodi;
+ SYSTEM_TIMEOFDAY_INFORMATION stodi;
tmp_pathbuf tp;
char *buf = tp.c_get ();
char *eobuf = buf;
- SYSTEM_PROCESSOR_TIMES spt[wincap.cpu_count ()];
- status = NtQuerySystemInformation (SystemProcessorTimes, (PVOID) spt,
+ SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION spt[wincap.cpu_count ()];
+ status = NtQuerySystemInformation (SystemProcessorPerformanceInformation,
+ (PVOID) spt,
sizeof spt[0] * wincap.cpu_count (), NULL);
if (!NT_SUCCESS (status))
- debug_printf ("NtQuerySystemInformation(SystemProcessorTimes), "
- "status %p", status);
+ debug_printf ("NtQuerySystemInformation(SystemProcessorPerformanceInformation), "
+ "status %y", status);
else
{
unsigned long long user_time = 0ULL, kernel_time = 0ULL, idle_time = 0ULL;
@@ -545,14 +546,14 @@ format_proc_stat (void *, char *&destbuf)
if (!NT_SUCCESS (status))
{
debug_printf ("NtQuerySystemInformation(SystemPerformanceInformation)"
- ", status %p", status);
+ ", status %y", status);
memset (spi, 0, sizeof_spi);
}
status = NtQuerySystemInformation (SystemTimeOfDayInformation,
(PVOID) &stodi, sizeof stodi, NULL);
if (!NT_SUCCESS (status))
debug_printf ("NtQuerySystemInformation(SystemTimeOfDayInformation), "
- "status %p", status);
+ "status %y", status);
}
if (!NT_SUCCESS (status))
{
@@ -588,7 +589,7 @@ format_proc_stat (void *, char *&destbuf)
#define print(x) { bufptr = stpcpy (bufptr, (x)); }
-static _off64_t
+static off_t
format_proc_cpuinfo (void *, char *&destbuf)
{
DWORD orig_affinity_mask;
@@ -1078,7 +1079,7 @@ format_proc_cpuinfo (void *, char *&destbuf)
return bufptr - buf;
}
-static _off64_t
+static off_t
format_proc_partitions (void *, char *&destbuf)
{
OBJECT_ATTRIBUTES attr;
@@ -1098,7 +1099,7 @@ format_proc_partitions (void *, char *&destbuf)
status = NtOpenDirectoryObject (&dirhdl, DIRECTORY_QUERY, &attr);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtOpenDirectoryObject, status %p", status);
+ debug_printf ("NtOpenDirectoryObject, status %y", status);
__seterrno_from_nt_status (status);
return 0;
}
@@ -1138,14 +1139,11 @@ format_proc_partitions (void *, char *&destbuf)
upath.MaximumLength = upath.Length + sizeof (WCHAR);
InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE,
dirhdl, NULL);
- /* Up to W2K the handle needs read access to fetch the partition info. */
- status = NtOpenFile (&devhdl, wincap.has_disk_ex_ioctls ()
- ? READ_CONTROL
- : READ_CONTROL | FILE_READ_DATA,
- &attr, &io, FILE_SHARE_VALID_FLAGS, 0);
+ status = NtOpenFile (&devhdl, READ_CONTROL, &attr, &io,
+ FILE_SHARE_VALID_FLAGS, 0);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtOpenFile(%S), status %p", &upath, status);
+ debug_printf ("NtOpenFile(%S), status %y", &upath, status);
__seterrno_from_nt_status (status);
continue;
}
@@ -1155,9 +1153,8 @@ format_proc_partitions (void *, char *&destbuf)
got_one = true;
}
/* Fetch partition info for the entire disk to get its size. */
- if (wincap.has_disk_ex_ioctls ()
- && DeviceIoControl (devhdl, IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0,
- ioctl_buf, NT_MAX_PATH, &bytes_read, NULL))
+ if (DeviceIoControl (devhdl, IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0,
+ ioctl_buf, NT_MAX_PATH, &bytes_read, NULL))
{
pix = (PARTITION_INFORMATION_EX *) ioctl_buf;
size = pix->PartitionLength.QuadPart;
@@ -1179,9 +1176,8 @@ format_proc_partitions (void *, char *&destbuf)
dev.get_major (), dev.get_minor (),
size >> 10, dev.name + 5);
/* Fetch drive layout info to get size of all partitions on the disk. */
- if (wincap.has_disk_ex_ioctls ()
- && DeviceIoControl (devhdl, IOCTL_DISK_GET_DRIVE_LAYOUT_EX,
- NULL, 0, ioctl_buf, NT_MAX_PATH, &bytes_read, NULL))
+ if (DeviceIoControl (devhdl, IOCTL_DISK_GET_DRIVE_LAYOUT_EX,
+ NULL, 0, ioctl_buf, NT_MAX_PATH, &bytes_read, NULL))
{
PDRIVE_LAYOUT_INFORMATION_EX pdlix = (PDRIVE_LAYOUT_INFORMATION_EX)
ioctl_buf;
@@ -1213,13 +1209,7 @@ format_proc_partitions (void *, char *&destbuf)
else
{
size = pi->PartitionLength.QuadPart;
- /* Pre-W2K you can't rely on the partition number info for
- unused partitions. */
- if (pi->PartitionType == PARTITION_ENTRY_UNUSED
- || pi->PartitionType == PARTITION_EXTENDED)
- part_num = 0;
- else
- part_num = pi->PartitionNumber;
+ part_num = pi->PartitionNumber;
++pi;
}
/* A partition number of 0 denotes an extended partition or a
@@ -1244,21 +1234,21 @@ format_proc_partitions (void *, char *&destbuf)
return bufptr - buf;
}
-static _off64_t
+static off_t
format_proc_self (void *, char *&destbuf)
{
destbuf = (char *) crealloc_abort (destbuf, 16);
return __small_sprintf (destbuf, "%d", getpid ());
}
-static _off64_t
+static off_t
format_proc_mounts (void *, char *&destbuf)
{
destbuf = (char *) crealloc_abort (destbuf, sizeof ("self/mounts"));
return __small_sprintf (destbuf, "self/mounts");
}
-static _off64_t
+static off_t
format_proc_filesystems (void *, char *&destbuf)
{
tmp_pathbuf tp;
@@ -1276,7 +1266,7 @@ format_proc_filesystems (void *, char *&destbuf)
return bufptr - buf;
}
-static _off64_t
+static off_t
format_proc_swaps (void *, char *&destbuf)
{
unsigned long long total = 0ULL, used = 0ULL;
@@ -1338,7 +1328,7 @@ format_proc_swaps (void *, char *&destbuf)
return bufptr - buf;
}
-static _off64_t
+static off_t
format_proc_devices (void *, char *&destbuf)
{
tmp_pathbuf tp;
@@ -1382,7 +1372,7 @@ format_proc_devices (void *, char *&destbuf)
return bufptr - buf;
}
-static _off64_t
+static off_t
format_proc_misc (void *, char *&destbuf)
{
tmp_pathbuf tp;
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 9faeb7d98..044757d74 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -34,25 +34,25 @@ details. */
#define _COMPILING_NEWLIB
#include <dirent.h>
-static _off64_t format_process_maps (void *, char *&);
-static _off64_t format_process_stat (void *, char *&);
-static _off64_t format_process_status (void *, char *&);
-static _off64_t format_process_statm (void *, char *&);
-static _off64_t format_process_winexename (void *, char *&);
-static _off64_t format_process_winpid (void *, char *&);
-static _off64_t format_process_exename (void *, char *&);
-static _off64_t format_process_root (void *, char *&);
-static _off64_t format_process_cwd (void *, char *&);
-static _off64_t format_process_cmdline (void *, char *&);
-static _off64_t format_process_ppid (void *, char *&);
-static _off64_t format_process_uid (void *, char *&);
-static _off64_t format_process_pgid (void *, char *&);
-static _off64_t format_process_sid (void *, char *&);
-static _off64_t format_process_gid (void *, char *&);
-static _off64_t format_process_ctty (void *, char *&);
-static _off64_t format_process_fd (void *, char *&);
-static _off64_t format_process_mounts (void *, char *&);
-static _off64_t format_process_mountinfo (void *, char *&);
+static off_t format_process_maps (void *, char *&);
+static off_t format_process_stat (void *, char *&);
+static off_t format_process_status (void *, char *&);
+static off_t format_process_statm (void *, char *&);
+static off_t format_process_winexename (void *, char *&);
+static off_t format_process_winpid (void *, char *&);
+static off_t format_process_exename (void *, char *&);
+static off_t format_process_root (void *, char *&);
+static off_t format_process_cwd (void *, char *&);
+static off_t format_process_cmdline (void *, char *&);
+static off_t format_process_ppid (void *, char *&);
+static off_t format_process_uid (void *, char *&);
+static off_t format_process_pgid (void *, char *&);
+static off_t format_process_sid (void *, char *&);
+static off_t format_process_gid (void *, char *&);
+static off_t format_process_ctty (void *, char *&);
+static off_t format_process_fd (void *, char *&);
+static off_t format_process_mounts (void *, char *&);
+static off_t format_process_mountinfo (void *, char *&);
static const virt_tab_t process_tab[] =
{
@@ -137,7 +137,7 @@ fhandler_process::fhandler_process ():
}
int __reg2
-fhandler_process::fstat (struct __stat64 *buf)
+fhandler_process::fstat (struct stat *buf)
{
const char *path = get_name ();
int file_type = exists ();
@@ -222,7 +222,7 @@ fhandler_process::readdir (DIR *dir, dirent *de)
int res = ENMFILE;
if (process_tab[fileid].fhandler == FH_PROCESSFD)
{
- if (dir->__d_position >= 2 + filesize / sizeof (int))
+ if ((size_t) dir->__d_position >= 2 + filesize / sizeof (int))
goto out;
}
else if (dir->__d_position >= PROCESS_LINK_COUNT)
@@ -314,7 +314,7 @@ success:
set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status ();
out:
- syscall_printf ("%d = fhandler_proc::open(%p, %d)", res, flags, mode);
+ syscall_printf ("%d = fhandler_proc::open(%y, 0%o)", res, flags, mode);
return res;
}
@@ -356,7 +356,7 @@ fhandler_process::fill_filebuf ()
return false;
}
-static _off64_t
+static off_t
format_process_fd (void *data, char *&destbuf)
{
_pinfo *p = ((process_fd_t *) data)->p;
@@ -390,7 +390,7 @@ format_process_fd (void *data, char *&destbuf)
return fs;
}
-static _off64_t
+static off_t
format_process_ppid (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -398,7 +398,7 @@ format_process_ppid (void *data, char *&destbuf)
return __small_sprintf (destbuf, "%d\n", p->ppid);
}
-static _off64_t
+static off_t
format_process_uid (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -406,7 +406,7 @@ format_process_uid (void *data, char *&destbuf)
return __small_sprintf (destbuf, "%d\n", p->uid);
}
-static _off64_t
+static off_t
format_process_pgid (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -414,7 +414,7 @@ format_process_pgid (void *data, char *&destbuf)
return __small_sprintf (destbuf, "%d\n", p->pgid);
}
-static _off64_t
+static off_t
format_process_sid (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -422,7 +422,7 @@ format_process_sid (void *data, char *&destbuf)
return __small_sprintf (destbuf, "%d\n", p->sid);
}
-static _off64_t
+static off_t
format_process_gid (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -430,7 +430,7 @@ format_process_gid (void *data, char *&destbuf)
return __small_sprintf (destbuf, "%d\n", p->gid);
}
-static _off64_t
+static off_t
format_process_ctty (void *data, char *&destbuf)
{
device d;
@@ -440,7 +440,7 @@ format_process_ctty (void *data, char *&destbuf)
return __small_sprintf (destbuf, "%s\n", d.name);
}
-static _off64_t
+static off_t
format_process_root (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -460,7 +460,7 @@ format_process_root (void *data, char *&destbuf)
return fs;
}
-static _off64_t
+static off_t
format_process_cwd (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -480,7 +480,7 @@ format_process_cwd (void *data, char *&destbuf)
return fs;
}
-static _off64_t
+static off_t
format_process_cmdline (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -500,7 +500,7 @@ format_process_cmdline (void *data, char *&destbuf)
return fs;
}
-static _off64_t
+static off_t
format_process_exename (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -526,7 +526,7 @@ format_process_exename (void *data, char *&destbuf)
return len;
}
-static _off64_t
+static off_t
format_process_winpid (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -534,7 +534,7 @@ format_process_winpid (void *data, char *&destbuf)
return __small_sprintf (destbuf, "%d\n", p->dwProcessId);
}
-static _off64_t
+static off_t
format_process_winexename (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -647,15 +647,15 @@ struct thread_info
{
NTSTATUS status;
PVOID buf = NULL;
- size_t size = 50 * (sizeof (SYSTEM_PROCESSES)
- + 16 * sizeof (SYSTEM_THREADS));
- PSYSTEM_PROCESSES proc;
+ ULONG size = 50 * (sizeof (SYSTEM_PROCESS_INFORMATION)
+ + 16 * sizeof (SYSTEM_THREADS));
+ PSYSTEM_PROCESS_INFORMATION proc;
PSYSTEM_THREADS thread;
do
{
buf = realloc (buf, size);
- status = NtQuerySystemInformation (SystemProcessesAndThreadsInformation,
+ status = NtQuerySystemInformation (SystemProcessInformation,
buf, size, NULL);
size <<= 1;
}
@@ -664,30 +664,30 @@ struct thread_info
{
if (buf)
free (buf);
- debug_printf ("NtQuerySystemInformation, %p", status);
+ debug_printf ("NtQuerySystemInformation, %y", status);
return;
}
- proc = (PSYSTEM_PROCESSES) buf;
+ proc = (PSYSTEM_PROCESS_INFORMATION) buf;
while (true)
{
- if (proc->ProcessId == pid)
+ if ((DWORD) (uintptr_t) proc->UniqueProcessId == pid)
break;
- if (!proc->NextEntryDelta)
+ if (!proc->NextEntryOffset)
{
free (buf);
return;
}
- proc = (PSYSTEM_PROCESSES) ((PBYTE) proc + proc->NextEntryDelta);
+ proc = (PSYSTEM_PROCESS_INFORMATION) ((PBYTE) proc + proc->NextEntryOffset);
}
thread = proc->Threads;
- for (ULONG i = 0; i < proc->ThreadCount; ++i)
+ for (ULONG i = 0; i < proc->NumberOfThreads; ++i)
{
THREAD_BASIC_INFORMATION tbi;
TEB teb;
HANDLE thread_h;
if (!(thread_h = OpenThread (THREAD_QUERY_INFORMATION, FALSE,
- (ULONG) thread[i].ClientId.UniqueThread)))
+ (ULONG) (ULONG_PTR) thread[i].ClientId.UniqueThread)))
continue;
status = NtQueryInformationThread (thread_h, ThreadBasicInformation,
&tbi, sizeof tbi, NULL);
@@ -697,7 +697,7 @@ struct thread_info
region *r = (region *) malloc (sizeof (region));
if (r)
{
- *r = (region) { regions, (ULONG) thread[i].ClientId.UniqueThread,
+ *r = (region) { regions, (ULONG) (ULONG_PTR) thread[i].ClientId.UniqueThread,
(char *) tbi.TebBaseAddress,
(char *) tbi.TebBaseAddress + wincap.page_size (),
true };
@@ -709,7 +709,7 @@ struct thread_info
r = (region *) malloc (sizeof (region));
if (r)
{
- *r = (region) { regions, (ULONG) thread[i].ClientId.UniqueThread,
+ *r = (region) { regions, (ULONG) (ULONG_PTR) thread[i].ClientId.UniqueThread,
(char *) (teb.DeallocationStack
?: teb.Tib.StackLimit),
(char *) teb.Tib.StackBase,
@@ -751,7 +751,7 @@ struct thread_info
}
};
-static _off64_t
+static off_t
format_process_maps (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -780,12 +780,12 @@ format_process_maps (void *data, char *&destbuf)
ReadProcessMemory (proc, &cygheap->user_heap, &user_heap,
sizeof user_heap, NULL);
- _off64_t len = 0;
+ off_t len = 0;
union access
{
char flags[8];
- _off64_t word;
+ off_t word;
} a;
struct region {
@@ -799,7 +799,7 @@ format_process_maps (void *data, char *&destbuf)
dos_drive_mappings drive_maps;
heap_info heaps (p->dwProcessId);
thread_info threads (p->dwProcessId, proc);
- struct __stat64 st;
+ struct stat st;
long last_pass = 0;
tmp_pathbuf tp;
@@ -815,7 +815,12 @@ format_process_maps (void *data, char *&destbuf)
/* Iterate over each VM region in the address space, coalescing
memory regions with the same permissions. Once we run out, do one
- last_pass to trigger output of the last accumulated region. */
+ last_pass to trigger output of the last accumulated region.
+
+ FIXME: 32 bit processes can't get address information beyond the
+ 32 bit address space from 64 bit processes. We have to run
+ this functionality in the target process, if the target
+ process is 64 bit and our own process is 32 bit. */
for (char *i = 0;
VirtualQueryEx (proc, i, &mb, sizeof(mb)) || (1 == ++last_pass);
i = cur.rend)
@@ -867,9 +872,9 @@ format_process_maps (void *data, char *&destbuf)
{
size_t newlen = strlen (posix_modname) + 62;
if (len + newlen >= maxsize)
- destbuf = (char *) crealloc_abort (destbuf,
- maxsize += roundup2 (newlen,
- 2048));
+ destbuf = (char *)
+ crealloc_abort (destbuf,
+ maxsize += roundup2 (newlen, 2048UL));
int written = __small_sprintf (destbuf + len,
"%08lx-%08lx %s %08lx %04x:%04x %U ",
cur.rbase, cur.rend, cur.a.flags,
@@ -889,7 +894,7 @@ format_process_maps (void *data, char *&destbuf)
{
/* If the return length pointer is missing, NtQueryVirtualMemory
returns with STATUS_ACCESS_VIOLATION on Windows 2000. */
- ULONG ret_len = 0;
+ SIZE_T ret_len = 0;
st.st_dev = 0;
st.st_ino = 0;
@@ -932,7 +937,7 @@ format_process_maps (void *data, char *&destbuf)
return len;
}
-static _off64_t
+static off_t
format_process_stat (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -975,8 +980,8 @@ format_process_stat (void *data, char *&destbuf)
KERNEL_USER_TIMES put;
PROCESS_BASIC_INFORMATION pbi;
QUOTA_LIMITS ql;
- SYSTEM_TIME_OF_DAY_INFORMATION stodi;
- SYSTEM_PROCESSOR_TIMES spt;
+ SYSTEM_TIMEOFDAY_INFORMATION stodi;
+ SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION spt;
hProcess = OpenProcess (PROCESS_VM_READ | PROCESS_QUERY_INFORMATION,
FALSE, p->dwProcessId);
if (hProcess != NULL)
@@ -998,19 +1003,19 @@ format_process_stat (void *data, char *&destbuf)
{
DWORD error = GetLastError ();
__seterrno_from_win_error (error);
- debug_printf ("OpenProcess: ret %d", error);
+ debug_printf ("OpenProcess: ret %u", error);
return 0;
}
if (NT_SUCCESS (status))
status = NtQuerySystemInformation (SystemTimeOfDayInformation,
(PVOID) &stodi, sizeof stodi, NULL);
if (NT_SUCCESS (status))
- status = NtQuerySystemInformation (SystemProcessorTimes, (PVOID) &spt,
- sizeof spt, NULL);
+ status = NtQuerySystemInformation (SystemProcessorPerformanceInformation,
+ (PVOID) &spt, sizeof spt, NULL);
if (!NT_SUCCESS (status))
{
__seterrno_from_nt_status (status);
- debug_printf ("NtQueryInformationProcess: status %p, %E", status);
+ debug_printf ("NtQueryInformationProcess: status %y, %E", status);
return 0;
}
fault_count = vmc.PageFaultCount;
@@ -1028,7 +1033,13 @@ format_process_stat (void *data, char *&destbuf)
*/
start_time = (spt.KernelTme.QuadPart + spt.UserTime.QuadPart) * HZ / 10000000ULL;
#endif
- priority = pbi.BasePriority;
+ /* The BasePriority returned to a 32 bit process under WOW64 is
+ apparently broken, for 32 and 64 bit target processes. 64 bit
+ processes get the correct base priority, even for 32 bit processes. */
+ if (wincap.is_wow64 ())
+ priority = 8; /* Default value. */
+ else
+ priority = pbi.BasePriority;
unsigned page_size = wincap.page_size ();
vmsize = vmc.PagefileUsage;
vmrss = vmc.WorkingSetSize / page_size;
@@ -1037,22 +1048,20 @@ format_process_stat (void *data, char *&destbuf)
destbuf = (char *) crealloc_abort (destbuf, strlen (cmd) + 320);
return __small_sprintf (destbuf, "%d (%s) %c "
"%d %d %d %d %d "
- "%lu %lu %lu %lu %lu %lu %lu "
- "%ld %ld %ld %ld %ld %ld "
+ "%u %lu %lu %u %u %lu %lu "
+ "%ld %ld %d %d %d %d "
"%lu %lu "
- "%ld "
- "%lu",
- p->pid, cmd,
- state,
- p->ppid, p->pgid, p->sid, p->ctty,
- -1, 0, fault_count, fault_count, 0, 0, utime, stime,
+ "%ld %lu",
+ p->pid, cmd, state,
+ p->ppid, p->pgid, p->sid, p->ctty, -1,
+ 0, fault_count, fault_count, 0, 0, utime, stime,
utime, stime, priority, 0, 0, 0,
start_time, vmsize,
vmrss, vmmaxrss
);
}
-static _off64_t
+static off_t
format_process_status (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -1139,7 +1148,7 @@ format_process_status (void *data, char *&destbuf)
);
}
-static _off64_t
+static off_t
format_process_statm (void *data, char *&destbuf)
{
_pinfo *p = (_pinfo *) data;
@@ -1158,13 +1167,13 @@ extern "C" {
struct mntent *getmntent (FILE *);
};
-static _off64_t
+static off_t
format_process_mountstuff (void *data, char *&destbuf, bool mountinfo)
{
_pinfo *p = (_pinfo *) data;
user_info *u_shared = NULL;
HANDLE u_hdl = NULL;
- _off64_t len = 0;
+ off_t len = 0;
struct mntent *mnt;
if (p->uid != myself->uid)
@@ -1203,7 +1212,7 @@ format_process_mountstuff (void *data, char *&destbuf, bool mountinfo)
each cygdrive entry if it's a remote drive. If so, ignore it. */
if (iteration >= mtab->nmounts && u_hdl)
{
- WCHAR drive[3] = { mnt->mnt_fsname[0], L':', L'\0' };
+ WCHAR drive[3] = { (WCHAR) mnt->mnt_fsname[0], L':', L'\0' };
disk_type dt = get_disk_type (drive);
if (dt == DT_SHARE_SMB || dt == DT_SHARE_NFS)
@@ -1246,13 +1255,13 @@ format_process_mountstuff (void *data, char *&destbuf, bool mountinfo)
return len;
}
-static _off64_t
+static off_t
format_process_mounts (void *data, char *&destbuf)
{
return format_process_mountstuff (data, destbuf, false);
}
-static _off64_t
+static off_t
format_process_mountinfo (void *data, char *&destbuf)
{
return format_process_mountstuff (data, destbuf, true);
@@ -1264,28 +1273,28 @@ get_process_state (DWORD dwProcessId)
/* This isn't really heavy magic - just go through the processes' threads
one by one and return a value accordingly. Errors are silently ignored. */
NTSTATUS status;
- PSYSTEM_PROCESSES p, sp;
+ PSYSTEM_PROCESS_INFORMATION p, sp;
ULONG n = 0x4000;
int state =' ';
- p = (PSYSTEM_PROCESSES) malloc (n);
+ p = (PSYSTEM_PROCESS_INFORMATION) malloc (n);
if (!p)
return state;
while (true)
{
- status = NtQuerySystemInformation (SystemProcessesAndThreadsInformation,
+ status = NtQuerySystemInformation (SystemProcessInformation,
(PVOID) p, n, NULL);
if (status != STATUS_INFO_LENGTH_MISMATCH)
break;
n <<= 1;
- PSYSTEM_PROCESSES new_p = (PSYSTEM_PROCESSES) realloc (p, n);
+ PSYSTEM_PROCESS_INFORMATION new_p = (PSYSTEM_PROCESS_INFORMATION) realloc (p, n);
if (!new_p)
goto out;
p = new_p;
}
if (!NT_SUCCESS (status))
{
- debug_printf ("NtQuerySystemInformation: status %p, %lu",
+ debug_printf ("NtQuerySystemInformation: status %y, %u",
status, RtlNtStatusToDosError (status));
goto out;
}
@@ -1293,12 +1302,12 @@ get_process_state (DWORD dwProcessId)
sp = p;
for (;;)
{
- if (sp->ProcessId == dwProcessId)
+ if ((DWORD) (uintptr_t) sp->UniqueProcessId == dwProcessId)
{
SYSTEM_THREADS *st;
st = &sp->Threads[0];
state = 'S';
- for (unsigned i = 0; i < sp->ThreadCount; i++)
+ for (unsigned i = 0; i < sp->NumberOfThreads; i++)
{
/* FIXME: at some point we should consider generating 'O' */
if (st->State == StateRunning ||
@@ -1311,9 +1320,9 @@ get_process_state (DWORD dwProcessId)
}
break;
}
- if (!sp->NextEntryDelta)
+ if (!sp->NextEntryOffset)
break;
- sp = (PSYSTEM_PROCESSES) ((char *) sp + sp->NextEntryDelta);
+ sp = (PSYSTEM_PROCESS_INFORMATION) ((char *) sp + sp->NextEntryOffset);
}
out:
free (p);
@@ -1330,7 +1339,7 @@ get_mem_values (DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss,
HANDLE hProcess;
VM_COUNTERS vmc;
PMEMORY_WORKING_SET_LIST p;
- ULONG n = 0x4000, length;
+ SIZE_T n = 0x4000, length;
p = (PMEMORY_WORKING_SET_LIST) malloc (n);
if (!p)
@@ -1346,7 +1355,7 @@ get_mem_values (DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss,
{
status = NtQueryVirtualMemory (hProcess, 0, MemoryWorkingSetList,
(PVOID) p, n,
- (length = ULONG_MAX, &length));
+ (length = (SIZE_T) -1, &length));
if (status != STATUS_INFO_LENGTH_MISMATCH)
break;
n <<= 1;
@@ -1358,7 +1367,7 @@ get_mem_values (DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss,
}
if (!NT_SUCCESS (status))
{
- debug_printf ("NtQueryVirtualMemory: status %p", status);
+ debug_printf ("NtQueryVirtualMemory: status %y", status);
if (status == STATUS_PROCESS_IS_TERMINATING)
{
*vmsize = *vmrss = *vmtext = *vmdata = *vmlib = *vmshare = 0;
@@ -1386,7 +1395,7 @@ get_mem_values (DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss,
sizeof vmc, NULL);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtQueryInformationProcess: status %p", status);
+ debug_printf ("NtQueryInformationProcess: status %y", status);
__seterrno_from_nt_status (status);
goto out;
}
diff --git a/winsup/cygwin/fhandler_procnet.cc b/winsup/cygwin/fhandler_procnet.cc
index d6dc20900..73f06f637 100644
--- a/winsup/cygwin/fhandler_procnet.cc
+++ b/winsup/cygwin/fhandler_procnet.cc
@@ -11,6 +11,8 @@ details. */
#define __INSIDE_CYGWIN_NET__
#define USE_SYS_TYPES_FD_SET
#include "winsup.h"
+#include <ws2tcpip.h>
+#include <iphlpapi.h>
#include "cygerrno.h"
#include "security.h"
#include "path.h"
@@ -18,8 +20,6 @@ details. */
#include "fhandler_virtual.h"
#include "dtable.h"
#include "cygheap.h"
-#include <ws2tcpip.h>
-#include <iphlpapi.h>
#include <asm/byteorder.h>
#define _COMPILING_NEWLIB
@@ -31,7 +31,7 @@ extern "C" int ip_addr_prefix (PIP_ADAPTER_UNICAST_ADDRESS pua,
PIP_ADAPTER_PREFIX pap);
bool get_adapters_addresses (PIP_ADAPTER_ADDRESSES *pa0, ULONG family);
-static _off64_t format_procnet_ifinet6 (void *, char *&);
+static off_t format_procnet_ifinet6 (void *, char *&);
static const virt_tab_t procnet_tab[] =
{
@@ -63,12 +63,8 @@ fhandler_procnet::exists ()
PROCNET_LINK_COUNT);
if (entry)
{
- if (entry->type == virt_file)
- {
- if (!wincap.has_gaa_prefixes ()
- || !get_adapters_addresses (NULL, AF_INET6))
- return virt_none;
- }
+ if (entry->type == virt_file && !get_adapters_addresses (NULL, AF_INET6))
+ return virt_none;
fileid = entry - procnet_tab;
return entry->type;
}
@@ -81,7 +77,7 @@ fhandler_procnet::fhandler_procnet ():
}
int __reg2
-fhandler_procnet::fstat (struct __stat64 *buf)
+fhandler_procnet::fstat (struct stat *buf)
{
fhandler_base::fstat (buf);
buf->st_mode &= ~_IFMT & NO_W;
@@ -109,12 +105,9 @@ fhandler_procnet::readdir (DIR *dir, dirent *de)
int res = ENMFILE;
if (dir->__d_position >= PROCNET_LINK_COUNT)
goto out;
- if (procnet_tab[dir->__d_position].type == virt_file)
- {
- if (!wincap.has_gaa_prefixes ()
- || !get_adapters_addresses (NULL, AF_INET6))
- goto out;
- }
+ if (procnet_tab[dir->__d_position].type == virt_file
+ && !get_adapters_addresses (NULL, AF_INET6))
+ goto out;
strcpy (de->d_name, procnet_tab[dir->__d_position++].name);
dir->__flags |= dirent_saw_dot | dirent_saw_dot_dot;
res = 0;
@@ -190,7 +183,7 @@ success:
set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status ();
out:
- syscall_printf ("%d = fhandler_proc::open(%p, %d)", res, flags, mode);
+ syscall_printf ("%d = fhandler_proc::open(%y, 0%o)", res, flags, mode);
return res;
}
@@ -230,16 +223,14 @@ static unsigned int dad_to_flags[] =
0x80 /* Preferred -> PERMANENT */
};
-static _off64_t
+static off_t
format_procnet_ifinet6 (void *, char *&filebuf)
{
PIP_ADAPTER_ADDRESSES pa0 = NULL, pap;
PIP_ADAPTER_UNICAST_ADDRESS pua;
ULONG alloclen;
+ off_t filesize = 0;
- if (!wincap.has_gaa_prefixes ())
- return 0;
- _off64_t filesize = 0;
if (!get_adapters_addresses (&pa0, AF_INET6))
goto out;
alloclen = 0;
@@ -263,7 +254,7 @@ format_procnet_ifinet6 (void *, char *&filebuf)
filebuf[filesize++] = ' ';
filesize += sprintf (filebuf + filesize,
"%02lx %02x %02x %02x %s\n",
- pap->Ipv6IfIndex,
+ (long) pap->Ipv6IfIndex,
ip_addr_prefix (pua, pap->FirstPrefix),
get_scope (&((struct sockaddr_in6 *)
pua->Address.lpSockaddr)->sin6_addr),
diff --git a/winsup/cygwin/fhandler_procsys.cc b/winsup/cygwin/fhandler_procsys.cc
index 14ce0ec28..759712f04 100644
--- a/winsup/cygwin/fhandler_procsys.cc
+++ b/winsup/cygwin/fhandler_procsys.cc
@@ -1,6 +1,6 @@
/* fhandler_procsys.cc: fhandler for native NT namespace.
- Copyright 2010, 2011, 2013 Red Hat, Inc.
+ Copyright 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -44,7 +44,7 @@ const size_t procsys_len = sizeof (procsys) - 1;
/* Returns 0 if path doesn't exist, >0 if path is a directory,
-1 if path is a file, -2 if it's a symlink. */
virtual_ftype_t
-fhandler_procsys::exists (struct __stat64 *buf)
+fhandler_procsys::exists (struct stat *buf)
{
UNICODE_STRING path;
UNICODE_STRING dir;
@@ -74,7 +74,7 @@ fhandler_procsys::exists (struct __stat64 *buf)
dir.Length -= sizeof (WCHAR);
InitializeObjectAttributes (&attr, &dir, OBJ_CASE_INSENSITIVE, NULL, NULL);
status = NtOpenDirectoryObject (&h, DIRECTORY_QUERY, &attr);
- debug_printf ("NtOpenDirectoryObject: %p", status);
+ debug_printf ("NtOpenDirectoryObject: %y", status);
if (NT_SUCCESS (status))
{
internal = true;
@@ -85,7 +85,7 @@ fhandler_procsys::exists (struct __stat64 *buf)
InitializeObjectAttributes (&attr, &path, OBJ_CASE_INSENSITIVE, NULL, NULL);
status = NtOpenSymbolicLinkObject (&h, READ_CONTROL | SYMBOLIC_LINK_QUERY,
&attr);
- debug_printf ("NtOpenSymbolicLinkObject: %p", status);
+ debug_printf ("NtOpenSymbolicLinkObject: %y", status);
if (NT_SUCCESS (status))
{
/* If requested, check permissions. */
@@ -98,7 +98,7 @@ fhandler_procsys::exists (struct __stat64 *buf)
return virt_symlink;
/* Then check if it's an object directory. */
status = NtOpenDirectoryObject (&h, READ_CONTROL | DIRECTORY_QUERY, &attr);
- debug_printf ("NtOpenDirectoryObject: %p", status);
+ debug_printf ("NtOpenDirectoryObject: %y", status);
if (NT_SUCCESS (status))
{
/* If requested, check permissions. */
@@ -112,7 +112,7 @@ fhandler_procsys::exists (struct __stat64 *buf)
/* Next try to open as file/device. */
status = NtOpenFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES, &attr, &io,
FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
- debug_printf ("NtOpenFile: %p", status);
+ debug_printf ("NtOpenFile: %y", status);
/* Name is invalid, that's nothing. */
if (status == STATUS_OBJECT_NAME_INVALID)
return virt_none;
@@ -135,7 +135,7 @@ fhandler_procsys::exists (struct __stat64 *buf)
since NtQueryAttributesFile might crash the machine if the underlying
driver is badly written. */
status = NtQueryAttributesFile (&attr, &fbi);
- debug_printf ("NtQueryAttributesFile: %p", status);
+ debug_printf ("NtQueryAttributesFile: %y", status);
if (NT_SUCCESS (status))
return (fbi.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
? virt_fsdir : virt_fsfile;
@@ -154,7 +154,7 @@ fhandler_procsys::exists (struct __stat64 *buf)
status = NtOpenFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES,
&attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT);
- debug_printf ("NtOpenDirectoryObject: %p", status);
+ debug_printf ("NtOpenDirectoryObject: %y", status);
if (dir.Length > sizeof (WCHAR))
dir.Length -= sizeof (WCHAR);
}
@@ -173,7 +173,7 @@ fhandler_procsys::exists (struct __stat64 *buf)
/* Check for the device type. */
status = NtQueryVolumeInformationFile (h, &io, &ffdi, sizeof ffdi,
FileFsDeviceInformation);
- debug_printf ("NtQueryVolumeInformationFile: %p", status);
+ debug_printf ("NtQueryVolumeInformationFile: %y", status);
/* Don't call NtQueryInformationFile unless we know it's a safe type.
The call is known to crash machines, if the underlying driver is
badly written. */
@@ -195,7 +195,7 @@ fhandler_procsys::exists (struct __stat64 *buf)
into a real FS through /proc/sys. */
status = NtQueryInformationFile (h, &io, &fbi, sizeof fbi,
FileBasicInformation);
- debug_printf ("NtQueryInformationFile: %p", status);
+ debug_printf ("NtQueryInformationFile: %y", status);
if (!NT_SUCCESS (status))
file_type = virt_blk;
else
@@ -261,7 +261,7 @@ unreadable:
}
int __reg2
-fhandler_procsys::fstat (struct __stat64 *buf)
+fhandler_procsys::fstat (struct stat *buf)
{
const char *path = get_name ();
debug_printf ("fstat (%s)", path);
@@ -271,7 +271,7 @@ fhandler_procsys::fstat (struct __stat64 *buf)
buf->st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
buf->st_uid = 544;
buf->st_gid = 18;
- buf->st_dev = buf->st_rdev = (int) dev ();
+ buf->st_dev = buf->st_rdev = dev ();
buf->st_ino = get_ino ();
switch (exists (buf))
{
@@ -391,29 +391,15 @@ fhandler_procsys::closedir (DIR *dir)
return fhandler_virtual::closedir (dir);
}
-void __stdcall
+void __reg3
fhandler_procsys::read (void *ptr, size_t& len)
{
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- LARGE_INTEGER off = { QuadPart:0LL };
-
- /* FIXME: Implement nonblocking I/O, interruptibility and cancelability. */
- status = NtReadFile (get_handle (), NULL, NULL, NULL, &io, ptr, len,
- &off, NULL);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- len = -1;
- }
- else
- len = io.Information;
+ fhandler_base::raw_read (ptr, len);
}
ssize_t __stdcall
fhandler_procsys::write (const void *ptr, size_t len)
{
- /* FIXME: Implement nonblocking I/O, interruptibility and cancelability. */
return fhandler_base::raw_write (ptr, len);
}
@@ -446,7 +432,7 @@ fhandler_procsys::open (int flags, mode_t mode)
break;
}
}
- syscall_printf ("%d = fhandler_procsys::open(%p, %d)", res, flags, mode);
+ syscall_printf ("%d = fhandler_procsys::open(%p, 0%o)", res, flags, mode);
return res;
}
diff --git a/winsup/cygwin/fhandler_procsysvipc.cc b/winsup/cygwin/fhandler_procsysvipc.cc
index f2b7169be..6c2aa4006 100644
--- a/winsup/cygwin/fhandler_procsysvipc.cc
+++ b/winsup/cygwin/fhandler_procsysvipc.cc
@@ -1,6 +1,6 @@
/* fhandler_procsysvipc.cc: fhandler for /proc/sysvipc virtual filesystem
- Copyright 2011, 2013 Red Hat, Inc.
+ Copyright 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -38,9 +38,9 @@ details. */
#include <sys/sem.h>
#include <sys/shm.h>
-static _off64_t format_procsysvipc_msg (void *, char *&);
-static _off64_t format_procsysvipc_sem (void *, char *&);
-static _off64_t format_procsysvipc_shm (void *, char *&);
+static off_t format_procsysvipc_msg (void *, char *&);
+static off_t format_procsysvipc_sem (void *, char *&);
+static off_t format_procsysvipc_shm (void *, char *&);
static const virt_tab_t procsysvipc_tab[] =
{
@@ -93,7 +93,7 @@ fhandler_procsysvipc::fhandler_procsysvipc ():
}
int __reg2
-fhandler_procsysvipc::fstat (struct __stat64 *buf)
+fhandler_procsysvipc::fstat (struct stat *buf)
{
fhandler_base::fstat (buf);
buf->st_mode &= ~_IFMT & NO_W;
@@ -202,7 +202,7 @@ success:
set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status ();
out:
- syscall_printf ("%d = fhandler_proc::open(%p, %d)", res, flags, mode);
+ syscall_printf ("%d = fhandler_proc::open(%p, 0%o)", res, flags, mode);
return res;
}
@@ -217,7 +217,7 @@ fhandler_procsysvipc::fill_filebuf ()
return false;
}
-static _off64_t
+static off_t
format_procsysvipc_msg (void *, char *&destbuf)
{
tmp_pathbuf tp;
@@ -238,7 +238,7 @@ format_procsysvipc_msg (void *, char *&destbuf)
for (int i = 0; i < msginfo.msgmni; i++) {
if (xmsqids[i].msg_qbytes != 0) {
bufptr += sprintf (bufptr,
- "%10llu %10u %5o %11lu %10lu %5d %5d %5lu %5lu %5lu %5lu %10ld %10ld %10ld\n",
+ "%10llu %10u %5o %11u %10u %5d %5d %5u %5u %5u %5u %10ld %10ld %10ld\n",
xmsqids[i].msg_perm.key,
IXSEQ_TO_IPCID(i, xmsqids[i].msg_perm),
xmsqids[i].msg_perm.mode,
@@ -246,10 +246,10 @@ format_procsysvipc_msg (void *, char *&destbuf)
xmsqids[i].msg_qnum,
xmsqids[i].msg_lspid,
xmsqids[i].msg_lrpid,
- xmsqids[i].msg_perm.uid,
- xmsqids[i].msg_perm.gid,
- xmsqids[i].msg_perm.cuid,
- xmsqids[i].msg_perm.cgid,
+ (unsigned) xmsqids[i].msg_perm.uid,
+ (unsigned) xmsqids[i].msg_perm.gid,
+ (unsigned) xmsqids[i].msg_perm.cuid,
+ (unsigned) xmsqids[i].msg_perm.cgid,
xmsqids[i].msg_stime,
xmsqids[i].msg_rtime,
xmsqids[i].msg_ctime);
@@ -261,7 +261,7 @@ format_procsysvipc_msg (void *, char *&destbuf)
return bufptr - buf;
}
-static _off64_t
+static off_t
format_procsysvipc_sem (void *, char *&destbuf)
{
tmp_pathbuf tp;
@@ -284,15 +284,15 @@ format_procsysvipc_sem (void *, char *&destbuf)
for (int i = 0; i < seminfo.semmni; i++) {
if ((xsemids[i].sem_perm.mode & SEM_ALLOC) != 0) {
bufptr += sprintf (bufptr,
- "%10llu %10u %5o %10d %5lu %5lu %5lu %5lu %10ld %10ld\n",
+ "%10llu %10u %5o %10d %5u %5u %5u %5u %10ld %10ld\n",
xsemids[i].sem_perm.key,
IXSEQ_TO_IPCID(i, xsemids[i].sem_perm),
xsemids[i].sem_perm.mode,
xsemids[i].sem_nsems,
- xsemids[i].sem_perm.uid,
- xsemids[i].sem_perm.gid,
- xsemids[i].sem_perm.cuid,
- xsemids[i].sem_perm.cgid,
+ (unsigned) xsemids[i].sem_perm.uid,
+ (unsigned) xsemids[i].sem_perm.gid,
+ (unsigned) xsemids[i].sem_perm.cuid,
+ (unsigned) xsemids[i].sem_perm.cgid,
xsemids[i].sem_otime,
xsemids[i].sem_ctime);
}
@@ -303,7 +303,7 @@ format_procsysvipc_sem (void *, char *&destbuf)
return bufptr - buf;
}
-static _off64_t
+static off_t
format_procsysvipc_shm (void *, char *&destbuf)
{
tmp_pathbuf tp;
@@ -323,7 +323,7 @@ format_procsysvipc_shm (void *, char *&destbuf)
for (int i = 0; i < shminfo.shmmni; i++) {
if (xshmids[i].shm_perm.mode & 0x0800) {
bufptr += sprintf (bufptr,
- "%10llu %10u %5o %10u %5d %5d %6u %5lu %5lu %5lu %5lu %10ld %10ld %10ld\n",
+ "%10llu %10u %5o %10u %5d %5d %6u %5u %5u %5u %5u %10ld %10ld %10ld\n",
xshmids[i].shm_perm.key,
IXSEQ_TO_IPCID(i, xshmids[i].shm_perm),
xshmids[i].shm_perm.mode,
@@ -331,10 +331,10 @@ format_procsysvipc_shm (void *, char *&destbuf)
xshmids[i].shm_cpid,
xshmids[i].shm_lpid,
xshmids[i].shm_nattch,
- xshmids[i].shm_perm.uid,
- xshmids[i].shm_perm.gid,
- xshmids[i].shm_perm.cuid,
- xshmids[i].shm_perm.cgid,
+ (unsigned) xshmids[i].shm_perm.uid,
+ (unsigned) xshmids[i].shm_perm.gid,
+ (unsigned) xshmids[i].shm_perm.cuid,
+ (unsigned) xshmids[i].shm_perm.cgid,
xshmids[i].shm_atime,
xshmids[i].shm_dtime,
xshmids[i].shm_ctime);
diff --git a/winsup/cygwin/fhandler_random.cc b/winsup/cygwin/fhandler_random.cc
index cc94801d3..56c8d107f 100644
--- a/winsup/cygwin/fhandler_random.cc
+++ b/winsup/cygwin/fhandler_random.cc
@@ -114,7 +114,7 @@ fhandler_dev_random::pseudo_read (void *ptr, size_t len)
return len;
}
-void __stdcall
+void __reg3
fhandler_dev_random::read (void *ptr, size_t& len)
{
if (!len)
@@ -143,13 +143,13 @@ fhandler_dev_random::read (void *ptr, size_t& len)
len = (size_t) -1;
}
-_off64_t
-fhandler_dev_random::lseek (_off64_t off, int whence)
+off_t
+fhandler_dev_random::lseek (off_t off, int whence)
{
/* As on Linux, fake being able to set an offset. The fact that neither
reading nor writing changes the dummy offset is also the same as on
Linux (tested with kernel 2.6.23). */
- _off64_t new_off;
+ off_t new_off;
switch (whence)
{
@@ -161,12 +161,12 @@ fhandler_dev_random::lseek (_off64_t off, int whence)
break;
default:
set_errno (EINVAL);
- return (_off64_t) -1;
+ return (off_t) -1;
}
if (new_off < 0)
{
set_errno (EINVAL);
- return (_off64_t) -1;
+ return (off_t) -1;
}
return dummy_offset = new_off;
}
diff --git a/winsup/cygwin/fhandler_raw.cc b/winsup/cygwin/fhandler_raw.cc
index cf6861f1f..04f40f387 100644
--- a/winsup/cygwin/fhandler_raw.cc
+++ b/winsup/cygwin/fhandler_raw.cc
@@ -36,7 +36,7 @@ fhandler_dev_raw::~fhandler_dev_raw ()
}
int __reg2
-fhandler_dev_raw::fstat (struct __stat64 *buf)
+fhandler_dev_raw::fstat (struct stat *buf)
{
debug_printf ("here");
@@ -95,7 +95,7 @@ fhandler_dev_raw::dup (fhandler_base *child, int flags)
/* Create sector-aligned buffer */
fhc->devbufalloc = new char [devbufsiz + devbufalign];
fhc->devbuf = (char *) roundup2 ((uintptr_t) fhc->devbufalloc,
- devbufalign);
+ (uintptr_t) devbufalign);
}
fhc->devbufstart = 0;
fhc->devbufend = 0;
@@ -121,7 +121,8 @@ fhandler_dev_raw::fixup_after_exec ()
{
/* Create sector-aligned buffer */
devbufalloc = new char [devbufsiz + devbufalign];
- devbuf = (char *) roundup2 ((uintptr_t) devbufalloc, devbufalign);
+ devbuf = (char *) roundup2 ((uintptr_t) devbufalloc,
+ (uintptr_t) devbufalign);
}
devbufstart = 0;
devbufend = 0;
@@ -165,7 +166,7 @@ fhandler_dev_raw::ioctl (unsigned int cmd, void *buf)
else if (!devbuf || op->rd_parm != devbufsiz)
{
char *buf = NULL;
- _off64_t curpos = lseek (0, SEEK_CUR);
+ off_t curpos = lseek (0, SEEK_CUR);
if (op->rd_parm > 1L)
buf = new char [op->rd_parm + devbufalign];
@@ -174,7 +175,8 @@ fhandler_dev_raw::ioctl (unsigned int cmd, void *buf)
delete [] devbufalloc;
devbufalloc = buf;
- devbuf = (char *) roundup2 ((uintptr_t) buf, devbufalign);
+ devbuf = (char *) roundup2 ((uintptr_t) buf,
+ (uintptr_t) devbufalign);
devbufsiz = op->rd_parm ?: 1L;
devbufstart = devbufend = 0;
lseek (curpos, SEEK_SET);
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc
index 97870f013..ef1213360 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -29,8 +29,8 @@ details. */
* the bottom 16 bits are the absolute position and the top 15 bits
* make up the value index if we are enuerating values.
*/
-static const _off_t REG_ENUM_VALUES_MASK = 0x8000000;
-static const _off_t REG_POSITION_MASK = 0xffff;
+static const __int32_t REG_ENUM_VALUES_MASK = 0x8000000;
+static const __int32_t REG_POSITION_MASK = 0xffff;
/* These key paths are used below whenever we return key information.
The problem is UAC virtualization when running an admin account with
@@ -59,7 +59,7 @@ static const char *registry_listing[] =
"HKEY_CURRENT_USER",
"HKEY_LOCAL_MACHINE",
"HKEY_USERS",
- "HKEY_PERFORMANCE_DATA", // NT/2000/XP
+ "HKEY_PERFORMANCE_DATA",
NULL
};
@@ -462,7 +462,7 @@ fhandler_proc ()
}
int __reg2
-fhandler_registry::fstat (struct __stat64 *buf)
+fhandler_registry::fstat (struct stat *buf)
{
fhandler_base::fstat (buf);
buf->st_mode &= ~_IFMT & NO_W;
@@ -551,8 +551,8 @@ fhandler_registry::fstat (struct __stat64 *buf)
else
buf->st_size = dwSize;
}
- __uid32_t uid;
- __gid32_t gid;
+ uid_t uid;
+ gid_t gid;
if (get_reg_attribute (hKey, &buf->st_mode, &uid, &gid) == 0)
{
buf->st_uid = uid;
@@ -616,7 +616,7 @@ fhandler_registry::readdir (DIR *dir, dirent *de)
dir->__handle = open_key (path + 1, KEY_READ, wow64, false);
if (dir->__handle == INVALID_HANDLE_VALUE)
goto out;
- dir->__d_internal = (unsigned) new __DIR_hash ();
+ dir->__d_internal = (uintptr_t) new __DIR_hash ();
}
if (dir->__d_position < SPECIAL_DOT_FILE_COUNT)
{
@@ -893,7 +893,7 @@ success:
set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status ();
out:
- syscall_printf ("%d = fhandler_registry::open(%p, %d)", res, flags, mode);
+ syscall_printf ("%d = fhandler_registry::open(%p, 0%o)", res, flags, mode);
return res;
}
diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc
index b6b06f76d..b6641e5e4 100644
--- a/winsup/cygwin/fhandler_serial.cc
+++ b/winsup/cygwin/fhandler_serial.cc
@@ -41,7 +41,7 @@ fhandler_serial::overlapped_setup ()
overlapped_armed = 0;
}
-void __stdcall
+void __reg3
fhandler_serial::raw_read (void *ptr, size_t& ulen)
{
int tot;
@@ -49,8 +49,8 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
size_t minchars = vmin_ ? MIN (vmin_, ulen) : ulen;
- debug_printf ("ulen %d, vmin_ %d, vtime_ %d, hEvent %p", ulen, vmin_, vtime_,
- io_status.hEvent);
+ debug_printf ("ulen %ld, vmin_ %ld, vtime_ %u, hEvent %p",
+ ulen, vmin_, vtime_, io_status.hEvent);
if (!overlapped_armed)
{
SetCommMask (get_handle (), EV_RXCHAR);
@@ -94,7 +94,7 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
if (!GetOverlappedResult (get_handle (), &io_status, &n,
FALSE))
goto err;
- debug_printf ("n %d, ev %x", n, ev);
+ debug_printf ("n %u, ev %x", n, ev);
break;
case WAIT_SIGNALED:
tot = -1;
@@ -117,7 +117,7 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
ResetEvent (io_status.hEvent);
if (inq > ulen)
inq = ulen;
- debug_printf ("inq %d", inq);
+ debug_printf ("inq %u", inq);
if (ReadFile (get_handle (), ptr, inq, &n, &io_status))
/* Got something */;
else if (GetLastError () != ERROR_IO_PENDING)
@@ -143,7 +143,7 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
goto err;
tot += n;
- debug_printf ("vtime_ %d, vmin_ %d, n %d, tot %d", vtime_, vmin_, n, tot);
+ debug_printf ("vtime_ %u, vmin_ %lu, n %u, tot %d", vtime_, vmin_, n, tot);
if (vtime_ || !vmin_ || !n)
break;
continue;
@@ -167,7 +167,7 @@ out:
/* Cover function to WriteFile to provide Posix interface and semantics
(as much as possible). */
-ssize_t __stdcall
+ssize_t __reg3
fhandler_serial::raw_write (const void *ptr, size_t len)
{
DWORD bytes_written;
@@ -244,8 +244,8 @@ fhandler_serial::open (int flags, mode_t mode)
int res;
COMMTIMEOUTS to;
- syscall_printf ("fhandler_serial::open (%s, %p, %p)",
- get_name (), flags, mode);
+ syscall_printf ("fhandler_serial::open (%s, %y, 0%o)",
+ get_name (), flags, mode);
if (!fhandler_base::open (flags, mode))
return 0;
@@ -301,8 +301,8 @@ fhandler_serial::open (int flags, mode_t mode)
SetCommMask (get_handle (), EV_RXCHAR);
set_open_status ();
- syscall_printf ("%p = fhandler_serial::open (%s, %p, %p)",
- res, get_name (), flags, mode);
+ syscall_printf ("%p = fhandler_serial::open (%s, %y, 0%o)",
+ res, get_name (), flags, mode);
return res;
}
@@ -446,7 +446,7 @@ fhandler_serial::ioctl (unsigned int cmd, void *buf)
{
int res = 0;
-# define ibuf ((int) buf)
+# define ibuf ((int) (intptr_t) buf)
# define ipbuf (*(int *) buf)
DWORD ev;
@@ -544,7 +544,7 @@ fhandler_serial::ioctl (unsigned int cmd, void *buf)
break;
}
- termios_printf ("%d = ioctl(%p, %p)", res, cmd, buf);
+ termios_printf ("%d = ioctl(%x, %p)", res, cmd, buf);
# undef ibuf
# undef ipbuf
return res;
@@ -699,7 +699,7 @@ fhandler_serial::tcsetattr (int action, const struct termios *t)
break;
default:
/* Unsupported baud rate! */
- termios_printf ("Invalid t->c_ospeed %d", t->c_ospeed);
+ termios_printf ("Invalid t->c_ospeed %u", t->c_ospeed);
set_errno (EINVAL);
return -1;
}
@@ -722,7 +722,7 @@ fhandler_serial::tcsetattr (int action, const struct termios *t)
break;
default:
/* Unsupported byte size! */
- termios_printf ("Invalid t->c_cflag byte size %d",
+ termios_printf ("Invalid t->c_cflag byte size %u",
t->c_cflag & CSIZE);
set_errno (EINVAL);
return -1;
@@ -902,7 +902,7 @@ fhandler_serial::tcsetattr (int action, const struct termios *t)
vmin_ = t->c_cc[VMIN];
}
- debug_printf ("vtime %d, vmin %d", vtime_, vmin_);
+ debug_printf ("vtime %d, vmin %ld", vtime_, vmin_);
if (ovmin != vmin_ || ovtime != vtime_)
{
@@ -935,7 +935,7 @@ fhandler_serial::tcsetattr (int action, const struct termios *t)
to.ReadIntervalTimeout = MAXDWORD;
}
- debug_printf ("ReadTotalTimeoutConstant %d, ReadIntervalTimeout %d, ReadTotalTimeoutMultiplier %d",
+ debug_printf ("ReadTotalTimeoutConstant %u, ReadIntervalTimeout %u, ReadTotalTimeoutMultiplier %u",
to.ReadTotalTimeoutConstant, to.ReadIntervalTimeout, to.ReadTotalTimeoutMultiplier);
if (!SetCommTimeouts(get_handle (), &to))
@@ -1042,7 +1042,7 @@ fhandler_serial::tcgetattr (struct termios *t)
break;
default:
/* Unsupported baud rate! */
- termios_printf ("Invalid baud rate %d", state.BaudRate);
+ termios_printf ("Invalid baud rate %u", state.BaudRate);
set_errno (EINVAL);
return -1;
}
@@ -1065,7 +1065,7 @@ fhandler_serial::tcgetattr (struct termios *t)
break;
default:
/* Unsupported byte size! */
- termios_printf ("Invalid byte size %d", state.ByteSize);
+ termios_printf ("Invalid byte size %u", state.ByteSize);
set_errno (EINVAL);
return -1;
}
@@ -1136,7 +1136,7 @@ fhandler_serial::tcgetattr (struct termios *t)
t->c_cc[VTIME] = vtime_ / 100;
t->c_cc[VMIN] = vmin_;
- debug_printf ("vmin_ %d, vtime_ %d", vmin_, vtime_);
+ debug_printf ("vmin_ %lu, vtime_ %u", vmin_, vtime_);
return 0;
}
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index c76fa47c3..b2a7f5c82 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -14,16 +14,18 @@
#define __INSIDE_CYGWIN_NET__
#define USE_SYS_TYPES_FD_SET
+#define _BSDTYPES_DEFINED
#include "winsup.h"
+#undef _BSDTYPES_DEFINED
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#include <iphlpapi.h>
#include "cygerrno.h"
#include "security.h"
#include "path.h"
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
-#include <ws2tcpip.h>
-#include <mswsock.h>
-#include <iphlpapi.h>
#include <asm/byteorder.h>
#include "cygwin/version.h"
#include "perprocess.h"
@@ -232,7 +234,7 @@ fhandler_socket::~fhandler_socket ()
char *
fhandler_socket::get_proc_fd_name (char *buf)
{
- __small_sprintf (buf, "socket:[%d]", get_socket ());
+ __small_sprintf (buf, "socket:[%lu]", get_socket ());
return buf;
}
@@ -328,7 +330,7 @@ fhandler_socket::af_local_send_secret ()
bool
fhandler_socket::af_local_recv_cred ()
{
- struct ucred out = { (pid_t) 0, (__uid32_t) -1, (__gid32_t) -1 };
+ struct ucred out = { (pid_t) 0, (uid_t) -1, (gid_t) -1 };
int rest = sizeof out;
char *ptr = (char *) &out;
while (rest > 0)
@@ -421,8 +423,8 @@ fhandler_socket::af_local_set_cred ()
sec_uid = geteuid32 ();
sec_gid = getegid32 ();
sec_peer_pid = (pid_t) 0;
- sec_peer_uid = (__uid32_t) -1;
- sec_peer_gid = (__gid32_t) -1;
+ sec_peer_uid = (uid_t) -1;
+ sec_peer_gid = (gid_t) -1;
}
void
@@ -504,7 +506,7 @@ search_wsa_event_slot (LONG new_serial_number)
everyone_sd (CYG_MUTANT_ACCESS));
status = NtCreateMutant (&wsa_slot_mtx, CYG_MUTANT_ACCESS, &attr, FALSE);
if (!NT_SUCCESS (status))
- api_fatal ("Couldn't create/open shared socket mutex %S, %p",
+ api_fatal ("Couldn't create/open shared socket mutex %S, %y",
&uname, status);
}
switch (WaitForSingleObject (wsa_slot_mtx, INFINITE))
@@ -566,7 +568,7 @@ fhandler_socket::init_events ()
status = NtCreateMutant (&wsock_mtx, CYG_MUTANT_ACCESS, &attr, FALSE);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtCreateMutant(%S), %p", &uname, status);
+ debug_printf ("NtCreateMutant(%S), %y", &uname, status);
set_errno (ENOBUFS);
return false;
}
@@ -722,7 +724,7 @@ fhandler_socket::fixup_before_fork_exec (DWORD win_pid)
if (ret)
set_winsock_errno ();
else
- debug_printf ("WSADuplicateSocket succeeded (%lx)", prot_info_ptr->dwProviderReserved);
+ debug_printf ("WSADuplicateSocket succeeded (%x)", prot_info_ptr->dwProviderReserved);
return (int) ret;
}
@@ -752,7 +754,7 @@ fhandler_socket::fixup_after_fork (HANDLE parent)
socket is potentially inheritable again. */
SetHandleInformation ((HANDLE) new_sock, HANDLE_FLAG_INHERIT, 0);
set_io_handle ((HANDLE) new_sock);
- debug_printf ("WSASocket succeeded (%lx)", new_sock);
+ debug_printf ("WSASocket succeeded (%p)", new_sock);
}
}
@@ -818,7 +820,7 @@ fhandler_socket::dup (fhandler_base *child, int flags)
}
int __reg2
-fhandler_socket::fstat (struct __stat64 *buf)
+fhandler_socket::fstat (struct stat *buf)
{
int res;
if (get_device () == FH_UNIX)
@@ -836,7 +838,7 @@ fhandler_socket::fstat (struct __stat64 *buf)
if (!res)
{
buf->st_dev = 0;
- buf->st_ino = (__ino64_t) ((DWORD) get_handle ());
+ buf->st_ino = (ino_t) ((uintptr_t) get_handle ());
buf->st_mode = S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO;
buf->st_size = 0;
}
@@ -844,7 +846,7 @@ fhandler_socket::fstat (struct __stat64 *buf)
return res;
}
-int __stdcall
+int __reg2
fhandler_socket::fstatvfs (struct statvfs *sfs)
{
if (get_device () == FH_UNIX)
@@ -872,7 +874,7 @@ fhandler_socket::fchmod (mode_t mode)
}
int
-fhandler_socket::fchown (__uid32_t uid, __gid32_t gid)
+fhandler_socket::fchown (uid_t uid, gid_t gid)
{
if (get_device () == FH_UNIX)
{
@@ -884,7 +886,7 @@ fhandler_socket::fchown (__uid32_t uid, __gid32_t gid)
}
int
-fhandler_socket::facl (int cmd, int nentries, __aclent32_t *aclbufp)
+fhandler_socket::facl (int cmd, int nentries, aclent_t *aclbufp)
{
if (get_device () == FH_UNIX)
{
@@ -1022,7 +1024,7 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
status = NtSetInformationFile (fh, &io, &fdi, sizeof fdi,
FileDispositionInformation);
if (!NT_SUCCESS (status))
- debug_printf ("Setting delete dispostion failed, status = %p",
+ debug_printf ("Setting delete dispostion failed, status = %y",
status);
}
else
@@ -1041,10 +1043,7 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
/* If the application didn't explicitely request SO_REUSEADDR,
enforce POSIX standard socket binding behaviour by setting the
SO_EXCLUSIVEADDRUSE socket option. See cygwin_setsockopt()
- for a more detailed description.
-
- KB 870562: Note that a bug in Win2K SP1-3 and XP up to SP1 only
- enables this option for users in the local administrators group. */
+ for a more detailed description. */
int on = 1;
int ret = ::setsockopt (get_socket (), SOL_SOCKET,
~(SO_REUSEADDR),
@@ -1069,8 +1068,6 @@ fhandler_socket::connect (const struct sockaddr *name, int namelen)
DWORD err;
int type;
- pthread_testcancel ();
-
if (get_inet_addr (name, namelen, &sst, &namelen, &type, connect_secret)
== SOCKET_ERROR)
return SOCKET_ERROR;
@@ -1181,8 +1178,6 @@ fhandler_socket::accept4 (struct sockaddr *peer, int *len, int flags)
struct sockaddr_storage lpeer;
int llen = sizeof (struct sockaddr_storage);
- pthread_testcancel ();
-
int res = 0;
while (!(res = wait_for_events (FD_ACCEPT | FD_CLOSE, 0))
&& (res = ::accept (get_socket (), (struct sockaddr *) &lpeer, &llen))
@@ -1355,30 +1350,6 @@ fhandler_socket::getpeername (struct sockaddr *name, int *namelen)
return res;
}
-void __stdcall
-fhandler_socket::read (void *in_ptr, size_t& len)
-{
- WSABUF wsabuf = { len, (char *) in_ptr };
- WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 };
- len = recv_internal (&wsamsg, false);
-}
-
-int
-fhandler_socket::readv (const struct iovec *const iov, const int iovcnt,
- ssize_t tot)
-{
- WSABUF wsabuf[iovcnt];
- WSABUF *wsaptr = wsabuf + iovcnt;
- const struct iovec *iovptr = iov + iovcnt;
- while (--wsaptr >= wsabuf)
- {
- wsaptr->len = (--iovptr)->iov_len;
- wsaptr->buf = (char *) iovptr->iov_base;
- }
- WSAMSG wsamsg = { NULL, 0, wsabuf, iovcnt, { 0, NULL}, 0 };
- return recv_internal (&wsamsg, false);
-}
-
/* There's no DLL which exports the symbol WSARecvMsg. One has to call
WSAIoctl as below to fetch the function pointer. Why on earth did the
MS developers decide not to export a normal symbol for these extension
@@ -1556,17 +1527,79 @@ fhandler_socket::recv_internal (LPWSAMSG wsamsg, bool use_recvmsg)
return ret;
}
+void __reg3
+fhandler_socket::read (void *in_ptr, size_t& len)
+{
+ char *ptr = (char *) in_ptr;
+
+#ifdef __x86_64__
+ /* size_t is 64 bit, but the len member in WSABUF is 32 bit.
+ Split buffer if necessary. */
+ DWORD bufcnt = len / UINT32_MAX + ((!len || (len % UINT32_MAX)) ? 1 : 0);
+ WSABUF wsabuf[bufcnt];
+ WSAMSG wsamsg = { NULL, 0, wsabuf, bufcnt, { 0, NULL }, 0 };
+ /* Don't use len as loop condition, it could be 0. */
+ for (WSABUF *wsaptr = wsabuf; bufcnt--; ++wsaptr)
+ {
+ wsaptr->len = MIN (len, UINT32_MAX);
+ wsaptr->buf = ptr;
+ len -= wsaptr->len;
+ ptr += wsaptr->len;
+ }
+#else
+ WSABUF wsabuf = { len, ptr };
+ WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 };
+#endif
+
+ len = recv_internal (&wsamsg, false);
+}
+
+ssize_t
+fhandler_socket::readv (const struct iovec *const iov, const int iovcnt,
+ ssize_t tot)
+{
+ WSABUF wsabuf[iovcnt];
+ WSABUF *wsaptr = wsabuf + iovcnt;
+ const struct iovec *iovptr = iov + iovcnt;
+ while (--wsaptr >= wsabuf)
+ {
+ wsaptr->len = (--iovptr)->iov_len;
+ wsaptr->buf = (char *) iovptr->iov_base;
+ }
+ WSAMSG wsamsg = { NULL, 0, wsabuf, (DWORD) iovcnt, { 0, NULL}, 0 };
+ return recv_internal (&wsamsg, false);
+}
+
ssize_t
-fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
+fhandler_socket::recvfrom (void *in_ptr, size_t len, int flags,
struct sockaddr *from, int *fromlen)
{
- pthread_testcancel ();
+ char *ptr = (char *) in_ptr;
- WSABUF wsabuf = { len, (char *) ptr };
+#ifdef __x86_64__
+ /* size_t is 64 bit, but the len member in WSABUF is 32 bit.
+ Split buffer if necessary. */
+ DWORD bufcnt = len / UINT32_MAX + ((!len || (len % UINT32_MAX)) ? 1 : 0);
+ WSABUF wsabuf[bufcnt];
+ WSAMSG wsamsg = { from, from && fromlen ? *fromlen : 0,
+ wsabuf, bufcnt,
+ { 0, NULL },
+ (DWORD) flags };
+ /* Don't use len as loop condition, it could be 0. */
+ for (WSABUF *wsaptr = wsabuf; bufcnt--; ++wsaptr)
+ {
+ wsaptr->len = MIN (len, UINT32_MAX);
+ wsaptr->buf = ptr;
+ len -= wsaptr->len;
+ ptr += wsaptr->len;
+ }
+#else
+ WSABUF wsabuf = { len, ptr };
WSAMSG wsamsg = { from, from && fromlen ? *fromlen : 0,
&wsabuf, 1,
{ 0, NULL},
- flags };
+ (DWORD) flags };
+#endif
ssize_t ret = recv_internal (&wsamsg, false);
if (fromlen)
*fromlen = wsamsg.namelen;
@@ -1576,15 +1609,12 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
ssize_t
fhandler_socket::recvmsg (struct msghdr *msg, int flags)
{
- pthread_testcancel ();
-
/* TODO: Descriptor passing on AF_LOCAL sockets. */
/* Disappointing but true: Even if WSARecvMsg is supported, it's only
supported for datagram and raw sockets. */
bool use_recvmsg = true;
- if (get_socket_type () == SOCK_STREAM || get_addr_family () == AF_LOCAL
- || !wincap.has_recvmsg ())
+ if (get_socket_type () == SOCK_STREAM || get_addr_family () == AF_LOCAL)
{
use_recvmsg = false;
msg->msg_controllen = 0;
@@ -1599,9 +1629,9 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags)
wsaptr->buf = (char *) iovptr->iov_base;
}
WSAMSG wsamsg = { (struct sockaddr *) msg->msg_name, msg->msg_namelen,
- wsabuf, msg->msg_iovlen,
- { msg->msg_controllen, (char *) msg->msg_control },
- flags };
+ wsabuf, (DWORD) msg->msg_iovlen,
+ { (DWORD) msg->msg_controllen, (char *) msg->msg_control },
+ (DWORD) flags };
ssize_t ret = recv_internal (&wsamsg, use_recvmsg);
if (ret >= 0)
{
@@ -1613,34 +1643,10 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags)
return ret;
}
-int
-fhandler_socket::write (const void *ptr, size_t len)
-{
- WSABUF wsabuf = { len, (char *) ptr };
- WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 };
- return send_internal (&wsamsg, 0);
-}
-
-int
-fhandler_socket::writev (const struct iovec *const iov, const int iovcnt,
- ssize_t tot)
-{
- WSABUF wsabuf[iovcnt];
- WSABUF *wsaptr = wsabuf;
- const struct iovec *iovptr = iov;
- for (int i = 0; i < iovcnt; ++i)
- {
- wsaptr->len = iovptr->iov_len;
- (wsaptr++)->buf = (char *) (iovptr++)->iov_base;
- }
- WSAMSG wsamsg = { NULL, 0, wsabuf, iovcnt, { 0, NULL}, 0 };
- return send_internal (&wsamsg, 0);
-}
-
inline ssize_t
fhandler_socket::send_internal (struct _WSAMSG *wsamsg, int flags)
{
- int res = 0;
+ ssize_t res = 0;
DWORD ret = 0, err = 0, sum = 0, off = 0;
WSABUF buf;
bool use_sendmsg = false;
@@ -1721,25 +1727,85 @@ fhandler_socket::send_internal (struct _WSAMSG *wsamsg, int flags)
}
ssize_t
-fhandler_socket::sendto (const void *ptr, size_t len, int flags,
+fhandler_socket::write (const void *in_ptr, size_t len)
+{
+ char *ptr = (char *) in_ptr;
+
+#ifdef __x86_64__
+ /* size_t is 64 bit, but the len member in WSABUF is 32 bit.
+ Split buffer if necessary. */
+ DWORD bufcnt = len / UINT32_MAX + ((!len || (len % UINT32_MAX)) ? 1 : 0);
+ WSABUF wsabuf[bufcnt];
+ WSAMSG wsamsg = { NULL, 0, wsabuf, bufcnt, { 0, NULL }, 0 };
+ /* Don't use len as loop condition, it could be 0. */
+ for (WSABUF *wsaptr = wsabuf; bufcnt--; ++wsaptr)
+ {
+ wsaptr->len = MIN (len, UINT32_MAX);
+ wsaptr->buf = ptr;
+ len -= wsaptr->len;
+ ptr += wsaptr->len;
+ }
+#else
+ WSABUF wsabuf = { len, ptr };
+ WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 };
+#endif
+ return send_internal (&wsamsg, 0);
+}
+
+ssize_t
+fhandler_socket::writev (const struct iovec *const iov, const int iovcnt,
+ ssize_t tot)
+{
+ WSABUF wsabuf[iovcnt];
+ WSABUF *wsaptr = wsabuf;
+ const struct iovec *iovptr = iov;
+ for (int i = 0; i < iovcnt; ++i)
+ {
+ wsaptr->len = iovptr->iov_len;
+ (wsaptr++)->buf = (char *) (iovptr++)->iov_base;
+ }
+ WSAMSG wsamsg = { NULL, 0, wsabuf, (DWORD) iovcnt, { 0, NULL}, 0 };
+ return send_internal (&wsamsg, 0);
+}
+
+ssize_t
+fhandler_socket::sendto (const void *in_ptr, size_t len, int flags,
const struct sockaddr *to, int tolen)
{
+ char *ptr = (char *) in_ptr;
struct sockaddr_storage sst;
- pthread_testcancel ();
-
if (to && get_inet_addr (to, tolen, &sst, &tolen) == SOCKET_ERROR)
return SOCKET_ERROR;
- WSABUF wsabuf = { len, (char *) ptr };
+#ifdef __x86_64__
+ /* size_t is 64 bit, but the len member in WSABUF is 32 bit.
+ Split buffer if necessary. */
+ DWORD bufcnt = len / UINT32_MAX + ((!len || (len % UINT32_MAX)) ? 1 : 0);
+ WSABUF wsabuf[bufcnt];
+ WSAMSG wsamsg = { to ? (struct sockaddr *) &sst : NULL, tolen,
+ wsabuf, bufcnt,
+ { 0, NULL },
+ 0 };
+ /* Don't use len as loop condition, it could be 0. */
+ for (WSABUF *wsaptr = wsabuf; bufcnt--; ++wsaptr)
+ {
+ wsaptr->len = MIN (len, UINT32_MAX);
+ wsaptr->buf = ptr;
+ len -= wsaptr->len;
+ ptr += wsaptr->len;
+ }
+#else
+ WSABUF wsabuf = { len, ptr };
WSAMSG wsamsg = { to ? (struct sockaddr *) &sst : NULL, tolen,
&wsabuf, 1,
{ 0, NULL},
0 };
+#endif
return send_internal (&wsamsg, flags);
}
-int
+ssize_t
fhandler_socket::sendmsg (const struct msghdr *msg, int flags)
{
/* TODO: Descriptor passing on AF_LOCAL sockets. */
@@ -1747,8 +1813,6 @@ fhandler_socket::sendmsg (const struct msghdr *msg, int flags)
struct sockaddr_storage sst;
int len = 0;
- pthread_testcancel ();
-
if (msg->msg_name
&& get_inet_addr ((struct sockaddr *) msg->msg_name, msg->msg_namelen,
&sst, &len) == SOCKET_ERROR)
@@ -1762,15 +1826,15 @@ fhandler_socket::sendmsg (const struct msghdr *msg, int flags)
wsaptr->len = iovptr->iov_len;
(wsaptr++)->buf = (char *) (iovptr++)->iov_base;
}
+ /* Disappointing but true: Even if WSASendMsg is supported, it's only
+ supported for datagram and raw sockets. */
+ DWORD controllen = (DWORD) (!wincap.has_sendmsg ()
+ || get_socket_type () == SOCK_STREAM
+ || get_addr_family () == AF_LOCAL
+ ? 0 : msg->msg_controllen);
WSAMSG wsamsg = { msg->msg_name ? (struct sockaddr *) &sst : NULL, len,
- wsabuf, msg->msg_iovlen,
- /* Disappointing but true: Even if WSASendMsg is
- supported, it's only supported for datagram and
- raw sockets. */
- { !wincap.has_sendmsg ()
- || get_socket_type () == SOCK_STREAM
- || get_addr_family () == AF_LOCAL
- ? 0 : msg->msg_controllen, (char *) msg->msg_control },
+ wsabuf, (DWORD) msg->msg_iovlen,
+ { controllen, (char *) msg->msg_control },
0 };
return send_internal (&wsamsg, flags);
}
@@ -1818,20 +1882,7 @@ int
fhandler_socket::close ()
{
int res = 0;
- /* TODO: CV - 2008-04-16. Lingering disabled. The original problem
- could be no longer reproduced on NT4, XP, 2K8. Any return of a
- spurious "Connection reset by peer" *could* be caused by disabling
- the linger code here... */
-#if 0
- /* HACK to allow a graceful shutdown even if shutdown() hasn't been
- called by the application. Note that this isn't the ultimate
- solution but it helps in many cases. */
- struct linger linger;
- linger.l_onoff = 1;
- linger.l_linger = 240; /* secs. default 2MSL value according to MSDN. */
- setsockopt (get_socket (), SOL_SOCKET, SO_LINGER,
- (const char *)&linger, sizeof linger);
-#endif
+
release_events ();
while ((res = closesocket (get_socket ())) != 0)
{
@@ -2040,7 +2091,17 @@ fhandler_socket::ioctl (unsigned int cmd, void *p)
WSAEventSelect (get_socket (), wsock_evt, EVENT_MASK);
break;
case FIONREAD:
- res = ioctlsocket (get_socket (), FIONREAD, (unsigned long *) p);
+#ifdef __x86_64__
+/* FIXME: This looks broken in the Mingw64 headers. If I make sure
+to use the Windows u_long definition, I'd expect that it's defined
+as a 4 byte type on LP64 as well. But that's not the case right now.
+The *additional* type __ms_u_long is available on LP64, and that's
+used in subsequent function declarations, but that's not available
+on 32 bit or LLP64. The LP64-ness shouldn't require to use another
+type name in the application code. */
+#define u_long __ms_u_long
+#endif
+ res = ioctlsocket (get_socket (), FIONREAD, (u_long *) p);
if (res == SOCKET_ERROR)
set_winsock_errno ();
break;
@@ -2055,15 +2116,15 @@ fhandler_socket::ioctl (unsigned int cmd, void *p)
res = 0;
}
else
- res = ioctlsocket (get_socket (), cmd, (unsigned long *) p);
+ res = ioctlsocket (get_socket (), cmd, (u_long *) p);
break;
}
- syscall_printf ("%d = ioctl_socket(%x, %x)", res, cmd, p);
+ syscall_printf ("%d = ioctl_socket(%x, %p)", res, cmd, p);
return res;
}
int
-fhandler_socket::fcntl (int cmd, void *arg)
+fhandler_socket::fcntl (int cmd, intptr_t arg)
{
int res = 0;
int request, current;
@@ -2087,7 +2148,7 @@ fhandler_socket::fcntl (int cmd, void *arg)
/* Carefully test for the O_NONBLOCK or deprecated OLD_O_NDELAY flag.
Set only the flag that has been passed in. If both are set, just
record O_NONBLOCK. */
- int new_flags = (int) arg & O_NONBLOCK_MASK;
+ int new_flags = arg & O_NONBLOCK_MASK;
if ((new_flags & OLD_O_NDELAY) && (new_flags & O_NONBLOCK))
new_flags = O_NONBLOCK;
current = get_flags () & O_NONBLOCK_MASK;
@@ -2131,7 +2192,7 @@ fhandler_socket::set_peer_sun_path (const char *path)
}
int
-fhandler_socket::getpeereid (pid_t *pid, __uid32_t *euid, __gid32_t *egid)
+fhandler_socket::getpeereid (pid_t *pid, uid_t *euid, gid_t *egid)
{
if (get_addr_family () != AF_LOCAL || get_socket_type () != SOCK_STREAM)
{
diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc
index 41bb118e9..b9833ffaf 100644
--- a/winsup/cygwin/fhandler_tape.cc
+++ b/winsup/cygwin/fhandler_tape.cc
@@ -53,7 +53,7 @@ details. */
/* mtinfo_part */
void
-mtinfo_part::initialize (long nblock)
+mtinfo_part::initialize (int32_t nblock)
{
block = nblock;
if (block == 0)
@@ -182,7 +182,7 @@ mtinfo_drive::close (HANDLE mt, bool rewind)
}
int
-mtinfo_drive::read (HANDLE mt, HANDLE mt_evt, void *ptr, size_t &ulen)
+mtinfo_drive::read (HANDLE mt, LPOVERLAPPED pov, void *ptr, size_t &ulen)
{
BOOL ret;
DWORD bytes_read = 0;
@@ -231,17 +231,17 @@ mtinfo_drive::read (HANDLE mt, HANDLE mt_evt, void *ptr, size_t &ulen)
part (partition)->smark = false;
if (auto_lock () && lock < auto_locked)
prepare (mt, TAPE_LOCK, true);
- ov.Offset = ov.OffsetHigh = 0;
- ov.hEvent = mt_evt;
- ret = ReadFile (mt, ptr, ulen, &bytes_read, &ov);
+ ov = pov;
+ ov->Offset = ov->OffsetHigh = 0;
+ ret = ReadFile (mt, ptr, ulen, &bytes_read, ov);
lasterr = ret ? 0 : GetLastError ();
if (lasterr == ERROR_IO_PENDING)
lasterr = async_wait (mt, &bytes_read);
ulen = (size_t) bytes_read;
if (bytes_read > 0)
{
- long blocks_read = mp ()->BlockSize == 0
- ? 1 : howmany (bytes_read, mp ()->BlockSize);
+ int32_t blocks_read = mp ()->BlockSize == 0
+ ? 1 : howmany (bytes_read, mp ()->BlockSize);
block += blocks_read;
part (partition)->block += blocks_read;
if (part (partition)->fblock >= 0)
@@ -287,14 +287,14 @@ mtinfo_drive::async_wait (HANDLE mt, DWORD *bytes_written)
{
DWORD written;
- bool ret = GetOverlappedResult (mt, &ov, &written, TRUE);
+ bool ret = GetOverlappedResult (mt, ov, &written, TRUE);
if (bytes_written)
*bytes_written = written;
return ret ? 0 : GetLastError ();
}
int
-mtinfo_drive::write (HANDLE mt, HANDLE mt_evt, const void *ptr, size_t &len)
+mtinfo_drive::write (HANDLE mt, LPOVERLAPPED pov, const void *ptr, size_t &len)
{
BOOL ret;
DWORD bytes_written = 0;
@@ -313,9 +313,9 @@ mtinfo_drive::write (HANDLE mt, HANDLE mt_evt, const void *ptr, size_t &len)
part (partition)->smark = false;
if (auto_lock () && lock < auto_locked)
prepare (mt, TAPE_LOCK, true);
- ov.Offset = ov.OffsetHigh = 0;
- ov.hEvent = mt_evt;
- ret = WriteFile (mt, ptr, len, &bytes_written, &ov);
+ ov = pov;
+ ov->Offset = ov->OffsetHigh = 0;
+ ret = WriteFile (mt, ptr, len, &bytes_written, ov);
lasterr = ret ? 0: GetLastError ();
if (lasterr == ERROR_IO_PENDING)
{
@@ -328,8 +328,8 @@ mtinfo_drive::write (HANDLE mt, HANDLE mt_evt, const void *ptr, size_t &len)
len = (size_t) bytes_written;
if (bytes_written > 0)
{
- long blocks_written = mp ()->BlockSize == 0
- ? 1 : howmany (bytes_written, mp ()->BlockSize);
+ int32_t blocks_written = mp ()->BlockSize == 0
+ ? 1 : howmany (bytes_written, mp ()->BlockSize);
block += blocks_written;
part (partition)->block += blocks_written;
if (part (partition)->fblock >= 0)
@@ -353,7 +353,7 @@ mtinfo_drive::write (HANDLE mt, HANDLE mt_evt, const void *ptr, size_t &len)
}
int
-mtinfo_drive::get_pos (HANDLE mt, long *ppartition, long *pblock)
+mtinfo_drive::get_pos (HANDLE mt, int32_t *ppartition, int32_t *pblock)
{
DWORD p, low, high;
@@ -363,8 +363,8 @@ mtinfo_drive::get_pos (HANDLE mt, long *ppartition, long *pblock)
if (!lasterr)
{
if (p > 0)
- partition = (long) p - 1;
- block = (long) low;
+ partition = (int32_t) p - 1;
+ block = (int32_t) low;
if (ppartition)
*ppartition= partition;
if (pblock)
@@ -379,7 +379,7 @@ mtinfo_drive::get_pos (HANDLE mt, long *ppartition, long *pblock)
}
int
-mtinfo_drive::_set_pos (HANDLE mt, int mode, long count, int partition,
+mtinfo_drive::_set_pos (HANDLE mt, int mode, int32_t count, int partition,
BOOL dont_wait)
{
/* If an async write is still pending, wait for completion. */
@@ -392,11 +392,11 @@ mtinfo_drive::_set_pos (HANDLE mt, int mode, long count, int partition,
}
int
-mtinfo_drive::set_pos (HANDLE mt, int mode, long count,
+mtinfo_drive::set_pos (HANDLE mt, int mode, int32_t count,
bool sfm_func)
{
int err = 0;
- long undone = count;
+ int32_t undone = count;
BOOL dont_wait = FALSE;
switch (mode)
@@ -547,7 +547,7 @@ out:
}
int
-mtinfo_drive::create_partitions (HANDLE mt, long count)
+mtinfo_drive::create_partitions (HANDLE mt, int32_t count)
{
if (dp ()->MaximumPartitionCount <= 1)
return ERROR_INVALID_PARAMETER;
@@ -578,9 +578,9 @@ out:
}
int
-mtinfo_drive::set_partition (HANDLE mt, long count)
+mtinfo_drive::set_partition (HANDLE mt, int32_t count)
{
- if (count < 0 || (unsigned long) count >= MAX_PARTITION_NUM)
+ if (count < 0 || (uint32_t) count >= MAX_PARTITION_NUM)
lasterr = ERROR_INVALID_PARAMETER;
else if ((DWORD) count >= dp ()->MaximumPartitionCount)
lasterr = ERROR_IO_DEVICE;
@@ -715,14 +715,14 @@ mtinfo_drive::prepare (HANDLE mt, int action, bool is_auto)
}
int
-mtinfo_drive::set_compression (HANDLE mt, long count)
+mtinfo_drive::set_compression (HANDLE mt, int32_t count)
{
if (!get_feature (TAPE_DRIVE_SET_COMPRESSION))
return ERROR_INVALID_PARAMETER;
TAPE_SET_DRIVE_PARAMETERS sdp =
{
dp ()->ECC,
- count ? TRUE : FALSE,
+ (BOOLEAN) (count ? TRUE : FALSE),
dp ()->DataPadding,
dp ()->ReportSetmarks,
dp ()->EOTWarningZoneSize
@@ -738,7 +738,7 @@ mtinfo_drive::set_compression (HANDLE mt, long count)
}
int
-mtinfo_drive::set_blocksize (HANDLE mt, long count)
+mtinfo_drive::set_blocksize (HANDLE mt, DWORD count)
{
TAPE_SET_MEDIA_PARAMETERS smp = {count};
TAPE_FUNC (SetTapeParameters (mt, SET_TAPE_MEDIA_INFORMATION, &smp));
@@ -768,32 +768,29 @@ mtinfo_drive::get_status (HANDLE mt, struct mtget *get)
get->mt_dsreg = (dp ()->DefaultBlockSize << MT_ST_BLKSIZE_SHIFT)
& MT_ST_BLKSIZE_MASK;
- if (wincap.has_ioctl_storage_get_media_types_ex ())
+ DWORD size = sizeof (GET_MEDIA_TYPES) + 10 * sizeof (DEVICE_MEDIA_INFO);
+ void *buf = alloca (size);
+ if (DeviceIoControl (mt, IOCTL_STORAGE_GET_MEDIA_TYPES_EX,
+ NULL, 0, buf, size, &size, NULL)
+ || GetLastError () == ERROR_MORE_DATA)
{
- DWORD size = sizeof (GET_MEDIA_TYPES) + 10 * sizeof (DEVICE_MEDIA_INFO);
- void *buf = alloca (size);
- if (DeviceIoControl (mt, IOCTL_STORAGE_GET_MEDIA_TYPES_EX,
- NULL, 0, buf, size, &size, NULL)
- || GetLastError () == ERROR_MORE_DATA)
+ PGET_MEDIA_TYPES gmt = (PGET_MEDIA_TYPES) buf;
+ for (DWORD i = 0; i < gmt->MediaInfoCount; ++i)
{
- PGET_MEDIA_TYPES gmt = (PGET_MEDIA_TYPES) buf;
- for (DWORD i = 0; i < gmt->MediaInfoCount; ++i)
+ PDEVICE_MEDIA_INFO dmi = &gmt->MediaInfo[i];
+ get->mt_type = dmi->DeviceSpecific.TapeInfo.MediaType;
+#define TINFO DeviceSpecific.TapeInfo
+ if (dmi->TINFO.MediaCharacteristics & MEDIA_CURRENTLY_MOUNTED)
{
- PDEVICE_MEDIA_INFO dmi = &gmt->MediaInfo[i];
get->mt_type = dmi->DeviceSpecific.TapeInfo.MediaType;
-#define TINFO DeviceSpecific.TapeInfo
- if (dmi->TINFO.MediaCharacteristics & MEDIA_CURRENTLY_MOUNTED)
- {
- get->mt_type = dmi->DeviceSpecific.TapeInfo.MediaType;
- if (dmi->TINFO.BusType == BusTypeScsi)
- get->mt_dsreg |=
- (dmi->TINFO.BusSpecificData.ScsiInformation.DensityCode
- << MT_ST_DENSITY_SHIFT)
- & MT_ST_DENSITY_MASK;
- break;
- }
-#undef TINFO
+ if (dmi->TINFO.BusType == BusTypeScsi)
+ get->mt_dsreg |=
+ (dmi->TINFO.BusSpecificData.ScsiInformation.DensityCode
+ << MT_ST_DENSITY_SHIFT)
+ & MT_ST_DENSITY_MASK;
+ break;
}
+#undef TINFO
}
}
@@ -870,9 +867,9 @@ mtinfo_drive::get_status (HANDLE mt, struct mtget *get)
}
int
-mtinfo_drive::set_options (HANDLE mt, long options)
+mtinfo_drive::set_options (HANDLE mt, int32_t options)
{
- long what = (options & MT_ST_OPTIONS);
+ int32_t what = (options & MT_ST_OPTIONS);
bool call_setparams = false;
bool set;
TAPE_SET_DRIVE_PARAMETERS sdp =
@@ -1234,13 +1231,13 @@ fhandler_dev_tape::close ()
cret = fhandler_dev_raw::close ();
unlock (0);
}
- if (mt_evt)
- CloseHandle (mt_evt);
+ if (ov.hEvent)
+ CloseHandle (ov.hEvent);
CloseHandle (mt_mtx);
return ret ? -1 : cret;
}
-void __stdcall
+void __reg3
fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
{
char *buf = (char *) ptr;
@@ -1267,7 +1264,7 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
if (devbufend > devbufstart)
{
bytes_to_read = MIN (len, devbufend - devbufstart);
- debug_printf ("read %d bytes from buffer (rest %d)",
+ debug_printf ("read %lu bytes from buffer (rest %lu)",
bytes_to_read, devbufend - devbufstart - bytes_to_read);
memcpy (buf, devbuf + devbufstart, bytes_to_read);
len -= bytes_to_read;
@@ -1284,15 +1281,16 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
}
if (len > 0)
{
- if (!mt_evt && !(mt_evt = CreateEvent (&sec_none, TRUE, FALSE, NULL)))
+ if (!ov.hEvent
+ && !(ov.hEvent = CreateEvent (&sec_none, TRUE, FALSE, NULL)))
debug_printf ("Creating event failed, %E");
size_t block_fit = !block_size ? len : rounddown(len, block_size);
if (block_fit)
{
- debug_printf ("read %d bytes from tape (rest %d)",
+ debug_printf ("read %lu bytes from tape (rest %lu)",
block_fit, len - block_fit);
- ret = mt.drive (driveno ())->read (get_handle (), mt_evt, buf,
- block_fit);
+ ret = mt.drive (driveno ())->read (get_handle (), &ov, buf,
+ block_fit);
if (ret)
__seterrno_from_win_error (ret);
else if (block_fit)
@@ -1312,9 +1310,9 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
}
if (!ret && len > 0)
{
- debug_printf ("read %d bytes from tape (one block)", block_size);
- ret = mt.drive (driveno ())->read (get_handle (), mt_evt, devbuf,
- block_size);
+ debug_printf ("read %lu bytes from tape (one block)", block_size);
+ ret = mt.drive (driveno ())->read (get_handle (), &ov, devbuf,
+ block_size);
if (ret)
__seterrno_from_win_error (ret);
else if (block_size)
@@ -1331,40 +1329,40 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
}
else
{
- if (!mt_evt && !(mt_evt = CreateEvent (&sec_none, TRUE, FALSE, NULL)))
+ if (!ov.hEvent
+ && !(ov.hEvent = CreateEvent (&sec_none, TRUE, FALSE, NULL)))
debug_printf ("Creating event failed, %E");
bytes_read = ulen;
- ret = mt.drive (driveno ())->read (get_handle (), mt_evt, ptr,
- bytes_read);
+ ret = mt.drive (driveno ())->read (get_handle (), &ov, ptr, bytes_read);
}
ulen = (ret ? (size_t) -1 : bytes_read);
unlock ();
}
-ssize_t __stdcall
+ssize_t __reg3
fhandler_dev_tape::raw_write (const void *ptr, size_t len)
{
if (!_lock (true))
return -1;
- if (!mt_evt && !(mt_evt = CreateEvent (&sec_none, TRUE, FALSE, NULL)))
+ if (!ov.hEvent && !(ov.hEvent = CreateEvent (&sec_none, TRUE, FALSE, NULL)))
debug_printf ("Creating event failed, %E");
- int ret = mt.drive (driveno ())->write (get_handle (), mt_evt, ptr, len);
+ int ret = mt.drive (driveno ())->write (get_handle (), &ov, ptr, len);
if (ret)
__seterrno_from_win_error (ret);
return unlock (ret ? -1 : (int) len);
}
-_off64_t
-fhandler_dev_tape::lseek (_off64_t offset, int whence)
+off_t
+fhandler_dev_tape::lseek (off_t offset, int whence)
{
struct mtop op;
struct mtpos pos;
DWORD block_size;
- _off64_t ret = ILLEGAL_SEEK;
+ off_t ret = ILLEGAL_SEEK;
lock (ILLEGAL_SEEK);
- debug_printf ("lseek (%s, %d, %d)", get_name (), offset, whence);
+ debug_printf ("lseek (%s, %D, %d)", get_name (), offset, whence);
block_size = mt.drive (driveno ())->mp ()->BlockSize;
if (block_size == 0)
@@ -1418,7 +1416,7 @@ out:
}
int __reg2
-fhandler_dev_tape::fstat (struct __stat64 *buf)
+fhandler_dev_tape::fstat (struct stat *buf)
{
int ret;
@@ -1441,19 +1439,19 @@ fhandler_dev_tape::dup (fhandler_base *child, int flags)
GetCurrentProcess (), &fh->mt_mtx,
0, TRUE, DUPLICATE_SAME_ACCESS))
{
- debug_printf ("dup(%s) failed, mutex handle %x, %E",
+ debug_printf ("dup(%s) failed, mutex handle %p, %E",
get_name (), mt_mtx);
__seterrno ();
return unlock (-1);
}
- fh->mt_evt = NULL;
- if (mt_evt &&
- !DuplicateHandle (GetCurrentProcess (), mt_evt,
- GetCurrentProcess (), &fh->mt_evt,
+ fh->ov.hEvent = NULL;
+ if (ov.hEvent &&
+ !DuplicateHandle (GetCurrentProcess (), ov.hEvent,
+ GetCurrentProcess (), &fh->ov.hEvent,
0, TRUE, DUPLICATE_SAME_ACCESS))
{
- debug_printf ("dup(%s) failed, event handle %x, %E",
- get_name (), mt_evt);
+ debug_printf ("dup(%s) failed, event handle %p, %E",
+ get_name (), ov.hEvent);
__seterrno ();
return unlock (-1);
}
@@ -1465,8 +1463,8 @@ fhandler_dev_tape::fixup_after_fork (HANDLE parent)
{
fhandler_dev_raw::fixup_after_fork (parent);
fork_fixup (parent, mt_mtx, "mt_mtx");
- if (mt_evt)
- fork_fixup (parent, mt_evt, "mt_evt");
+ if (ov.hEvent)
+ fork_fixup (parent, ov.hEvent, "ov.hEvent");
}
void
@@ -1474,8 +1472,8 @@ fhandler_dev_tape::set_close_on_exec (bool val)
{
fhandler_dev_raw::set_close_on_exec (val);
set_no_inheritance (mt_mtx, val);
- if (mt_evt)
- set_no_inheritance (mt_evt, val);
+ if (ov.hEvent)
+ set_no_inheritance (ov.hEvent, val);
}
int
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index 1383d5e37..fdf758918 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -306,6 +306,7 @@ fhandler_termios::line_edit (const char *rptr, int nread, termios& ti)
else
set_input_done (iscanon);
}
+
if (iscanon && ti.c_lflag & IEXTEN && CCEQ (ti.c_cc[VDISCARD], c))
{
ti.c_lflag ^= FLUSHO;
@@ -392,8 +393,8 @@ fhandler_termios::line_edit (const char *rptr, int nread, termios& ti)
return ret;
}
-_off64_t
-fhandler_termios::lseek (_off64_t, int)
+off_t
+fhandler_termios::lseek (off_t, int)
{
set_errno (ESPIPE);
return -1;
@@ -426,7 +427,7 @@ fhandler_termios::ioctl (int cmd, void *varg)
if (cmd != TIOCSCTTY)
return 1; /* Not handled by this function */
- int arg = (int) varg;
+ int arg = (int) (intptr_t) varg;
if (arg != 0 && arg != 1)
{
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index e34707944..34c879503 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -45,12 +45,6 @@ struct pipe_reply {
DWORD error;
};
-int
-fhandler_pty_slave::get_unit ()
-{
- return dev ().get_minor ();
-}
-
bool
bytes_available (DWORD& n, HANDLE h)
{
@@ -102,6 +96,8 @@ fhandler_pty_common::__acquire_output_mutex (const char *fn, int ln,
{
if (strace.active ())
strace.prntf (_STRACE_TERMIOS, fn, "(%d): pty output_mutex (%p): waiting %d ms", ln, output_mutex, ms);
+ if (ms == INFINITE)
+ ms = 100;
DWORD res = WaitForSingleObject (output_mutex, ms);
if (res == WAIT_OBJECT_0)
{
@@ -176,7 +172,7 @@ fhandler_pty_master::accept_input ()
DWORD rc;
DWORD written = 0;
- paranoid_printf ("about to write %d chars to slave", bytes_left);
+ paranoid_printf ("about to write %u chars to slave", bytes_left);
rc = WriteFile (get_output_handle (), p, bytes_left, &written, NULL);
if (!rc)
{
@@ -352,7 +348,7 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on
if (optr - buf >= (int) len)
{
if (*iptr != '\n' || n != 0)
- system_printf ("internal error: %d unexpected characters", n);
+ system_printf ("internal error: %u unexpected characters", n);
need_nl = 1;
break;
}
@@ -402,11 +398,11 @@ fhandler_pty_slave::open (int flags, mode_t)
for (HANDLE **h = handles; *h; h++)
**h = NULL;
- _tc = cygwin_shared->tty[get_unit ()];
+ _tc = cygwin_shared->tty[get_minor ()];
tcinit (false);
- cygwin_shared->tty.attach (get_unit ());
+ cygwin_shared->tty.attach (get_minor ());
/* Create synchronisation events */
char buf[MAX_PATH];
@@ -423,7 +419,7 @@ fhandler_pty_slave::open (int flags, mode_t)
errmsg = "open input mutex failed, %E";
goto err;
}
- shared_name (buf, INPUT_AVAILABLE_EVENT, get_unit ());
+ shared_name (buf, INPUT_AVAILABLE_EVENT, get_minor ());
if (!(input_available_event = OpenEvent (MAXIMUM_ALLOWED, TRUE, buf)))
{
errmsg = "open input event failed, %E";
@@ -441,13 +437,13 @@ fhandler_pty_slave::open (int flags, mode_t)
S_IFCHR | S_IRUSR | S_IWUSR | S_IWGRP,
sd))
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR) sd;
- acquire_output_mutex (500);
+ acquire_output_mutex (INFINITE);
inuse = get_ttyp ()->create_inuse (&sa);
get_ttyp ()->was_opened = true;
release_output_mutex ();
}
- if (!get_ttyp ()->from_master || !get_ttyp ()->to_master)
+ if (!get_ttyp ()->from_master () || !get_ttyp ()->to_master ())
{
errmsg = "pty handles have been closed";
set_errno (EACCES);
@@ -488,16 +484,16 @@ fhandler_pty_slave::open (int flags, mode_t)
}
if (pty_owner)
{
- if (!DuplicateHandle (pty_owner, get_ttyp ()->from_master,
+ if (!DuplicateHandle (pty_owner, get_ttyp ()->from_master (),
GetCurrentProcess (), &from_master_local, 0, TRUE,
DUPLICATE_SAME_ACCESS))
{
termios_printf ("can't duplicate input from %u/%p, %E",
- get_ttyp ()->master_pid, get_ttyp ()->from_master);
+ get_ttyp ()->master_pid, get_ttyp ()->from_master ());
__seterrno ();
goto err_no_msg;
}
- if (!DuplicateHandle (pty_owner, get_ttyp ()->to_master,
+ if (!DuplicateHandle (pty_owner, get_ttyp ()->to_master (),
GetCurrentProcess (), &to_master_local, 0, TRUE,
DUPLICATE_SAME_ACCESS))
{
@@ -514,7 +510,7 @@ fhandler_pty_slave::open (int flags, mode_t)
DWORD len;
__small_sprintf (buf, "\\\\.\\pipe\\cygwin-%S-pty%d-master-ctl",
- &cygheap->installation_key, get_unit ());
+ &cygheap->installation_key, get_minor ());
termios_printf ("dup handles via master control pipe %s", buf);
if (!CallNamedPipe (buf, &req, sizeof req, &repl, sizeof repl,
&len, 500))
@@ -535,9 +531,9 @@ fhandler_pty_slave::open (int flags, mode_t)
VerifyHandle (to_master_local);
termios_printf ("duplicated from_master %p->%p from pty_owner",
- get_ttyp ()->from_master, from_master_local);
+ get_ttyp ()->from_master (), from_master_local);
termios_printf ("duplicated to_master %p->%p from pty_owner",
- get_ttyp ()->to_master, to_master_local);
+ get_ttyp ()->to_master (), to_master_local);
set_io_handle (from_master_local);
set_output_handle (to_master_local);
@@ -587,7 +583,7 @@ fhandler_pty_slave::close ()
termios_printf ("CloseHandle (inuse), %E");
if (!ForceCloseHandle (input_available_event))
termios_printf ("CloseHandle (input_available_event<%p>), %E", input_available_event);
- if ((unsigned) myself->ctty == FHDEV (DEV_PTYS_MAJOR, get_unit ()))
+ if ((unsigned) myself->ctty == FHDEV (DEV_PTYS_MAJOR, get_minor ()))
fhandler_console::free_console (); /* assumes that we are the last pty closer */
return fhandler_pty_common::close ();
}
@@ -635,13 +631,14 @@ fhandler_pty_slave::init (HANDLE h, DWORD a, mode_t)
ssize_t __stdcall
fhandler_pty_slave::write (const void *ptr, size_t len)
{
- DWORD n, towrite = len;
+ DWORD n;
+ ssize_t towrite = len;
bg_check_types bg = bg_check (SIGTTOU);
if (bg <= bg_eof)
return (ssize_t) bg;
- termios_printf ("pty%d, write(%x, %d)", get_unit (), ptr, len);
+ termios_printf ("pty%d, write(%p, %lu)", get_minor (), ptr, len);
push_process_state process_state (PID_TTYOU);
@@ -662,7 +659,7 @@ fhandler_pty_slave::write (const void *ptr, size_t len)
if (get_ttyp ()->write_error)
{
set_errno (get_ttyp ()->write_error);
- towrite = (DWORD) -1;
+ towrite = -1;
get_ttyp ()->write_error = 0;
release_output_mutex ();
break;
@@ -682,17 +679,17 @@ fhandler_pty_slave::write (const void *ptr, size_t len)
__seterrno_from_win_error (err);
}
raise (SIGHUP); /* FIXME: Should this be SIGTTOU? */
- towrite = (DWORD) -1;
+ towrite = -1;
break;
}
}
return towrite;
}
-void __stdcall
+void __reg3
fhandler_pty_slave::read (void *ptr, size_t& len)
{
- int totalread = 0;
+ ssize_t totalread = 0;
int vmin = 0;
int vtime = 0; /* Initialized to prevent -Wuninitialized warning */
size_t readlen;
@@ -707,7 +704,7 @@ fhandler_pty_slave::read (void *ptr, size_t& len)
return;
}
- termios_printf ("read(%x, %d) handle %p", ptr, len, get_handle ());
+ termios_printf ("read(%p, %lu) handle %p", ptr, len, get_handle ());
push_process_state process_state (PID_TTYIN);
@@ -836,7 +833,7 @@ fhandler_pty_slave::read (void *ptr, size_t& len)
DWORD n = 0;
if (readlen)
{
- termios_printf ("reading %d bytes (vtime %d)", readlen, vtime);
+ termios_printf ("reading %lu bytes (vtime %d)", readlen, vtime);
if (!ReadFile (get_handle (), buf, readlen, &n, NULL))
{
termios_printf ("read failed, %E");
@@ -912,7 +909,7 @@ fhandler_pty_slave::read (void *ptr, size_t& len)
break;
}
out:
- termios_printf ("%d=read(%x, %d)", totalread, ptr, len);
+ termios_printf ("%d=read(%p, %lu)", totalread, ptr, len);
len = (size_t) totalread;
}
@@ -987,7 +984,7 @@ fhandler_pty_slave::ioctl (unsigned int cmd, void *arg)
return res;
if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid
- && (unsigned) myself->ctty == FHDEV (DEV_PTYS_MAJOR, get_unit ())
+ && (unsigned) myself->ctty == FHDEV (DEV_PTYS_MAJOR, get_minor ())
&& (get_ttyp ()->ti.c_lflag & TOSTOP))
{
/* background process */
@@ -1015,7 +1012,7 @@ fhandler_pty_slave::ioctl (unsigned int cmd, void *arg)
}
goto out;
case TIOCSPGRP:
- retval = this->tcsetpgrp ((pid_t) arg);
+ retval = this->tcsetpgrp ((pid_t) (intptr_t) arg);
goto out;
case FIONREAD:
{
@@ -1072,7 +1069,7 @@ out:
}
int __reg2
-fhandler_pty_slave::fstat (struct __stat64 *st)
+fhandler_pty_slave::fstat (struct stat *st)
{
fhandler_base::fstat (st);
@@ -1080,7 +1077,7 @@ fhandler_pty_slave::fstat (struct __stat64 *st)
if (!input_available_event)
{
char buf[MAX_PATH];
- shared_name (buf, INPUT_AVAILABLE_EVENT, get_unit ());
+ shared_name (buf, INPUT_AVAILABLE_EVENT, get_minor ());
input_available_event = OpenEvent (READ_CONTROL, TRUE, buf);
if (input_available_event)
to_close = true;
@@ -1107,8 +1104,8 @@ fhandler_pty_slave::fch_open_handles ()
{
char buf[MAX_PATH];
- _tc = cygwin_shared->tty[get_unit ()];
- shared_name (buf, INPUT_AVAILABLE_EVENT, get_unit ());
+ _tc = cygwin_shared->tty[get_minor ()];
+ shared_name (buf, INPUT_AVAILABLE_EVENT, get_minor ());
input_available_event = OpenEvent (READ_CONTROL | WRITE_DAC | WRITE_OWNER,
TRUE, buf);
output_mutex = get_ttyp ()->open_output_mutex (WRITE_DAC | WRITE_OWNER);
@@ -1155,14 +1152,14 @@ fhandler_pty_slave::fch_close_handles ()
close_maybe (inuse);
}
-int __stdcall
+int __reg1
fhandler_pty_slave::fchmod (mode_t mode)
{
int ret = -1;
bool to_close = false;
security_descriptor sd;
- __uid32_t uid;
- __gid32_t gid;
+ uid_t uid;
+ gid_t gid;
if (!input_available_event)
{
@@ -1181,14 +1178,14 @@ errout:
return ret;
}
-int __stdcall
-fhandler_pty_slave::fchown (__uid32_t uid, __gid32_t gid)
+int __reg2
+fhandler_pty_slave::fchown (uid_t uid, gid_t gid)
{
int ret = -1;
bool to_close = false;
mode_t mode = 0;
- __uid32_t o_uid;
- __gid32_t o_gid;
+ uid_t o_uid;
+ gid_t o_gid;
security_descriptor sd;
if (uid == ILLEGAL_UID && gid == ILLEGAL_GID)
@@ -1247,12 +1244,12 @@ fhandler_pty_master::open_setup (int flags)
{
set_flags ((flags & ~O_TEXT) | O_BINARY);
char buf[sizeof ("opened pty master for ptyNNNNNNNNNNN")];
- __small_sprintf (buf, "opened pty master for pty%d", get_unit ());
+ __small_sprintf (buf, "opened pty master for pty%d", get_minor ());
report_tty_counts (this, buf, "");
}
-_off64_t
-fhandler_pty_common::lseek (_off64_t, int)
+off_t
+fhandler_pty_common::lseek (off_t, int)
{
set_errno (ESPIPE);
return -1;
@@ -1261,7 +1258,7 @@ fhandler_pty_common::lseek (_off64_t, int)
int
fhandler_pty_common::close ()
{
- termios_printf ("pty%d <%p,%p> closing", get_unit (), get_handle (), get_output_handle ());
+ termios_printf ("pty%d <%p,%p> closing", get_minor (), get_handle (), get_output_handle ());
if (!ForceCloseHandle (input_mutex))
termios_printf ("CloseHandle (input_mutex<%p>), %E", input_mutex);
if (!ForceCloseHandle (output_mutex))
@@ -1285,7 +1282,7 @@ fhandler_pty_master::cleanup ()
int
fhandler_pty_master::close ()
{
- termios_printf ("closing from_master(%p)/to_master(%p) since we own them(%d)",
+ termios_printf ("closing from_master(%p)/to_master(%p) since we own them(%u)",
from_master, to_master, dwProcessId);
if (cygwin_finished_initializing)
{
@@ -1297,7 +1294,7 @@ fhandler_pty_master::close ()
DWORD len;
__small_sprintf (buf, "\\\\.\\pipe\\cygwin-%S-pty%d-master-ctl",
- &cygheap->installation_key, get_unit ());
+ &cygheap->installation_key, get_minor ());
CallNamedPipe (buf, &req, sizeof req, &repl, sizeof repl, &len, 500);
CloseHandle (master_ctl);
master_thread->detach ();
@@ -1360,7 +1357,7 @@ fhandler_pty_master::write (const void *ptr, size_t len)
return i;
}
-void __stdcall
+void __reg3
fhandler_pty_master::read (void *ptr, size_t& len)
{
bg_check_types bg = bg_check (SIGTTIN);
@@ -1376,14 +1373,14 @@ fhandler_pty_master::read (void *ptr, size_t& len)
int
fhandler_pty_master::tcgetattr (struct termios *t)
{
- *t = cygwin_shared->tty[get_unit ()]->ti;
+ *t = cygwin_shared->tty[get_minor ()]->ti;
return 0;
}
int
fhandler_pty_master::tcsetattr (int, const struct termios *t)
{
- cygwin_shared->tty[get_unit ()]->ti = *t;
+ cygwin_shared->tty[get_minor ()]->ti = *t;
return 0;
}
@@ -1432,7 +1429,7 @@ fhandler_pty_master::ioctl (unsigned int cmd, void *arg)
*((pid_t *) arg) = this->tcgetpgrp ();
break;
case TIOCSPGRP:
- return this->tcsetpgrp ((pid_t) arg);
+ return this->tcsetpgrp ((pid_t) (intptr_t) arg);
case FIONREAD:
{
DWORD n;
@@ -1455,7 +1452,7 @@ fhandler_pty_master::ptsname_r (char *buf, size_t buflen)
{
char tmpbuf[TTY_NAME_MAX];
- __ptsname (tmpbuf, get_unit ());
+ __ptsname (tmpbuf, get_minor ());
if (buflen <= strlen (tmpbuf))
{
set_errno (ERANGE);
@@ -1556,7 +1553,7 @@ fhandler_pty_master::pty_master_thread ()
&token);
if (!NT_SUCCESS (status))
{
- termios_printf ("NtOpenThreadToken, %p", status);
+ termios_printf ("NtOpenThreadToken, %y", status);
SetLastError (RtlNtStatusToDosError (status));
goto reply;
}
@@ -1566,7 +1563,7 @@ fhandler_pty_master::pty_master_thread ()
NtClose (token);
if (!NT_SUCCESS (status))
{
- termios_printf ("NtAccessCheck, %p", status);
+ termios_printf ("NtAccessCheck, %y", status);
SetLastError (RtlNtStatusToDosError (status));
goto reply;
}
@@ -1614,7 +1611,7 @@ reply:
if (deimp)
cygheap->user.reimpersonate ();
sd.free ();
- termios_printf ("Reply: from %p, to %p, error %lu",
+ termios_printf ("Reply: from %p, to %p, error %u",
repl.from_master, repl.to_master, repl.error );
if (!WriteFile (master_ctl, &repl, sizeof repl, &len, NULL))
termios_printf ("WriteFile, %E");
@@ -1699,10 +1696,13 @@ fhandler_pty_master::setup ()
the pty pipe handles to processes which deserve it. */
__small_sprintf (buf, "\\\\.\\pipe\\cygwin-%S-pty%d-master-ctl",
&cygheap->installation_key, unit);
- master_ctl = CreateNamedPipe (buf, PIPE_ACCESS_DUPLEX,
+ master_ctl = CreateNamedPipe (buf, PIPE_ACCESS_DUPLEX
+ | FILE_FLAG_FIRST_PIPE_INSTANCE,
PIPE_WAIT | PIPE_TYPE_MESSAGE
- | PIPE_READMODE_MESSAGE, 1, 4096, 4096,
- 0, &sec_all_nih);
+ | PIPE_READMODE_MESSAGE
+ | (wincap.has_pipe_reject_remote_clients ()
+ ? PIPE_REJECT_REMOTE_CLIENTS : 0),
+ 1, 4096, 4096, 0, &sec_all_nih);
if (master_ctl == INVALID_HANDLE_VALUE)
{
errstr = "pty master control pipe";
@@ -1715,8 +1715,8 @@ fhandler_pty_master::setup ()
goto err;
}
- t.from_master = from_master;
- t.to_master = to_master;
+ t.set_from_master (from_master);
+ t.set_to_master (to_master);
t.winsize.ws_col = 80;
t.winsize.ws_row = 25;
t.master_pid = myself->pid;
@@ -1751,8 +1751,8 @@ fhandler_pty_master::fixup_after_fork (HANDLE parent)
tty& t = *get_ttyp ();
if (myself->pid == t.master_pid)
{
- t.from_master = arch->from_master;
- t.to_master = arch->to_master;
+ t.set_from_master (arch->from_master);
+ t.set_to_master (arch->to_master);
}
arch->dwProcessId = wpid;
}
diff --git a/winsup/cygwin/fhandler_virtual.cc b/winsup/cygwin/fhandler_virtual.cc
index 24c517702..07b8e4b0b 100644
--- a/winsup/cygwin/fhandler_virtual.cc
+++ b/winsup/cygwin/fhandler_virtual.cc
@@ -126,15 +126,15 @@ fhandler_virtual::closedir (DIR * dir)
return 0;
}
-_off64_t
-fhandler_virtual::lseek (_off64_t offset, int whence)
+off_t
+fhandler_virtual::lseek (off_t offset, int whence)
{
/*
* On Linux, when you lseek within a /proc file,
* the contents of the file are updated.
*/
if (!fill_filebuf ())
- return (_off64_t) -1;
+ return (off_t) -1;
switch (whence)
{
case SEEK_SET:
@@ -148,7 +148,7 @@ fhandler_virtual::lseek (_off64_t offset, int whence)
break;
default:
set_errno (EINVAL);
- return (_off64_t) -1;
+ return (off_t) -1;
}
return position;
}
@@ -181,7 +181,7 @@ fhandler_virtual::close ()
return 0;
}
-void __stdcall
+void __reg3
fhandler_virtual::read (void *ptr, size_t& len)
{
if (len == 0)
@@ -246,7 +246,7 @@ fhandler_virtual::fchmod (mode_t mode)
}
int
-fhandler_virtual::fchown (__uid32_t uid, __gid32_t gid)
+fhandler_virtual::fchown (uid_t uid, gid_t gid)
{
/* Same as on Linux. */
set_errno (EPERM);
@@ -254,7 +254,7 @@ fhandler_virtual::fchown (__uid32_t uid, __gid32_t gid)
}
int
-fhandler_virtual::facl (int cmd, int nentries, __aclent32_t *aclbufp)
+fhandler_virtual::facl (int cmd, int nentries, aclent_t *aclbufp)
{
int res = fhandler_base::facl (cmd, nentries, aclbufp);
if (res >= 0 && cmd == GETACL)
@@ -266,7 +266,7 @@ fhandler_virtual::facl (int cmd, int nentries, __aclent32_t *aclbufp)
return res;
}
-int __stdcall
+int __reg2
fhandler_virtual::fstatvfs (struct statvfs *sfs)
{
/* Virtual file system. Just return an empty buffer with a few values
diff --git a/winsup/cygwin/fhandler_virtual.h b/winsup/cygwin/fhandler_virtual.h
index dff8195ea..9747dd2cb 100644
--- a/winsup/cygwin/fhandler_virtual.h
+++ b/winsup/cygwin/fhandler_virtual.h
@@ -13,7 +13,7 @@ struct virt_tab_t {
size_t name_len;
fh_devices fhandler;
virtual_ftype_t type;
- _off64_t (*format_func)(void *data, char *&);
+ off_t (*format_func)(void *data, char *&);
};
#define _VN(s) s, sizeof (s) - 1
diff --git a/winsup/cygwin/fhandler_windows.cc b/winsup/cygwin/fhandler_windows.cc
index 2ac3bfabf..12ab5265b 100644
--- a/winsup/cygwin/fhandler_windows.cc
+++ b/winsup/cygwin/fhandler_windows.cc
@@ -84,7 +84,7 @@ fhandler_windows::write (const void *buf, size_t)
return sizeof (MSG);
}
-void __stdcall
+void __reg3
fhandler_windows::read (void *buf, size_t& len)
{
MSG *ptr = (MSG *) buf;
diff --git a/winsup/cygwin/fhandler_zero.cc b/winsup/cygwin/fhandler_zero.cc
index 943d8738e..1fd874614 100644
--- a/winsup/cygwin/fhandler_zero.cc
+++ b/winsup/cygwin/fhandler_zero.cc
@@ -41,14 +41,14 @@ fhandler_dev_zero::write (const void *, size_t len)
return len;
}
-void __stdcall
+void __reg3
fhandler_dev_zero::read (void *ptr, size_t& len)
{
memset (ptr, 0, len);
}
-_off64_t
-fhandler_dev_zero::lseek (_off64_t, int)
+off_t
+fhandler_dev_zero::lseek (off_t, int)
{
return 0;
}
diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc
index 0a2ff9ea2..c9d7eb6ea 100644
--- a/winsup/cygwin/flock.cc
+++ b/winsup/cygwin/flock.cc
@@ -1,6 +1,6 @@
/* flock.cc. NT specific implementation of advisory file locking.
- Copyright 2003, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ Copyright 2003, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -170,7 +170,7 @@ allow_others_to_sync ()
MAX_PROCESS_SD_SIZE, &len);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtQuerySecurityObject: %p", status);
+ debug_printf ("NtQuerySecurityObject: %y", status);
return;
}
/* Create a valid dacl pointer and set its size to be as big as
@@ -197,14 +197,14 @@ allow_others_to_sync ()
well_known_world_sid);
if (!NT_SUCCESS (status))
{
- debug_printf ("RtlAddAccessAllowedAce: %p", status);
+ debug_printf ("RtlAddAccessAllowedAce: %y", status);
return;
}
/* Set the size of the DACL correctly. */
status = RtlFirstFreeAce (dacl, &ace);
if (!NT_SUCCESS (status))
{
- debug_printf ("RtlFirstFreeAce: %p", status);
+ debug_printf ("RtlFirstFreeAce: %y", status);
return;
}
dacl->AclSize = (char *) ace - (char *) dacl;
@@ -212,7 +212,7 @@ allow_others_to_sync ()
status = NtSetSecurityObject (NtCurrentProcess (), DACL_SECURITY_INFORMATION, sd);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtSetSecurityObject: %p", status);
+ debug_printf ("NtSetSecurityObject: %y", status);
return;
}
done = true;
@@ -228,7 +228,7 @@ get_obj_handle_count (HANDLE h)
status = NtQueryObject (h, ObjectBasicInformation, &obi, sizeof obi, NULL);
if (!NT_SUCCESS (status))
- debug_printf ("NtQueryObject: %p\n", status);
+ debug_printf ("NtQueryObject: %y", status);
else
hdl_cnt = obi.HandleCount;
return hdl_cnt;
@@ -248,9 +248,9 @@ class lockf_t
public:
uint16_t lf_flags; /* Semantics: F_POSIX, F_FLOCK, F_WAIT */
uint16_t lf_type; /* Lock type: F_RDLCK, F_WRLCK */
- _off64_t lf_start; /* Byte # of the start of the lock */
- _off64_t lf_end; /* Byte # of the end of the lock (-1=EOF) */
- int64_t lf_id; /* Cygwin PID for POSIX locks, a unique id per
+ off_t lf_start; /* Byte # of the start of the lock */
+ off_t lf_end; /* Byte # of the end of the lock (-1=EOF) */
+ int64_t lf_id; /* Cygwin PID for POSIX locks, a unique id per
file table entry for BSD flock locks. */
DWORD lf_wid; /* Win PID of the resource holding the lock */
uint16_t lf_ver; /* Version number of the lock. If a released
@@ -268,7 +268,7 @@ class lockf_t
lf_next (NULL), lf_obj (NULL)
{}
lockf_t (class inode_t *node, class lockf_t **head,
- short flags, short type, _off64_t start, _off64_t end,
+ short flags, short type, off_t start, off_t end,
long long id, DWORD wid, uint16_t ver)
: lf_flags (flags), lf_type (type), lf_start (start), lf_end (end),
lf_id (id), lf_wid (wid), lf_ver (ver), lf_head (head), lf_inode (node),
@@ -308,8 +308,8 @@ class inode_t
lockf_t *i_lockf; /* List of locks of this process. */
lockf_t *i_all_lf; /* Temp list of all locks for this file. */
- __dev32_t i_dev; /* Device ID */
- __ino64_t i_ino; /* inode number */
+ dev_t i_dev; /* Device ID */
+ ino_t i_ino; /* inode number */
private:
HANDLE i_dir;
@@ -317,7 +317,7 @@ class inode_t
uint32_t i_cnt; /* # of threads referencing this instance. */
public:
- inode_t (__dev32_t dev, __ino64_t ino);
+ inode_t (dev_t dev, ino_t ino);
~inode_t ();
void *operator new (size_t size)
@@ -325,7 +325,7 @@ class inode_t
void operator delete (void *p)
{ cfree (p); }
- static inode_t *get (__dev32_t dev, __ino64_t ino,
+ static inode_t *get (dev_t dev, ino_t ino,
bool create_if_missing, bool lock);
void LOCK () { WaitForSingleObject (i_mtx, INFINITE); }
@@ -482,7 +482,7 @@ fixup_lockf_after_exec ()
file. The file is specified by the device and inode_t number. If inode_t
doesn't exist, create it. */
inode_t *
-inode_t::get (__dev32_t dev, __ino64_t ino, bool create_if_missing, bool lock)
+inode_t::get (dev_t dev, ino_t ino, bool create_if_missing, bool lock)
{
inode_t *node;
@@ -504,7 +504,7 @@ inode_t::get (__dev32_t dev, __ino64_t ino, bool create_if_missing, bool lock)
return node;
}
-inode_t::inode_t (__dev32_t dev, __ino64_t ino)
+inode_t::inode_t (dev_t dev, ino_t ino)
: i_lockf (NULL), i_all_lf (NULL), i_dev (dev), i_ino (ino), i_cnt (0L)
{
HANDLE parent_dir;
@@ -522,14 +522,14 @@ inode_t::inode_t (__dev32_t dev, __ino64_t ino)
parent_dir, everyone_sd (FLOCK_INODE_DIR_ACCESS));
status = NtCreateDirectoryObject (&i_dir, FLOCK_INODE_DIR_ACCESS, &attr);
if (!NT_SUCCESS (status))
- api_fatal ("NtCreateDirectoryObject(inode): %p", status);
+ api_fatal ("NtCreateDirectoryObject(inode): %y", status);
/* Create a mutex object in the file specific dir, which is used for
access synchronization on the dir and its objects. */
InitializeObjectAttributes (&attr, &ro_u_mtx, OBJ_INHERIT | OBJ_OPENIF, i_dir,
everyone_sd (CYG_MUTANT_ACCESS));
status = NtCreateMutant (&i_mtx, CYG_MUTANT_ACCESS, &attr, FALSE);
if (!NT_SUCCESS (status))
- api_fatal ("NtCreateMutant(inode): %p", status);
+ api_fatal ("NtCreateMutant(inode): %y", status);
}
/* Enumerate all lock event objects for this file and create a lockf_t
@@ -554,10 +554,10 @@ lockf_t::from_obj_name (inode_t *node, lockf_t **head, const wchar_t *name)
lf_type = wcstol (endptr + 1, &endptr, 16);
if ((lf_type != F_RDLCK && lf_type != F_WRLCK) || !endptr || *endptr != L'-')
return false;
- lf_start = (_off64_t) wcstoull (endptr + 1, &endptr, 16);
+ lf_start = (off_t) wcstoull (endptr + 1, &endptr, 16);
if (lf_start < 0 || !endptr || *endptr != L'-')
return false;
- lf_end = (_off64_t) wcstoull (endptr + 1, &endptr, 16);
+ lf_end = (off_t) wcstoull (endptr + 1, &endptr, 16);
if (lf_end < -1LL
|| (lf_end > 0 && lf_end < lf_start)
|| !endptr || *endptr != L'-')
@@ -640,8 +640,8 @@ create_lock_in_parent (PVOID param)
OBJECT_NAME_INFORMATION *ntfn;
NTSTATUS status;
wchar_t *lockname, *inodename, *endptr;
- __dev32_t dev;
- __ino64_t ino;
+ dev_t dev;
+ ino_t ino;
inode_t *node;
lockf_t newlock, *lock;
int cnt;
@@ -753,7 +753,7 @@ lockf_t::create_lock_obj ()
if (!NT_SUCCESS (status))
{
if (status != STATUS_OBJECT_NAME_COLLISION)
- api_fatal ("NtCreateEvent(lock): %p", status);
+ api_fatal ("NtCreateEvent(lock): %y", status);
/* If we get a STATUS_OBJECT_NAME_COLLISION, the event still exists
because some other process is waiting for it in lf_setlock.
If so, check the event's signal state. If we can't open it, it
@@ -764,7 +764,7 @@ lockf_t::create_lock_obj ()
if (open_lock_obj ())
{
if (!IsEventSignalled (lf_obj))
- api_fatal ("NtCreateEvent(lock): %p", status);
+ api_fatal ("NtCreateEvent(lock): %y", status);
close_lock_obj ();
/* Increment the lf_ver field until we have no collision. */
++lf_ver;
@@ -910,15 +910,25 @@ static int maxlockdepth = MAXDEPTH;
static int lf_clearlock (lockf_t *, lockf_t **, HANDLE);
static int lf_findoverlap (lockf_t *, lockf_t *, int, lockf_t ***, lockf_t **);
static lockf_t *lf_getblock (lockf_t *, inode_t *node);
-static int lf_getlock (lockf_t *, inode_t *, struct __flock64 *);
+static int lf_getlock (lockf_t *, inode_t *, struct flock *);
static int lf_setlock (lockf_t *, inode_t *, lockf_t **, HANDLE);
static void lf_split (lockf_t *, lockf_t *, lockf_t **);
static void lf_wakelock (lockf_t *, HANDLE);
+/* This is the fcntl advisory lock implementation. For the implementation
+ of mandatory locks using the Windows mandatory locking functions, see the
+ fhandler_disk_file::mand_lock method at the end of this file. */
int
-fhandler_disk_file::lock (int a_op, struct __flock64 *fl)
+fhandler_base::lock (int, struct flock *)
{
- _off64_t start, end, oadd;
+ set_errno (EINVAL);
+ return -1;
+}
+
+int
+fhandler_disk_file::lock (int a_op, struct flock *fl)
+{
+ off_t start, end, oadd;
int error = 0;
short a_flags = fl->l_type & (F_POSIX | F_FLOCK);
@@ -1499,7 +1509,7 @@ lf_clearlock (lockf_t *unlock, lockf_t **clean, HANDLE fhdl)
* and if so return its process identifier.
*/
static int
-lf_getlock (lockf_t *lock, inode_t *node, struct __flock64 *fl)
+lf_getlock (lockf_t *lock, inode_t *node, struct flock *fl)
{
lockf_t *block;
tmp_pathbuf tp;
@@ -1577,7 +1587,7 @@ static int
lf_findoverlap (lockf_t *lf, lockf_t *lock, int type, lockf_t ***prev,
lockf_t **overlap)
{
- _off64_t start, end;
+ off_t start, end;
*overlap = lf;
if (lf == NOLOCKF)
@@ -1716,7 +1726,7 @@ flock (int fd, int operation)
{
int res = -1;
int cmd;
- struct __flock64 fl = { 0, SEEK_SET, 0, 0, 0 };
+ struct flock fl = { 0, SEEK_SET, 0, 0, 0 };
myfault efault;
if (efault.faulted (EFAULT))
@@ -1730,19 +1740,22 @@ flock (int fd, int operation)
switch (operation & (~LOCK_NB))
{
case LOCK_EX:
- fl.l_type = F_WRLCK | F_FLOCK;
+ fl.l_type = F_WRLCK;
break;
case LOCK_SH:
- fl.l_type = F_RDLCK | F_FLOCK;
+ fl.l_type = F_RDLCK;
break;
case LOCK_UN:
- fl.l_type = F_UNLCK | F_FLOCK;
+ fl.l_type = F_UNLCK;
break;
default:
set_errno (EINVAL);
goto done;
}
- res = cfd->lock (cmd, &fl);
+ if (!cfd->mandatory_locking ())
+ fl.l_type |= F_FLOCK;
+ res = cfd->mandatory_locking () ? cfd->mand_lock (cmd, &fl)
+ : cfd->lock (cmd, &fl);
if ((res == -1) && ((get_errno () == EAGAIN) || (get_errno () == EACCES)))
set_errno (EWOULDBLOCK);
done:
@@ -1751,11 +1764,11 @@ done:
}
extern "C" int
-lockf (int filedes, int function, _off64_t size)
+lockf (int filedes, int function, off_t size)
{
int res = -1;
int cmd;
- struct __flock64 fl;
+ struct flock fl;
pthread_testcancel ();
@@ -1800,8 +1813,212 @@ lockf (int filedes, int function, _off64_t size)
goto done;
/* NOTREACHED */
}
- res = cfd->lock (cmd, &fl);
+ res = cfd->mandatory_locking () ? cfd->mand_lock (cmd, &fl)
+ : cfd->lock (cmd, &fl);
done:
syscall_printf ("%R = lockf(%d, %d, %D)", res, filedes, function, size);
return res;
}
+
+/* This is the fcntl lock implementation for mandatory locks using the
+ Windows mandatory locking functions. For the UNIX-like advisory locking
+ implementation see the fhandler_disk_file::lock method earlier in this
+ file. */
+struct lock_parms {
+ HANDLE h;
+ PIO_STATUS_BLOCK pio;
+ PLARGE_INTEGER poff;
+ PLARGE_INTEGER plen;
+ BOOL type;
+ NTSTATUS status;
+};
+
+static DWORD WINAPI
+blocking_lock_thr (LPVOID param)
+{
+ struct lock_parms *lp = (struct lock_parms *) param;
+ lp->status = NtLockFile (lp->h, NULL, NULL, NULL, lp->pio, lp->poff,
+ lp->plen, 0, FALSE, lp->type);
+ return 0;
+}
+
+int
+fhandler_base::mand_lock (int, struct flock *)
+{
+ set_errno (EINVAL);
+ return -1;
+}
+
+int
+fhandler_disk_file::mand_lock (int a_op, struct flock *fl)
+{
+ NTSTATUS status;
+ IO_STATUS_BLOCK io;
+ FILE_POSITION_INFORMATION fpi;
+ FILE_STANDARD_INFORMATION fsi;
+ off_t startpos;
+ LARGE_INTEGER offset;
+ LARGE_INTEGER length;
+
+ /* Calculate where to start from, then adjust this by fl->l_start. */
+ switch (fl->l_whence)
+ {
+ case SEEK_SET:
+ startpos = 0;
+ break;
+ case SEEK_CUR:
+ status = NtQueryInformationFile (get_handle (), &io, &fpi, sizeof fpi,
+ FilePositionInformation);
+ if (!NT_SUCCESS (status))
+ {
+ __seterrno_from_nt_status (status);
+ return -1;
+ }
+ startpos = fpi.CurrentByteOffset.QuadPart;
+ break;
+ case SEEK_END:
+ status = NtQueryInformationFile (get_handle (), &io, &fsi, sizeof fsi,
+ FileStandardInformation);
+ if (!NT_SUCCESS (status))
+ {
+ __seterrno_from_nt_status (status);
+ return -1;
+ }
+ startpos = fsi.EndOfFile.QuadPart;
+ break;
+ default:
+ set_errno (EINVAL);
+ return -1;
+ }
+ /* Adjust start and length until they make sense. */
+ offset.QuadPart = startpos + fl->l_start;
+ if (fl->l_len < 0)
+ {
+ offset.QuadPart -= fl->l_len;
+ length.QuadPart = -fl->l_len;
+ }
+ else
+ length.QuadPart = fl->l_len;
+ if (offset.QuadPart < 0)
+ {
+ length.QuadPart -= -offset.QuadPart;
+ if (length.QuadPart <= 0)
+ {
+ set_errno (EINVAL);
+ return -1;
+ }
+ offset.QuadPart = 0;
+ }
+ /* Special case if len == 0. For POSIX this means lock to the end of
+ the entire file, even when file grows later. */
+ if (length.QuadPart == 0)
+ length.QuadPart = UINT64_MAX;
+ /* Action! */
+ if (fl->l_type == F_UNLCK)
+ {
+ status = NtUnlockFile (get_handle (), &io, &offset, &length, 0);
+ if (status == STATUS_RANGE_NOT_LOCKED) /* Not an error */
+ status = STATUS_SUCCESS;
+ }
+ else if (a_op == F_SETLKW)
+ {
+ /* We open file handles synchronously. To allow asynchronous operation
+ the file locking functions require a file handle opened in asynchronous
+ mode. Since Windows locks are per-process/per-file object, we can't
+ open another handle asynchrously and lock/unlock using that handle:
+ The original file handle would not have placed the lock and would be
+ restricted by the lock like any other file handle.
+ So, what we do here is to start a thread which calls the potentially
+ blocking NtLockFile call. Then we wait for thread completion in an
+ interruptible fashion. */
+ OBJECT_ATTRIBUTES attr;
+ HANDLE evt;
+ struct lock_parms lp = { get_handle (), &io, &offset, &length,
+ fl->l_type == F_WRLCK, 0 };
+ cygthread *thr = NULL;
+
+ InitializeObjectAttributes (&attr, NULL, 0, NULL, NULL);
+ status = NtCreateEvent (&evt, EVENT_ALL_ACCESS, &attr,
+ NotificationEvent, FALSE);
+ if (evt)
+ thr = new cygthread (blocking_lock_thr, &lp, "blk_lock", evt);
+ if (!thr)
+ {
+ /* Thread creation failed. Fall back to blocking lock call. */
+ if (evt)
+ NtClose (evt);
+ status = NtLockFile (get_handle (), NULL, NULL, NULL, &io, &offset,
+ &length, 0, FALSE, fl->l_type == F_WRLCK);
+ }
+ else
+ {
+ /* F_SETLKW and lock cannot be established. Wait until the lock can
+ be established, or a signal request arrived. We deliberately
+ don't handle thread cancel requests here. */
+ DWORD wait_res = cygwait (evt, INFINITE, cw_sig | cw_sig_eintr);
+ NtClose (evt);
+ switch (wait_res)
+ {
+ case WAIT_OBJECT_0:
+ /* Fetch completion status. */
+ status = lp.status;
+ thr->detach ();
+ break;
+ default:
+ /* Signal arrived. */
+ /* Starting with Vista, CancelSynchronousIo works, and we wait
+ for the thread to exit. lp.status will be either
+ STATUS_SUCCESS, or STATUS_CANCELLED. We only call
+ NtUnlockFile in the first case.
+ Prior to Vista, CancelSynchronousIo doesn't exist, so we
+ terminated the thread and always call NtUnlockFile since
+ lp.status was 0 to begin with. */
+ if (CancelSynchronousIo (thr->thread_handle ()))
+ thr->detach ();
+ else
+ thr->terminate_thread ();
+ if (NT_SUCCESS (lp.status))
+ NtUnlockFile (get_handle (), &io, &offset, &length, 0);
+ /* Per SUSv4: If a signal is received while fcntl is waiting,
+ fcntl shall be interrupted. Upon return from the signal
+ handler, fcntl shall return -1 with errno set to EINTR,
+ and the lock operation shall not be done. */
+ _my_tls.call_signal_handler ();
+ set_errno (EINTR);
+ return -1;
+ }
+ }
+ }
+ else
+ {
+ status = NtLockFile (get_handle (), NULL, NULL, NULL, &io, &offset,
+ &length, 0, TRUE, fl->l_type == F_WRLCK);
+ if (a_op == F_GETLK)
+ {
+ /* This is non-atomic, but there's no other way on Windows to detect
+ if another lock is blocking our lock, other than trying to place
+ the lock, and then having to unlock it again. */
+ if (NT_SUCCESS (status))
+ {
+ NtUnlockFile (get_handle (), &io, &offset, &length, 0);
+ fl->l_type = F_UNLCK;
+ }
+ else
+ {
+ /* FAKE! FAKE! FAKE! */
+ fl->l_type = F_WRLCK;
+ fl->l_whence = SEEK_SET;
+ fl->l_start = offset.QuadPart;
+ fl->l_len = length.QuadPart;
+ fl->l_pid = (pid_t) -1;
+ }
+ status = STATUS_SUCCESS;
+ }
+ }
+ if (!NT_SUCCESS (status))
+ {
+ __seterrno_from_nt_status (status);
+ return -1;
+ }
+ return 0;
+}
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 720d62a4c..f7b9aa880 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -262,6 +262,11 @@ frok::parent (volatile char * volatile stack_here)
int c_flags = GetPriorityClass (GetCurrentProcess ());
debug_printf ("priority class %d", c_flags);
+ /* Per MSDN, this must be specified even if lpEnvironment is set to NULL,
+ otherwise UNICODE characters in the parent environment are not copied
+ correctly to the child. Omitting it may scramble %PATH% on non-English
+ systems. */
+ c_flags |= CREATE_UNICODE_ENVIRONMENT;
errmsg = NULL;
hchild = NULL;
@@ -302,17 +307,17 @@ frok::parent (volatile char * volatile stack_here)
ch.forker_finished = forker_finished;
+ PTEB teb = NtCurrentTeb ();
ch.stackbottom = _tlsbase;
ch.stacktop = (void *) _tlstop;
- ch.stackaddr = 0;
+ ch.stackaddr = teb->DeallocationStack;
ch.guardsize = 0;
if (&_my_tls != _main_tls)
{
/* We have not been started from the main thread. Fetch the
information required to set up the thread stack identically
in the child. */
- PTEB teb = NtCurrentTeb ();
- if (!teb->DeallocationStack)
+ if (!ch.stackaddr)
{
/* Pthread with application-provided stack. Don't set up a
PAGE_GUARD page. guardsize == -1 is used in alloc_stack_hard_way
@@ -320,15 +325,11 @@ frok::parent (volatile char * volatile stack_here)
ch.stackaddr = _my_tls.tid->attr.stackaddr;
ch.guardsize = (size_t) -1;
}
- else
- {
- ch.stackaddr = teb->DeallocationStack;
- /* If it's a pthread, fetch guardsize from thread attributes. */
- if (_my_tls.tid)
- ch.guardsize = _my_tls.tid->attr.guardsize;
- }
+ else if (_my_tls.tid)
+ /* If it's a pthread, fetch guardsize from thread attributes. */
+ ch.guardsize = _my_tls.tid->attr.guardsize;
}
- debug_printf ("stack - bottom %p, top %p, addr %p, guardsize %p",
+ debug_printf ("stack - bottom %p, top %p, addr %p, guardsize %ly",
ch.stackbottom, ch.stacktop, ch.stackaddr, ch.guardsize);
PROCESS_INFORMATION pi;
@@ -340,7 +341,7 @@ frok::parent (volatile char * volatile stack_here)
si.lpReserved2 = (LPBYTE) &ch;
si.cbReserved2 = sizeof (ch);
- syscall_printf ("CreateProcessW (%W, %W, 0, 0, 1, %p, 0, 0, %p, %p)",
+ syscall_printf ("CreateProcessW (%W, %W, 0, 0, 1, %y, 0, 0, %p, %p)",
myself->progname, myself->progname, c_flags, &si, &pi);
bool locked = __malloc_lock ();
time_t start_time = time (NULL);
@@ -355,7 +356,11 @@ frok::parent (volatile char * volatile stack_here)
{
hchild = NULL;
rc = CreateProcessW (myself->progname, /* image to run */
- myself->progname, /* what we send in arg0 */
+ GetCommandLineW (), /* Take same space for command
+ line as in parent to make
+ sure child stack is allocated
+ in the same memory location
+ as in parent. */
&sec_none_nih,
&sec_none_nih,
TRUE, /* inherit handles from parent */
@@ -598,14 +603,18 @@ fork ()
ischild = !!setjmp (grouped.ch.jmp);
- volatile char * volatile esp;
- __asm__ volatile ("movl %%esp,%0": "=r" (esp));
+ volatile char * volatile stackp;
+#ifdef __x86_64__
+ __asm__ volatile ("movq %%rsp,%0": "=r" (stackp));
+#else
+ __asm__ volatile ("movl %%esp,%0": "=r" (stackp));
+#endif
if (!ischild)
- res = grouped.parent (esp);
+ res = grouped.parent (stackp);
else
{
- res = grouped.child (esp);
+ res = grouped.child (stackp);
in_forkee = false;
ischild = true; /* might have been reset by fork mem copy */
}
@@ -664,12 +673,12 @@ child_copy (HANDLE hp, bool write, ...)
{
char *low = va_arg (args, char *);
char *high = va_arg (args, char *);
- DWORD todo = high - low;
+ SIZE_T todo = high - low;
char *here;
for (here = low; here < high; here += todo)
{
- DWORD done = 0;
+ SIZE_T done = 0;
if (here + todo > high)
todo = high - here;
int res;
@@ -684,7 +693,7 @@ child_copy (HANDLE hp, bool write, ...)
__seterrno ();
/* If this happens then there is a bug in our fork
implementation somewhere. */
- system_printf ("%s %s copy failed, %p..%p, done %d, windows pid %u, %E",
+ system_printf ("%s %s copy failed, %p..%p, done %lu, windows pid %u, %E",
what, huh[write], low, high, done, myself->dwProcessId);
goto err;
}
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef
index c393f2372..2bb790588 100755
--- a/winsup/cygwin/gendef
+++ b/winsup/cygwin/gendef
@@ -9,28 +9,32 @@
# details.
#
use strict;
+use integer;
+use Getopt::Long;
+
sub cleanup(@);
-my $in = shift;
-my $tls_offsets = shift;
-my $out = shift;
-my $sigfe = shift;
+my $cpu;
+my $output_def;
+my $tls_offsets;
+GetOptions('cpu=s'=>\$cpu, 'output-def=s'=>\$output_def, 'tlsoffsets=s'=>\$tls_offsets);
$main::first = 0;
-if (!defined($in) || !defined($out) || !defined($sigfe)) {
- die "usage: $0 deffile.in cygtls.h deffile.def sigfe.s\n";
+if (!defined($cpu) || !defined($output_def) || !defined($tls_offsets)) {
+ die "$0: missing required option\n";
}
require $tls_offsets;
-open(IN, $in) or die "$0: couldn't open \"$in\" - $!\n";
+my $is64bit = $cpu eq 'x86_64';
+my $sym_prefix = $is64bit ? '' : '_';
+
my @top = ();
-while (<IN>) {
+while (<>) {
push(@top, cleanup $_);
- last if /^\s*exports$/i;
+ last if /^\s*exports$/oi;
}
-my @in = cleanup <IN>;
-close(IN);
+my @in = cleanup <>;
my %sigfe = ();
my @data = ();
@@ -47,7 +51,7 @@ for (@in) {
# nothing
} elsif (s/\s+SIGFE(_MAYBE)?$//) {
my $func = (split(' '))[2];
- my $maybe = lc $1 . '_';
+ my $maybe = (defined($1) ? lc $1 : '') . '_';
$sigfe{$func} = '_sigfe' . $maybe . $func;
}
} else {
@@ -73,12 +77,12 @@ for (@text) {
if defined($func) && $sigfe{$func};
}
-open(OUT, '>', $out) or die "$0: couldn't open \"$out\" - $!\n";
+open OUT, '>', $output_def or die "$0: couldn't open \"$output_def\" - $!\n";
push @top, (map {$_ . " DATA\n"} @data), (map {$_ . "\n"} @text);
print OUT @top;
close OUT;
-open(SIGFE, '>', $sigfe) or die "$0: couldn't open sigfe file \"$sigfe\" - $!\n";
+open SIGFE, '>', 'sigfe.s' or die "$0: couldn't open 'sigfe.s' file for writing - $!\n";
for my $k (sort keys %sigfe) {
print SIGFE fefunc($k, $sigfe{$k});
@@ -86,20 +90,301 @@ for my $k (sort keys %sigfe) {
close SIGFE;
sub fefunc {
- my $func = '_' . shift;
- my $fe = '_' . shift;
- my $sigfe_func = ($fe =~ /^(.*)$func/)[0];
+ my $func = $sym_prefix . shift;
+ my $fe = $sym_prefix . shift;
+ my $sigfe_func;
+ if ($is64bit) {
+ $sigfe_func = ($fe =~ /^(.*)_${func}$/)[0];
+ } else {
+ $sigfe_func = ($fe =~ /^(.*)${func}$/)[0];
+ }
my $extra;
- my $res = <<EOF;
+ my $res;
+ if ($is64bit) {
+ $res = <<EOF;
.extern $func
.global $fe
+ .seh_proc $fe
$fe:
- pushl \$$func
+ leaq $func(%rip),%r10
+ pushq %r10
+ .seh_pushreg %r10
+ .seh_endprologue
jmp $sigfe_func
+ .seh_endproc
+
+EOF
+ } else {
+ $res = <<EOF;
+ .extern $func
+ .global $fe
+$fe:
+ pushl \$$func
+ jmp $sigfe_func
EOF
+ }
if (!$main::first++) {
- $res = <<EOF . longjmp () . $res;
+ if ($is64bit) {
+ $res = <<EOF . longjmp () . $res;
+ .text
+
+ .seh_proc _sigfe_maybe
+_sigfe_maybe: # stack is aligned on entry!
+ .seh_endprologue
+ movq %gs:8,%r10 # location of bottom of stack
+ leaq $tls::initialized(%r10),%r11 # where we will be looking
+ cmpq %r11,%rsp # stack loc > than tls
+ jge 0f # yep. we don't have a tls.
+ movl $tls::initialized(%r10),%r11d
+ cmpl \$0xc763173f,%r11d # initialized?
+ je 1f
+0: ret
+ .seh_endproc
+
+ .seh_proc _sigfe
+_sigfe: # stack is aligned on entry!
+ .seh_endprologue
+ movq %gs:8,%r10 # location of bottom of stack
+1: movl \$1,%r11d # potential lock value
+ xchgl %r11d,$tls::stacklock(%r10) # see if we can grab it
+ movl %r11d,$tls::spinning(%r10) # flag if we are waiting for lock
+ testl %r11d,%r11d # it will be zero
+ jz 2f # if so
+ pause
+ jmp 1b # loop
+2: movq \$8,%rax # have the lock, now increment the
+ xaddq %rax,$tls::stackptr(%r10) # stack pointer and get pointer
+ leaq _sigbe(%rip),%r11 # new place to return to
+ xchgq %r11,8(%rsp) # exchange with real return value
+ movq %r11,(%rax) # store real return value on alt stack
+ incl $tls::incyg(%r10)
+ decl $tls::stacklock(%r10) # remove lock
+ popq %rax # pop real function address from stack
+ jmp *%rax # and jmp to it
+ .seh_endproc
+
+ .seh_proc _sigfe
+_sigbe: # return here after cygwin syscall
+ # stack is aligned on entry!
+ .seh_endprologue
+ movq %gs:8,%r10 # address of bottom of tls
+1: movl \$1,%r11d # potential lock value
+ xchgl %r11d,$tls::stacklock(%r10) # see if we can grab it
+ movl %r11d,$tls::spinning(%r10) # flag if we are waiting for lock
+ testl %r11d,%r11d # it will be zero
+ jz 2f # if so
+ pause
+ jmp 1b # and loop
+2: movq \$-8,%r11 # now decrement aux stack
+ xaddq %r11,$tls::stackptr(%r10) # and get pointer
+ movq -8(%r11),%r11 # get return address from signal stack
+ decl $tls::incyg(%r10)
+ decl $tls::stacklock(%r10) # release lock
+ jmp *%r11 # "return" to caller
+ .seh_endproc
+
+ .global sigdelayed
+ .seh_proc sigdelayed
+sigdelayed:
+ pushq %r10 # used for return address injection
+ .seh_pushreg %rbp
+ pushq %rbp
+ .seh_pushreg %rbp
+ movq %rsp,%rbp
+ # stack is aligned or unaligned on entry!
+ # make sure it is aligned from here on
+ # We could be called from an interrupted thread which doesn't know
+ # about his fate, so save and restore everything and the kitchen sink.
+ andq \$0xfffffffffffffff0,%rsp
+ .seh_setframe %rbp,0
+ pushq %r15
+ .seh_pushreg %r15
+ pushq %r14
+ .seh_pushreg %r14
+ pushq %r13
+ .seh_pushreg %r13
+ pushq %r12
+ .seh_pushreg %r12
+ pushq %r11
+ .seh_pushreg %r11
+ pushq %r9
+ .seh_pushreg %r9
+ pushq %r8
+ .seh_pushreg %r8
+ pushq %rsi
+ .seh_pushreg %rsi
+ pushq %rdi
+ .seh_pushreg %rdi
+ pushq %rdx
+ .seh_pushreg %rdx
+ pushq %rcx
+ .seh_pushreg %rcx
+ pushq %rbx
+ .seh_pushreg %rbx
+ pushq %rax
+ .seh_pushreg %rax
+ pushf
+ subq \$0x120,%rsp
+ .seh_stackalloc 0x120
+ movdqa %xmm15,0x110(%rsp)
+ movdqa %xmm14,0x100(%rsp)
+ movdqa %xmm13,0xf0(%rsp)
+ movdqa %xmm12,0xe0(%rsp)
+ movdqa %xmm11,0xd0(%rsp)
+ movdqa %xmm10,0xc0(%rsp)
+ movdqa %xmm9,0xb0(%rsp)
+ movdqa %xmm8,0xa0(%rsp)
+ movdqa %xmm7,0x90(%rsp)
+ movdqa %xmm6,0x80(%rsp)
+ movdqa %xmm5,0x70(%rsp)
+ movdqa %xmm4,0x60(%rsp)
+ movdqa %xmm3,0x50(%rsp)
+ movdqa %xmm2,0x40(%rsp)
+ movdqa %xmm1,0x30(%rsp)
+ movdqa %xmm0,0x20(%rsp)
+ .seh_endprologue
+
+ movq %gs:8,%r12 # get tls
+ movl $tls::saved_errno(%r12),%r15d # temporarily save saved_errno
+ movq \$$tls::start_offset,%rcx # point to beginning of tls block
+ addq %r12,%rcx # and store as first arg to method
+ call _ZN7_cygtls19call_signal_handlerEv # call handler
+
+1: movl \$1,%r11d # potential lock value
+ xchgl %r11d,$tls::stacklock(%r12) # see if we can grab it
+ movl %r11d,$tls::spinning(%r12) # flag if we are waiting for lock
+ testl %r11d,%r11d # it will be zero
+ jz 2f # if so
+ pause
+ jmp 1b # and loop
+2: testl %r15d,%r15d # was saved_errno < 0
+ jl 3f # yup. ignore it
+ movq $tls::errno_addr(%r12),%r11
+ movl %r15d,(%r11)
+3: movq \$-8,%r11 # now decrement aux stack
+ xaddq %r11,$tls::stackptr(%r12) # and get pointer
+ xorq %r10,%r10
+ xchgq %r10,-8(%r11) # get return address from signal stack
+ xorl %r11d,%r11d
+ movl %r11d,$tls::incyg(%r12)
+ movl %r11d,$tls::stacklock(%r12) # unlock
+ movdqa 0x20(%rsp),%xmm0
+ movdqa 0x30(%rsp),%xmm1
+ movdqa 0x40(%rsp),%xmm2
+ movdqa 0x50(%rsp),%xmm3
+ movdqa 0x60(%rsp),%xmm4
+ movdqa 0x70(%rsp),%xmm5
+ movdqa 0x80(%rsp),%xmm6
+ movdqa 0x90(%rsp),%xmm7
+ movdqa 0xa0(%rsp),%xmm8
+ movdqa 0xb0(%rsp),%xmm9
+ movdqa 0xc0(%rsp),%xmm10
+ movdqa 0xd0(%rsp),%xmm11
+ movdqa 0xe0(%rsp),%xmm12
+ movdqa 0xf0(%rsp),%xmm13
+ movdqa 0x100(%rsp),%xmm14
+ movdqa 0x110(%rsp),%xmm15
+ addq \$0x120,%rsp
+ popf
+ popq %rax
+ popq %rbx
+ popq %rcx
+ popq %rdx
+ popq %rdi
+ popq %rsi
+ popq %r8
+ popq %r9
+ popq %r11
+ popq %r12
+ popq %r13
+ popq %r14
+ popq %r15
+ movq %rbp,%rsp
+ popq %rbp
+ xchgq %r10,(%rsp)
+ ret
+ .seh_endproc
+
+# _cygtls::pop
+ .global _ZN7_cygtls3popEv
+ .seh_proc _ZN7_cygtls3popEv
+_ZN7_cygtls3popEv:
+ .seh_endprologue
+ movq \$-8,%r11
+ xaddq %r11,$tls::pstackptr(%rcx)
+ movq -8(%r11),%rax
+ ret
+ .seh_endproc
+
+# _cygtls::lock
+ .global _ZN7_cygtls4lockEv
+ .seh_proc _ZN7_cygtls4lockEv
+_ZN7_cygtls4lockEv:
+ pushq %r12
+ .seh_pushreg %r12
+ .seh_endprologue
+ movq %rcx,%r12
+1: movl \$1,%r11d
+ xchgl %r11d,$tls::pstacklock(%r12)
+ testl %r11d,%r11d
+ jz 2f
+ pause
+ jmp 1b
+2: popq %r12
+ ret
+ .seh_endproc
+
+# _cygtls::unlock
+ .global _ZN7_cygtls6unlockEv
+ .seh_proc _ZN7_cygtls6unlockEv
+_ZN7_cygtls6unlockEv:
+ .seh_endprologue
+ decl $tls::pstacklock(%rcx)
+ ret
+ .seh_endproc
+
+# _cygtls::locked
+ .global _ZN7_cygtls6lockedEv
+ .seh_proc _ZN7_cygtls6lockedEv
+_ZN7_cygtls6lockedEv:
+ .seh_endprologue
+ movl $tls::pstacklock(%rcx),%eax
+ ret
+ .seh_endproc
+
+ .seh_proc stabilize_sig_stack
+stabilize_sig_stack:
+ pushq %r12
+ .seh_pushreg %r12
+ subq \$0x20,%rsp
+ .seh_stackalloc 32
+ .seh_endprologue
+ movq %gs:8,%r12
+1: movl \$1,%r10d
+ xchgl %r10d,$tls::stacklock(%r12)
+ movl %r10d,$tls::spinning(%r12) # flag if we are waiting for lock
+ testl %r10d,%r10d
+ jz 2f
+ pause
+ jmp 1b
+2: incl $tls::incyg(%r12)
+ cmpl \$0,$tls::sig(%r12)
+ jz 3f
+ decl $tls::stacklock(%r12) # unlock
+ movq \$$tls::start_offset,%rcx # point to beginning
+ addq %r12,%rcx # of tls block
+ call _ZN7_cygtls19call_signal_handlerEv
+ jmp 1b
+3: decl $tls::incyg(%r12)
+ addq \$0x20,%rsp
+ movq %r12,%r11 # return tls addr in r11
+ popq %r12
+ ret
+ .seh_endproc
+EOF
+ } else {
+ $res = <<EOF . longjmp () . $res;
.text
__sigfe_maybe:
@@ -265,12 +550,170 @@ stabilize_sig_stack:
3: decl $tls::incyg(%ebx)
ret
EOF
+ }
}
return $res;
}
sub longjmp {
- return <<EOF;
+ if ($is64bit) {
+ return <<EOF;
+
+ .globl setjmp
+ .seh_proc setjmp
+setjmp:
+ .seh_endprologue
+ # We use the Windows jmp_buf layout. Store ExceptionList in Frame.
+ # Store alternative stackptr in Spare.
+ movq %gs:0,%r10
+ movq %r10,(%rcx)
+ movq %rbx,0x8(%rcx)
+ movq %rsp,0x10(%rcx)
+ movq %rbp,0x18(%rcx)
+ movq %rsi,0x20(%rcx)
+ movq %rdi,0x28(%rcx)
+ movq %r12,0x30(%rcx)
+ movq %r13,0x38(%rcx)
+ movq %r14,0x40(%rcx)
+ movq %r15,0x48(%rcx)
+ movq (%rsp),%r10
+ movq %r10,0x50(%rcx)
+ # jmp_buf is potentially unaligned!
+ movdqu %xmm6,0x60(%rcx)
+ movdqu %xmm7,0x70(%rcx)
+ movdqu %xmm8,0x80(%rcx)
+ movdqu %xmm9,0x90(%rcx)
+ movdqu %xmm10,0xa0(%rcx)
+ movdqu %xmm11,0xb0(%rcx)
+ movdqu %xmm12,0xc0(%rcx)
+ movdqu %xmm13,0xd0(%rcx)
+ movdqu %xmm14,0xe0(%rcx)
+ movdqu %xmm15,0xf0(%rcx)
+ pushq %rcx
+ .seh_pushreg %rcx
+ call stabilize_sig_stack # returns tls in r11
+ popq %rcx
+ movq $tls::stackptr(%r11),%r10
+ movq %r10,0x58(%rcx)
+ decl $tls::stacklock(%r11)
+ movl \$0,%eax
+ ret
+ .seh_endproc
+
+ .globl __sjfault
+ .seh_proc __sjfault
+__sjfault:
+ .seh_endprologue
+ # Like setjmp, just w/o storing the alternate stackptr.
+ movq %gs:0,%r10
+ movq %r10,(%rcx)
+ movq %rbx,0x8(%rcx)
+ movq %rsp,0x10(%rcx)
+ movq %rbp,0x18(%rcx)
+ movq %rsi,0x20(%rcx)
+ movq %rdi,0x28(%rcx)
+ movq %r12,0x30(%rcx)
+ movq %r13,0x38(%rcx)
+ movq %r14,0x40(%rcx)
+ movq %r15,0x48(%rcx)
+ movq (%rsp),%r10
+ movq %r10,0x50(%rcx)
+ # jmp_buf is potentially unaligned!
+ movdqu %xmm6,0x60(%rcx)
+ movdqu %xmm7,0x70(%rcx)
+ movdqu %xmm8,0x80(%rcx)
+ movdqu %xmm9,0x90(%rcx)
+ movdqu %xmm10,0xa0(%rcx)
+ movdqu %xmm11,0xb0(%rcx)
+ movdqu %xmm12,0xc0(%rcx)
+ movdqu %xmm13,0xd0(%rcx)
+ movdqu %xmm14,0xe0(%rcx)
+ movdqu %xmm15,0xf0(%rcx)
+ movl \$0,%eax
+ ret
+ .seh_endproc
+
+ .globl __ljfault
+ .seh_proc __ljfault
+__ljfault:
+ movq (%rcx),%r10
+ movq %r10,%gs:0
+ movq 0x8(%rcx),%rbx
+ movq 0x10(%rcx),%rsp
+ movq 0x18(%rcx),%rbp
+ movq 0x20(%rcx),%rsi
+ movq 0x28(%rcx),%rdi
+ movq 0x30(%rcx),%r12
+ movq 0x38(%rcx),%r13
+ movq 0x40(%rcx),%r14
+ movq 0x48(%rcx),%r15
+ movq 0x50(%rcx),%r10
+ movq %r10,(%rsp)
+ # jmp_buf is potentially unaligned!
+ movdqu 0x60(%rcx),%xmm6
+ movdqu 0x70(%rcx),%xmm7
+ movdqu 0x80(%rcx),%xmm8
+ movdqu 0x90(%rcx),%xmm9
+ movdqu 0xa0(%rcx),%xmm10
+ movdqu 0xb0(%rcx),%xmm11
+ movdqu 0xc0(%rcx),%xmm12
+ movdqu 0xd0(%rcx),%xmm13
+ movdqu 0xe0(%rcx),%xmm14
+ movdqu 0xf0(%rcx),%xmm15
+ movl %edx,%eax
+ testl %eax,%eax
+ jne 0f
+ incl %eax
+0: ret
+ .seh_endproc
+
+ .globl longjmp
+ .seh_proc longjmp
+longjmp:
+ pushq %rcx
+ .seh_pushreg %rcx
+ .seh_endprologue
+ movl %edx,%r12d # save return value (r12 is overwritten anyway)
+ call stabilize_sig_stack # returns tls in r11
+ popq %rcx
+ movl %r12d,%eax # restore return value
+ movq 0x58(%rcx),%r10 # get old signal stack
+ movq %r10,$tls::stackptr(%r11) # restore
+ decl $tls::stacklock(%r11) # relinquish lock
+ xorl %r10d,%r10d
+ movl %r10d,$tls::incyg(%r11) # we're definitely not in cygwin anymore
+ movq (%rcx),%r10
+ movq %r10,%gs:0
+ movq 0x8(%rcx),%rbx
+ movq 0x10(%rcx),%rsp
+ movq 0x18(%rcx),%rbp
+ movq 0x20(%rcx),%rsi
+ movq 0x28(%rcx),%rdi
+ movq 0x30(%rcx),%r12
+ movq 0x38(%rcx),%r13
+ movq 0x40(%rcx),%r14
+ movq 0x48(%rcx),%r15
+ movq 0x50(%rcx),%r10
+ movq %r10,(%rsp)
+ # jmp_buf is potentially unaligned!
+ movdqu 0x60(%rcx),%xmm6
+ movdqu 0x70(%rcx),%xmm7
+ movdqu 0x80(%rcx),%xmm8
+ movdqu 0x90(%rcx),%xmm9
+ movdqu 0xa0(%rcx),%xmm10
+ movdqu 0xb0(%rcx),%xmm11
+ movdqu 0xc0(%rcx),%xmm12
+ movdqu 0xd0(%rcx),%xmm13
+ movdqu 0xe0(%rcx),%xmm14
+ movdqu 0xf0(%rcx),%xmm15
+ testl %eax,%eax
+ jne 0f
+ incl %eax
+0: ret
+ .seh_endproc
+EOF
+ } else {
+ return <<EOF;
.globl _setjmp
_setjmp:
@@ -424,10 +867,9 @@ _longjmp:
popfl
ret
EOF
+ }
}
sub cleanup(@) {
- map {s/\r//g; $_} @_;
- map {s/#.*//g; $_} @_;
- map {s/[ \t]+$//g; $_} @_;
+ grep {s/\r//og; s/#.*//og; s/\s+\n//sog; !/^$/o && $_} @_;
}
diff --git a/winsup/cygwin/gentls_offsets b/winsup/cygwin/gentls_offsets
index 0272868d2..d2400bb29 100755
--- a/winsup/cygwin/gentls_offsets
+++ b/winsup/cygwin/gentls_offsets
@@ -1,5 +1,5 @@
#!/usr/bin/perl -s
-# Copyright 2003, 2004, 2005, 2006, 2008, 2012, 2013 Red Hat, Inc.
+# Copyright 2003, 2004, 2005, 2012, 2013 Red Hat, Inc.
#
# This file is part of Cygwin.
#
@@ -9,6 +9,13 @@
#
my $tls = shift;
my $tls_out = shift;
+my $tgt = shift;
+# FIXME? This method obviously requires a 64 bit OS to build tlsoffsets64.h
+# Another method which doesn't requires to run an executable would be to
+# generate assembler code accessing the various struct members and analyzing
+# it, but that's arguably a lot more effort.
+my $tgt_opt='-m64';
+$tgt_opt='-m32' unless ($tgt eq 'x86_64');
open(TLS, $tls) or die "$0: couldn't open tls file \"$tls\" - $!\n";
my $struct = '';
my @fields = ();
@@ -44,7 +51,9 @@ close TLS;
open(TMP, '>', "/tmp/$$.cc") or die "$0: couldn't open temporary index file \"/tmp/$$.c\" - $!\n";
print TMP <<EOF;
#define __INSIDE_CYGWIN__
+#ifndef __x86_64__
#define __attribute__(X)
+#endif
#define __reg1
#define __reg2
#define __reg3
@@ -81,13 +90,13 @@ EOF
EOF
close TMP;
system @ARGV, '-o', "/tmp/$$-1.cc", '-E', "/tmp/$$.cc";
-system 'g++', '-m32', '-o', "/tmp/$$.a.out", "/tmp/$$-1.cc" and
-($? == 127 && system 'c++', '-m32', '-o', "/tmp/$$.a.out", "/tmp/$$-1.cc") and
+system 'g++', "$tgt_opt", '-o', "/tmp/$$.a.out", "/tmp/$$-1.cc" and
+($? == 127 && system 'c++', "$tgt_opt", '-o', "/tmp/$$.a.out", "/tmp/$$-1.cc") and
die "$0: couldn't generate executable for offset calculation \"/tmp/$$.a.out\" - $!\n";
open(TLS_OUT, '>', $tls_out) or die "$0: couldn't open tls index file \"$tls_out\" - $!\n";
open(OFFS, "/tmp/$$.a.out|") or die "$0: couldn't run \"/tmp/$$.a.out\" - $!\n";
print TLS_OUT <OFFS>;
close OFFS;
close TLS_OUT;
-unlink "/tmp/$$.cc", "/tmp/$$.a.out";
+unlink "/tmp/$$.cc", "/tmp/$$-1.cc", "/tmp/$$-1.d", "/tmp/$$.a.out";
exit(0);
diff --git a/winsup/cygwin/glob.cc b/winsup/cygwin/glob.cc
index c02901fc6..296cd7fbc 100644
--- a/winsup/cygwin/glob.cc
+++ b/winsup/cygwin/glob.cc
@@ -105,8 +105,6 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/glob.c,v 1.28 2010/05/12 17:44:00 gordon Ex
#define getuid() getuid32 ()
#define issetugid() (cygheap->user.issetuid ())
-#define stat __stat64
-
#define CCHAR(c) (ignore_case_with_glob ? towlower (CHAR (c)) : CHAR (c))
#define Cchar(c) (ignore_case_with_glob ? towlower (c) : (c))
#endif
@@ -858,8 +856,11 @@ g_opendir(Char *str, glob_t *pglob)
return(opendir(buf));
}
+#ifdef __x86_64__
+#define CYGWIN_gl_stat(sfptr) ((*pglob->sfptr) (buf, sb))
+#else
static void
-stat32_to_stat64 (struct __stat32 *src, struct __stat64 *dst)
+stat32_to_stat64 (struct __stat32 *src, struct stat *dst)
{
dst->st_dev = src->st_dev;
dst->st_ino = src->st_ino;
@@ -882,10 +883,11 @@ stat32_to_stat64 (struct __stat32 *src, struct __stat64 *dst)
struct __stat32 lsb; \
if (CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES) \
ret = (*pglob->sfptr) (buf, sb); \
- else if (!(ret = (*pglob->sfptr) (buf, (struct __stat64 *) &lsb))) \
+ else if (!(ret = (*pglob->sfptr) (buf, (struct stat *) &lsb))) \
stat32_to_stat64 (&lsb, sb); \
ret; \
})
+#endif
static int
g_lstat(Char *fn, struct stat *sb, glob_t *pglob)
diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc
index d08cae75c..da732a493 100644
--- a/winsup/cygwin/globals.cc
+++ b/winsup/cygwin/globals.cc
@@ -26,8 +26,10 @@ HMODULE NO_COPY cygwin_hmodule;
int NO_COPY sigExeced;
WCHAR windows_system_directory[MAX_PATH];
UINT windows_system_directory_length;
+#ifndef __x86_64__
WCHAR system_wow64_directory[MAX_PATH];
UINT system_wow64_directory_length;
+#endif /* !__x86_64__ */
/* program exit the program */
@@ -47,6 +49,17 @@ enum exit_states
ES_FINAL
};
+/* The type of symlink to create. The value is set depending on the
+ "winsymlinks" setting of the CYGWIN environment variable. */
+enum winsym_t
+{
+ WSYM_sysfile = 0,
+ WSYM_lnk,
+ WSYM_native,
+ WSYM_nativestrict,
+ WSYM_nfs
+};
+
exit_states NO_COPY exit_state;
/* Set in init.cc. Used to check if Cygwin DLL is dynamically loaded. */
@@ -56,13 +69,20 @@ int NO_COPY dynamically_loaded;
bool allow_glob = true;
bool ignore_case_with_glob = false;
bool dos_file_warning = true;
-bool allow_winsymlinks = false;
+winsym_t allow_winsymlinks = WSYM_sysfile;
bool reset_com = false;
bool pipe_byte = false;
bool detect_bloda = false;
bool NO_COPY in_forkee;
+/* Taken from BSD libc:
+ This variable is zero until a process has created a pthread. It is used
+ to avoid calling locking functions in libc when they are not required.
+ Note that this is moderately dangerous. Do not rely on it if the public
+ API is also used from a non-pthread thread like the signal thread. */
+int NO_COPY __isthreaded = 0;
+
int __argc_safe;
int __argc;
char **__argv;
@@ -78,64 +98,75 @@ bool NO_COPY _cygwin_testing;
char NO_COPY almost_null[1];
-/* Heavily-used const UNICODE_STRINGs are defined here once. The idea is a
- speed improvement by not having to initialize a UNICODE_STRING every time
- we make a string comparison. The strings are not defined as const,
- because the respective NT functions are not taking const arguments
- and doing so here results in lots of extra casts for no good reason.
- Rather, the strings are placed in the R/O section .rdata, so we get
- a SEGV if some code erroneously tries to overwrite these strings. */
+extern "C" {
+
+ /* Heavily-used const UNICODE_STRINGs are defined here once. The idea is a
+ speed improvement by not having to initialize a UNICODE_STRING every time
+ we make a string comparison. The _RDATA trick allows defining the strings
+ as const (so we get a SEGV if some code erroneously tries to overwrite
+ them), while declaring them as non-const in the auto-generated globals.h.
+ The strings are usually used in NT functions which don't take const
+ arguments. We avoid a lot of extra casts here...
+ Note: The "extern" is required, otherwise either the variables are dropped
+ entirely, or C++ name mangling is applied despite the extern "C"
+ bracket, depending on the compiler version */
+#ifndef _RDATA
+# define _RDATA const
+#endif
+
#define _ROU(_s) \
- { Length: sizeof (_s) - sizeof (WCHAR), \
- MaximumLength: sizeof (_s), \
- Buffer: (PWSTR) (_s) }
-UNICODE_STRING _RDATA ro_u_empty = _ROU (L"");
-UNICODE_STRING _RDATA ro_u_lnk = _ROU (L".lnk");
-UNICODE_STRING _RDATA ro_u_exe = _ROU (L".exe");
-UNICODE_STRING _RDATA ro_u_dll = _ROU (L".dll");
-UNICODE_STRING _RDATA ro_u_com = _ROU (L".com");
-UNICODE_STRING _RDATA ro_u_scr = _ROU (L".scr");
-UNICODE_STRING _RDATA ro_u_sys = _ROU (L".sys");
-UNICODE_STRING _RDATA ro_u_proc = _ROU (L"proc");
-UNICODE_STRING _RDATA ro_u_dev = _ROU (L"dev");
-UNICODE_STRING _RDATA ro_u_pmem = _ROU (L"\\Device\\PhysicalMemory");
-UNICODE_STRING _RDATA ro_u_natp = _ROU (L"\\??\\");
-UNICODE_STRING _RDATA ro_u_uncp = _ROU (L"\\??\\UNC\\");
-UNICODE_STRING _RDATA ro_u_mtx = _ROU (L"mtx");
-UNICODE_STRING _RDATA ro_u_csc = _ROU (L"CSC-CACHE");
-UNICODE_STRING _RDATA ro_u_fat = _ROU (L"FAT");
-UNICODE_STRING _RDATA ro_u_mvfs = _ROU (L"MVFS");
-UNICODE_STRING _RDATA ro_u_nfs = _ROU (L"NFS");
-UNICODE_STRING _RDATA ro_u_ntfs = _ROU (L"NTFS");
-UNICODE_STRING _RDATA ro_u_refs = _ROU (L"ReFS");
-UNICODE_STRING _RDATA ro_u_sunwnfs = _ROU (L"SUNWNFS");
-UNICODE_STRING _RDATA ro_u_udf = _ROU (L"UDF");
-UNICODE_STRING _RDATA ro_u_unixfs = _ROU (L"UNIXFS");
-UNICODE_STRING _RDATA ro_u_nwfs = _ROU (L"NWFS");
-UNICODE_STRING _RDATA ro_u_ncfsd = _ROU (L"NcFsd");
-UNICODE_STRING _RDATA ro_u_volume = _ROU (L"\\??\\Volume{");
-UNICODE_STRING _RDATA ro_u_pipedir = _ROU (L"\\\\?\\PIPE\\");
-UNICODE_STRING _RDATA ro_u_globalroot = _ROU (L"\\\\.\\GLOBALROOT");
-#undef _ROU
-
-/* Cygwin properties are meant to be readonly data placed in the DLL, but
- which can be changed by external tools to make adjustments to the
- behaviour of a DLL based on the binary of the DLL itself. This is
- different from $CYGWIN since it only affects that very DLL, not all
- DLLs which have access to the $CYGWIN environment variable. */
-cygwin_props_t _RDATA cygwin_props =
-{
- CYGWIN_PROPS_MAGIC,
- sizeof (cygwin_props_t),
- 0
-};
+ { Length: sizeof (_s) - sizeof (WCHAR), \
+ MaximumLength: sizeof (_s), \
+ Buffer: (PWSTR) (_s) }
+ extern UNICODE_STRING _RDATA ro_u_empty = _ROU (L"");
+ extern UNICODE_STRING _RDATA ro_u_lnk = _ROU (L".lnk");
+ extern UNICODE_STRING _RDATA ro_u_exe = _ROU (L".exe");
+ extern UNICODE_STRING _RDATA ro_u_dll = _ROU (L".dll");
+ extern UNICODE_STRING _RDATA ro_u_com = _ROU (L".com");
+ extern UNICODE_STRING _RDATA ro_u_scr = _ROU (L".scr");
+ extern UNICODE_STRING _RDATA ro_u_sys = _ROU (L".sys");
+ extern UNICODE_STRING _RDATA ro_u_proc = _ROU (L"proc");
+ extern UNICODE_STRING _RDATA ro_u_dev = _ROU (L"dev");
+ extern UNICODE_STRING _RDATA ro_u_pmem = _ROU (L"\\Device\\PhysicalMemory");
+ extern UNICODE_STRING _RDATA ro_u_natp = _ROU (L"\\??\\");
+ extern UNICODE_STRING _RDATA ro_u_uncp = _ROU (L"\\??\\UNC\\");
+ extern UNICODE_STRING _RDATA ro_u_mtx = _ROU (L"mtx");
+ extern UNICODE_STRING _RDATA ro_u_csc = _ROU (L"CSC-CACHE");
+ extern UNICODE_STRING _RDATA ro_u_fat = _ROU (L"FAT");
+ extern UNICODE_STRING _RDATA ro_u_mvfs = _ROU (L"MVFS");
+ extern UNICODE_STRING _RDATA ro_u_nfs = _ROU (L"NFS");
+ extern UNICODE_STRING _RDATA ro_u_ntfs = _ROU (L"NTFS");
+ extern UNICODE_STRING _RDATA ro_u_refs = _ROU (L"ReFS");
+ extern UNICODE_STRING _RDATA ro_u_sunwnfs = _ROU (L"SUNWNFS");
+ extern UNICODE_STRING _RDATA ro_u_udf = _ROU (L"UDF");
+ extern UNICODE_STRING _RDATA ro_u_unixfs = _ROU (L"UNIXFS");
+ extern UNICODE_STRING _RDATA ro_u_nwfs = _ROU (L"NWFS");
+ extern UNICODE_STRING _RDATA ro_u_ncfsd = _ROU (L"NcFsd");
+ extern UNICODE_STRING _RDATA ro_u_afs = _ROU (L"AFSRDRFsd");
+ extern UNICODE_STRING _RDATA ro_u_volume = _ROU (L"\\??\\Volume{");
+ extern UNICODE_STRING _RDATA ro_u_pipedir = _ROU (L"\\\\?\\PIPE\\");
+ extern UNICODE_STRING _RDATA ro_u_globalroot = _ROU (L"\\\\.\\GLOBALROOT");
+ #undef _ROU
+
+ /* Cygwin properties are meant to be readonly data placed in the DLL, but
+ which can be changed by external tools to make adjustments to the
+ behaviour of a DLL based on the binary of the DLL itself. This is
+ different from $CYGWIN since it only affects that very DLL, not all
+ DLLs which have access to the $CYGWIN environment variable. We use the
+ same _RDATA trick as for the above UNICODE_STRINGs. */
+ extern cygwin_props_t _RDATA cygwin_props =
+ {
+ CYGWIN_PROPS_MAGIC,
+ sizeof (cygwin_props_t),
+ 0
+ };
-extern "C"
-{
/* This is an exported copy of environ which can be used by DLLs
which use cygwin.dll. */
char **__cygwin_environ;
+#ifndef __x86_64__
char ***main_environ = &__cygwin_environ;
+#endif
/* __progname used in getopt error message */
char *__progname;
char *program_invocation_name;
@@ -145,7 +176,10 @@ extern "C"
{/* initial_sp */ 0, /* magic_biscuit */ 0,
/* dll_major */ CYGWIN_VERSION_DLL_MAJOR,
/* dll_major */ CYGWIN_VERSION_DLL_MINOR,
- /* impure_ptr_ptr */ NULL, /* envptr */ NULL,
+ /* impure_ptr_ptr */ NULL,
+#ifndef __x86_64__
+ /* envptr */ NULL,
+#endif
/* malloc */ malloc, /* free */ free,
/* realloc */ realloc,
/* fmode_ptr */ NULL, /* main */ NULL, /* ctors */ NULL,
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 17f0954f0..7ff9e59b2 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -1,7 +1,7 @@
/* grp.cc
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2011, 2012 Red Hat, Inc.
+ 2008, 2009, 2011, 2012, 2013 Red Hat, Inc.
Original stubs by Jason Molenda of Cygnus Support, crash@cygnus.com
First implementation by Gunther Ebert, gunther.ebert@ixos-leipzig.de
@@ -25,14 +25,14 @@ details. */
#include "ntdll.h"
#include "pwdgrp.h"
-static __group32 *group_buf;
+static group *group_buf;
static pwdgrp gr (group_buf);
-static char * NO_COPY null_ptr;
+static char * NO_COPY_RO null_ptr;
bool
pwdgrp::parse_group ()
{
- __group32 &grp = (*group_buf)[curr_lines];
+ group &grp = (*group_buf)[curr_lines];
grp.gr_name = next_str (':');
if (!*grp.gr_name)
return false;
@@ -81,15 +81,15 @@ pwdgrp::read_group ()
static char linebuf [200];
char group_name [UNLEN + 1] = "mkgroup";
char strbuf[128] = "";
- struct __group32 *gr;
+ struct group *gr;
cygheap->user.groups.pgsid.string (strbuf);
if ((gr = internal_getgrsid (cygheap->user.groups.pgsid)))
snprintf (group_name, sizeof (group_name),
- "passwd/group_GID_clash(%lu/%lu)", myself->gid, gr->gr_gid);
+ "passwd/group_GID_clash(%u/%u)", myself->gid, gr->gr_gid);
if (myself->uid == UNKNOWN_UID)
strcpy (group_name, "mkpasswd"); /* Feedback... */
- snprintf (linebuf, sizeof (linebuf), "%s:%s:%lu:%s",
+ snprintf (linebuf, sizeof (linebuf), "%s:%s:%u:%s",
group_name, strbuf, myself->gid, cygheap->user.name ());
debug_printf ("Completing /etc/group: %s", linebuf);
add_line (linebuf);
@@ -108,7 +108,7 @@ pwdgrp::pwdgrp (passwd *&pbuf) :
pglock.init ("pglock");
}
-pwdgrp::pwdgrp (__group32 *&gbuf) :
+pwdgrp::pwdgrp (group *&gbuf) :
pwdgrp_buf_elem_size (sizeof (*gbuf)), group_buf (&gbuf)
{
read = &pwdgrp::read_group;
@@ -116,7 +116,7 @@ pwdgrp::pwdgrp (__group32 *&gbuf) :
pglock.init ("pglock");
}
-struct __group32 *
+struct group *
internal_getgrsid (cygpsid &sid)
{
char sid_string[128];
@@ -130,8 +130,8 @@ internal_getgrsid (cygpsid &sid)
return NULL;
}
-struct __group32 *
-internal_getgrgid (__gid32_t gid, bool check)
+struct group *
+internal_getgrgid (gid_t gid, bool check)
{
gr.refresh (check);
@@ -141,7 +141,7 @@ internal_getgrgid (__gid32_t gid, bool check)
return NULL;
}
-struct __group32 *
+struct group *
internal_getgrnam (const char *name, bool check)
{
gr.refresh (check);
@@ -154,8 +154,9 @@ internal_getgrnam (const char *name, bool check)
return NULL;
}
+#ifndef __x86_64__
static struct __group16 *
-grp32togrp16 (struct __group16 *gp16, struct __group32 *gp32)
+grp32togrp16 (struct __group16 *gp16, struct group *gp32)
{
if (!gp16 || !gp32)
return NULL;
@@ -169,17 +170,18 @@ grp32togrp16 (struct __group16 *gp16, struct __group32 *gp32)
return gp16;
}
+#endif
extern "C" int
-getgrgid_r (__gid32_t gid, struct __group32 *grp, char *buffer, size_t bufsize,
- struct __group32 **result)
+getgrgid_r (gid_t gid, struct group *grp, char *buffer, size_t bufsize,
+ struct group **result)
{
*result = NULL;
if (!grp || !buffer)
return ERANGE;
- struct __group32 *tempgr = internal_getgrgid (gid, true);
+ struct group *tempgr = internal_getgrgid (gid, true);
pthread_testcancel ();
if (!tempgr)
return 0;
@@ -206,12 +208,15 @@ getgrgid_r (__gid32_t gid, struct __group32 *grp, char *buffer, size_t bufsize,
return 0;
}
-extern "C" struct __group32 *
-getgrgid32 (__gid32_t gid)
+extern "C" struct group *
+getgrgid32 (gid_t gid)
{
return internal_getgrgid (gid, true);
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getgrgid32, getgrgid)
+#else
extern "C" struct __group16 *
getgrgid (__gid16_t gid)
{
@@ -219,17 +224,18 @@ getgrgid (__gid16_t gid)
return grp32togrp16 (&g16, getgrgid32 (gid16togid32 (gid)));
}
+#endif
extern "C" int
-getgrnam_r (const char *nam, struct __group32 *grp, char *buffer,
- size_t bufsize, struct __group32 **result)
+getgrnam_r (const char *nam, struct group *grp, char *buffer,
+ size_t bufsize, struct group **result)
{
*result = NULL;
if (!grp || !buffer)
return ERANGE;
- struct __group32 *tempgr = internal_getgrnam (nam, true);
+ struct group *tempgr = internal_getgrnam (nam, true);
pthread_testcancel ();
if (!tempgr)
return 0;
@@ -256,12 +262,15 @@ getgrnam_r (const char *nam, struct __group32 *grp, char *buffer,
return 0;
}
-extern "C" struct __group32 *
+extern "C" struct group *
getgrnam32 (const char *name)
{
return internal_getgrnam (name, true);
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getgrnam32, getgrnam)
+#else
extern "C" struct __group16 *
getgrnam (const char *name)
{
@@ -269,6 +278,7 @@ getgrnam (const char *name)
return grp32togrp16 (&g16, getgrnam32 (name));
}
+#endif
extern "C" void
endgrent ()
@@ -276,7 +286,7 @@ endgrent ()
_my_tls.locals.grp_pos = 0;
}
-extern "C" struct __group32 *
+extern "C" struct group *
getgrent32 ()
{
if (_my_tls.locals.grp_pos == 0)
@@ -287,6 +297,9 @@ getgrent32 ()
return NULL;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getgrent32, getgrent)
+#else
extern "C" struct __group16 *
getgrent ()
{
@@ -294,6 +307,7 @@ getgrent ()
return grp32togrp16 (&g16, getgrent32 ());
}
+#endif
extern "C" void
setgrent ()
@@ -302,7 +316,7 @@ setgrent ()
}
/* Internal function. ONLY USE THIS INTERNALLY, NEVER `getgrent'!!! */
-struct __group32 *
+struct group *
internal_getgrent (int pos)
{
gr.refresh (false);
@@ -313,13 +327,13 @@ internal_getgrent (int pos)
}
int
-internal_getgroups (int gidsetsize, __gid32_t *grouplist, cygpsid * srchsid)
+internal_getgroups (int gidsetsize, gid_t *grouplist, cygpsid * srchsid)
{
NTSTATUS status;
HANDLE hToken = NULL;
ULONG size;
int cnt = 0;
- struct __group32 *gr;
+ struct group *gr;
if (!srchsid && cygheap->user.groups.issetgroups ())
{
@@ -383,7 +397,7 @@ internal_getgroups (int gidsetsize, __gid32_t *grouplist, cygpsid * srchsid)
}
}
else
- debug_printf ("%lu = NtQueryInformationToken(NULL) %p", size, status);
+ debug_printf ("%u = NtQueryInformationToken(NULL) %y", size, status);
return cnt;
error:
@@ -392,15 +406,18 @@ error:
}
extern "C" int
-getgroups32 (int gidsetsize, __gid32_t *grouplist)
+getgroups32 (int gidsetsize, gid_t *grouplist)
{
return internal_getgroups (gidsetsize, grouplist);
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getgroups32, getgroups)
+#else
extern "C" int
getgroups (int gidsetsize, __gid16_t *grouplist)
{
- __gid32_t *grouplist32 = NULL;
+ gid_t *grouplist32 = NULL;
if (gidsetsize < 0)
{
@@ -408,7 +425,7 @@ getgroups (int gidsetsize, __gid16_t *grouplist)
return -1;
}
if (gidsetsize > 0 && grouplist)
- grouplist32 = (__gid32_t *) alloca (gidsetsize * sizeof (__gid32_t));
+ grouplist32 = (gid_t *) alloca (gidsetsize * sizeof (gid_t));
int ret = internal_getgroups (gidsetsize, grouplist32);
@@ -418,57 +435,54 @@ getgroups (int gidsetsize, __gid16_t *grouplist)
return ret;
}
+#endif
/* Core functionality of initgroups and getgrouplist. */
-static int
+static void
get_groups (const char *user, gid_t gid, cygsidlist &gsids)
{
- int ret = -1;
-
cygheap->user.deimpersonate ();
struct passwd *pw = internal_getpwnam (user);
- struct __group32 *gr = internal_getgrgid (gid);
+ struct group *gr = internal_getgrgid (gid);
cygsid usersid, grpsid;
- if (!usersid.getfrompw (pw) || !grpsid.getfromgr (gr))
- set_errno (EINVAL);
- else if (get_server_groups (gsids, usersid, pw))
- {
- gsids += grpsid;
- ret = 0;
- }
+ if (usersid.getfrompw (pw))
+ get_server_groups (gsids, usersid, pw);
+ if (grpsid.getfromgr (gr))
+ gsids += grpsid;
cygheap->user.reimpersonate ();
- return ret;
}
extern "C" int
-initgroups32 (const char *user, __gid32_t gid)
+initgroups32 (const char *user, gid_t gid)
{
- int ret;
-
assert (user != NULL);
cygsidlist tmp_gsids (cygsidlist_auto, 12);
- if (!(ret = get_groups (user, gid, tmp_gsids)))
- {
- cygsidlist new_gsids (cygsidlist_alloc, tmp_gsids.count ());
- for (int i = 0; i < tmp_gsids.count (); i++)
- new_gsids.sids[i] = tmp_gsids.sids[i];
- new_gsids.count (tmp_gsids.count ());
- cygheap->user.groups.update_supp (new_gsids);
- }
- syscall_printf ( "%d = initgroups(%s, %u)", ret, user, gid);
- return ret;
+ get_groups (user, gid, tmp_gsids);
+ cygsidlist new_gsids (cygsidlist_alloc, tmp_gsids.count ());
+ for (int i = 0; i < tmp_gsids.count (); i++)
+ new_gsids.sids[i] = tmp_gsids.sids[i];
+ new_gsids.count (tmp_gsids.count ());
+ cygheap->user.groups.update_supp (new_gsids);
+ syscall_printf ( "0 = initgroups(%s, %u)", user, gid);
+ return 0;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (initgroups32, initgroups)
+#else
extern "C" int
initgroups (const char *user, __gid16_t gid)
{
return initgroups32 (user, gid16togid32(gid));
}
+#endif
extern "C" int
getgrouplist (const char *user, gid_t gid, gid_t *groups, int *ngroups)
{
- int ret;
+ int ret = 0;
+ int cnt = 0;
+ struct group *gr;
/* Note that it's not defined if groups or ngroups may be NULL!
GLibc does not check the pointers on entry and just uses them.
@@ -479,23 +493,18 @@ getgrouplist (const char *user, gid_t gid, gid_t *groups, int *ngroups)
assert (ngroups != NULL);
cygsidlist tmp_gsids (cygsidlist_auto, 12);
- if (!(ret = get_groups (user, gid, tmp_gsids)))
- {
- int cnt = 0;
- for (int i = 0; i < tmp_gsids.count (); i++)
- {
- struct __group32 *gr = internal_getgrsid (tmp_gsids.sids[i]);
- if (gr)
- {
- if (groups && cnt < *ngroups)
- groups[cnt] = gr->gr_gid;
- ++cnt;
- }
- }
- if (cnt > *ngroups)
- ret = -1;
- *ngroups = cnt;
- }
+ get_groups (user, gid, tmp_gsids);
+ for (int i = 0; i < tmp_gsids.count (); i++)
+ if ((gr = internal_getgrsid (tmp_gsids.sids[i])) != NULL)
+ {
+ if (groups && cnt < *ngroups)
+ groups[cnt] = gr->gr_gid;
+ ++cnt;
+ }
+ if (cnt > *ngroups)
+ ret = -1;
+ *ngroups = cnt;
+
syscall_printf ( "%d = getgrouplist(%s, %u, %p, %d)",
ret, user, gid, groups, *ngroups);
return ret;
@@ -503,7 +512,7 @@ getgrouplist (const char *user, gid_t gid, gid_t *groups, int *ngroups)
/* setgroups32: standards? */
extern "C" int
-setgroups32 (int ngroups, const __gid32_t *grouplist)
+setgroups32 (int ngroups, const gid_t *grouplist)
{
syscall_printf ("setgroups32 (%d)", ngroups);
if (ngroups < 0 || (ngroups > 0 && !grouplist))
@@ -513,7 +522,7 @@ setgroups32 (int ngroups, const __gid32_t *grouplist)
}
cygsidlist gsids (cygsidlist_alloc, ngroups);
- struct __group32 *gr;
+ struct group *gr;
if (ngroups && !gsids.sids)
return -1;
@@ -523,7 +532,7 @@ setgroups32 (int ngroups, const __gid32_t *grouplist)
if ((gr = internal_getgrgid (grouplist[gidx]))
&& gsids.addfromgr (gr))
continue;
- debug_printf ("No sid found for gid %d", grouplist[gidx]);
+ debug_printf ("No sid found for gid %u", grouplist[gidx]);
gsids.free_sids ();
set_errno (EINVAL);
return -1;
@@ -532,14 +541,17 @@ setgroups32 (int ngroups, const __gid32_t *grouplist)
return 0;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (setgroups32, setgroups)
+#else
extern "C" int
setgroups (int ngroups, const __gid16_t *grouplist)
{
- __gid32_t *grouplist32 = NULL;
+ gid_t *grouplist32 = NULL;
if (ngroups > 0 && grouplist)
{
- grouplist32 = (__gid32_t *) alloca (ngroups * sizeof (__gid32_t));
+ grouplist32 = (gid_t *) alloca (ngroups * sizeof (gid_t));
if (grouplist32 == NULL)
return -1;
for (int i = 0; i < ngroups; i++)
@@ -547,3 +559,4 @@ setgroups (int ngroups, const __gid16_t *grouplist)
}
return setgroups32 (ngroups, grouplist32);
}
+#endif
diff --git a/winsup/cygwin/heap.cc b/winsup/cygwin/heap.cc
index 23093dda7..b10261cb6 100644
--- a/winsup/cygwin/heap.cc
+++ b/winsup/cygwin/heap.cc
@@ -1,7 +1,7 @@
/* heap.cc: Cygwin heap manager.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -22,13 +22,22 @@ details. */
#define assert(x)
-static unsigned page_const;
+static ptrdiff_t page_const;
#define MINHEAP_SIZE (4 * 1024 * 1024)
static uintptr_t
eval_start_address ()
{
+#ifdef __x86_64__
+ /* On 64 bit, we choose a fixed address outside the 32 bit area. The
+ executable starts at 0x1:00400000L, the Cygwin DLL starts at
+ 0x1:80040000L, other rebased DLLs are located in the region from
+ 0x2:00000000L up to 0x4:00000000L, -auto-image-based DLLs are located
+ in the region from 0x4:00000000L up to 0x6:00000000L.
+ So we let the heap start at 0x6:00000000L. */
+ uintptr_t start_address = 0x600000000L;
+#else
/* Starting with Vista, Windows performs heap ASLR. This spoils the entire
region below 0x20000000 for us, because that region is used by Windows
to randomize heap and stack addresses. Therefore we put our heap into a
@@ -53,30 +62,41 @@ eval_start_address ()
memory for heap, thread stacks, and shared memory regions. */
start_address = 0x80000000L;
}
+#endif
return start_address;
}
-static unsigned
+static SIZE_T
eval_initial_heap_size ()
{
PIMAGE_DOS_HEADER dosheader;
- PIMAGE_NT_HEADERS32 ntheader;
- unsigned size;
+ PIMAGE_NT_HEADERS ntheader;
+ SIZE_T size;
dosheader = (PIMAGE_DOS_HEADER) GetModuleHandle (NULL);
- ntheader = (PIMAGE_NT_HEADERS32) ((PBYTE) dosheader + dosheader->e_lfanew);
+ ntheader = (PIMAGE_NT_HEADERS) ((PBYTE) dosheader + dosheader->e_lfanew);
/* LoaderFlags is an obsolete DWORD member of the PE/COFF file header.
It's value is ignored by the loader, so we're free to use it for
- Cygwin. If it's 0, we default to the usual 384 Megs. Otherwise,
- we use it as the default initial heap size in megabyte. Valid values
- are between 4 and 2048 Megs. */
+ Cygwin. If it's 0, we default to the usual 384 Megs on 32 bit and
+ 512 on 64 bit. Otherwise, we use it as the default initial heap size
+ in megabyte. Valid values are between 4 and 2048/8388608 Megs. */
+
size = ntheader->OptionalHeader.LoaderFlags;
+#ifdef __x86_64__
+ if (size == 0)
+ size = 512;
+ else if (size < 4)
+ size = 4;
+ else if (size > 8388608)
+ size = 8388608;
+#else
if (size == 0)
size = 384;
else if (size < 4)
size = 4;
else if (size > 2048)
size = 2048;
+#endif
return size << 20;
}
@@ -93,7 +113,7 @@ heap_init ()
{
uintptr_t start_address = eval_start_address ();
PVOID largest_found = NULL;
- size_t largest_found_size = 0;
+ SIZE_T largest_found_size = 0;
SIZE_T ret;
MEMORY_BASIC_INFORMATION mbi;
@@ -156,7 +176,7 @@ heap_init ()
}
while (!cygheap->user_heap.base && ret);
if (cygheap->user_heap.base == NULL)
- api_fatal ("unable to allocate heap, heap_chunk_size %p, %E",
+ api_fatal ("unable to allocate heap, heap_chunk_size %ly, %E",
cygheap->user_heap.chunk);
cygheap->user_heap.ptr = cygheap->user_heap.top = cygheap->user_heap.base;
cygheap->user_heap.max = (char *) cygheap->user_heap.base
@@ -164,14 +184,21 @@ heap_init ()
}
else
{
- DWORD chunk = cygheap->user_heap.chunk; /* allocation chunk */
+ SIZE_T chunk = cygheap->user_heap.chunk; /* allocation chunk */
/* total size commited in parent */
- DWORD allocsize = (char *) cygheap->user_heap.top -
- (char *) cygheap->user_heap.base;
+ SIZE_T allocsize = (char *) cygheap->user_heap.top -
+ (char *) cygheap->user_heap.base;
/* Loop until we've managed to reserve an adequate amount of memory. */
char *p;
- DWORD reserve_size = chunk * ((allocsize + (chunk - 1)) / chunk);
+ SIZE_T reserve_size = chunk * ((allocsize + (chunk - 1)) / chunk);
+ /* With ptmalloc3 there's a good chance that there has been no memory
+ allocated on the heap. If we don't check that, reserve_size will
+ be 0 and from there, the below loop will end up overallocating due
+ to integer overflow. */
+ if (!reserve_size)
+ reserve_size = chunk;
+
while (1)
{
p = (char *) VirtualAlloc (cygheap->user_heap.base, reserve_size,
@@ -183,12 +210,14 @@ heap_init ()
}
if (!p && in_forkee && !fork_info->abort (NULL))
api_fatal ("couldn't allocate heap, %E, base %p, top %p, "
- "reserve_size %d, allocsize %d, page_const %d",
+ "reserve_size %ld, allocsize %ld, page_const %d",
cygheap->user_heap.base, cygheap->user_heap.top,
reserve_size, allocsize, page_const);
if (p != cygheap->user_heap.base)
- api_fatal ("heap allocated at wrong address %p (mapped) != %p (expected)", p, cygheap->user_heap.base);
- if (allocsize && !VirtualAlloc (cygheap->user_heap.base, allocsize, MEM_COMMIT, PAGE_READWRITE))
+ api_fatal ("heap allocated at wrong address %p (mapped) "
+ "!= %p (expected)", p, cygheap->user_heap.base);
+ if (allocsize && !VirtualAlloc (cygheap->user_heap.base, allocsize,
+ MEM_COMMIT, PAGE_READWRITE))
api_fatal ("MEM_COMMIT failed, %E");
}
@@ -198,7 +227,7 @@ heap_init ()
size has not been evaluated yet, except in a forked child. Since
heap_init is called early, the heap size is printed pretty much at the
start of the strace output, so there isn't anything lost. */
- debug_printf ("heap base %p, heap top %p, heap size %p (%u)",
+ debug_printf ("heap base %p, heap top %p, heap size %ly (%lu)",
cygheap->user_heap.base, cygheap->user_heap.top,
cygheap->user_heap.chunk, cygheap->user_heap.chunk);
page_const--;
@@ -209,11 +238,14 @@ heap_init ()
/* FIXME: This function no longer handles "split heaps". */
+/* Linux defines n to be intptr_t, newlib defines it to be ptrdiff_t.
+ It shouldn't matter much, though, since the function is not standarized
+ and sizeof(ptrdiff_t) == sizeof(intptr_t) anyway. */
extern "C" void *
-sbrk (int n)
+sbrk (ptrdiff_t n)
{
char *newtop, *newbrk;
- unsigned commitbytes, newbrksize;
+ SIZE_T commitbytes, newbrksize;
if (n == 0)
return cygheap->user_heap.ptr; /* Just wanted to find current cygheap->user_heap.ptr address */
@@ -230,9 +262,8 @@ sbrk (int n)
assert (newtop < cygheap->user_heap.top);
n = (char *) cygheap->user_heap.top - newtop;
if (VirtualFree (newtop, n, MEM_DECOMMIT)) /* Give it back to OS */
- goto good; /* Didn't take */
- else
- goto err;
+ goto good;
+ goto err; /* Didn't take */
}
assert (newtop > cygheap->user_heap.top);
@@ -256,11 +287,15 @@ sbrk (int n)
if ((newbrksize = cygheap->user_heap.chunk) < commitbytes)
newbrksize = commitbytes;
- if ((VirtualAlloc (cygheap->user_heap.top, newbrksize, MEM_RESERVE, PAGE_NOACCESS)
- || VirtualAlloc (cygheap->user_heap.top, newbrksize = commitbytes, MEM_RESERVE, PAGE_NOACCESS))
- && VirtualAlloc (cygheap->user_heap.top, commitbytes, MEM_COMMIT, PAGE_READWRITE) != NULL)
+ if ((VirtualAlloc (cygheap->user_heap.top, newbrksize,
+ MEM_RESERVE, PAGE_NOACCESS)
+ || VirtualAlloc (cygheap->user_heap.top, newbrksize = commitbytes,
+ MEM_RESERVE, PAGE_NOACCESS))
+ && VirtualAlloc (cygheap->user_heap.top, commitbytes,
+ MEM_COMMIT, PAGE_READWRITE) != NULL)
{
- cygheap->user_heap.max = (char *) cygheap->user_heap.max + pround (newbrksize);
+ cygheap->user_heap.max = (char *) cygheap->user_heap.max
+ + pround (newbrksize);
goto good;
}
diff --git a/winsup/cygwin/hookapi.cc b/winsup/cygwin/hookapi.cc
index 0c3494d3f..133d8cbf5 100644
--- a/winsup/cygwin/hookapi.cc
+++ b/winsup/cygwin/hookapi.cc
@@ -1,6 +1,6 @@
/* hookapi.cc
- Copyright 2005, 2006, 2007, 2008, 2011, 2012 Red Hat, Inc.
+ Copyright 2005, 2006, 2007, 2008, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -29,13 +29,13 @@ struct function_hook
void *origfn; // Stored by HookAPICalls, the address of the original function.
};
-/* Given an HMODULE, returns a pointer to the PE header */
+/* Given an HMODULE, returns a pointer to the PE header. */
static PIMAGE_NT_HEADERS
-PEHeaderFromHModule (HMODULE hModule)
+PEHeaderFromHModule (HMODULE hModule, bool &is_64bit)
{
PIMAGE_NT_HEADERS pNTHeader;
- if (PIMAGE_DOS_HEADER(hModule) ->e_magic != IMAGE_DOS_SIGNATURE)
+ if (PIMAGE_DOS_HEADER (hModule) ->e_magic != IMAGE_DOS_SIGNATURE)
pNTHeader = NULL;
else
{
@@ -43,6 +43,12 @@ PEHeaderFromHModule (HMODULE hModule)
+ PIMAGE_DOS_HEADER (hModule) ->e_lfanew);
if (pNTHeader->Signature != IMAGE_NT_SIGNATURE)
pNTHeader = NULL;
+ else if (pNTHeader->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64)
+ is_64bit = true;
+ else if (pNTHeader->FileHeader.Machine == IMAGE_FILE_MACHINE_I386)
+ is_64bit = false;
+ else
+ pNTHeader = NULL;
}
return pNTHeader;
@@ -55,7 +61,6 @@ rvadelta (PIMAGE_NT_HEADERS pnt, DWORD import_rva, DWORD &max_size)
for (int i = 0; i < pnt->FileHeader.NumberOfSections; i++)
if (section[i].VirtualAddress <= import_rva
&& (section[i].VirtualAddress + section[i].Misc.VirtualSize) > import_rva)
- // if (ascii_strncasematch ((char *) section[i].Name, ".idata", IMAGE_SIZEOF_SHORT_NAME))
{
max_size = section[i].SizeOfRawData
- (import_rva - section[i].VirtualAddress);
@@ -64,21 +69,30 @@ rvadelta (PIMAGE_NT_HEADERS pnt, DWORD import_rva, DWORD &max_size)
return -1;
}
+/* This function is only used for the current architecture.
+ Just the size of the IMAGE_THUNK_DATA Function member differs. */
static void *
putmem (PIMAGE_THUNK_DATA pi, const void *hookfn)
{
+#ifdef __x86_64__
+#define THUNK_FUNC_TYPE ULONGLONG
+#else
+#define THUNK_FUNC_TYPE DWORD
+#endif
+
DWORD ofl;
- if (!VirtualProtect (pi, sizeof (PVOID), PAGE_READWRITE, &ofl) )
+ if (!VirtualProtect (pi, sizeof (THUNK_FUNC_TYPE), PAGE_READWRITE, &ofl) )
return NULL;
void *origfn = (void *) pi->u1.Function;
- pi->u1.Function = (DWORD) hookfn;
+ pi->u1.Function = (THUNK_FUNC_TYPE) hookfn;
- VirtualProtect (pi, sizeof (PVOID), ofl, &ofl);
+ VirtualProtect (pi, sizeof (THUNK_FUNC_TYPE), ofl, &ofl);
return origfn;
}
-/* Builds stubs for and redirects the IAT for one DLL (pImportDesc) */
+/* Builds stubs for and redirects the IAT for one DLL (pImportDesc)
+ This function is only used for the current architecture. */
static bool
RedirectIAT (function_hook& fh, PIMAGE_IMPORT_DESCRIPTOR pImportDesc,
@@ -122,6 +136,7 @@ RedirectIAT (function_hook& fh, PIMAGE_IMPORT_DESCRIPTOR pImportDesc,
return true;
}
+/* This function is only used for the current architecture. */
static void
get_export (function_hook& fh)
{
@@ -162,6 +177,59 @@ makename (const char *name, char *&buf, int& i, int inc)
return name;
}
+static HMODULE
+remap (PIMAGE_IMPORT_DESCRIPTOR &pdfirst, long &delta, HANDLE hc,
+ DWORD importRVA, DWORD importRVASize, DWORD importRVAMaxSize)
+{
+ /* If h is not NULL, the calling function only mapped at most the first
+ 64K of the image. The IAT is usually at the end of the image, so
+ what we do here is to map the IAT into our address space if it doesn't
+ reside in the first 64K anyway. The offset must be a multiple of the
+ allocation granularity, though, so we have to map a bit more. */
+ HMODULE map;
+ DWORD offset = rounddown (importRVA, wincap.allocation_granularity ());
+ /* But that's not all, unfortunately. Apparently there's a difference
+ between the importRVASize of applications built with gcc and those
+ built with Visual Studio. When built with gcc, importRVASize contains
+ the size of the import RVA table plus the size of the referenced
+ string table with the DLL names. When built with VS, it only contains
+ the size of the naked import RVA table. The following code handles
+ the situation. importRVAMaxSize contains the size of the remainder
+ of the section. If the difference between importRVAMaxSize and
+ importRVASize is less than 64K, we just use importRVAMaxSize to
+ compute the size of the memory map. Otherwise the executable may be
+ very big. In that case we only map the import RVA table and ... */
+ DWORD size = importRVA - offset + ((importRVAMaxSize - importRVASize
+ <= wincap.allocation_granularity ())
+ ? importRVAMaxSize : importRVASize);
+ map = (HMODULE) MapViewOfFile (hc, FILE_MAP_READ, 0, offset, size);
+ if (!map)
+ return NULL;
+ pdfirst = rva (PIMAGE_IMPORT_DESCRIPTOR, map, importRVA - offset);
+ /* ... carefully check the required size to fit the string table into
+ the map as well. Allow NAME_MAX bytes for the DLL name, but don't
+ go beyond the remainder of the section. */
+ if (importRVAMaxSize - importRVASize > wincap.allocation_granularity ())
+ {
+ DWORD newsize = size;
+ for (PIMAGE_IMPORT_DESCRIPTOR pd = pdfirst; pd->FirstThunk; pd++)
+ if (pd->Name - delta - offset + (NAME_MAX + 1) > newsize)
+ newsize = pd->Name - delta - offset + (NAME_MAX + 1);
+ if (newsize > size)
+ {
+ if (newsize > importRVA - offset + importRVAMaxSize)
+ newsize = importRVA - offset + importRVAMaxSize;
+ UnmapViewOfFile (map);
+ map = (HMODULE) MapViewOfFile (hc, FILE_MAP_READ, 0, offset, newsize);
+ if (!map)
+ return NULL;
+ pdfirst = rva (PIMAGE_IMPORT_DESCRIPTOR, map, importRVA - offset);
+ }
+ }
+ delta += offset;
+ return map;
+}
+
/* Find first missing dll in a given executable.
FIXME: This is not foolproof since it doesn't look for dlls in the
same directory as the given executable, like Windows. Instead it
@@ -178,6 +246,10 @@ find_first_notloaded_dll (path_conv& pc)
HANDLE h;
NTSTATUS status;
LARGE_INTEGER size;
+ PIMAGE_NT_HEADERS pExeNTHdr;
+ DWORD importRVA, importRVASize, importRVAMaxSize;
+ HMODULE map;
+ long delta;
status = NtOpenFile (&h, SYNCHRONIZE | GENERIC_READ,
pc.get_object_attr (attr, sec_none_nih),
@@ -199,7 +271,7 @@ find_first_notloaded_dll (path_conv& pc)
NtClose (h);
goto out;
}
- if (size.QuadPart > wincap.allocation_granularity ())
+ if (size.QuadPart > (LONGLONG) wincap.allocation_granularity ())
size.LowPart = wincap.allocation_granularity ();
hc = CreateFileMapping (h, &sec_none_nih, PAGE_READONLY, 0, 0, NULL);
NtClose (h);
@@ -209,55 +281,58 @@ find_first_notloaded_dll (path_conv& pc)
if (!hm)
goto out;
- PIMAGE_NT_HEADERS pExeNTHdr;
- pExeNTHdr = PEHeaderFromHModule (hm);
+ bool is_64bit;
+ pExeNTHdr = PEHeaderFromHModule (hm, is_64bit);
+
+ if (!pExeNTHdr)
+ goto out;
+
+#ifdef __x86_64__
+ if (!is_64bit)
+#else
+ if (is_64bit)
+#endif
+ goto out;
+
+ importRVA = pExeNTHdr->OptionalHeader.DataDirectory
+ [IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
+ importRVASize = pExeNTHdr->OptionalHeader.DataDirectory
+ [IMAGE_DIRECTORY_ENTRY_IMPORT].Size;
+ if (!importRVA)
+ goto out;
- if (pExeNTHdr)
+ delta = rvadelta (pExeNTHdr, importRVA, importRVAMaxSize);
+ if (delta < 0)
+ goto out;
+ importRVA -= delta;
+ map = NULL;
+
+ PIMAGE_IMPORT_DESCRIPTOR pdfirst;
+
+ if (importRVA + importRVAMaxSize > wincap.allocation_granularity ())
{
- DWORD importRVA;
- DWORD importRVAMaxSize;
- importRVA = pExeNTHdr->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
- if (importRVA)
+ map = remap (pdfirst, delta, hc, importRVA, importRVASize,
+ importRVAMaxSize);
+ if (!map)
+ goto out;
+ }
+ else
+ pdfirst = rva (PIMAGE_IMPORT_DESCRIPTOR, hm, importRVA);
+
+ /* Iterate through each import descriptor, and check if DLL can be loaded. */
+ for (PIMAGE_IMPORT_DESCRIPTOR pd = pdfirst; pd->FirstThunk; pd++)
+ {
+ const char *lib = rva (PSTR, map ?: hm, pd->Name - delta);
+ if (!LoadLibraryEx (lib, NULL, DONT_RESOLVE_DLL_REFERENCES
+ | LOAD_LIBRARY_AS_DATAFILE))
{
- long delta = rvadelta (pExeNTHdr, importRVA, importRVAMaxSize);
- if (delta < 0)
- goto out;
- importRVA -= delta;
-
- DWORD offset = 0;
- HMODULE map = NULL;
- if (importRVA + importRVAMaxSize > wincap.allocation_granularity ())
- {
- offset = rounddown (importRVA, wincap.allocation_granularity ());
- DWORD size = importRVA - offset + importRVAMaxSize;
- map = (HMODULE) MapViewOfFile (hc, FILE_MAP_READ, 0,
- offset, size);
- if (!map)
- goto out;
- }
-
- // Convert imports RVA to a usable pointer
- PIMAGE_IMPORT_DESCRIPTOR pdfirst;
- pdfirst = rva (PIMAGE_IMPORT_DESCRIPTOR, map ?: hm,
- importRVA - offset);
-
- // Iterate through each import descriptor, and redirect if appropriate
- for (PIMAGE_IMPORT_DESCRIPTOR pd = pdfirst; pd->FirstThunk; pd++)
- {
- const char *lib = rva (PSTR, map ?: hm,
- pd->Name - delta - offset);
- if (!LoadLibraryEx (lib, NULL, DONT_RESOLVE_DLL_REFERENCES
- | LOAD_LIBRARY_AS_DATAFILE))
- {
- static char buf[MAX_PATH];
- strlcpy (buf, lib, MAX_PATH);
- res = buf;
- }
- }
- if (map)
- UnmapViewOfFile (map);
+ static char buf[MAX_PATH];
+ strlcpy (buf, lib, MAX_PATH);
+ res = buf;
}
}
+ if (map)
+ UnmapViewOfFile (map);
out:
if (hm)
@@ -273,25 +348,32 @@ void *
hook_or_detect_cygwin (const char *name, const void *fn, WORD& subsys, HANDLE h)
{
HMODULE hm = fn ? GetModuleHandle (NULL) : (HMODULE) name;
- PIMAGE_NT_HEADERS pExeNTHdr = PEHeaderFromHModule (hm);
+ bool is_64bit;
+ PIMAGE_NT_HEADERS pExeNTHdr = PEHeaderFromHModule (hm, is_64bit);
if (!pExeNTHdr)
return NULL;
- /* FIXME: This code has to be made 64 bit capable. */
- if (pExeNTHdr->FileHeader.Machine != IMAGE_FILE_MACHINE_I386)
+ /* Shortcut. We don't have to do anything further from here, if the
+ executable's architecture doesn't match, unless we want to support
+ a mix of 32 and 64 bit Cygwin at one point. */
+#ifdef __x86_64__
+ if (!is_64bit)
+#else
+ if (is_64bit)
+#endif
return NULL;
- subsys = pExeNTHdr->OptionalHeader.Subsystem;
-
- DWORD importRVA = pExeNTHdr->OptionalHeader.DataDirectory
- [IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
- DWORD importRVASize = pExeNTHdr->OptionalHeader.DataDirectory
+ DWORD importRVA, importRVASize;
+ subsys = pExeNTHdr->OptionalHeader.Subsystem;
+ importRVA = pExeNTHdr->OptionalHeader.DataDirectory
+ [IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
+ importRVASize = pExeNTHdr->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_IMPORT].Size;
if (!importRVA)
return NULL;
- DWORD importRVAMaxSize;
+ DWORD importRVAMaxSize = 0;
long delta = fn ? 0 : rvadelta (pExeNTHdr, importRVA, importRVAMaxSize);
if (delta < 0)
return NULL;
@@ -300,55 +382,12 @@ hook_or_detect_cygwin (const char *name, const void *fn, WORD& subsys, HANDLE h)
// Convert imports RVA to a usable pointer
PIMAGE_IMPORT_DESCRIPTOR pdfirst;
char *map = NULL;
- DWORD offset = 0;
if (h && importRVA + importRVAMaxSize > wincap.allocation_granularity ())
{
- /* If h is not NULL, the calling function only mapped at most the first
- 64K of the image. The IAT is usually at the end of the image, so
- what we do here is to map the IAT into our address space if it doesn't
- reside in the first 64K anyway. The offset must be a multiple of the
- allocation granularity, though, so we have to map a bit more. */
- offset = rounddown (importRVA, wincap.allocation_granularity ());
- /* But that's not all, unfortunately. Apparently there's a difference
- between the importRVASize of applications built with gcc and those
- built with Visual Studio. When built with gcc, importRVASize contains
- the size of the import RVA table plus the size of the referenced
- string table with the DLL names. When built with VS, it only contains
- the size of the naked import RVA table. The following code handles
- the situation. importRVAMaxSize contains the size of the remainder
- of the section. If the difference between importRVAMaxSize and
- importRVASize is less than 64K, we just use importRVAMaxSize to
- compute the size of the memory map. Otherwise the executable may be
- very big. In that case we only map the import RVA table and ... */
- DWORD size = importRVA - offset
- + ((importRVAMaxSize - importRVASize
- <= wincap.allocation_granularity ())
- ? importRVAMaxSize : importRVASize);
- map = (char *) MapViewOfFile (h, FILE_MAP_READ, 0, offset, size);
+ map = (char *) remap (pdfirst, delta, h, importRVA, importRVASize,
+ importRVAMaxSize);
if (!map)
return NULL;
- pdfirst = rva (PIMAGE_IMPORT_DESCRIPTOR, map, importRVA - offset);
- /* ... carefully check the required size to fit the string table into
- the map as well. Allow NAME_MAX bytes for the DLL name, but don't
- go beyond the remainder of the section. */
- if (importRVAMaxSize - importRVASize > wincap.allocation_granularity ())
- {
- DWORD newsize = size;
- for (PIMAGE_IMPORT_DESCRIPTOR pd = pdfirst; pd->FirstThunk; pd++)
- if (pd->Name - delta - offset + (NAME_MAX + 1) > newsize)
- newsize = pd->Name - delta - offset + (NAME_MAX + 1);
- if (newsize > size)
- {
- if (newsize > importRVA - offset + importRVAMaxSize)
- newsize = importRVA - offset + importRVAMaxSize;
- UnmapViewOfFile (map);
- map = (char *) MapViewOfFile (h, FILE_MAP_READ, 0, offset,
- newsize);
- if (!map)
- return NULL;
- pdfirst = rva (PIMAGE_IMPORT_DESCRIPTOR, map, importRVA - offset);
- }
- }
}
else
pdfirst = rva (PIMAGE_IMPORT_DESCRIPTOR, hm, importRVA);
@@ -363,14 +402,15 @@ hook_or_detect_cygwin (const char *name, const void *fn, WORD& subsys, HANDLE h)
// Iterate through each import descriptor, and redirect if appropriate
for (PIMAGE_IMPORT_DESCRIPTOR pd = pdfirst; pd->FirstThunk; pd++)
{
- if (!ascii_strcasematch (rva (PSTR, map ?: (char *) hm,
- pd->Name - delta - offset), "cygwin1.dll"))
- continue;
+ if (!ascii_strcasematch (rva (PSTR, map ?: (char *) hm, pd->Name - delta),
+ "cygwin1.dll"))
+ continue;
if (!fn)
{
+ /* Just checking if executable used cygwin1.dll. */
if (map)
UnmapViewOfFile (map);
- return (void *) "found it"; // just checking if executable used cygwin1.dll
+ return (void *) "found it";
}
i = -1;
while (!fh.origfn && (fh.name = makename (name, buf, i, 1)))
diff --git a/winsup/cygwin/i686.din b/winsup/cygwin/i686.din
new file mode 100644
index 000000000..2ef0135fd
--- /dev/null
+++ b/winsup/cygwin/i686.din
@@ -0,0 +1,656 @@
+LIBRARY "cygwin1.dll" BASE=0x61000000
+
+EXPORTS
+#Exported variables
+__cygwin_environ DATA
+_fe_dfl_env DATA
+_fe_nomask_env DATA
+
+#Exported functions
+__argz_add = argz_add SIGFE
+__argz_add_sep = argz_add_sep SIGFE
+__argz_append = argz_append SIGFE
+__argz_count = argz_count NOSIGFE
+__argz_create = argz_create SIGFE
+__argz_create_sep = argz_create_sep SIGFE
+__argz_delete = argz_delete SIGFE
+__argz_extract = argz_extract NOSIGFE
+__argz_insert = argz_insert SIGFE
+__argz_next = argz_next NOSIGFE
+__argz_replace = argz_replace SIGFE
+__argz_stringify = argz_stringify NOSIGFE
+__envz_add = envz_add SIGFE
+__envz_entry = envz_entry NOSIGFE
+__envz_get = envz_get NOSIGFE
+__envz_merge = envz_merge SIGFE
+__envz_remove = envz_remove SIGFE
+__envz_strip = envz_strip SIGFE
+__f_atan2 = _f_atan2 NOSIGFE
+__f_atan2f = _f_atan2f NOSIGFE
+__f_exp = _f_exp NOSIGFE
+__f_expf = _f_expf NOSIGFE
+__f_frexp = _f_frexp NOSIGFE
+__f_frexpf = _f_frexpf NOSIGFE
+__f_ldexp = _f_ldexp NOSIGFE
+__f_ldexpf = _f_ldexpf NOSIGFE
+__f_log = _f_log NOSIGFE
+__f_log10 = _f_log10 NOSIGFE
+__f_log10f = _f_log10f NOSIGFE
+__f_logf = _f_logf NOSIGFE
+__f_pow = _f_pow NOSIGFE
+__f_powf = _f_powf NOSIGFE
+__f_tan = _f_tan NOSIGFE
+__f_tanf = _f_tanf NOSIGFE
+__getdelim SIGFE
+__getline SIGFE
+__mempcpy = mempcpy NOSIGFE
+__wrap__Znaj NOSIGFE # void *operator new[](std::size_t sz) throw (std::bad_alloc)
+__wrap__ZnajRKSt9nothrow_t NOSIGFE # void *operator new[](std::size_t sz, const std::nothrow_t &nt) throw()
+__wrap__Znwj NOSIGFE # void *operator new(std::size_t sz) throw (std::bad_alloc)
+__wrap__ZnwjRKSt9nothrow_t NOSIGFE # void *operator new(std::size_t sz, const std::nothrow_t &nt) throw()
+_abort = abort NOSIGFE
+_abs = abs NOSIGFE
+_access = access SIGFE
+_acl = acl SIGFE
+_acl32 = acl32 SIGFE
+_aclcheck = aclcheck NOSIGFE
+_aclcheck32 = aclcheck32 NOSIGFE
+_aclfrommode = aclfrommode SIGFE
+_aclfrommode32 = aclfrommode32 SIGFE
+_aclfrompbits = aclfrompbits SIGFE
+_aclfrompbits32 = aclfrompbits32 SIGFE
+_aclfromtext = aclfromtext SIGFE
+_aclfromtext32 = aclfromtext32 SIGFE
+_aclsort = aclsort SIGFE
+_aclsort32 = aclsort32 SIGFE
+_acltomode = acltomode SIGFE
+_acltomode32 = acltomode32 SIGFE
+_acltopbits = acltopbits SIGFE
+_acltopbits32 = acltopbits32 SIGFE
+_acltotext = acltotext SIGFE
+_acltotext32 = acltotext32 SIGFE
+_acos = acos NOSIGFE
+_acosf = acosf NOSIGFE
+_acosh = acosh NOSIGFE
+_acoshf = acoshf NOSIGFE
+_alarm = alarm SIGFE
+_alloca NOSIGFE
+_alphasort = alphasort NOSIGFE
+_asctime = asctime SIGFE
+_asctime_r = asctime_r SIGFE
+_asin = asin NOSIGFE
+_asinf = asinf NOSIGFE
+_asinh = asinh NOSIGFE
+_asinhf = asinhf NOSIGFE
+_asprintf = asprintf SIGFE
+_asprintf_r SIGFE
+_atan = atan NOSIGFE
+_atan2 = atan2 NOSIGFE
+_atan2f = atan2f NOSIGFE
+_atanf = atanf NOSIGFE
+_atanh = atanh NOSIGFE
+_atanhf = atanhf NOSIGFE
+_atexit = cygwin_atexit SIGFE
+_atof = atof SIGFE
+_atoff = atoff SIGFE
+_atoi = atoi NOSIGFE
+_atol = atol NOSIGFE
+_bcmp = bcmp NOSIGFE
+_bcopy = bcopy NOSIGFE
+_bsearch = bsearch NOSIGFE
+_bzero = bzero NOSIGFE
+_cabs = cabs NOSIGFE
+_cabsf = cabsf NOSIGFE
+_calloc = calloc SIGFE
+_cbrt = cbrt NOSIGFE
+_cbrtf = cbrtf NOSIGFE
+_ceil = ceil NOSIGFE
+_ceilf = ceilf NOSIGFE
+_chdir = chdir SIGFE
+_chmod = chmod SIGFE
+_chown = chown SIGFE
+_chown32 = chown32 SIGFE
+_chroot = chroot SIGFE
+_clearerr = clearerr SIGFE
+_clock = clock SIGFE
+_close = close SIGFE
+_closedir = closedir SIGFE
+_copysign = copysign NOSIGFE
+_copysignf = copysignf NOSIGFE
+_cos = cos NOSIGFE
+_cosf = cosf NOSIGFE
+_cosh = cosh NOSIGFE
+_coshf = coshf NOSIGFE
+_creat = creat SIGFE
+_ctime = ctime SIGFE
+_ctime_r = ctime_r SIGFE
+_cuserid = cuserid NOSIGFE
+_cwait = cwait SIGFE
+_difftime = difftime NOSIGFE
+_dirfd = dirfd SIGFE
+_div = div NOSIGFE
+_dll_crt0@0 NOSIGFE
+_drand48 = drand48 NOSIGFE
+_drem = drem NOSIGFE
+_dremf = dremf NOSIGFE
+_dup = dup SIGFE
+_dup2 = dup2 SIGFE
+_ecvt = ecvt SIGFE
+_ecvtbuf = ecvtbuf SIGFE
+_ecvtf = ecvtf SIGFE
+_endgrent = endgrent NOSIGFE
+_endmntent = endmntent NOSIGFE
+_endpwent = endpwent NOSIGFE
+_endutent = endutent SIGFE
+_erand48 = erand48 NOSIGFE
+_erf = erf NOSIGFE
+_erfc = erfc NOSIGFE
+_erfcf = erfcf NOSIGFE
+_erff = erff NOSIGFE
+_execl = execl SIGFE
+_execle = execle SIGFE
+_execlp = execlp SIGFE
+_execv = execv SIGFE
+_execve = execve SIGFE
+_execvp = execvp SIGFE
+_exp = exp NOSIGFE
+_expf = expf NOSIGFE
+_expm1 = expm1 NOSIGFE
+_expm1f = expm1f NOSIGFE
+_f_atan2 NOSIGFE
+_f_atan2f NOSIGFE
+_f_exp NOSIGFE
+_f_expf NOSIGFE
+_f_frexp NOSIGFE
+_f_frexpf NOSIGFE
+_f_ldexp NOSIGFE
+_f_ldexpf NOSIGFE
+_f_llrint NOSIGFE
+_f_llrintf NOSIGFE
+_f_llrintl NOSIGFE
+_f_log NOSIGFE
+_f_log10 NOSIGFE
+_f_log10f NOSIGFE
+_f_logf NOSIGFE
+_f_lrint NOSIGFE
+_f_lrintf NOSIGFE
+_f_lrintl NOSIGFE
+_f_pow NOSIGFE
+_f_powf NOSIGFE
+_f_rint NOSIGFE
+_f_rintf NOSIGFE
+_f_rintl NOSIGFE
+_f_tan NOSIGFE
+_f_tanf NOSIGFE
+_fabs = fabs NOSIGFE
+_fabsf = fabsf NOSIGFE
+_facl = facl SIGFE
+_facl32 = facl32 SIGFE
+_fchdir = fchdir SIGFE
+_fchmod = fchmod SIGFE
+_fchown = fchown SIGFE
+_fchown32 = fchown32 SIGFE
+_fclose = fclose SIGFE
+_fcloseall = fcloseall SIGFE
+_fcloseall_r SIGFE
+_fcntl = fcntl SIGFE
+_fcntl64 = fcntl64 SIGFE
+_fcvt = fcvt SIGFE
+_fcvtbuf = fcvtbuf SIGFE
+_fcvtf = fcvtf SIGFE
+_fdopen = fdopen SIGFE
+_fdopen64 = fdopen64 SIGFE
+_feof = feof SIGFE
+_ferror = ferror SIGFE
+_fflush = fflush SIGFE
+_ffs = ffs NOSIGFE
+_fgetc = fgetc SIGFE
+_fgetpos = fgetpos SIGFE
+_fgetpos64 = fgetpos64 SIGFE
+_fgets = fgets SIGFE
+_fileno = fileno SIGFE
+_finite = finite NOSIGFE
+_finitef = finitef NOSIGFE
+_fiprintf = fiprintf SIGFE
+_floor = floor NOSIGFE
+_floorf = floorf NOSIGFE
+_fmod = fmod NOSIGFE
+_fmodf = fmodf NOSIGFE
+_fnmatch = fnmatch NOSIGFE
+_fopen = fopen SIGFE
+_fopen64 = fopen64 SIGFE
+_fork = fork SIGFE
+_fprintf = fprintf SIGFE
+_fputc = fputc SIGFE
+_fputs = fputs SIGFE
+_fread = fread SIGFE
+_free = free SIGFE
+_freopen = freopen SIGFE
+_freopen64 = freopen64 SIGFE
+_frexp = frexp NOSIGFE
+_frexpf = frexpf NOSIGFE
+_fscanf = fscanf SIGFE
+_fseek = fseek SIGFE
+_fseeko = fseeko SIGFE
+_fseeko64 = fseeko64 SIGFE
+_fsetpos = fsetpos SIGFE
+_fsetpos64 = fsetpos64 SIGFE
+_fstat = fstat SIGFE
+_fstat64 = fstat64 SIGFE
+_fstatfs = fstatfs SIGFE
+_fsync = fsync SIGFE
+_ftell = ftell SIGFE
+_ftello = ftello SIGFE
+_ftello64 = ftello64 SIGFE
+_ftime = ftime SIGFE
+_ftok = ftok SIGFE
+_ftruncate = ftruncate SIGFE
+_ftruncate64 = ftruncate64 SIGFE
+_fwrite = fwrite SIGFE
+_gamma = gamma NOSIGFE
+_gamma_r = gamma_r NOSIGFE
+_gammaf = gammaf NOSIGFE
+_gammaf_r = gammaf_r NOSIGFE
+_gcvt = gcvt SIGFE
+_gcvtf = gcvtf SIGFE
+_getc = getc SIGFE
+_getc_unlocked = getc_unlocked SIGFE
+_getchar = getchar SIGFE
+_getchar_unlocked = getchar_unlocked SIGFE
+_getcwd = getcwd SIGFE
+_getdomainname = getdomainname SIGFE
+_getdtablesize = getdtablesize NOSIGFE
+_getegid = getegid NOSIGFE
+_getegid32 = getegid32 NOSIGFE
+_getenv = getenv NOSIGFE
+_geteuid = geteuid NOSIGFE
+_geteuid32 = geteuid32 NOSIGFE
+_getgid = getgid NOSIGFE
+_getgid32 = getgid32 NOSIGFE
+_getgrent = getgrent SIGFE
+_getgrent32 = getgrent32 SIGFE
+_getgrgid = getgrgid SIGFE
+_getgrgid32 = getgrgid32 SIGFE
+_getgrnam = getgrnam SIGFE
+_getgrnam32 = getgrnam32 SIGFE
+_getgroups = getgroups SIGFE
+_getgroups32 = getgroups32 SIGFE
+_gethostname = cygwin_gethostname SIGFE
+_getlogin = getlogin NOSIGFE
+_getmntent = getmntent SIGFE
+_getmode = getmode SIGFE
+_getpagesize = getpagesize SIGFE
+_getpass = getpass SIGFE
+_getpgrp = getpgrp SIGFE
+_getpid = getpid NOSIGFE
+_getppid = getppid NOSIGFE
+_getpwduid = getpwduid NOSIGFE
+_getpwent = getpwent SIGFE
+_getpwnam = getpwnam SIGFE
+_getpwuid = getpwuid SIGFE
+_getpwuid32 = getpwuid32 SIGFE
+_getpwuid_r32 = getpwuid_r32 SIGFE
+_getrlimit = getrlimit SIGFE
+_getrusage = getrusage SIGFE
+_gets = gets SIGFE
+_gettimeofday = gettimeofday SIGFE
+_getuid = getuid NOSIGFE
+_getuid32 = getuid32 NOSIGFE
+_getutent = getutent SIGFE
+_getutid = getutid SIGFE
+_getw = getw SIGFE
+_getwd = getwd SIGFE
+_gmtime = gmtime SIGFE
+_gmtime_r = gmtime_r SIGFE
+_htonl = htonl NOSIGFE
+_htons = htons NOSIGFE
+_hypot = hypot NOSIGFE
+_hypotf = hypotf NOSIGFE
+_ilogb = ilogb NOSIGFE
+_ilogbf = ilogbf NOSIGFE
+_index = index NOSIGFE
+_infinity = infinity NOSIGFE
+_infinityf = infinityf NOSIGFE
+_initgroups32 = initgroups32 SIGFE
+_ioctl = ioctl SIGFE
+_iprintf = iprintf SIGFE
+_isalnum = isalnum NOSIGFE
+_isalpha = isalpha NOSIGFE
+_isascii = isascii NOSIGFE
+_isatty = isatty SIGFE
+_iscntrl = iscntrl NOSIGFE
+_isdigit = isdigit NOSIGFE
+_isgraph = isgraph NOSIGFE
+_isinf = isinf NOSIGFE
+_isinff = isinff NOSIGFE
+_islower = islower NOSIGFE
+_isnan = isnan NOSIGFE
+_isnanf = isnanf NOSIGFE
+_isprint = isprint NOSIGFE
+_ispunct = ispunct NOSIGFE
+_isspace = isspace NOSIGFE
+_isupper = isupper NOSIGFE
+_isxdigit = isxdigit NOSIGFE
+_j0 = j0 NOSIGFE
+_j0f = j0f NOSIGFE
+_j1 = j1 NOSIGFE
+_j1f = j1f NOSIGFE
+_jn = jn NOSIGFE
+_jnf = jnf NOSIGFE
+_jrand48 = jrand48 NOSIGFE
+_kill = kill SIGFE
+_labs = labs NOSIGFE
+_lacl = lacl SIGFE
+_lchown = lchown SIGFE
+_lchown32 = lchown32 SIGFE
+_lcong48 = lcong48 NOSIGFE
+_ldexp = ldexp NOSIGFE
+_ldexpf = ldexpf NOSIGFE
+_ldiv = ldiv NOSIGFE
+_lgamma = lgamma NOSIGFE
+_lgamma_r = lgamma_r NOSIGFE
+_lgammaf = lgammaf NOSIGFE
+_lgammaf_r = lgammaf_r NOSIGFE
+_link = link SIGFE
+_localeconv = localeconv NOSIGFE
+_localtime = localtime SIGFE
+_localtime_r = localtime_r SIGFE
+_log = log NOSIGFE
+_log10 = log10 NOSIGFE
+_log10f = log10f NOSIGFE
+_log1p = log1p NOSIGFE
+_log1pf = log1pf NOSIGFE
+_logb = logb NOSIGFE
+_logbf = logbf NOSIGFE
+_logf = logf NOSIGFE
+_lrand48 = lrand48 NOSIGFE
+_lseek = lseek SIGFE
+_lseek64 = lseek64 SIGFE
+_lstat = lstat SIGFE
+_lstat64 = lstat64 SIGFE
+_malloc = malloc SIGFE
+_matherr = matherr NOSIGFE
+_mblen = mblen NOSIGFE
+_mbstowcs = mbstowcs NOSIGFE
+_mbtowc = mbtowc NOSIGFE
+_memccpy = memccpy NOSIGFE
+_memchr = memchr NOSIGFE
+_memcmp = memcmp NOSIGFE
+_memcpy = memcpy NOSIGFE
+_memmove = memmove NOSIGFE
+_memset = memset NOSIGFE
+_mkdir = mkdir SIGFE
+_mknod = mknod SIGFE
+_mknod32 = mknod32 SIGFE
+_mkstemp = mkstemp SIGFE
+_mktemp = mktemp SIGFE
+_mktime = mktime SIGFE
+_mmap64 = mmap64 SIGFE
+_modf = modf NOSIGFE
+_modff = modff NOSIGFE
+_mount = mount SIGFE
+_nan = nan NOSIGFE
+_nanf = nanf NOSIGFE
+_nanosleep = nanosleep SIGFE
+_nextafter = nextafter NOSIGFE
+_nextafterf = nextafterf NOSIGFE
+_nice = nice SIGFE
+_nl_langinfo = nl_langinfo SIGFE
+_nrand48 = nrand48 NOSIGFE
+_ntohl = ntohl NOSIGFE
+_ntohs = ntohs NOSIGFE
+_open = open SIGFE
+_open64
+_openlog = openlog SIGFE
+_pathconf = pathconf SIGFE
+_pclose = pclose SIGFE
+_perror = perror SIGFE
+_poll = poll SIGFE
+_popen = popen SIGFE
+_pow = pow NOSIGFE
+_powf = powf NOSIGFE
+_printf = printf SIGFE
+_putc = putc SIGFE
+_putc_unlocked = putc_unlocked SIGFE
+_putchar = putchar SIGFE
+_putchar_unlocked = putchar_unlocked SIGFE
+_putenv = putenv SIGFE
+_puts = puts SIGFE
+_pututline = pututline SIGFE
+_putw = putw SIGFE
+_qsort = qsort NOSIGFE
+_raise = raise SIGFE
+_rand = rand NOSIGFE
+_read = read SIGFE
+_readdir = readdir SIGFE
+_readlink = readlink SIGFE
+_readv = readv SIGFE
+_realloc = realloc SIGFE
+_remainder = remainder NOSIGFE
+_remainderf = remainderf NOSIGFE
+_remove = remove SIGFE
+_rename = rename SIGFE
+_rewind = rewind SIGFE
+_rewinddir = rewinddir SIGFE
+_rindex = rindex NOSIGFE
+_rmdir = rmdir SIGFE
+_sbrk = sbrk SIGFE
+_scalb = scalb NOSIGFE
+_scalbf = scalbf NOSIGFE
+_scalbn = scalbn NOSIGFE
+_scalbnf = scalbnf NOSIGFE
+_scandir = scandir SIGFE
+_scanf = scanf SIGFE
+_scanf_r SIGFE
+_seed48 = seed48 NOSIGFE
+_seekdir = seekdir SIGFE
+_seekdir64 = seekdir64 SIGFE
+_select = cygwin_select SIGFE
+_setbuf = setbuf SIGFE
+_setdtablesize = setdtablesize SIGFE
+_setegid = setegid SIGFE
+_setegid32 = setegid32 SIGFE
+_setenv = setenv SIGFE
+_seteuid = seteuid SIGFE
+_seteuid32 = seteuid32 SIGFE
+_setgid = setgid SIGFE
+_setgid32 = setgid32 SIGFE
+_setgrent = setgrent NOSIGFE
+_setgroups = setgroups SIGFE
+_setgroups32 = setgroups32 SIGFE
+_setlocale = setlocale NOSIGFE
+_setmntent = setmntent SIGFE
+_setpassent = setpassent NOSIGFE
+_setpgid = setpgid SIGFE
+_setpgrp = setpgrp SIGFE
+_setpwent = setpwent NOSIGFE
+_setregid = setregid SIGFE
+_setregid32 = setregid32 SIGFE
+_setreuid = setreuid SIGFE
+_setreuid32 = setreuid32 SIGFE
+_setrlimit = setrlimit SIGFE
+_setsid = setsid SIGFE
+_settimeofday = settimeofday SIGFE
+_setuid = setuid SIGFE
+_setuid32 = setuid32 SIGFE
+_setutent = setutent SIGFE
+_setvbuf = setvbuf SIGFE
+_sin = sin NOSIGFE
+_sinf = sinf NOSIGFE
+_sinh = sinh NOSIGFE
+_sinhf = sinhf NOSIGFE
+_siprintf = siprintf SIGFE
+_sleep = sleep SIGFE
+_snprintf = snprintf SIGFE
+_spawnl = spawnl SIGFE
+_spawnle = spawnle SIGFE
+_spawnlp = spawnlp SIGFE
+_spawnlpe = spawnlpe SIGFE
+_spawnv = spawnv SIGFE
+_spawnve = spawnve SIGFE
+_spawnvp = spawnvp SIGFE
+_spawnvpe = spawnvpe SIGFE
+_sprintf = sprintf SIGFE
+_sqrt = sqrt NOSIGFE
+_sqrtf = sqrtf NOSIGFE
+_srand = srand NOSIGFE
+_srand48 = srand48 NOSIGFE
+_sscanf = sscanf SIGFE
+_sscanf_r SIGFE
+_stat = stat SIGFE
+_stat64 = stat64 SIGFE
+_statfs = statfs SIGFE
+_strcasecmp = strcasecmp NOSIGFE
+_strcat = strcat NOSIGFE
+_strchr = strchr NOSIGFE
+_strcmp = strcmp NOSIGFE
+_strcoll = strcoll NOSIGFE
+_strcpy = strcpy NOSIGFE
+_strcspn = strcspn NOSIGFE
+_strdup = strdup SIGFE
+_strerror = strerror SIGFE
+_strerror_r = strerror_r SIGFE
+_strftime = strftime SIGFE
+_strlcat = strlcat NOSIGFE
+_strlcpy = strlcpy NOSIGFE
+_strlen = strlen NOSIGFE
+_strlwr = strlwr NOSIGFE
+_strncasecmp = strncasecmp NOSIGFE
+_strncat = strncat NOSIGFE
+_strncmp = strncmp NOSIGFE
+_strncpy = strncpy NOSIGFE
+_strpbrk = strpbrk NOSIGFE
+_strptime = strptime SIGFE
+_strrchr = strrchr NOSIGFE
+_strsep = strsep NOSIGFE
+_strspn = strspn NOSIGFE
+_strstr = strstr NOSIGFE
+_strtod = strtod SIGFE
+_strtodf = strtof SIGFE
+_strtok = strtok NOSIGFE
+_strtok_r = strtok_r NOSIGFE
+_strtol = strtol NOSIGFE
+_strtoll = strtoll NOSIGFE
+_strtoul = strtoul NOSIGFE
+_strtoull = strtoull NOSIGFE
+_strupr = strupr NOSIGFE
+_strxfrm = strxfrm NOSIGFE
+_swab = swab NOSIGFE
+_symlink = symlink SIGFE
+_sysconf = sysconf SIGFE
+_syslog = syslog SIGFE
+_system = system SIGFE
+_tan = tan NOSIGFE
+_tanf = tanf NOSIGFE
+_tanh = tanh NOSIGFE
+_tanhf = tanhf NOSIGFE
+_telldir = telldir SIGFE
+_telldir64 = telldir64 SIGFE
+_tempnam = tempnam SIGFE
+_time = time SIGFE
+_times = times SIGFE
+_tmpfile = tmpfile SIGFE
+_tmpfile64 = tmpfile64 SIGFE
+_tmpnam = tmpnam SIGFE
+_toascii = toascii NOSIGFE
+_tolower = tolower NOSIGFE
+_toupper = toupper NOSIGFE
+_truncate = truncate SIGFE
+_truncate64 = truncate64 SIGFE
+_ttyname = ttyname SIGFE
+_tzset = tzset SIGFE
+_ualarm = ualarm SIGFE
+_umask = umask NOSIGFE
+_umount = umount SIGFE
+_uname = uname SIGFE
+_ungetc = ungetc SIGFE
+_unlink = unlink SIGFE
+_unsetenv = unsetenv SIGFE
+_usleep = usleep SIGFE
+_utime = utime SIGFE
+_utimes = utimes SIGFE
+_utmpname = utmpname SIGFE
+_vasprintf = vasprintf SIGFE
+_vasprintf_r SIGFE
+_vfiprintf = vfiprintf SIGFE
+_vfork = vfork SIGFE
+_vfprintf = vfprintf SIGFE
+_vfscanf = vfscanf SIGFE
+_vfscanf_r SIGFE
+_vhangup = vhangup SIGFE
+_vprintf = vprintf SIGFE
+_vscanf = vscanf SIGFE
+_vscanf_r SIGFE
+_vsnprintf = vsnprintf SIGFE
+_vsprintf = vsprintf SIGFE
+_vsscanf = vsscanf SIGFE
+_vsscanf_r SIGFE
+_wait = wait SIGFE
+_waitpid = waitpid SIGFE
+_wcscmp = wcscmp NOSIGFE
+_wcslen = wcslen NOSIGFE
+_wcstombs = wcstombs NOSIGFE
+_wctomb = wctomb NOSIGFE
+_write = write SIGFE
+_writev = writev SIGFE
+asprintf_r = _asprintf_r SIGFE
+cygwin32_attach_handle_to_fd = cygwin_attach_handle_to_fd SIGFE
+cygwin32_conv_to_full_posix_path = cygwin_conv_to_full_posix_path SIGFE
+cygwin32_conv_to_full_win32_path = cygwin_conv_to_full_win32_path SIGFE
+cygwin32_conv_to_posix_path = cygwin_conv_to_posix_path SIGFE
+cygwin32_conv_to_win32_path = cygwin_conv_to_win32_path SIGFE
+cygwin32_detach_dll = cygwin_detach_dll SIGFE_MAYBE
+cygwin32_internal = cygwin_internal SIGFE
+cygwin32_posix_path_list_p = cygwin_posix_path_list_p NOSIGFE
+cygwin32_posix_to_win32_path_list = cygwin_posix_to_win32_path_list SIGFE
+cygwin32_posix_to_win32_path_list_buf_size = cygwin_posix_to_win32_path_list_buf_size SIGFE
+cygwin32_split_path = cygwin_split_path NOSIGFE
+cygwin32_win32_to_posix_path_list = cygwin_win32_to_posix_path_list SIGFE
+cygwin32_win32_to_posix_path_list_buf_size = cygwin_win32_to_posix_path_list_buf_size SIGFE
+cygwin32_winpid_to_pid = cygwin_winpid_to_pid SIGFE
+cygwin_conv_to_full_posix_path SIGFE
+cygwin_conv_to_full_win32_path SIGFE
+cygwin_conv_to_posix_path SIGFE
+cygwin_conv_to_win32_path SIGFE
+cygwin_posix_to_win32_path_list SIGFE
+cygwin_posix_to_win32_path_list_buf_size SIGFE
+cygwin_win32_to_posix_path_list SIGFE
+cygwin_win32_to_posix_path_list_buf_size SIGFE
+dll_entry@12 NOSIGFE
+dll_noncygwin_dllcrt0 NOSIGFE
+fcloseall_r = _fcloseall_r SIGFE
+fscanf_r = _fscanf_r SIGFE
+get_osfhandle = _get_osfhandle SIGFE
+getpwduid NOSIGFE
+lacl SIGFE
+llrint = _f_llrint NOSIGFE
+llrintf = _f_llrintf NOSIGFE
+llrintl = _f_llrintl NOSIGFE
+lrint = _f_lrint NOSIGFE
+lrintf = _f_lrintf NOSIGFE
+lrintl = _f_lrintl NOSIGFE
+posix_regcomp = regcomp SIGFE
+posix_regerror = regerror SIGFE
+posix_regexec = regexec SIGFE
+posix_regfree = regfree SIGFE
+rint = _f_rint NOSIGFE
+rintf = _f_rintf NOSIGFE
+rintl = _f_rintl NOSIGFE
+scanf_r = _scanf_r SIGFE
+setmode = cygwin_setmode SIGFE
+setregid32 SIGFE
+setreuid32 SIGFE
+sexecl = sexecve_is_bad SIGFE
+sexecle = sexecve_is_bad SIGFE
+sexeclp = sexecve_is_bad SIGFE
+sexeclpe = sexecve_is_bad SIGFE
+sexecp = sexecve_is_bad SIGFE
+sexecv = sexecve_is_bad SIGFE
+sexecve = sexecve_is_bad SIGFE
+sexecvpe = sexecve_is_bad SIGFE
+sscanf_r = _sscanf_r SIGFE
+strtodf = strtof SIGFE
+vasprintf_r = _vasprintf_r SIGFE
+vfscanf_r = _vfscanf_r SIGFE
+vscanf_r = _vscanf_r SIGFE
+vsscanf_r = _vsscanf_r SIGFE
diff --git a/winsup/cygwin/include/a.out.h b/winsup/cygwin/include/a.out.h
index 1ccc3f425..ad9b5a56f 100644
--- a/winsup/cygwin/include/a.out.h
+++ b/winsup/cygwin/include/a.out.h
@@ -1,6 +1,6 @@
/* a.out.h
- Copyright 1997, 1998, 1999, 2000, 2001 Red Hat, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2001, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,22 +14,25 @@ details. */
#ifdef __cplusplus
extern "C" {
#endif
+
+#include <stdint.h>
+
#define COFF_IMAGE_WITH_PE
#define COFF_LONG_SECTION_NAMES
-/*** coff information for Intel 386/486. */
+/*** coff information for Intel 386/486 and AMD64. */
/********************** FILE HEADER **********************/
struct external_filehdr {
- short f_magic; /* magic number */
- short f_nscns; /* number of sections */
- unsigned long f_timdat; /* time & date stamp */
- unsigned long f_symptr; /* file pointer to symtab */
- unsigned long f_nsyms; /* number of symtab entries */
- short f_opthdr; /* sizeof(optional hdr) */
- short f_flags; /* flags */
+ uint16_t f_magic; /* magic number */
+ uint16_t f_nscns; /* number of sections */
+ uint32_t f_timdat; /* time & date stamp */
+ uint32_t f_symptr; /* file pointer to symtab */
+ uint32_t f_nsyms; /* number of symtab entries */
+ uint16_t f_opthdr; /* sizeof(optional hdr) */
+ uint16_t f_flags; /* flags */
};
/* Bits for f_flags:
@@ -50,6 +53,7 @@ struct external_filehdr {
#define I386MAGIC 0x14c
#define I386PTXMAGIC 0x154
#define I386AIXMAGIC 0x175
+#define AMD64MAGIC 0x8664
/* This is Lynx's all-platform magic number for executables. */
@@ -70,14 +74,14 @@ struct external_filehdr {
typedef struct
{
- unsigned short magic; /* type of file */
- unsigned short vstamp; /* version stamp */
- unsigned long tsize; /* text size in bytes, padded to FW bdry*/
- unsigned long dsize; /* initialized data " " */
- unsigned long bsize; /* uninitialized data " " */
- unsigned long entry; /* entry pt. */
- unsigned long text_start; /* base of text used for this file */
- unsigned long data_start; /* base of data used for this file=
+ uint16_t magic; /* type of file */
+ uint16_t vstamp; /* version stamp */
+ uint32_t tsize; /* text size in bytes, padded to FW bdry*/
+ uint32_t dsize; /* initialized data " " */
+ uint32_t bsize; /* uninitialized data " " */
+ uint32_t entry; /* entry pt. */
+ uint32_t text_start; /* base of text used for this file */
+ uint32_t data_start; /* base of data used for this file=
*/
}
AOUTHDR;
@@ -103,16 +107,16 @@ AOUTHDR;
struct external_scnhdr {
char s_name[8]; /* section name */
- unsigned long s_paddr; /* physical address, offset
+ uint32_t s_paddr; /* physical address, offset
of last addr in scn */
- unsigned long s_vaddr; /* virtual address */
- unsigned long s_size; /* section size */
- unsigned long s_scnptr; /* file ptr to raw data for section */
- unsigned long s_relptr; /* file ptr to relocation */
- unsigned long s_lnnoptr; /* file ptr to line numbers */
- unsigned short s_nreloc; /* number of relocation entries */
- unsigned short s_nlnno; /* number of line number entries*/
- unsigned long s_flags; /* flags */
+ uint32_t s_vaddr; /* virtual address */
+ uint32_t s_size; /* section size */
+ uint32_t s_scnptr; /* file ptr to raw data for section */
+ uint32_t s_relptr; /* file ptr to relocation */
+ uint32_t s_lnnoptr; /* file ptr to line numbers */
+ uint16_t s_nreloc; /* number of relocation entries */
+ uint16_t s_nlnno; /* number of line number entries*/
+ uint32_t s_flags; /* flags */
};
#define SCNHDR struct external_scnhdr
@@ -136,10 +140,10 @@ struct external_scnhdr {
*/
struct external_lineno {
union {
- unsigned long l_symndx; /* function name symbol index, iff l_lnno 0 */
- unsigned long l_paddr; /* (physical) address of line number */
+ uint32_t l_symndx; /* function name symbol index, iff l_lnno 0 */
+ uint32_t l_paddr; /* (physical) address of line number */
} l_addr;
- unsigned short l_lnno; /* line number */
+ uint16_t l_lnno; /* line number */
};
#define LINENO struct external_lineno
@@ -156,13 +160,13 @@ struct external_syment
union {
char e_name[E_SYMNMLEN];
struct {
- unsigned long e_zeroes;
- unsigned long e_offset;
+ uint32_t e_zeroes;
+ uint32_t e_offset;
} e;
} e;
- unsigned long e_value;
- unsigned short e_scnum;
- unsigned short e_type;
+ uint32_t e_value;
+ uint16_t e_scnum;
+ uint16_t e_type;
char e_sclass[1];
char e_numaux[1];
};
@@ -174,46 +178,46 @@ struct external_syment
union external_auxent {
struct {
- unsigned long x_tagndx; /* str, un, or enum tag indx */
+ uint32_t x_tagndx; /* str, un, or enum tag indx */
union {
struct {
- unsigned short x_lnno; /* declaration line number */
- unsigned short x_size; /* str/union/array size */
+ uint16_t x_lnno; /* declaration line number */
+ uint16_t x_size; /* str/union/array size */
} x_lnsz;
- unsigned long x_fsize; /* size of function */
+ uint32_t x_fsize; /* size of function */
} x_misc;
union {
struct { /* if ISFCN, tag, or .bb */
- unsigned long x_lnnoptr;/* ptr to fcn line # */
- unsigned long x_endndx; /* entry ndx past block end */
+ uint32_t x_lnnoptr; /* ptr to fcn line # */
+ uint32_t x_endndx; /* entry ndx past block end */
} x_fcn;
struct { /* if ISARY, up to 4 dimen. */
char x_dimen[E_DIMNUM][2];
} x_ary;
} x_fcnary;
- unsigned short x_tvndx; /* tv index */
+ uint16_t x_tvndx; /* tv index */
} x_sym;
union {
char x_fname[E_FILNMLEN];
struct {
- unsigned long x_zeroes;
- unsigned long x_offset;
+ uint32_t x_zeroes;
+ uint32_t x_offset;
} x_n;
} x_file;
struct {
- unsigned long x_scnlen; /* section length */
- unsigned short x_nreloc; /* # relocation entries */
- unsigned short x_nlinno; /* # line numbers */
- unsigned long x_checksum; /* section COMDAT checksum */
- unsigned short x_associated;/* COMDAT associated section index */
+ uint32_t x_scnlen; /* section length */
+ uint16_t x_nreloc; /* # relocation entries */
+ uint16_t x_nlinno; /* # line numbers */
+ uint32_t x_checksum; /* section COMDAT checksum */
+ uint16_t x_associated; /* COMDAT associated section index */
char x_comdat[1]; /* COMDAT selection number */
} x_scn;
struct {
- unsigned long x_tvfill; /* tv fill value */
- unsigned short x_tvlen; /* length of .tv */
+ uint32_t x_tvfill; /* tv fill value */
+ uint16_t x_tvlen; /* length of .tv */
char x_tvran[2][2]; /* tv range */
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
@@ -244,6 +248,20 @@ struct external_reloc {
#ifndef _PE_H
#define _PE_H
+#define IMAGE_FILE_MACHINE_I386 0x014c
+#define IMAGE_FILE_MACHINE_AMD64 0x8664
+
+#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
+#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
+
+#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
+#define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER 224
+#define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 240
+
+#define IMAGE_SUBSYSTEM_NATIVE 1
+#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2
+#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
+
/* NT specific file attributes */
#define IMAGE_FILE_RELOCS_STRIPPED 0x0001
#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002
@@ -320,43 +338,43 @@ struct external_reloc {
#ifdef COFF_IMAGE_WITH_PE
-/* The filehdr is only weired in images */
+/* The filehdr is only weird in images */
#undef FILHDR
struct external_PE_filehdr
{
/* DOS header fields */
- unsigned short e_magic; /* Magic number, 0x5a4d */
- unsigned short e_cblp; /* Bytes on last page of file, 0x90 */
- unsigned short e_cp; /* Pages in file, 0x3 */
- unsigned short e_crlc; /* Relocations, 0x0 */
- unsigned short e_cparhdr; /* Size of header in paragraphs, 0x4 */
- unsigned short e_minalloc; /* Minimum extra paragraphs needed, 0x0 */
- unsigned short e_maxalloc; /* Maximum extra paragraphs needed, 0xFFFF */
- unsigned short e_ss; /* Initial (relative) SS value, 0x0 */
- unsigned short e_sp; /* Initial SP value, 0xb8 */
- unsigned short e_csum; /* Checksum, 0x0 */
- unsigned short e_ip; /* Initial IP value, 0x0 */
- unsigned short e_cs; /* Initial (relative) CS value, 0x0 */
- unsigned short e_lfarlc; /* File address of relocation table, 0x40 */
- unsigned short e_ovno; /* Overlay number, 0x0 */
- char e_res[4][2]; /* Reserved words, all 0x0 */
- unsigned short e_oemid; /* OEM identifier (for e_oeminfo), 0x0 */
- unsigned short e_oeminfo; /* OEM information; e_oemid specific, 0x0 */
- char e_res2[10][2]; /* Reserved words, all 0x0 */
- unsigned long e_lfanew; /* File address of new exe header, 0x80 */
+ uint16_t e_magic; /* Magic number, 0x5a4d */
+ uint16_t e_cblp; /* Bytes on last page of file, 0x90 */
+ uint16_t e_cp; /* Pages in file, 0x3 */
+ uint16_t e_crlc; /* Relocations, 0x0 */
+ uint16_t e_cparhdr; /* Size of header in paragraphs, 0x4 */
+ uint16_t e_minalloc; /* Minimum extra paragraphs needed, 0x0 */
+ uint16_t e_maxalloc; /* Maximum extra paragraphs needed, 0xFFFF */
+ uint16_t e_ss; /* Initial (relative) SS value, 0x0 */
+ uint16_t e_sp; /* Initial SP value, 0xb8 */
+ uint16_t e_csum; /* Checksum, 0x0 */
+ uint16_t e_ip; /* Initial IP value, 0x0 */
+ uint16_t e_cs; /* Initial (relative) CS value, 0x0 */
+ uint16_t e_lfarlc; /* File address of relocation table, 0x40 */
+ uint16_t e_ovno; /* Overlay number, 0x0 */
+ char e_res[4][2]; /* Reserved words, all 0x0 */
+ uint16_t e_oemid; /* OEM identifier (for e_oeminfo), 0x0 */
+ uint16_t e_oeminfo; /* OEM information; e_oemid specific, 0x0 */
+ char e_res2[10][2]; /* Reserved words, all 0x0 */
+ uint32_t e_lfanew; /* File address of new exe header, 0x80 */
char dos_message[16][4]; /* other stuff, always follow DOS header */
- unsigned int nt_signature; /* required NT signature, 0x4550 */
+ uint32_t nt_signature; /* required NT signature, 0x4550 */
/* From standard header */
- unsigned short f_magic; /* magic number */
- unsigned short f_nscns; /* number of sections */
- unsigned long f_timdat; /* time & date stamp */
- unsigned long f_symptr; /* file pointer to symtab */
- unsigned long f_nsyms; /* number of symtab entries */
- unsigned short f_opthdr; /* sizeof(optional hdr) */
- unsigned short f_flags; /* flags */
+ uint16_t f_magic; /* magic number */
+ uint16_t f_nscns; /* number of sections */
+ uint32_t f_timdat; /* time & date stamp */
+ uint32_t f_symptr; /* file pointer to symtab */
+ uint32_t f_nsyms; /* number of symtab entries */
+ uint16_t f_opthdr; /* sizeof(optional hdr) */
+ uint16_t f_flags; /* flags */
};
@@ -368,37 +386,39 @@ struct external_PE_filehdr
typedef struct
{
- unsigned short magic; /* type of file */
- unsigned short vstamp; /* version stamp */
- unsigned long tsize; /* text size in bytes, padded to FW bdry*/
- unsigned long dsize; /* initialized data " " */
- unsigned long bsize; /* uninitialized data " " */
- unsigned long entry; /* entry pt. */
- unsigned long text_start; /* base of text used for this file */
- unsigned long data_start; /* base of all data used for this file */
+ uint16_t magic; /* type of file */
+ uint16_t vstamp; /* version stamp */
+ uint32_t tsize; /* text size in bytes, padded to FW bdry*/
+ uint32_t dsize; /* initialized data " " */
+ uint32_t bsize; /* uninitialized data " " */
+ uint32_t entry; /* entry pt. */
+ uint32_t text_start; /* base of text used for this file */
+#ifndef __x86_64__
+ uint32_t data_start; /* base of all data used for this file */
+#endif
/* NT extra fields; see internal.h for descriptions */
- unsigned long ImageBase;
- unsigned long SectionAlignment;
- unsigned long FileAlignment;
- unsigned short MajorOperatingSystemVersion;
- unsigned short MinorOperatingSystemVersion;
- unsigned short MajorImageVersion;
- unsigned short MinorImageVersion;
- unsigned short MajorSubsystemVersion;
- unsigned short MinorSubsystemVersion;
+ uintptr_t ImageBase;
+ uint32_t SectionAlignment;
+ uint32_t FileAlignment;
+ uint16_t MajorOperatingSystemVersion;
+ uint16_t MinorOperatingSystemVersion;
+ uint16_t MajorImageVersion;
+ uint16_t MinorImageVersion;
+ uint16_t MajorSubsystemVersion;
+ uint16_t MinorSubsystemVersion;
char Reserved1[4];
- unsigned long SizeOfImage;
- unsigned long SizeOfHeaders;
- unsigned long CheckSum;
- unsigned short Subsystem;
- unsigned short DllCharacteristics;
- unsigned long SizeOfStackReserve;
- unsigned long SizeOfStackCommit;
- unsigned long SizeOfHeapReserve;
- unsigned long SizeOfHeapCommit;
- unsigned long LoaderFlags;
- unsigned long NumberOfRvaAndSizes;
+ uint32_t SizeOfImage;
+ uint32_t SizeOfHeaders;
+ uint32_t CheckSum;
+ uint16_t Subsystem;
+ uint16_t DllCharacteristics;
+ uintptr_t SizeOfStackReserve;
+ uintptr_t SizeOfStackCommit;
+ uintptr_t SizeOfHeapReserve;
+ uintptr_t SizeOfHeapCommit;
+ uint32_t LoaderFlags;
+ uint32_t NumberOfRvaAndSizes;
/* IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; */
char DataDirectory[16][2][4]; /* 16 entries, 2 elements/entry, 4 chars */
@@ -406,7 +426,11 @@ typedef struct
#undef AOUTSZ
+#ifdef __x86_64__
+#define AOUTSZ (AOUTHDRSZ + 212)
+#else
#define AOUTSZ (AOUTHDRSZ + 196)
+#endif
#undef E_FILNMLEN
#define E_FILNMLEN 18 /* # characters in a file name */
diff --git a/winsup/cygwin/include/asm/byteorder.h b/winsup/cygwin/include/asm/byteorder.h
index 4887016ac..4f5d7cb59 100644
--- a/winsup/cygwin/include/asm/byteorder.h
+++ b/winsup/cygwin/include/asm/byteorder.h
@@ -1,6 +1,6 @@
/* asm/byteorder.h
- Copyright 1996, 1998, 2000, 2001, 2006, 2009, 2011 Red Hat, Inc.
+ Copyright 1996, 1998, 2001, 2006, 2009, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -34,11 +34,7 @@ _ELIDABLE_INLINE uint16_t __ntohs(uint16_t);
_ELIDABLE_INLINE uint32_t
__ntohl(uint32_t x)
{
- __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
- "rorl $16,%0\n\t" /* swap words */
- "xchgb %b0,%h0" /* swap higher bytes */
- :"=q" (x)
- : "0" (x));
+ __asm__("bswap %0" : "=r" (x) : "0" (x));
return x;
}
@@ -52,7 +48,7 @@ _ELIDABLE_INLINE uint16_t
__ntohs(uint16_t x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */
- : "=q" (x)
+ : "=Q" (x)
: "0" (x));
return x;
}
diff --git a/winsup/cygwin/include/bits/wordsize.h b/winsup/cygwin/include/bits/wordsize.h
index 38e14f85f..b0ee337f8 100644
--- a/winsup/cygwin/include/bits/wordsize.h
+++ b/winsup/cygwin/include/bits/wordsize.h
@@ -2,5 +2,10 @@
#ifndef _WORDSIZE_H
#define _WORDSIZE_H 1
-#define __WORDSIZE 32
+#ifdef __x86_64__
+# define __WORDSIZE 64
+# define __WORDSIZE_COMPAT32 1
+#else
+# define __WORDSIZE 32
+#endif
#endif /*_WORDSIZE_H*/
diff --git a/winsup/cygwin/include/cygwin/acl.h b/winsup/cygwin/include/cygwin/acl.h
index 6083b5332..9a62e325e 100644
--- a/winsup/cygwin/include/cygwin/acl.h
+++ b/winsup/cygwin/include/cygwin/acl.h
@@ -59,24 +59,20 @@ extern "C" {
#define OTHER OTHER_OBJ
#ifdef __INSIDE_CYGWIN__
+#ifndef __x86_64__
typedef struct __acl16 {
int a_type;
__uid16_t a_id;
mode_t a_perm;
} __aclent16_t;
+#endif
+#endif
-typedef struct __acl32 {
- int a_type;
- __uid32_t a_id;
- mode_t a_perm;
-} __aclent32_t;
-#else
typedef struct acl {
int a_type; /* entry type */
uid_t a_id; /* UID | GID */
mode_t a_perm; /* permissions */
} aclent_t;
-#endif
#ifndef __INSIDE_CYGWIN__
int _EXFUN(acl,(const char *path, int cmd, int nentries, aclent_t *aclbufp));
diff --git a/winsup/cygwin/include/cygwin/config.h b/winsup/cygwin/include/cygwin/config.h
index f330ca4ab..cd73388d5 100644
--- a/winsup/cygwin/include/cygwin/config.h
+++ b/winsup/cygwin/include/cygwin/config.h
@@ -4,7 +4,7 @@
sys/config.h before. This way we can manaage our configuration
setting without bothering newlib.
- Copyright 2003, 2007, 2008, 2009, 2010, 2012 Red Hat, Inc.
+ Copyright 2003, 2007, 2008, 2009, 2010, 2012, 2013 Red Hat, Inc.
Written by C. Vinschen.
This file is part of Cygwin.
@@ -38,11 +38,31 @@ extern "C" {
we might as well just use it here. */
#ifdef _COMPILING_NEWLIB
+#ifdef __x86_64__
+#include "../tlsoffsets64.h"
+/* We would like to use just "%gs:8", but on x86_64 gcc uses pc-relative
+ addressing and translates "gs:8" into the wrong addressing mode. */
+static inline char *___getreent (void)
+{
+ register char *ret;
+ __asm __volatile__ ("movq %%gs:8,%0" : "=r" (ret));
+ return ret + tls_local_clib;
+}
+#define __getreent() ((struct _reent *) ___getreent())
+#else
#include "../tlsoffsets.h"
extern char *_tlsbase __asm__ ("%fs:4");
#define __getreent() (struct _reent *)(_tlsbase + tls_local_clib)
+#endif
#endif /* _COMPILING_NEWLIB */
+#ifdef __x86_64__
+# define __SYMBOL_PREFIX
+#else
+# define __SYMBOL_PREFIX "_"
+#endif
+#define _SYMSTR(x) __SYMBOL_PREFIX #x
+
#define __FILENAME_MAX__ 4096 /* Keep in sync with PATH_MAX in limits.h. */
/* The following block of macros is required to build newlib correctly for
diff --git a/winsup/cygwin/include/cygwin/cygwin_dll.h b/winsup/cygwin/include/cygwin/cygwin_dll.h
index 7abf5bd97..d3da87ddd 100644
--- a/winsup/cygwin/include/cygwin/cygwin_dll.h
+++ b/winsup/cygwin/include/cygwin/cygwin_dll.h
@@ -1,6 +1,6 @@
/* cygwin_dll.h
- Copyright 1998, 1999, 2000, 2001, 2009, 2011 Red Hat, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2009, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -26,8 +26,8 @@ details. */
CDECL_BEGIN \
int WINAPI Entry (HINSTANCE h, DWORD reason, void *ptr); \
typedef int (*mainfunc) (int, char **, char **); \
- extern int cygwin_attach_dll (HMODULE, mainfunc); \
- extern void cygwin_detach_dll (DWORD); \
+ extern PVOID cygwin_attach_dll (HMODULE, mainfunc); \
+ extern void cygwin_detach_dll (PVOID); \
CDECL_END \
\
static HINSTANCE storedHandle; \
@@ -35,12 +35,14 @@ static DWORD storedReason; \
static void* storedPtr; \
int __dynamically_loaded; \
\
-static int __dllMain (int a, char **b, char **c) \
+static int __dllMain (int a __attribute__ ((unused)), \
+ char **b __attribute__ ((unused)), \
+ char **c __attribute__ ((unused))) \
{ \
return Entry (storedHandle, storedReason, storedPtr); \
} \
\
-static DWORD dll_index; \
+static PVOID dll_index; \
\
int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \
{ \
@@ -56,7 +58,7 @@ int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \
storedPtr = ptr; \
__dynamically_loaded = (ptr == NULL); \
dll_index = cygwin_attach_dll (h, &__dllMain); \
- if (dll_index == (DWORD) -1) \
+ if (dll_index == (PVOID) -1) \
ret = 0; \
} \
break; \
@@ -67,7 +69,7 @@ int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \
if (ret) \
{ \
cygwin_detach_dll (dll_index); \
- dll_index = (DWORD) -1; \
+ dll_index = (PVOID) -1; \
} \
} \
break; \
diff --git a/winsup/cygwin/include/cygwin/grp.h b/winsup/cygwin/include/cygwin/grp.h
index b990b25ac..056c5f618 100644
--- a/winsup/cygwin/include/cygwin/grp.h
+++ b/winsup/cygwin/include/cygwin/grp.h
@@ -19,6 +19,7 @@ extern "C" {
#endif
#ifdef __INSIDE_CYGWIN__
+#ifndef __x86_64__
struct __group16
{
char *gr_name;
@@ -26,19 +27,12 @@ struct __group16
__gid16_t gr_gid;
char **gr_mem;
};
+#endif
-struct __group32
-{
- char *gr_name;
- char *gr_passwd;
- __gid32_t gr_gid;
- char **gr_mem;
-};
-
-struct __group32 * getgrgid32 (__gid32_t gid);
-struct __group32 * getgrnam32 (const char *name);
-__gid32_t getgid32 ();
-__gid32_t getegid32 ();
+struct group * getgrgid32 (gid_t gid);
+struct group * getgrnam32 (const char *name);
+gid_t getgid32 ();
+gid_t getegid32 ();
#endif
extern int getgrouplist (const char *, gid_t, gid_t *, int *);
diff --git a/winsup/cygwin/include/cygwin/if.h b/winsup/cygwin/include/cygwin/if.h
index aa0c02b29..2cd6ac5f3 100644
--- a/winsup/cygwin/include/cygwin/if.h
+++ b/winsup/cygwin/include/cygwin/if.h
@@ -1,6 +1,6 @@
/* cygwin/if.h
- Copyright 1996, 2000, 2001, 2007, 2012 Red Hat, Inc.
+ Copyright 1996, 2000, 2001, 2007, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -16,7 +16,7 @@ extern "C" {
#endif /* __cplusplus */
#include <sys/types.h>
-#include <sys/socket.h>
+#include <cygwin/socket.h>
/* Standard interface flags. */
#define IFF_UP 0x1 /* interface is up */
diff --git a/winsup/cygwin/include/cygwin/ipc.h b/winsup/cygwin/include/cygwin/ipc.h
index 783778822..c660d960a 100644
--- a/winsup/cygwin/include/cygwin/ipc.h
+++ b/winsup/cygwin/include/cygwin/ipc.h
@@ -1,6 +1,6 @@
/* sys/ipc.h
- Copyright 2001, 2002 Red Hat Inc.
+ Copyright 2001, 2002, 2012, 2013 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
This file is part of Cygwin.
@@ -13,6 +13,7 @@ details. */
#define _CYGWIN_IPC_H
#include <sys/types.h>
+#include <stdint.h>
#ifdef __cplusplus
extern "C"
diff --git a/winsup/cygwin/include/cygwin/msg.h b/winsup/cygwin/include/cygwin/msg.h
index 8679786dd..c737971ea 100644
--- a/winsup/cygwin/include/cygwin/msg.h
+++ b/winsup/cygwin/include/cygwin/msg.h
@@ -1,6 +1,6 @@
/* sys/msg.h
- Copyright 2002 Red Hat Inc.
+ Copyright 2002, 2012, 2013 Red Hat Inc.
Written by Conrad Scott <conrad.scott@dsl.pipex.com>
This file is part of Cygwin.
@@ -32,11 +32,11 @@ extern "C"
/* Used for the number of messages in the message queue.
*/
-typedef unsigned long msgqnum_t;
+typedef uint32_t msgqnum_t;
/* Used for the number of bytes allowed in a message queue.
*/
-typedef unsigned long msglen_t;
+typedef uint32_t msglen_t;
struct msqid_ds
{
@@ -66,27 +66,27 @@ struct msqid_ds
*/
struct msginfo
{
- long msgmax; /* Maximum number of bytes per
+ int32_t msgmax; /* Maximum number of bytes per
message. */
- long msgmnb; /* Maximum number of bytes on any one
+ int32_t msgmnb; /* Maximum number of bytes on any one
message queue. */
- long msgmni; /* Maximum number of message queues,
+ int32_t msgmni; /* Maximum number of message queues,
system wide. */
- long msgtql; /* Maximum number of messages, system
+ int32_t msgtql; /* Maximum number of messages, system
wide. */
- long msgssz; /* Size of a message segment, must be
+ int32_t msgssz; /* Size of a message segment, must be
small power of 2 greater than 4. */
- long msgseg; /* Number of message segments */
- long msg_spare[2];
+ int32_t msgseg; /* Number of message segments */
+ int32_t msg_spare[2];
};
/* Buffer type for msgctl (MSG_INFO, ...) as used by ipcs(8).
*/
struct msg_info
{
- long msg_ids; /* Number of allocated queues. */
- long msg_num; /* Number of messages, system wide. */
- long msg_tot; /* Size in bytes of messages, system wide. */
+ int32_t msg_ids; /* Number of allocated queues. */
+ int32_t msg_num; /* Number of messages, system wide. */
+ int32_t msg_tot; /* Size in bytes of messages, system wide. */
};
#endif /* _KERNEL */
diff --git a/winsup/cygwin/include/cygwin/sem.h b/winsup/cygwin/include/cygwin/sem.h
index af7a42f36..71592e52f 100644
--- a/winsup/cygwin/include/cygwin/sem.h
+++ b/winsup/cygwin/include/cygwin/sem.h
@@ -1,6 +1,6 @@
/* sys/sem.h
- Copyright 2002 Red Hat Inc.
+ Copyright 2002, 2012, 2013 Red Hat Inc.
Written by Conrad Scott <conrad.scott@dsl.pipex.com>
This file is part of Cygwin.
@@ -67,23 +67,23 @@ struct sembuf
*/
struct seminfo
{
- long semmni; /* Maximum number of unique semaphore
+ int32_t semmni; /* Maximum number of unique semaphore
sets, system wide. */
- long semmns; /* Maximum number of semaphores,
+ int32_t semmns; /* Maximum number of semaphores,
system wide. */
- long semmsl; /* Maximum number of semaphores per
+ int32_t semmsl; /* Maximum number of semaphores per
semaphore set. */
- long semopm; /* Maximum number of operations per
+ int32_t semopm; /* Maximum number of operations per
semop call. */
- long semmnu; /* Maximum number of undo structures,
+ int32_t semmnu; /* Maximum number of undo structures,
system wide. */
- long semume; /* Maximum number of undo entries per
+ int32_t semume; /* Maximum number of undo entries per
undo structure. */
- long semvmx; /* Maximum semaphore value. */
- long semaem; /* Maximum adjust-on-exit value. */
- long semmap; /* # of entries in semaphore map */
- long semusz; /* size in bytes of undo structure */
- long sem_spare[2];
+ int32_t semvmx; /* Maximum semaphore value. */
+ int32_t semaem; /* Maximum adjust-on-exit value. */
+ int32_t semmap; /* # of entries in semaphore map */
+ int32_t semusz; /* size in bytes of undo structure */
+ int32_t sem_spare[2];
};
/* Buffer type for semctl (SEM_INFO, ...) as used by ipcs(8).
diff --git a/winsup/cygwin/include/cygwin/shm.h b/winsup/cygwin/include/cygwin/shm.h
index 2c882012c..c58599379 100644
--- a/winsup/cygwin/include/cygwin/shm.h
+++ b/winsup/cygwin/include/cygwin/shm.h
@@ -1,6 +1,6 @@
/* sys/shm.h
- Copyright 2001, 2002 Red Hat Inc.
+ Copyright 2001, 2002, 2012, 2013 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
This file is part of Cygwin.
@@ -40,12 +40,12 @@ extern "C"
/* Unsigned integer used for the number of current attaches.
*/
-typedef unsigned int shmatt_t;
+typedef uint32_t shmatt_t;
struct shmid_ds
{
struct ipc_perm shm_perm; /* Operation permission structure. */
- size_t shm_segsz; /* Size of segment in bytes. */
+ uint32_t shm_segsz; /* Size of segment in bytes. */
pid_t shm_lpid; /* Process ID of last operation. */
pid_t shm_cpid; /* Process ID of creator. */
shmatt_t shm_nattch;/* Number of current attaches. */
@@ -69,17 +69,20 @@ struct shmid_ds
*/
struct shminfo
{
- long shmmax; /* Maximum size in bytes of a shared
+ int32_t shmmax; /* Maximum size in bytes of a shared
memory segment. */
- long shmmin; /* Minimum size in bytes of a shared
+ int32_t shmmin; /* Minimum size in bytes of a shared
memory segment. */
- long shmmni; /* Maximum number of shared memory
+ int32_t shmmni; /* Maximum number of shared memory
segments, system wide. */
- long shmseg; /* Maximum number of shared memory
+ int32_t shmseg; /* Maximum number of shared memory
segments attached per process. */
- long shmall; /* Maximum number of bytes of shared
- memory, system wide. */
- long shm_spare[4];
+ int32_t shmall; /* Maximum number of bytes of shared
+ memory, system wide.
+ Note that XSI IPC shared memory allocation is
+ restricted to a bit less than 2 Gigs, even on
+ 64 bit, so using an int32_t here is sufficient. */
+ int32_t shm_spare[4];
};
/* Buffer type for shmctl (SHM_INFO, ...) as used by ipcs(8).
@@ -87,9 +90,9 @@ struct shminfo
struct shm_info
{
#define shm_ids used_ids
- long used_ids; /* Number of allocated segments. */
- long shm_tot; /* Size in bytes of allocated segments. */
- long shm_atts; /* Number of attached segments, system
+ int32_t used_ids; /* Number of allocated segments. */
+ int32_t shm_tot; /* Size in bytes of allocated segments. */
+ int32_t shm_atts; /* Number of attached segments, system
wide. */
};
#endif /* _KERNEL */
diff --git a/winsup/cygwin/include/cygwin/signal.h b/winsup/cygwin/include/cygwin/signal.h
index 268b5eb74..3d74c9c8d 100644
--- a/winsup/cygwin/include/cygwin/signal.h
+++ b/winsup/cygwin/include/cygwin/signal.h
@@ -12,53 +12,144 @@
#ifndef _CYGWIN_SIGNAL_H
#define _CYGWIN_SIGNAL_H
+#include <bits/wordsize.h>
+
#ifdef __cplusplus
extern "C" {
#endif
+
+#ifdef __x86_64__
+
+struct _uc_fpxreg {
+ __uint16_t significand[4];
+ __uint16_t exponent;
+ __uint16_t padding[3];
+};
+
+struct _uc_xmmreg {
+ __uint32_t element[4];
+};
+
struct _fpstate
{
- unsigned long cw;
- unsigned long sw;
- unsigned long tag;
- unsigned long ipoff;
- unsigned long cssel;
- unsigned long dataoff;
- unsigned long datasel;
- unsigned char _st[80];
- unsigned long nxst;
+ __uint16_t cwd;
+ __uint16_t swd;
+ __uint16_t ftw;
+ __uint16_t fop;
+ __uint64_t rip;
+ __uint64_t rdp;
+ __uint32_t mxcsr;
+ __uint32_t mxcr_mask;
+ struct _uc_fpxreg st[8];
+ struct _uc_xmmreg xmm[16];
+ __uint32_t padding[24];
};
struct ucontext
{
- unsigned long cr2;
- unsigned long dr0;
- unsigned long dr1;
- unsigned long dr2;
- unsigned long dr3;
- unsigned long dr6;
- unsigned long dr7;
+ __uint64_t p1home;
+ __uint64_t p2home;
+ __uint64_t p3home;
+ __uint64_t p4home;
+ __uint64_t p5home;
+ __uint64_t p6home;
+ __uint32_t cr2;
+ __uint32_t mxcsr;
+ __uint16_t cs;
+ __uint16_t ds;
+ __uint16_t es;
+ __uint16_t fs;
+ __uint16_t gs;
+ __uint16_t ss;
+ __uint32_t eflags;
+ __uint64_t dr0;
+ __uint64_t dr1;
+ __uint64_t dr2;
+ __uint64_t dr3;
+ __uint64_t dr6;
+ __uint64_t dr7;
+ __uint64_t rax;
+ __uint64_t rcx;
+ __uint64_t rdx;
+ __uint64_t rbx;
+ __uint64_t rsp;
+ __uint64_t rbp;
+ __uint64_t rsi;
+ __uint64_t rdi;
+ __uint64_t r8;
+ __uint64_t r9;
+ __uint64_t r10;
+ __uint64_t r11;
+ __uint64_t r12;
+ __uint64_t r13;
+ __uint64_t r14;
+ __uint64_t r15;
+ __uint64_t rip;
+ struct _fpstate fpregs;
+ __uint64_t vcx;
+ __uint64_t dbc;
+ __uint64_t btr;
+ __uint64_t bfr;
+ __uint64_t etr;
+ __uint64_t efr;
+ __uint8_t _internal;
+ __uint64_t oldmask;
+};
+
+#else /* !x86_64 */
+
+struct _uc_fpreg
+{
+ __uint16_t significand[4];
+ __uint16_t exponent;
+};
+
+struct _fpstate
+{
+ __uint32_t cw;
+ __uint32_t sw;
+ __uint32_t tag;
+ __uint32_t ipoff;
+ __uint32_t cssel;
+ __uint32_t dataoff;
+ __uint32_t datasel;
+ struct _uc_fpreg _st[8];
+ __uint32_t nxst;
+};
+
+struct ucontext
+{
+ __uint32_t cr2;
+ __uint32_t dr0;
+ __uint32_t dr1;
+ __uint32_t dr2;
+ __uint32_t dr3;
+ __uint32_t dr6;
+ __uint32_t dr7;
struct _fpstate fpstate;
- unsigned long gs;
- unsigned long fs;
- unsigned long es;
- unsigned long ds;
- unsigned long edi;
- unsigned long esi;
- unsigned long ebx;
- unsigned long edx;
- unsigned long ecx;
- unsigned long eax;
- unsigned long ebp;
- unsigned long eip;
- unsigned long cs;
- unsigned long eflags;
- unsigned long esp;
- unsigned long ss;
- unsigned char _internal;
- unsigned long oldmask;
+ __uint32_t gs;
+ __uint32_t fs;
+ __uint32_t es;
+ __uint32_t ds;
+ __uint32_t edi;
+ __uint32_t esi;
+ __uint32_t ebx;
+ __uint32_t edx;
+ __uint32_t ecx;
+ __uint32_t eax;
+ __uint32_t ebp;
+ __uint32_t eip;
+ __uint32_t cs;
+ __uint32_t eflags;
+ __uint32_t esp;
+ __uint32_t ss;
+ __uint8_t _internal;
+ __uint32_t oldmask;
};
-#define __COPY_CONTEXT_SIZE ((unsigned) &((struct ucontext *) 0)->_internal)
+#endif /* !x86_64 */
+
+#define __COPY_CONTEXT_SIZE ((size_t) (uintptr_t) &((struct ucontext *) 0)->_internal)
typedef union sigval
{
@@ -208,7 +299,13 @@ enum
perform notification */
};
+#if __WORDSIZE == 64
+typedef __uint64_t sigset_t;
+#else
+/* FIXME: We should probably raise the # of signals for 32 bit as well.
+ Unfortunately this is an ABI change so requires some forethought. */
typedef __uint32_t sigset_t;
+#endif
typedef void (*_sig_func_ptr)(int);
@@ -274,10 +371,15 @@ struct sigaction
#define SIGUSR1 30 /* user defined signal 1 */
#define SIGUSR2 31 /* user defined signal 2 */
+#if __WORDSIZE == 64
+#define NSIG 65 /* signal 0 implied */
+#else
+#define NSIG 33 /* signal 0 implied */
+#endif
+
/* Real-Time signals per SUSv3. RT_SIGMAX is defined as 8 in limits.h */
#define SIGRTMIN 32
-#define SIGRTMAX ((SIGRTMIN) + 0)
-#define NSIG 33 /* signal 0 implied */
+#define SIGRTMAX (NSIG - 1)
#define SIG_HOLD ((_sig_func_ptr)2) /* Signal in signal mask */
diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/cygwin/socket.h
index eec7962e8..5ed83bef9 100644
--- a/winsup/cygwin/include/cygwin/socket.h
+++ b/winsup/cygwin/include/cygwin/socket.h
@@ -1,7 +1,7 @@
/* cygwin/socket.h
- Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2012
- Red Hat, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2012,
+ 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -55,8 +55,8 @@ struct sockaddr_storage {
struct ucred {
pid_t pid;
- __uid32_t uid;
- __gid32_t gid;
+ uid_t uid;
+ gid_t gid;
};
struct linger {
@@ -302,6 +302,11 @@ struct OLD_msghdr
#define TCP_MAXSEG 2
#endif
+/* SUS symbolic values for the second parm to shutdown(2) */
+#define SHUT_RD 0 /* == Win32 SD_RECEIVE */
+#define SHUT_WR 1 /* == Win32 SD_SEND */
+#define SHUT_RDWR 2 /* == Win32 SD_BOTH */
+
/* The various priorities. */
#define SOPRI_INTERACTIVE 0
#define SOPRI_NORMAL 1
diff --git a/winsup/cygwin/include/cygwin/stat.h b/winsup/cygwin/include/cygwin/stat.h
index 13c1e3bed..ed96fafd9 100644
--- a/winsup/cygwin/include/cygwin/stat.h
+++ b/winsup/cygwin/include/cygwin/stat.h
@@ -16,7 +16,26 @@ details. */
extern "C" {
#endif
+struct stat
+{
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ off_t st_size;
+ timestruc_t st_atim;
+ timestruc_t st_mtim;
+ timestruc_t st_ctim;
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+ timestruc_t st_birthtim;
+};
+
#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB)
+#ifndef __x86_64__
struct __stat32
{
__dev16_t st_dev;
@@ -34,49 +53,14 @@ struct __stat32
__blkcnt32_t st_blocks;
long st_spare4[2];
};
+#endif
-struct __stat64
-{
- __dev32_t st_dev;
- __ino64_t st_ino;
- mode_t st_mode;
- nlink_t st_nlink;
- __uid32_t st_uid;
- __gid32_t st_gid;
- __dev32_t st_rdev;
- _off64_t st_size;
- timestruc_t st_atim;
- timestruc_t st_mtim;
- timestruc_t st_ctim;
- blksize_t st_blksize;
- __blkcnt64_t st_blocks;
- timestruc_t st_birthtim;
-};
-
-extern int fstat64 (int fd, struct __stat64 *buf);
-extern int stat64 (const char *file_name, struct __stat64 *buf);
-extern int lstat64 (const char *file_name, struct __stat64 *buf);
+extern int fstat64 (int fd, struct stat *buf);
+extern int stat64 (const char *file_name, struct stat *buf);
+extern int lstat64 (const char *file_name, struct stat *buf);
#endif
-struct stat
-{
- dev_t st_dev;
- ino_t st_ino;
- mode_t st_mode;
- nlink_t st_nlink;
- uid_t st_uid;
- gid_t st_gid;
- dev_t st_rdev;
- off_t st_size;
- timestruc_t st_atim;
- timestruc_t st_mtim;
- timestruc_t st_ctim;
- blksize_t st_blksize;
- blkcnt_t st_blocks;
- timestruc_t st_birthtim;
-};
-
#define st_atime st_atim.tv_sec
#define st_mtime st_mtim.tv_sec
#define st_ctime st_ctim.tv_sec
diff --git a/winsup/cygwin/include/cygwin/stdlib.h b/winsup/cygwin/include/cygwin/stdlib.h
index 7159368f9..3abe00ef3 100644
--- a/winsup/cygwin/include/cygwin/stdlib.h
+++ b/winsup/cygwin/include/cygwin/stdlib.h
@@ -1,6 +1,6 @@
/* stdlib.h
- Copyright 2005, 2006, 2007, 2008, 2009, 2011 Red Hat Inc.
+ Copyright 2005, 2006, 2007, 2008, 2009, 2011, 2013 Red Hat Inc.
This file is part of Cygwin.
@@ -18,6 +18,12 @@ extern "C"
{
#endif
+__uint32_t arc4random(void);
+void arc4random_addrandom(unsigned char *, int);
+void arc4random_buf(void *, size_t);
+void arc4random_stir(void);
+__uint32_t arc4random_uniform(__uint32_t);
+
const char *getprogname (void);
void setprogname (const char *);
diff --git a/winsup/cygwin/include/cygwin/sysproto.h b/winsup/cygwin/include/cygwin/sysproto.h
index 3d183a94b..838555002 100644
--- a/winsup/cygwin/include/cygwin/sysproto.h
+++ b/winsup/cygwin/include/cygwin/sysproto.h
@@ -1,6 +1,6 @@
/* cygwin/sysproto.h
- Copyright 2003, 2005 Red Hat, Inc.
+ Copyright 2003, 2005, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
diff --git a/winsup/cygwin/include/cygwin/time.h b/winsup/cygwin/include/cygwin/time.h
index d1b7670bc..3dbc372a3 100644
--- a/winsup/cygwin/include/cygwin/time.h
+++ b/winsup/cygwin/include/cygwin/time.h
@@ -26,10 +26,10 @@ time_t __cdecl timegm (struct tm *);
#ifndef __STRICT_ANSI__
-extern int daylight __asm__ ("__daylight");
+extern int daylight __asm__ (_SYMSTR (_daylight));
#ifndef __timezonefunc__
-extern long timezone __asm__ ("__timezone");
+extern long timezone __asm__ (_SYMSTR (_timezone));
#endif
#endif /*__STRICT_ANSI__*/
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index cbb4b4492..54c0c5ba5 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -19,6 +19,7 @@ extern "C"
#include <stdint.h>
#include <endian.h>
+#include <bits/wordsize.h>
#ifndef __timespec_t_defined
#define __timespec_t_defined
@@ -32,68 +33,72 @@ typedef struct timespec timestruc_t;
#ifndef __off_t_defined
#define __off_t_defined
+/* Based on the newlib definitions. */
+#if __WORDSIZE == 64
+typedef _off_t off_t;
+#else
typedef _off64_t off_t;
+#endif
#endif /*__off_t_defined*/
typedef __loff_t loff_t;
#ifndef __dev_t_defined
#define __dev_t_defined
-typedef short __dev16_t;
-typedef unsigned long __dev32_t;
-typedef __dev32_t dev_t;
+typedef __int16_t __dev16_t;
+typedef __uint32_t dev_t;
#endif /*__dev_t_defined*/
#ifndef __blksize_t_defined
#define __blksize_t_defined
-typedef long blksize_t;
+typedef __int32_t blksize_t;
#endif /*__blksize_t_defined*/
#ifndef __blkcnt_t_defined
#define __blkcnt_t_defined
-typedef long __blkcnt32_t;
-typedef long long __blkcnt64_t;
-typedef __blkcnt64_t blkcnt_t;
+typedef __int32_t __blkcnt32_t;
+typedef __int64_t blkcnt_t;
#endif /*__blkcnt_t_defined*/
#ifndef __fsblkcnt_t_defined
#define __fsblkcnt_t_defined
+/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
typedef unsigned long fsblkcnt_t;
#endif /* __fsblkcnt_t_defined */
#ifndef __fsfilcnt_t_defined
#define __fsfilcnt_t_defined
+/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
typedef unsigned long fsfilcnt_t;
#endif /* __fsfilcnt_t_defined */
#ifndef __uid_t_defined
#define __uid_t_defined
typedef unsigned short __uid16_t;
-typedef unsigned long __uid32_t;
-typedef __uid32_t uid_t;
+typedef __uint32_t uid_t;
#endif /*__uid_t_defined*/
#ifndef __gid_t_defined
#define __gid_t_defined
typedef unsigned short __gid16_t;
-typedef unsigned long __gid32_t;
-typedef __gid32_t gid_t;
+typedef __uint32_t gid_t;
#endif /*__gid_t_defined*/
#ifndef __ino_t_defined
#define __ino_t_defined
-typedef unsigned long __ino32_t;
-typedef unsigned long long __ino64_t;
-typedef __ino64_t ino_t;
+#ifndef __x86_64__
+typedef __uint32_t __ino32_t;
+#endif
+typedef __uint64_t ino_t;
#endif /*__ino_t_defined*/
/* Generic ID type, must match at least pid_t, uid_t and gid_t in size. */
#ifndef __id_t_defined
#define __id_t_defined
-typedef unsigned long id_t;
+typedef __uint32_t id_t;
#endif /* __id_t_defined */
-#if defined (__INSIDE_CYGWIN__)
+#if defined (__INSIDE_CYGWIN__) && !defined (__x86_64__)
struct __flock32 {
short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
short l_whence; /* flag to choose starting offset */
@@ -102,14 +107,6 @@ struct __flock32 {
short l_pid; /* returned with F_GETLK */
short l_xxx; /* reserved for future use */
};
-
-struct __flock64 {
- short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
- short l_whence; /* flag to choose starting offset */
- _off64_t l_start; /* relative offset, in bytes */
- _off64_t l_len; /* length, in bytes; 0 means lock to EOF */
- pid_t l_pid; /* returned with F_GETLK */
-};
#endif
struct flock {
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 7284c58ef..adda3271c 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -1,7 +1,7 @@
/* version.h -- Cygwin version numbers and accompanying documentation.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -43,7 +43,7 @@ details. */
changes to the DLL and is mainly informative in nature. */
#define CYGWIN_VERSION_DLL_MAJOR 1007
-#define CYGWIN_VERSION_DLL_MINOR 19
+#define CYGWIN_VERSION_DLL_MINOR 20
/* Major numbers before CYGWIN_VERSION_DLL_EPOCH are
incompatible. */
@@ -432,12 +432,16 @@ details. */
261: Export memrchr.
262: Export getmntent_r.
263: Export cfsetspeed.
+ 264: Consistently export strtold
+ 265: Export __b64_ntop, __b64_pton.
+ 266: Export arc4random, arc4random_addrandom, arc4random_buf,
+ arc4random_stir, arc4random_uniform.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 263
+#define CYGWIN_VERSION_API_MINOR 266
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/include/fcntl.h b/winsup/cygwin/include/fcntl.h
index 9c3ddf926..fe8a1fc42 100644
--- a/winsup/cygwin/include/fcntl.h
+++ b/winsup/cygwin/include/fcntl.h
@@ -1,6 +1,6 @@
/* fcntl.h
- Copyright 1996, 1998, 2000, 2001, 2005, 2006, 2009, 2010 Red Hat, Inc.
+ Copyright 1996, 1998, 2000, 2001, 2005, 2006, 2009, 2010, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,12 +14,29 @@ details. */
#include <sys/fcntl.h>
#define O_NDELAY _FNDELAY
-/* sys/fcntl defines values up to 0x40000 (O_NOINHERIT). */
+/* sys/_default_fcntl.h defines values up to 0x40000 (O_NOINHERIT). */
#define _FDIRECT 0x80000
#define _FNOFOLLOW 0x100000
#define _FDIRECTORY 0x200000
#define _FEXECSRCH 0x400000
+/* F_LCK_MANDATORY: Request mandatory locks for this file descriptor.
+
+ Cygwin extension to fcntl file locking mechanism. By default, fcntl file
+ locks are advisory locks. This works nicely as long as only Cygwin
+ processes interact. If you have the requirement to interact with native
+ Windows applications which use Windows mandatory file locking, your have
+ to use mandatory locking as well. The command
+
+ fcntl (fd, F_LCK_MANDATORY, 1)
+
+ switches subsequent F_GETLK, F_SETLK, F_SETLKW calls to mandatory locking
+ for this file descriptor and subsequently duplicated ones WITHIN THE SAME
+ PROCESS. Note that mandatory locks are NOT inherited by child processes,
+ nor do they survive an execve call. This fully corresponds to Windows
+ mandatory locking semantics. */
+#define F_LCK_MANDATORY 0x99
+
/* POSIX-1.2008 requires this flag and allows to set it to 0 if its
functionality is not required. */
#define O_TTY_INIT 0
diff --git a/winsup/cygwin/include/fts.h b/winsup/cygwin/include/fts.h
index d4900bb24..57e9096b4 100644
--- a/winsup/cygwin/include/fts.h
+++ b/winsup/cygwin/include/fts.h
@@ -41,7 +41,7 @@ typedef struct {
struct _ftsent *fts_cur; /* current node */
struct _ftsent *fts_child; /* linked list of children */
struct _ftsent **fts_array; /* sort array */
- __dev32_t fts_dev; /* starting device # */
+ dev_t fts_dev; /* starting device # */
char *fts_path; /* path for this descent */
int fts_rfd; /* fd for root */
int fts_pathlen; /* sizeof(path) */
@@ -88,8 +88,8 @@ typedef struct _ftsent {
u_short fts_pathlen; /* strlen(fts_path) */
u_short fts_namelen; /* strlen(fts_name) */
- __ino64_t fts_ino; /* inode */
- __dev32_t fts_dev; /* device */
+ ino_t fts_ino; /* inode */
+ dev_t fts_dev; /* device */
nlink_t fts_nlink; /* link count */
#define FTS_ROOTPARENTLEVEL -1
@@ -123,11 +123,7 @@ typedef struct _ftsent {
#define FTS_SKIP 4 /* discard node */
u_short fts_instr; /* fts_set() instructions */
-#ifdef __INSIDE_CYGWIN__
- struct __stat64 *fts_statp; /* stat(2) information */
-#else
struct stat *fts_statp; /* stat(2) information */
-#endif
char *fts_name; /* file name */
FTS *fts_fts; /* back pointer to main FTS */
} FTSENT;
diff --git a/winsup/cygwin/include/ftw.h b/winsup/cygwin/include/ftw.h
index 4f53bf5d6..c0025a7c6 100644
--- a/winsup/cygwin/include/ftw.h
+++ b/winsup/cygwin/include/ftw.h
@@ -55,15 +55,9 @@ struct FTW {
};
__BEGIN_DECLS
-#ifdef __INSIDE_CYGWIN__
-int ftw(const char *, int (*)(const char *, const struct __stat64 *, int), int);
-int nftw(const char *, int (*)(const char *, const struct __stat64 *, int,
- struct FTW *), int, int);
-#else
int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
int nftw(const char *, int (*)(const char *, const struct stat *, int,
struct FTW *), int, int);
-#endif
__END_DECLS
#endif /* !_FTW_H */
diff --git a/winsup/cygwin/include/glob.h b/winsup/cygwin/include/glob.h
index 93f2d7e94..35745196b 100644
--- a/winsup/cygwin/include/glob.h
+++ b/winsup/cygwin/include/glob.h
@@ -61,14 +61,8 @@ typedef struct {
void (*gl_closedir)(void *);
struct dirent *(*gl_readdir)(void *);
void *(*gl_opendir)(const char *);
-#if defined (__INSIDE_CYGWIN__)
- int (*gl_lstat) __P((const char *, struct __stat64 *));
- int (*gl_stat) __P((const char *, struct __stat64 *));
-#else
-
int (*gl_lstat) __P((const char *, struct stat *));
int (*gl_stat) __P((const char *, struct stat *));
-#endif
} glob_t;
/* Believed to have been introduced in 1003.2-1992 */
diff --git a/winsup/cygwin/include/inttypes.h b/winsup/cygwin/include/inttypes.h
index cc1d8970a..eb60e79e4 100644
--- a/winsup/cygwin/include/inttypes.h
+++ b/winsup/cygwin/include/inttypes.h
@@ -14,13 +14,14 @@ details. */
#include <stdint.h>
#define __need_wchar_t
#include <stddef.h>
+#include <bits/wordsize.h>
/* C99 requires that in C++ the following macros should be defined only
if requested. */
#if !defined (__cplusplus) || defined (__STDC_FORMAT_MACROS) \
|| defined (__INSIDE_CYGWIN__)
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define __PRI64 "l"
#define __PRIFAST "l"
#define __PRIPTR "l"
@@ -144,7 +145,7 @@ details. */
/* fscanf() macros for signed integers */
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define __SCN64 "l"
#define __SCNFAST "l"
#define __SCNPTR "l"
diff --git a/winsup/cygwin/include/io.h b/winsup/cygwin/include/io.h
index de9f39e0a..517f871fe 100644
--- a/winsup/cygwin/include/io.h
+++ b/winsup/cygwin/include/io.h
@@ -18,9 +18,10 @@ extern "C" {
/*
* Function to return a Win32 HANDLE from a fd.
*/
-extern long get_osfhandle(int);
-extern int setmode (int __fd, int __mode);
-int access(const char *__path, int __amode);
+extern long _get_osfhandle(int);
+#define get_osfhandle(i) _get_osfhandle(i)
+extern int _setmode (int __fd, int __mode);
+#define setmode(f,m) _setmode((f),(m))
#ifdef __cplusplus
};
diff --git a/winsup/cygwin/include/limits.h b/winsup/cygwin/include/limits.h
index 20723ab1d..e093d283d 100644
--- a/winsup/cygwin/include/limits.h
+++ b/winsup/cygwin/include/limits.h
@@ -1,7 +1,7 @@
/* limits.h
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2011, 2012 Red Hat, Inc.
+ 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -12,6 +12,7 @@ details. */
#ifndef _LIMITS_H___
#include <features.h>
+#include <bits/wordsize.h>
#ifndef _MACH_MACHLIMITS_H_
@@ -24,15 +25,15 @@ details. */
/* Number of bits in a `char'. */
#undef CHAR_BIT
-#define CHAR_BIT 8
+#define CHAR_BIT __CHAR_BIT__
/* Number of bits in a `long'. */
#undef LONG_BIT
-#define LONG_BIT 32
+#define LONG_BIT (__SIZEOF_LONG__ * __CHAR_BIT__)
/* Number of bits in a `int'. */
#undef WORD_BIT
-#define WORD_BIT 32
+#define WORD_BIT (__SIZEOF_INT__ * __CHAR_BIT__)
/* Maximum length of a multibyte character. */
#ifndef MB_LEN_MAX
@@ -89,14 +90,14 @@ details. */
/* Minimum and maximum values a `signed long int' can hold.
(Same as `int'). */
#ifndef __LONG_MAX__
-#ifndef __alpha__
-#define __LONG_MAX__ 2147483647L
-#else
+#if __WORDSIZE == 64
#define __LONG_MAX__ 9223372036854775807L
+#else
+#define __LONG_MAX__ 2147483647L
# endif /* __alpha__ */
#endif
#undef LONG_MIN
-#define LONG_MIN (-LONG_MAX-1)
+#define LONG_MIN (-LONG_MAX-1L)
#undef LONG_MAX
#define LONG_MAX __LONG_MAX__
@@ -221,9 +222,9 @@ details. */
#define PTHREAD_DESTRUCTOR_ITERATIONS 1
/* Maximum number of data keys that can be created by a process. */
-/* Tls has 64 items for pre win2000 - and we don't want to use them all :] */
+/* Tls has 1088 items - and we don't want to use them all :] */
#undef PTHREAD_KEYS_MAX
-#define PTHREAD_KEYS_MAX 32
+#define PTHREAD_KEYS_MAX 1024
/* Minimum size in bytes of thread stack storage. */
/* Actually the minimum stack size is somewhat of a split personality.
@@ -242,9 +243,14 @@ details. */
/* #define PTHREAD_THREADS_MAX unspecified */
/* Maximum number of realtime signals reserved for application use. */
-/* FIXME: We only support one realtime signal but _POSIX_RTSIG_MAX is 8. */
+/* FIXME: We only support one realtime signal in 32 bit mode, but
+ _POSIX_RTSIG_MAX is 8. */
#undef RTSIG_MAX
+#if __WORDSIZE == 64
+#define RTSIG_MAX 33
+#else
#define RTSIG_MAX 1
+#endif
/* Maximum number of semaphores that a process may have. */
/* Windows allows any arbitrary number of semaphores per process. */
diff --git a/winsup/cygwin/include/mntent.h b/winsup/cygwin/include/mntent.h
index db87904ef..5a0c13054 100644
--- a/winsup/cygwin/include/mntent.h
+++ b/winsup/cygwin/include/mntent.h
@@ -33,9 +33,7 @@ struct mntent *getmntent_r (FILE *, struct mntent *, char *, int);
int endmntent (FILE *__filep);
#endif
-#ifdef __CYGWIN__
-/* Only include paths.h if building for Cygwin. This avoids including
- newlib headers when building the native tools in winsup/utils. */
+#ifndef _NOMNTENT_MACROS
#include <paths.h>
@@ -52,7 +50,7 @@ int endmntent (FILE *__filep);
#define MOUNTED _PATH_MOUNTED
#endif
-#endif /* __CYGWIN__ */
+#endif /* !_NOMNTENT_MACROS */
#ifdef __cplusplus
};
diff --git a/winsup/cygwin/include/stdint.h b/winsup/cygwin/include/stdint.h
index 3c8a50d83..b670884a7 100644
--- a/winsup/cygwin/include/stdint.h
+++ b/winsup/cygwin/include/stdint.h
@@ -11,6 +11,8 @@ details. */
#ifndef _STDINT_H
#define _STDINT_H
+#include <bits/wordsize.h>
+
/* Exact-width integer types */
#ifndef __int8_t_defined
@@ -18,7 +20,7 @@ details. */
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef long int64_t;
#else
typedef long long int64_t;
@@ -31,7 +33,7 @@ typedef unsigned short uint16_t;
#define __uint32_t_defined
typedef unsigned int uint32_t;
#endif
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef unsigned long uint64_t;
#else
typedef unsigned long long uint64_t;
@@ -42,7 +44,7 @@ typedef unsigned long long uint64_t;
typedef signed char int_least8_t;
typedef short int_least16_t;
typedef int int_least32_t;
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef long int_least64_t;
#else
typedef long long int_least64_t;
@@ -51,7 +53,7 @@ typedef long long int_least64_t;
typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned int uint_least32_t;
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef unsigned long uint_least64_t;
#else
typedef unsigned long long uint_least64_t;
@@ -60,7 +62,7 @@ typedef unsigned long long uint_least64_t;
/* Fastest minimum-width integer types */
typedef signed char int_fast8_t;
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef long int_fast16_t;
typedef long int_fast32_t;
typedef long int_fast64_t;
@@ -71,7 +73,7 @@ typedef long long int_fast64_t;
#endif
typedef unsigned char uint_fast8_t;
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef unsigned long uint_fast16_t;
typedef unsigned long uint_fast32_t;
typedef unsigned long uint_fast64_t;
@@ -85,13 +87,13 @@ typedef unsigned long long uint_fast64_t;
#ifndef __intptr_t_defined
#define __intptr_t_defined
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef long intptr_t;
#else
typedef int intptr_t;
#endif
#endif
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef unsigned long uintptr_t;
#else
typedef unsigned int uintptr_t;
@@ -99,7 +101,7 @@ typedef unsigned int uintptr_t;
/* Greatest-width integer types */
-#ifdef __x86_64__
+#if __WORDSIZE == 64
typedef long intmax_t;
typedef unsigned long uintmax_t;
#else
@@ -157,7 +159,7 @@ typedef unsigned long long uintmax_t;
/* Limits of fastest minimum-width integer types */
#define INT_FAST8_MIN (-128)
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define INT_FAST16_MIN (-__I64(9223372036854775807) - 1)
#define INT_FAST32_MIN (-__I64(9223372036854775807) - 1)
#else
@@ -167,7 +169,7 @@ typedef unsigned long long uintmax_t;
#define INT_FAST64_MIN (-__I64(9223372036854775807) - 1)
#define INT_FAST8_MAX (127)
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define INT_FAST16_MAX (__I64(9223372036854775807))
#define INT_FAST32_MAX (__I64(9223372036854775807))
#else
@@ -177,7 +179,7 @@ typedef unsigned long long uintmax_t;
#define INT_FAST64_MAX (__I64(9223372036854775807))
#define UINT_FAST8_MAX (255)
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define UINT_FAST16_MAX (__U64(18446744073709551615))
#define UINT_FAST32_MAX (__U64(18446744073709551615))
#else
@@ -188,9 +190,9 @@ typedef unsigned long long uintmax_t;
/* Limits of integer types capable of holding object pointers */
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define INTPTR_MIN (-__I64(9223372036854775807) - 1)
-#define INTPTR_MAX (__I64(9223372036854775807)
+#define INTPTR_MAX (__I64(9223372036854775807))
#define UINTPTR_MAX (__U64(18446744073709551615))
#else
#define INTPTR_MIN (-2147483647 - 1)
@@ -207,7 +209,7 @@ typedef unsigned long long uintmax_t;
/* Limits of other integer types */
#ifndef PTRDIFF_MIN
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define PTRDIFF_MIN (-9223372036854775807L - 1)
#define PTRDIFF_MAX (9223372036854775807L)
#else
@@ -224,7 +226,7 @@ typedef unsigned long long uintmax_t;
#endif
#ifndef SIZE_MAX
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define SIZE_MAX (18446744073709551615UL)
#else
#define SIZE_MAX (4294967295U)
@@ -258,7 +260,7 @@ typedef unsigned long long uintmax_t;
#define INT8_C(x) x
#define INT16_C(x) x
#define INT32_C(x) x
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define INT64_C(x) x ## L
#else
#define INT64_C(x) x ## LL
@@ -267,7 +269,7 @@ typedef unsigned long long uintmax_t;
#define UINT8_C(x) x
#define UINT16_C(x) x
#define UINT32_C(x) x ## U
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define UINT64_C(x) x ## UL
#else
#define UINT64_C(x) x ## ULL
@@ -275,7 +277,7 @@ typedef unsigned long long uintmax_t;
/* Macros for greatest-width integer constant expressions */
-#ifdef __x86_64__
+#if __WORDSIZE == 64
#define INTMAX_C(x) x ## L
#define UINTMAX_C(x) x ## UL
#else
diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h
index ac7b2336a..354d0eb4c 100644
--- a/winsup/cygwin/include/sys/cygwin.h
+++ b/winsup/cygwin/include/sys/cygwin.h
@@ -1,7 +1,7 @@
/* sys/cygwin.h
Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,6 +14,7 @@ details. */
#include <sys/types.h>
#include <limits.h>
+#include <stdint.h>
#ifdef __cplusplus
extern "C" {
@@ -21,8 +22,9 @@ extern "C" {
#define _CYGWIN_SIGNAL_STRING "cYgSiGw00f"
+#ifndef __x86_64__
/* DEPRECATED INTERFACES. These are restricted to MAX_PATH length.
- Don't use in modern applications. */
+ Don't use in modern applications. They don't exist on x86_64. */
extern int cygwin_win32_to_posix_path_list (const char *, char *)
__attribute__ ((deprecated));
extern int cygwin_win32_to_posix_path_list_buf_size (const char *)
@@ -39,6 +41,7 @@ extern int cygwin_conv_to_posix_path (const char *, char *)
__attribute__ ((deprecated));
extern int cygwin_conv_to_full_posix_path (const char *, char *)
__attribute__ ((deprecated));
+#endif /* !__x86_64__ */
/* Use these interfaces in favor of the above. */
@@ -200,7 +203,7 @@ CW_TOKEN_RESTRICTED = 1
};
#define CW_NEXTPID 0x80000000 /* or with pid to get next one */
-unsigned long cygwin_internal (cygwin_getinfo_types, ...);
+uintptr_t cygwin_internal (cygwin_getinfo_types, ...);
/* Flags associated with process_state */
enum
@@ -255,12 +258,14 @@ struct per_process
/* The offset of these 3 values can never change. */
/* magic_biscuit is the size of this class and should never change. */
- unsigned long magic_biscuit;
- unsigned long dll_major;
- unsigned long dll_minor;
+ uint32_t magic_biscuit;
+ uint32_t dll_major;
+ uint32_t dll_minor;
struct _reent **impure_ptr_ptr;
+#ifndef __x86_64__
char ***envptr;
+#endif
/* Used to point to the memory machine we should use. Usually these
point back into the dll, but they can be overridden by the user. */
@@ -284,10 +289,10 @@ struct per_process
/* For future expansion of values set by the app. */
void (*premain[4]) (int, char **, struct per_process *);
- /* non-zero of ctors have been run. Inherited from parent. */
- int run_ctors_p;
+ /* non-zero if ctors have been run. Inherited from parent. */
+ int32_t run_ctors_p;
- DWORD unused[7];
+ DWORD_PTR unused[7];
/* Pointers to real operator new/delete functions for forwarding. */
struct per_process_cxx_malloc *cxx_malloc;
@@ -298,7 +303,11 @@ struct per_process
DWORD api_minor; /* linked with */
/* For future expansion, so apps won't have to be relinked if we
add an item. */
- DWORD unused2[3];
+#ifdef __x86_64__
+ DWORD_PTR unused2[5];
+#else
+ DWORD_PTR unused2[3];
+#endif
void *pseudo_reloc_start;
void *pseudo_reloc_end;
void *image_base;
@@ -310,7 +319,7 @@ struct per_process
#endif
struct _reent *impure_ptr;
};
-#define per_process_overwrite ((unsigned) &(((struct per_process *) NULL)->threadinterface))
+#define per_process_overwrite offsetof (struct per_process, threadinterface)
#ifdef _PATH_PASSWD
extern HANDLE cygwin_logon_user (const struct passwd *, const char *);
@@ -335,11 +344,11 @@ extern void cygwin_premain3 (int, char **, struct per_process *);
#define EXTERNAL_PINFO_VERSION_32_LP 2
#define EXTERNAL_PINFO_VERSION EXTERNAL_PINFO_VERSION_32_LP
-#ifndef _SYS_TYPES_H
-typedef unsigned short __uid16_t;
-typedef unsigned short __gid16_t;
-typedef unsigned long __uid32_t;
-typedef unsigned long __gid32_t;
+#ifndef __uid_t_defined
+typedef __uint16_t __uid16_t;
+typedef __uint16_t __gid16_t;
+typedef __uint32_t uid_t;
+typedef __uint32_t gid_t;
#endif
struct external_pinfo
@@ -367,8 +376,8 @@ struct external_pinfo
DWORD process_state;
/* Only available if version >= EXTERNAL_PINFO_VERSION_32_BIT */
- __uid32_t uid32;
- __gid32_t gid32;
+ uid_t uid32;
+ gid_t gid32;
/* Only available if version >= EXTERNAL_PINFO_VERSION_32_LP */
char *progname_long;
diff --git a/winsup/cygwin/include/sys/dirent.h b/winsup/cygwin/include/sys/dirent.h
index bcb1a2488..027fa8f73 100644
--- a/winsup/cygwin/include/sys/dirent.h
+++ b/winsup/cygwin/include/sys/dirent.h
@@ -1,6 +1,7 @@
/* Posix dirent.h for WIN32.
- Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2010, 2012 Red Hat, Inc.
+ Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2010, 2012,
+ 2013 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
@@ -16,38 +17,50 @@
#define __DIRENT_VERSION 2
+#ifndef __x86_64__
#pragma pack(push,4)
+#endif
#define _DIRENT_HAVE_D_TYPE
struct dirent
{
- long __d_version; /* Used internally */
- __ino64_t d_ino;
+ uint32_t __d_version; /* Used internally */
+ ino_t d_ino;
unsigned char d_type;
unsigned char __d_unused1[3];
__uint32_t __d_internal1;
char d_name[NAME_MAX + 1];
};
+#ifndef __x86_64__
#pragma pack(pop)
+#endif
#define d_fileno d_ino /* BSD compatible definition */
+#ifdef __x86_64__
+#define __DIRENT_COOKIE 0xcdcd8484
+#else
#define __DIRENT_COOKIE 0xdede4242
+#endif
+#ifndef __x86_64__
#pragma pack(push,4)
+#endif
typedef struct __DIR
{
/* This is first to set alignment in non _COMPILING_NEWLIB case. */
unsigned long __d_cookie;
struct dirent *__d_dirent;
char *__d_dirname; /* directory name with trailing '*' */
- long __d_position; /* used by telldir/seekdir */
+ __int32_t __d_position; /* used by telldir/seekdir */
int __d_fd;
- unsigned __d_internal;
+ uintptr_t __d_internal;
void *__handle;
void *__fh;
unsigned __flags;
} DIR;
+#ifndef __x86_64__
#pragma pack(pop)
+#endif
DIR *opendir (const char *);
DIR *fdopendir (int);
diff --git a/winsup/cygwin/include/sys/resource.h b/winsup/cygwin/include/sys/resource.h
index d487a272d..d9419d150 100644
--- a/winsup/cygwin/include/sys/resource.h
+++ b/winsup/cygwin/include/sys/resource.h
@@ -34,7 +34,7 @@ extern "C" {
#define RLIMIT_NLIMITS 7 /* upper bound of RLIMIT_* defines */
#define RLIM_NLIMITS RLIMIT_NLIMITS
-#define RLIM_INFINITY (0xffffffffUL)
+#define RLIM_INFINITY (~0UL)
#define RLIM_SAVED_MAX RLIM_INFINITY
#define RLIM_SAVED_CUR RLIM_INFINITY
diff --git a/winsup/cygwin/include/sys/socket.h b/winsup/cygwin/include/sys/socket.h
index 8a16be822..2d66abb26 100644
--- a/winsup/cygwin/include/sys/socket.h
+++ b/winsup/cygwin/include/sys/socket.h
@@ -1,7 +1,7 @@
/* sys/socket.h
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2009, 2010
- Red Hat, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2009, 2010,
+ 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -21,11 +21,6 @@ extern "C"
{
#endif
-/* SUS symbolic values for the second parm to shutdown(2) */
-#define SHUT_RD 0 /* == Win32 SD_RECEIVE */
-#define SHUT_WR 1 /* == Win32 SD_SEND */
-#define SHUT_RDWR 2 /* == Win32 SD_BOTH */
-
#ifndef __INSIDE_CYGWIN_NET__
int accept (int, struct sockaddr *__peer, socklen_t *);
int accept4 (int, struct sockaddr *__peer, socklen_t *, int flags);
diff --git a/winsup/cygwin/include/sys/strace.h b/winsup/cygwin/include/sys/strace.h
index c58b45cda..164af1e50 100644
--- a/winsup/cygwin/include/sys/strace.h
+++ b/winsup/cygwin/include/sys/strace.h
@@ -1,7 +1,7 @@
/* sys/strace.h
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
- 2010, 2011 Red Hat, Inc.
+ 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -29,6 +29,7 @@ details. */
#define _SYS_STRACE_H
#include <stdarg.h>
+#include <sys/types.h>
#ifdef __cplusplus
@@ -49,7 +50,7 @@ public:
void prntf (unsigned, const char *func, const char *, ...) /*__attribute__ ((regparm(3)))*/;
void vprntf (unsigned, const char *func, const char *, va_list ap) /*__attribute__ ((regparm(3)))*/;
void wm (int message, int word, int lon) __attribute__ ((regparm(3)));
- void write_childpid (unsigned long) __attribute__ ((regparm (3)));
+ void write_childpid (pid_t) __attribute__ ((regparm (3)));
bool attached () const {return _active == 3;}
bool active () const {return _active & 1;}
unsigned char& active_val () {return _active;}
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index f99cbf9be..78e88b94b 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -1,7 +1,7 @@
/* init.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -96,13 +96,6 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
&& (PVOID) &_my_tls > (PVOID) &test_stack_marker
&& _my_tls.isinitialized ())
_my_tls.remove (0);
- /* Windows 2000 has a bug in NtTerminateThread. Instead of releasing
- the stack at teb->DeallocationStack it uses the value of
- teb->Tib.StackLimit to evaluate the stack address. So we just claim
- there is no stack. */
- if (NtCurrentTeb ()->DeallocationStack == NULL
- && !wincap.has_stack_size_param_is_a_reservation ())
- NtCurrentTeb ()->Tib.StackLimit = NULL;
break;
}
diff --git a/winsup/cygwin/ioctl.cc b/winsup/cygwin/ioctl.cc
index fa02db4d4..326c6e28b 100644
--- a/winsup/cygwin/ioctl.cc
+++ b/winsup/cygwin/ioctl.cc
@@ -1,7 +1,7 @@
/* ioctl.cc: ioctl routines.
- Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008, 2009, 2011
- Red Hat, Inc.
+ Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008, 2009, 2011,
+ 2012 Red Hat, Inc.
Written by Doug Evans of Cygnus Support
dje@cygnus.com
@@ -33,7 +33,7 @@ ioctl (int fd, int cmd, ...)
char *argp = va_arg (ap, char *);
va_end (ap);
- debug_printf ("ioctl(fd %d, cmd %p)", fd, cmd);
+ debug_printf ("ioctl(fd %d, cmd %y)", fd, cmd);
int res;
/* FIXME: This stinks. There are collisions between cmd types
depending on whether fd is associated with a pty master or not.
@@ -58,6 +58,6 @@ ioctl (int fd, int cmd, ...)
res = cfd->ioctl (cmd, argp);
out:
- syscall_printf ("%R = ioctl(%d, %p, ...)", res, fd, cmd);
+ syscall_printf ("%R = ioctl(%d, %y, ...)", res, fd, cmd);
return res;
}
diff --git a/winsup/cygwin/ipc.cc b/winsup/cygwin/ipc.cc
index 5bf8b20fb..3be8666fb 100644
--- a/winsup/cygwin/ipc.cc
+++ b/winsup/cygwin/ipc.cc
@@ -18,7 +18,7 @@
extern "C" key_t
ftok (const char *path, int id)
{
- struct __stat64 statbuf;
+ struct stat statbuf;
key_t tmp;
if (stat64 (path, &statbuf))
{
diff --git a/winsup/cygwin/kernel32.cc b/winsup/cygwin/kernel32.cc
index 5b6aae771..6eeb2dc43 100644
--- a/winsup/cygwin/kernel32.cc
+++ b/winsup/cygwin/kernel32.cc
@@ -310,7 +310,7 @@ CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
ULONG attribs = flProtect & (SEC_COMMIT | SEC_IMAGE | SEC_NOCACHE
| SEC_RESERVE);
LARGE_INTEGER size = {{ LowPart : dwMaximumSizeLow,
- HighPart : dwMaximumSizeHigh }};
+ HighPart : (LONG) dwMaximumSizeHigh }};
PLARGE_INTEGER psize = size.QuadPart ? &size : NULL;
if (prot & (PAGE_READWRITE | PAGE_WRITECOPY
diff --git a/winsup/cygwin/lc_msg.h b/winsup/cygwin/lc_msg.h
index 98b9e4b86..6b7ccaaff 100644
--- a/winsup/cygwin/lc_msg.h
+++ b/winsup/cygwin/lc_msg.h
@@ -1,5 +1,5 @@
/* This struct of LC_MESSAGES data has been generated by fetching locale
- data from a Linux system using glibc-2.14-5.x86_64 on 2011-09-01. */
+ data from a Linux system using glibc-2.16-28.fc18.x86_64 on 2013-03-30. */
struct lc_msg_t
{
@@ -46,12 +46,14 @@ static struct lc_msg_t lc_msg[] =
{ "ber_DZ", L"^[Bb].*", L"^[YyNn].*", L"b\x0259li", L"yox" },
{ "ber_MA", L"^[Bb].*", L"^[YyNn].*", L"b\x0259li", L"yox" },
{ "bg_BG", L"^[+1\x0414\x0434\x0044\x0064YyOo].*", L"^[-0\x041d\x043dNnKk].*", L"", L"" },
+ { "bho_IN", L"^[yY].*", L"^[nN].*", L"", L"" },
{ "bn_BD", L"^[\x09b9\x09cd\x09af\x09be\x0981yY]", L"^[\x09a8\x09benN]", L"\x09b9\x09cd\x09af\x09be\x0981", L"\x09a8\x09be" },
{ "bn_IN", L"^[\x09b9\x09cd\x09af\x09be\x0981yY]", L"^[\x09a8\x09benN]", L"\x09b9\x09cd\x09af\x09be\x0981", L"\x09a8\x09be" },
{ "bo_CN", L"^[\x0f68Yy].*", L"^[\x0f58Nn].*", L"\x0f68\x0f72\x0f53", L"\x0f58\x0f7a\x0f53" },
{ "bo_IN", L"^[\x0f68Yy].*", L"^[\x0f58Nn].*", L"\x0f68\x0f72\x0f53", L"\x0f58\x0f7a\x0f53" },
{ "br_FR", L"^[oOyY].*", L"^[nN].*", L"", L"" },
{ "br_FR@euro", L"^[oOyY].*", L"^[nN].*", L"", L"" },
+ { "brx_IN", L"^(\x0928\x0902\x0917\x094c|[yY])", L"^(\x0928\x0919\x093e|[nN])", L"", L"" },
{ "bs_BA", L"^[dDyY]*.", L"^[nN]*.", L"", L"" },
{ "byn_ER", L"^[yY].*", L"^[nN].*", L"", L"" },
{ "ca_AD", L"^[sSyY].*", L"^[nN].*", L"", L"" },
@@ -74,6 +76,7 @@ static struct lc_msg_t lc_msg[] =
{ "de_DE@euro", L"^[jJyY].*", L"^[nN].*", L"", L"" },
{ "de_LU", L"^[jJyY].*", L"^[nN].*", L"", L"" },
{ "de_LU@euro", L"^[jJyY].*", L"^[nN].*", L"", L"" },
+ { "doi_IN", L"^(\x0911\x0939|[yY])", L"^(\x0928\x093e|[nN])", L"", L"" },
{ "dv_MV", L"^[yY].*", L"^[nN].*", L"", L"" },
{ "dz_BT", L"^[\x0f68Yy].*", L"^[\x0f58Nn].*", L"\x0f68\x0f72\x0f53", L"\x0f58\x0f7a\x0f53" },
{ "el_CY", L"^[\x03bd\x039dyY].*", L"^[\x03bf\x039fnN].*", L"", L"" },
@@ -101,6 +104,7 @@ static struct lc_msg_t lc_msg[] =
{ "es_CL", L"^[sSyY].*", L"^[nN].*", L"", L"" },
{ "es_CO", L"^[sSyY].*", L"^[nN].*", L"", L"" },
{ "es_CR", L"^[sSyY].*", L"^[nN].*", L"", L"" },
+ { "es_CU", L"^[sSyY].*", L"^[nN].*", L"", L"" },
{ "es_DO", L"^[sSyY].*", L"^[nN].*", L"", L"" },
{ "es_EC", L"^[sSyY].*", L"^[nN].*", L"", L"" },
{ "es_ES", L"^[sSyY].*", L"^[nN].*", L"", L"" },
@@ -122,8 +126,8 @@ static struct lc_msg_t lc_msg[] =
{ "eu_ES@euro", L"^[bBsSyY].*", L"^[eEnN].*", L"", L"" },
{ "fa_IR", L"^[yY\x0622\x0628Hf].*", L"^[nN\x062e\x0646ok].*", L"", L"" },
{ "ff_SN", L"^[yYeE].*", L"^[nNaA].*", L"", L"" },
- { "fi_FI", L"^[KkJjYy].*", L"^[NnEe].*", L"", L"" },
- { "fi_FI@euro", L"^[KkJjYy].*", L"^[NnEe].*", L"", L"" },
+ { "fi_FI", L"^[KkYy].*", L"^[EeNn].*", L"", L"" },
+ { "fi_FI@euro", L"^[KkYy].*", L"^[EeNn].*", L"", L"" },
{ "fil_PH", L"[oOyY].*", L"[hHnN].*", L"oo", L"hindi" },
{ "fo_FO", L"^[JjYy].*", L"^[Nn].*", L"", L"" },
{ "fr_BE", L"^[oOjJyY1].*", L"^[nN0].*", L"", L"" },
@@ -187,6 +191,7 @@ static struct lc_msg_t lc_msg[] =
{ "lo_LA", L"^[yY\x0ea1]", L"^[nN\x0e9a]", L"\x0ec1\x0ea1\x0ec8\x0e99", L"\x0e9a\x0ecd\x0ec8\x0ec1\x0ea1\x0ec8\x0e99" },
{ "lt_LT", L"^[TtYy].*", L"^[Nn].*", L"", L"" },
{ "lv_LV", L"^[JjYy].*", L"^[Nn].*", L"", L"" },
+ { "mag_IN", L"^[yY].*", L"^[nN].*", L"", L"" },
{ "mai_IN", L"^[yY].*", L"^[nN].*", L"", L"" },
{ "mg_MG", L"^[eEyY].*", L"^[tTnN].*", L"", L"" },
{ "mhr_RU", L"^[\x0422\x0442Yy].*", L"^[\x0423\x0443Nn].*", L"", L"" },
@@ -194,6 +199,7 @@ static struct lc_msg_t lc_msg[] =
{ "mk_MK", L"^[\x0414\x0434\x0044\x0064Yy1].*", L"^[\x041d\x043dNn0].*", L"\x0434\x0430", L"\x043d\x0435" },
{ "ml_IN", L"^[\x0d05\x0d24\x0d46yY]", L"^[\x0d05\x0d32\x0d4d\x0d32nN]", L"\x0d05\x0d24\x0d46", L"\x0d05\x0d32\x0d4d\x0d32" },
{ "mn_MN", L"^[\x0442\x0422yY].*", L"^[\x04af\x04aenN].*", L"", L"" },
+ { "mni_IN", L"^[yY]", L"^[nN]", L"Yes", L"No" },
{ "mr_IN", L"^(Yes|[yY])", L"^(No|[nN])", L"", L"" },
{ "ms_MY", L"^[yY]", L"^[tT]", L"Ya", L"Tidak" },
{ "mt_MT", L"^(Yes|[yY])", L"^(No|[nN])", L"", L"" },
@@ -230,6 +236,7 @@ static struct lc_msg_t lc_msg[] =
{ "ru_UA", L"^[\x0414\x0434Yy].*", L"^[\x041d\x043dNn].*", L"", L"" },
{ "rw_RW", L"^[yY]", L"^[nNoO]", L"", L"" },
{ "sa_IN", L"^[aAyY].*", L"^[nN].*", L"", L"" },
+ { "sat_IN", L"^(\x0939\x094b\x092f|[yY])", L"^(\x092c\x093e\x0919|[nN])", L"", L"" },
{ "sc_IT", L"^[sSjJoOyY].*", L"^[nN].*", L"", L"" },
{ "sd_IN", L"^[\x0646yY].*", L"^[\x0644nN].*", L"\x0646\x0639\x0645", L"\x0644\x0627" },
{ "sd_IN@devanagari", L"^[yY].*", L"^[nN].*", L"", L"" },
@@ -261,6 +268,7 @@ static struct lc_msg_t lc_msg[] =
{ "sw_KE", L"^[nNyY].*", L"^[hHlL].*", L"", L"" },
{ "sw_TZ", L"^[nNyY].*", L"^[hHlL].*", L"", L"" },
{ "ta_IN", L"^[\x0b86\x0bae\x0bcdyY]", L"^[\x0b87\x0bb2\x0bcd\x0bb2\x0bc8nN]", L"\x0b86\x0bae\x0bcd", L"\x0b87\x0bb2\x0bcd\x0bb2\x0bc8" },
+ { "ta_LK", L"^[\x0b86\x0bae\x0bcdyY]", L"^[\x0b87\x0bb2\x0bcd\x0bb2\x0bc8nN]", L"\x0b86\x0bae\x0bcd", L"\x0b87\x0bb2\x0bcd\x0bb2\x0bc8" },
{ "te_IN", L"^[yY\x0c05].*", L"^[nN\x0c15].*", L"\x0c05\x0c35\x0c28\x0c41", L"\x0c15\x0c3e\x0c26\x0c41" },
{ "tg_TJ", L"^[\x04b2\x04b3\x0425\x0445\x0414\x0434Yy].*", L"^[\x041d\x043dNn].*", L"\x0434\x0430", L"\x043d\x0435\x0442" },
{ "th_TH", L"^[yY\x0e0a]", L"^[nN\x0e21]", L"\x0e43\x0e0a\x0e48", L"\x0e44\x0e21\x0e48\x0e43\x0e0a\x0e48" },
@@ -277,6 +285,8 @@ static struct lc_msg_t lc_msg[] =
{ "tt_RU@iqtelif", L"^[Ee].*", L"^[YyNn].*", L"ey\x00ed", L"yuq" },
{ "ug_CN", L"^[1JjsSyYoO].*", L"^[0nN].*", L"yes", L"no" },
{ "uk_UA", L"^([Yy+]|[\x0422\x0442][\x0410\x0430][\x041a\x043a]?)$", L"^([Nn-]|[\x041d\x043d][\x0406\x0456])$", L"\x0442\x0430\x043a", L"\x043d\x0456" },
+ { "unm_US", L"^[yY].*", L"^[kKmM].*", L"", L"" },
+ { "ur_IN", L"^[\x06c1yY].*", L"^[\x0646nN].*", L"\x06c1\x0627\x06ba", L"\x0646\x06c1\x06cc\x06ba" },
{ "ur_PK", L"^[yY\x0647\x0628\x0066].*", L"^[nN\x0646o].*", L"\x0628\x0644\x0643\x0644", L"\x0646\x0647\x064a\x06ba" },
{ "uz_UZ", L"^[yY\x0647\x0628\x0066].*", L"^[nN\x0646o].*", L"\x0628\x0644\x0643\x0644", L"\x0646\x0647\x064a\x06ba" },
{ "uz_UZ@cyrillic", L"^[\x04b2\x04b3Yy].*", L"^[\x0419\x0439Nn].*", L"\x04b2\x0430", L"\x0419\x045e\x049b" },
@@ -285,6 +295,7 @@ static struct lc_msg_t lc_msg[] =
{ "wa_BE", L"^[oOyYaAwW].*", L"^[nN].*", L"Oyi", L"Neni" },
{ "wa_BE@euro", L"^[oOyYaAwW].*", L"^[nN].*", L"Oyi", L"Neni" },
{ "wae_CH", L"^[jJyY].*", L"^[nN].*", L"Ja", L"Nei" },
+ { "wal_ET", L"^[yY].*", L"^[nN].*", L"", L"" },
{ "wo_SN", L"^[wWyY].*", L"^[dDnN].*", L"", L"" },
{ "xh_ZA", L"^[yYeE]", L"^[nNhH]", L"", L"" },
{ "yi_US", L"^[Yy\x05d9].*", L"^[Nn\x05e0\x05e7].*", L"\x05d9\x05d0\x05b8", L"\x05e7\x05f2\x05df" },
diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc
index 83cbda828..b22859ec0 100644
--- a/winsup/cygwin/lib/_cygwin_crt0_common.cc
+++ b/winsup/cygwin/lib/_cygwin_crt0_common.cc
@@ -1,6 +1,7 @@
/* _cygwin_crt0_common.cc: common crt0 function for cygwin crt0's.
- Copyright 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011, 2012, 2013
+ Red Hat, Inc.
This file is part of Cygwin.
@@ -16,26 +17,42 @@ details. */
unnecessarily. */
#define WEAK __attribute__ ((weak))
+#ifdef __x86_64__
+#define REAL_ZNWX "__real__Znwm"
+#define REAL_ZNAX "__real__Znam"
+#define REAL_ZNWX_NOTHROW_T "__real__ZnwmRKSt9nothrow_t"
+#define REAL_ZNAX_NOTHROW_T "__real__ZnamRKSt9nothrow_t"
+#else
+#define REAL_ZNWX "___real__Znwj"
+#define REAL_ZNAX "___real__Znaj"
+#define REAL_ZNWX_NOTHROW_T "___real__ZnwjRKSt9nothrow_t"
+#define REAL_ZNAX_NOTHROW_T "___real__ZnajRKSt9nothrow_t"
+#endif
+#define REAL_ZDLPV _SYMSTR (__real__ZdlPv)
+#define REAL_ZDAPV _SYMSTR (__real__ZdaPv)
+#define REAL_ZDLPV_NOTHROW_T _SYMSTR (__real__ZdlPvRKSt9nothrow_t)
+#define REAL_ZDAPV_NOTHROW_T _SYMSTR (__real__ZdaPvRKSt9nothrow_t)
+
/* Use asm names to bypass the --wrap that is being applied to redirect all other
references to these operators toward the redirectors in the Cygwin DLL; this
way we can record what definitions were visible at final link time but still
send all calls to the redirectors. */
extern WEAK void *operator new(std::size_t sz) throw (std::bad_alloc)
- __asm__ ("___real__Znwj");
+ __asm__ (REAL_ZNWX);
extern WEAK void *operator new[](std::size_t sz) throw (std::bad_alloc)
- __asm__ ("___real__Znaj");
+ __asm__ (REAL_ZNAX);
extern WEAK void operator delete(void *p) throw()
- __asm__ ("___real__ZdlPv ");
+ __asm__ (REAL_ZDLPV);
extern WEAK void operator delete[](void *p) throw()
- __asm__ ("___real__ZdaPv");
+ __asm__ (REAL_ZDAPV);
extern WEAK void *operator new(std::size_t sz, const std::nothrow_t &nt) throw()
- __asm__ ("___real__ZnwjRKSt9nothrow_t");
+ __asm__ (REAL_ZNWX_NOTHROW_T);
extern WEAK void *operator new[](std::size_t sz, const std::nothrow_t &nt) throw()
- __asm__ ("___real__ZnajRKSt9nothrow_t");
+ __asm__ (REAL_ZNAX_NOTHROW_T);
extern WEAK void operator delete(void *p, const std::nothrow_t &nt) throw()
- __asm__ ("___real__ZdlPvRKSt9nothrow_t");
+ __asm__ (REAL_ZDLPV_NOTHROW_T);
extern WEAK void operator delete[](void *p, const std::nothrow_t &nt) throw()
- __asm__ ("___real__ZdaPvRKSt9nothrow_t");
+ __asm__ (REAL_ZDAPV_NOTHROW_T);
/* Avoid an info message from linker when linking applications. */
extern __declspec(dllimport) struct _reent *_impure_ptr;
@@ -47,12 +64,19 @@ extern int __dynamically_loaded;
extern "C"
{
+#ifndef __x86_64__
char **environ;
+#endif
int _fmode;
extern char __RUNTIME_PSEUDO_RELOC_LIST__;
extern char __RUNTIME_PSEUDO_RELOC_LIST_END__;
+#ifdef __x86_64__
+extern char __image_base__;
+#define _image_base__ __image_base__
+#else
extern char _image_base__;
+#endif
struct per_process_cxx_malloc __cygwin_cxx_malloc =
{
@@ -93,7 +117,9 @@ _cygwin_crt0_common (MainFunc f, per_process *u)
u->ctors = &__CTOR_LIST__;
u->dtors = &__DTOR_LIST__;
+#ifndef __x86_64__
u->envptr = &environ;
+#endif
if (uwasnull)
_impure_ptr = u->impure_ptr; /* Use field initialized in newer DLLs. */
else
@@ -145,10 +171,17 @@ _cygwin_crt0_common (MainFunc f, per_process *u)
u->hmodule = GetModuleHandle (0);
/* variables for fork */
+#ifdef __x86_64__
+ u->data_start = &__data_start__;
+ u->data_end = &__data_end__;
+ u->bss_start = &__bss_start__;
+ u->bss_end = &__bss_end__;
+#else
u->data_start = &_data_start__;
u->data_end = &_data_end__;
u->bss_start = &_bss_start__;
u->bss_end = &_bss_end__;
+#endif
u->pseudo_reloc_start = &__RUNTIME_PSEUDO_RELOC_LIST__;
u->pseudo_reloc_end = &__RUNTIME_PSEUDO_RELOC_LIST_END__;
u->image_base = &_image_base__;
diff --git a/winsup/cygwin/lib/crt0.h b/winsup/cygwin/lib/crt0.h
index 1d0b6f0c3..d289e7824 100644
--- a/winsup/cygwin/lib/crt0.h
+++ b/winsup/cygwin/lib/crt0.h
@@ -16,7 +16,7 @@ extern "C" {
struct per_process;
typedef int (*MainFunc) (int argc, char *argv[], char **env);
int __stdcall _cygwin_crt0_common (MainFunc, struct per_process *);
-int dll_dllcrt0 (HMODULE, struct per_process *);
+PVOID dll_dllcrt0 (HMODULE, struct per_process *);
#ifdef __cplusplus
}
diff --git a/winsup/cygwin/lib/cygwin_attach_dll.c b/winsup/cygwin/lib/cygwin_attach_dll.c
index 54c3caf4c..543073c89 100644
--- a/winsup/cygwin/lib/cygwin_attach_dll.c
+++ b/winsup/cygwin/lib/cygwin_attach_dll.c
@@ -16,7 +16,7 @@ details. */
#include "crt0.h"
/* for a loaded dll */
-int
+PVOID
cygwin_attach_dll (HMODULE h, MainFunc f)
{
static struct per_process u;
diff --git a/winsup/cygwin/lib/premain0.c b/winsup/cygwin/lib/premain0.c
index b77e02e8e..20e4e7712 100644
--- a/winsup/cygwin/lib/premain0.c
+++ b/winsup/cygwin/lib/premain0.c
@@ -1,6 +1,6 @@
/* premain0.c
- Copyright 2000 Red Hat, Inc.
+ Copyright 2000, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
void
-cygwin_premain0(int argc, char **argv)
+cygwin_premain0(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
{
}
diff --git a/winsup/cygwin/lib/premain1.c b/winsup/cygwin/lib/premain1.c
index 99aeac916..e30d11265 100644
--- a/winsup/cygwin/lib/premain1.c
+++ b/winsup/cygwin/lib/premain1.c
@@ -1,6 +1,6 @@
/* premain1.c
- Copyright 2000 Red Hat, Inc.
+ Copyright 2000, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
void
-cygwin_premain1(int argc, char **argv)
+cygwin_premain1(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
{
}
diff --git a/winsup/cygwin/lib/premain2.c b/winsup/cygwin/lib/premain2.c
index a89e76ec3..437562dc5 100644
--- a/winsup/cygwin/lib/premain2.c
+++ b/winsup/cygwin/lib/premain2.c
@@ -1,6 +1,6 @@
/* premain2.c
- Copyright 2000 Red Hat, Inc.
+ Copyright 2000, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
void
-cygwin_premain2(int argc, char **argv)
+cygwin_premain2(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
{
}
diff --git a/winsup/cygwin/lib/premain3.c b/winsup/cygwin/lib/premain3.c
index c5b99b918..b37758600 100644
--- a/winsup/cygwin/lib/premain3.c
+++ b/winsup/cygwin/lib/premain3.c
@@ -1,6 +1,6 @@
/* premain3.c
- Copyright 2000 Red Hat, Inc.
+ Copyright 2000, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
void
-cygwin_premain3(int argc, char **argv)
+cygwin_premain3(int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)))
{
}
diff --git a/winsup/cygwin/libc/arc4random.cc b/winsup/cygwin/libc/arc4random.cc
new file mode 100644
index 000000000..2a38b1355
--- /dev/null
+++ b/winsup/cygwin/libc/arc4random.cc
@@ -0,0 +1,363 @@
+/* $OpenBSD: arc4random.c,v 1.22 2010/12/22 08:23:42 otto Exp $ */
+
+/*
+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Arc4 random number generator for OpenBSD.
+ *
+ * This code is derived from section 17.1 of Applied Cryptography,
+ * second edition, which describes a stream cipher allegedly
+ * compatible with RSA Labs "RC4" cipher (the actual description of
+ * which is a trade secret). The same algorithm is used as a stream
+ * cipher called "arcfour" in Tatu Ylonen's ssh package.
+ *
+ * RC4 is a registered trademark of RSA Laboratories.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/lib/libc/gen/arc4random.c,v 1.30 2012/11/17 01:49:23 svnexp Exp $");
+
+#ifdef __CYGWIN__
+#include "winsup.h"
+#include "sync.h"
+#else
+#include "namespace.h"
+#endif
+#include <fcntl.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#ifndef __CYGWIN__
+#include <sys/sysctl.h>
+#endif
+#include <sys/time.h>
+#include <pthread.h>
+
+#ifndef __CYGWIN__
+#include "libc_private.h"
+#include "un-namespace.h"
+#endif
+
+#ifdef __CYGWIN__
+#define _open open
+#define _read read
+#define _close close
+#endif
+
+#ifdef __GNUC__
+#define inline __inline
+#else /* !__GNUC__ */
+#define inline
+#endif /* !__GNUC__ */
+
+struct arc4_stream {
+ u_int8_t i;
+ u_int8_t j;
+ u_int8_t s[256];
+};
+
+#ifdef __CYGWIN__
+static NO_COPY muto arc4random_mtx;
+#else
+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+#define RANDOMDEV "/dev/random"
+#define KEYSIZE 128
+#ifdef __CYGWIN__
+#define _ARC4_LOCK() \
+ do { \
+ if (__isthreaded) \
+ arc4random_mtx.init ("arc4random_mtx")->acquire (); \
+ } while (0)
+#define _ARC4_UNLOCK() \
+ do { \
+ if (__isthreaded) \
+ arc4random_mtx.release (); \
+ } while (0)
+#else
+#define _ARC4_LOCK() \
+ do { \
+ if (__isthreaded) \
+ _pthread_mutex_lock(&arc4random_mtx); \
+ } while (0)
+
+#define _ARC4_UNLOCK() \
+ do { \
+ if (__isthreaded) \
+ _pthread_mutex_unlock(&arc4random_mtx); \
+ } while (0)
+#endif
+
+static int rs_initialized;
+static struct arc4_stream rs;
+static pid_t arc4_stir_pid;
+static int arc4_count;
+
+#ifndef __CYGWIN__
+extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
+ void *newp, size_t newlen);
+#endif
+
+static inline u_int8_t arc4_getbyte(void);
+static void arc4_stir(void);
+
+static inline void
+arc4_init(void)
+{
+ int n;
+
+ for (n = 0; n < 256; n++)
+ rs.s[n] = n;
+ rs.i = 0;
+ rs.j = 0;
+}
+
+static inline void
+arc4_addrandom(u_char *dat, int datlen)
+{
+ int n;
+ u_int8_t si;
+
+ rs.i--;
+ for (n = 0; n < 256; n++) {
+ rs.i = (rs.i + 1);
+ si = rs.s[rs.i];
+ rs.j = (rs.j + si + dat[n % datlen]);
+ rs.s[rs.i] = rs.s[rs.j];
+ rs.s[rs.j] = si;
+ }
+ rs.j = rs.i;
+}
+
+#ifndef __CYGWIN__
+static size_t
+arc4_sysctl(u_char *buf, size_t size)
+{
+ int mib[2];
+ size_t len, done;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_ARND;
+ done = 0;
+
+ do {
+ len = size;
+ if (__sysctl(mib, 2, buf, &len, NULL, 0) == -1)
+ return (done);
+ done += len;
+ buf += len;
+ size -= len;
+ } while (size > 0);
+
+ return (done);
+}
+#endif
+
+static void
+arc4_stir(void)
+{
+ int done, fd, i;
+ struct {
+ struct timeval tv;
+ pid_t pid;
+ u_char rnd[KEYSIZE];
+ } rdat;
+
+ if (!rs_initialized) {
+ arc4_init();
+ rs_initialized = 1;
+ }
+ done = 0;
+#ifndef __CYGWIN__
+ if (arc4_sysctl((u_char *)&rdat, KEYSIZE) == KEYSIZE)
+ done = 1;
+#endif
+ if (!done) {
+ fd = _open(RANDOMDEV, O_RDONLY | O_CLOEXEC, 0);
+ if (fd >= 0) {
+ if (_read(fd, &rdat, KEYSIZE) == KEYSIZE)
+ done = 1;
+ (void)_close(fd);
+ }
+ }
+ if (!done) {
+ (void)gettimeofday(&rdat.tv, NULL);
+ rdat.pid = getpid();
+ /* We'll just take whatever was on the stack too... */
+ }
+
+ arc4_addrandom((u_char *)&rdat, KEYSIZE);
+
+ /*
+ * Discard early keystream, as per recommendations in:
+ * "(Not So) Random Shuffles of RC4" by Ilya Mironov.
+ */
+ for (i = 0; i < 1024; i++)
+ (void)arc4_getbyte();
+ arc4_count = 1600000;
+}
+
+static void
+arc4_stir_if_needed(void)
+{
+ pid_t pid = getpid();
+
+ if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid)
+ {
+ arc4_stir_pid = pid;
+ arc4_stir();
+ }
+}
+
+static inline u_int8_t
+arc4_getbyte(void)
+{
+ u_int8_t si, sj;
+
+ rs.i = (rs.i + 1);
+ si = rs.s[rs.i];
+ rs.j = (rs.j + si);
+ sj = rs.s[rs.j];
+ rs.s[rs.i] = sj;
+ rs.s[rs.j] = si;
+ return (rs.s[(si + sj) & 0xff]);
+}
+
+static inline u_int32_t
+arc4_getword(void)
+{
+ u_int32_t val;
+ val = arc4_getbyte() << 24;
+ val |= arc4_getbyte() << 16;
+ val |= arc4_getbyte() << 8;
+ val |= arc4_getbyte();
+ return val;
+}
+
+void
+arc4random_stir(void)
+{
+ _ARC4_LOCK();
+ arc4_stir();
+ _ARC4_UNLOCK();
+}
+
+void
+arc4random_addrandom(u_char *dat, int datlen)
+{
+ _ARC4_LOCK();
+ if (!rs_initialized)
+ arc4_stir();
+ arc4_addrandom(dat, datlen);
+ _ARC4_UNLOCK();
+}
+
+u_int32_t
+arc4random(void)
+{
+ u_int32_t val;
+ _ARC4_LOCK();
+ arc4_count -= 4;
+ arc4_stir_if_needed();
+ val = arc4_getword();
+ _ARC4_UNLOCK();
+ return val;
+}
+
+void
+arc4random_buf(void *_buf, size_t n)
+{
+ u_char *buf = (u_char *)_buf;
+ _ARC4_LOCK();
+ arc4_stir_if_needed();
+ while (n--) {
+ if (--arc4_count <= 0)
+ arc4_stir();
+ buf[n] = arc4_getbyte();
+ }
+ _ARC4_UNLOCK();
+}
+
+/*
+ * Calculate a uniformly distributed random number less than upper_bound
+ * avoiding "modulo bias".
+ *
+ * Uniformity is achieved by generating new random numbers until the one
+ * returned is outside the range [0, 2**32 % upper_bound). This
+ * guarantees the selected random number will be inside
+ * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound)
+ * after reduction modulo upper_bound.
+ */
+u_int32_t
+arc4random_uniform(u_int32_t upper_bound)
+{
+ u_int32_t r, min;
+
+ if (upper_bound < 2)
+ return 0;
+
+#if (ULONG_MAX > 0xffffffffUL)
+ min = 0x100000000UL % upper_bound;
+#else
+ /* Calculate (2**32 % upper_bound) avoiding 64-bit math */
+ if (upper_bound > 0x80000000)
+ min = 1 + ~upper_bound; /* 2**32 - upper_bound */
+ else {
+ /* (2**32 - (x * 2)) % x == 2**32 % x when x <= 2**31 */
+ min = ((0xffffffff - (upper_bound * 2)) + 1) % upper_bound;
+ }
+#endif
+
+ /*
+ * This could theoretically loop forever but each retry has
+ * p > 0.5 (worst case, usually far better) of selecting a
+ * number inside the range we need, so it should rarely need
+ * to re-roll.
+ */
+ for (;;) {
+ r = arc4random();
+ if (r >= min)
+ break;
+ }
+
+ return r % upper_bound;
+}
+
+#if 0
+/*-------- Test code for i386 --------*/
+#include <stdio.h>
+#include <machine/pctr.h>
+int
+main(int argc, char **argv)
+{
+ const int iter = 1000000;
+ int i;
+ pctrval v;
+
+ v = rdtsc();
+ for (i = 0; i < iter; i++)
+ arc4random();
+ v = rdtsc() - v;
+ v /= iter;
+
+ printf("%qd cycles\n", v);
+}
+#endif
diff --git a/winsup/cygwin/libc/base64.c b/winsup/cygwin/libc/base64.c
new file mode 100644
index 000000000..933c92721
--- /dev/null
+++ b/winsup/cygwin/libc/base64.c
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 1996, 1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <winsup.h>
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/lib/libc/net/base64.c,v 1.6 2012/11/17 01:49:32 svnexp Exp $");
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <resolv.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define Assert(Cond) if (!(Cond)) abort()
+
+static const char Base64[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char Pad64 = '=';
+
+/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
+ The following encoding technique is taken from RFC 1521 by Borenstein
+ and Freed. It is reproduced here in a slightly edited form for
+ convenience.
+
+ A 65-character subset of US-ASCII is used, enabling 6 bits to be
+ represented per printable character. (The extra 65th character, "=",
+ is used to signify a special processing function.)
+
+ The encoding process represents 24-bit groups of input bits as output
+ strings of 4 encoded characters. Proceeding from left to right, a
+ 24-bit input group is formed by concatenating 3 8-bit input groups.
+ These 24 bits are then treated as 4 concatenated 6-bit groups, each
+ of which is translated into a single digit in the base64 alphabet.
+
+ Each 6-bit group is used as an index into an array of 64 printable
+ characters. The character referenced by the index is placed in the
+ output string.
+
+ Table 1: The Base64 Alphabet
+
+ Value Encoding Value Encoding Value Encoding Value Encoding
+ 0 A 17 R 34 i 51 z
+ 1 B 18 S 35 j 52 0
+ 2 C 19 T 36 k 53 1
+ 3 D 20 U 37 l 54 2
+ 4 E 21 V 38 m 55 3
+ 5 F 22 W 39 n 56 4
+ 6 G 23 X 40 o 57 5
+ 7 H 24 Y 41 p 58 6
+ 8 I 25 Z 42 q 59 7
+ 9 J 26 a 43 r 60 8
+ 10 K 27 b 44 s 61 9
+ 11 L 28 c 45 t 62 +
+ 12 M 29 d 46 u 63 /
+ 13 N 30 e 47 v
+ 14 O 31 f 48 w (pad) =
+ 15 P 32 g 49 x
+ 16 Q 33 h 50 y
+
+ Special processing is performed if fewer than 24 bits are available
+ at the end of the data being encoded. A full encoding quantum is
+ always completed at the end of a quantity. When fewer than 24 input
+ bits are available in an input group, zero bits are added (on the
+ right) to form an integral number of 6-bit groups. Padding at the
+ end of the data is performed using the '=' character.
+
+ Since all base64 input is an integral number of octets, only the
+ -------------------------------------------------
+ following cases can arise:
+
+ (1) the final quantum of encoding input is an integral
+ multiple of 24 bits; here, the final unit of encoded
+ output will be an integral multiple of 4 characters
+ with no "=" padding,
+ (2) the final quantum of encoding input is exactly 8 bits;
+ here, the final unit of encoded output will be two
+ characters followed by two "=" padding characters, or
+ (3) the final quantum of encoding input is exactly 16 bits;
+ here, the final unit of encoded output will be three
+ characters followed by one "=" padding character.
+ */
+
+int
+b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
+ size_t datalength = 0;
+ u_char input[3];
+ u_char output[4];
+ size_t i;
+
+ while (2 < srclength) {
+ input[0] = *src++;
+ input[1] = *src++;
+ input[2] = *src++;
+ srclength -= 3;
+
+ output[0] = input[0] >> 2;
+ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+ output[3] = input[2] & 0x3f;
+ Assert(output[0] < 64);
+ Assert(output[1] < 64);
+ Assert(output[2] < 64);
+ Assert(output[3] < 64);
+
+ if (datalength + 4 > targsize)
+ return (-1);
+ target[datalength++] = Base64[output[0]];
+ target[datalength++] = Base64[output[1]];
+ target[datalength++] = Base64[output[2]];
+ target[datalength++] = Base64[output[3]];
+ }
+
+ /* Now we worry about padding. */
+ if (0 != srclength) {
+ /* Get what's left. */
+ input[0] = input[1] = input[2] = '\0';
+ for (i = 0; i < srclength; i++)
+ input[i] = *src++;
+
+ output[0] = input[0] >> 2;
+ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+ Assert(output[0] < 64);
+ Assert(output[1] < 64);
+ Assert(output[2] < 64);
+
+ if (datalength + 4 > targsize)
+ return (-1);
+ target[datalength++] = Base64[output[0]];
+ target[datalength++] = Base64[output[1]];
+ if (srclength == 1)
+ target[datalength++] = Pad64;
+ else
+ target[datalength++] = Base64[output[2]];
+ target[datalength++] = Pad64;
+ }
+ if (datalength >= targsize)
+ return (-1);
+ target[datalength] = '\0'; /* Returned value doesn't count \0. */
+ return (datalength);
+}
+
+/* skips all whitespace anywhere.
+ converts characters, four at a time, starting at (or after)
+ src from base - 64 numbers into three 8 bit bytes in the target area.
+ it returns the number of data bytes stored at the target, or -1 on error.
+ */
+
+int
+b64_pton(src, target, targsize)
+ char const *src;
+ u_char *target;
+ size_t targsize;
+{
+ int tarindex, state, ch;
+ char *pos;
+
+ state = 0;
+ tarindex = 0;
+
+ while ((ch = *src++) != '\0') {
+ if (isspace((unsigned char)ch)) /* Skip whitespace anywhere. */
+ continue;
+
+ if (ch == Pad64)
+ break;
+
+ pos = strchr(Base64, ch);
+ if (pos == 0) /* A non-base64 character. */
+ return (-1);
+
+ switch (state) {
+ case 0:
+ if (target) {
+ if ((size_t)tarindex >= targsize)
+ return (-1);
+ target[tarindex] = (pos - Base64) << 2;
+ }
+ state = 1;
+ break;
+ case 1:
+ if (target) {
+ if ((size_t)tarindex + 1 >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64) >> 4;
+ target[tarindex+1] = ((pos - Base64) & 0x0f)
+ << 4 ;
+ }
+ tarindex++;
+ state = 2;
+ break;
+ case 2:
+ if (target) {
+ if ((size_t)tarindex + 1 >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64) >> 2;
+ target[tarindex+1] = ((pos - Base64) & 0x03)
+ << 6;
+ }
+ tarindex++;
+ state = 3;
+ break;
+ case 3:
+ if (target) {
+ if ((size_t)tarindex >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64);
+ }
+ tarindex++;
+ state = 0;
+ break;
+ default:
+ abort();
+ }
+ }
+
+ /*
+ * We are done decoding Base-64 chars. Let's see if we ended
+ * on a byte boundary, and/or with erroneous trailing characters.
+ */
+
+ if (ch == Pad64) { /* We got a pad char. */
+ ch = *src++; /* Skip it, get next. */
+ switch (state) {
+ case 0: /* Invalid = in first position */
+ case 1: /* Invalid = in second position */
+ return (-1);
+
+ case 2: /* Valid, means one byte of info */
+ /* Skip any number of spaces. */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (!isspace((unsigned char)ch))
+ break;
+ /* Make sure there is another trailing = sign. */
+ if (ch != Pad64)
+ return (-1);
+ ch = *src++; /* Skip the = */
+ /* Fall through to "single trailing =" case. */
+ /* FALLTHROUGH */
+
+ case 3: /* Valid, means two bytes of info */
+ /*
+ * We know this char is an =. Is there anything but
+ * whitespace after it?
+ */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (!isspace((unsigned char)ch))
+ return (-1);
+
+ /*
+ * Now make sure for cases 2 and 3 that the "extra"
+ * bits that slopped past the last full byte were
+ * zeros. If we don't check them, they become a
+ * subliminal channel.
+ */
+ if (target && target[tarindex] != 0)
+ return (-1);
+ }
+ } else {
+ /*
+ * We ended by seeing the end of the string. Make sure we
+ * have no partial bytes lying around.
+ */
+ if (state != 0)
+ return (-1);
+ }
+
+ return (tarindex);
+}
diff --git a/winsup/cygwin/libc/bsdlib.cc b/winsup/cygwin/libc/bsdlib.cc
index 599df7107..66cffc7d3 100644
--- a/winsup/cygwin/libc/bsdlib.cc
+++ b/winsup/cygwin/libc/bsdlib.cc
@@ -54,7 +54,7 @@ daemon (int nochdir, int noclose)
break;
default:
/* This sleep avoids a race condition which kills the
- child process if parent is started by a NT/W2K service.
+ child process if parent is started by a service process.
FIXME: Is that still true? */
Sleep (1000L);
_exit (0);
@@ -112,7 +112,7 @@ openpty (int *amaster, int *aslave, char *name, const struct termios *termp,
{
grantpt (master);
unlockpt (master);
- __ptsname (pts, cygheap->fdtab[master]->get_unit ());
+ __ptsname (pts, cygheap->fdtab[master]->get_minor ());
revoke (pts);
if ((slave = open (pts, O_RDWR | O_NOCTTY)) >= 0)
{
diff --git a/winsup/cygwin/libc/fts.c b/winsup/cygwin/libc/fts.c
index 7f292a57b..e82ec3fd7 100644
--- a/winsup/cygwin/libc/fts.c
+++ b/winsup/cygwin/libc/fts.c
@@ -94,7 +94,7 @@ static int fts_ufslinks(FTS *, const FTSENT *);
struct _fts_private {
FTS ftsp_fts;
struct statfs ftsp_statfs;
- __dev32_t ftsp_dev;
+ dev_t ftsp_dev;
int ftsp_linksreliable;
};
@@ -507,7 +507,7 @@ name: t = sp->fts_path + NAPPEND(p->fts_parent);
/* ARGSUSED */
int
fts_set(sp, p, instr)
- FTS *sp;
+ FTS *sp __attribute__ ((unused));
FTSENT *p;
int instr;
{
@@ -758,7 +758,7 @@ fts_build(sp, type)
if ((p = fts_alloc(sp, dp->d_name, (int)dnamlen)) == NULL)
goto mem1;
- if (dnamlen >= maxlen) { /* include space for NUL */
+ if ((int) dnamlen >= maxlen) { /* include space for NUL */
oldaddr = sp->fts_path;
if (fts_palloc(sp, dnamlen + len + 1)) {
/*
@@ -907,9 +907,9 @@ fts_stat(sp, p, follow)
int follow;
{
FTSENT *t;
- __dev32_t dev;
- __ino64_t ino;
- struct __stat64 *sbp, sb;
+ dev_t dev;
+ ino_t ino;
+ struct stat *sbp, sb;
int saved_errno;
/* If user needs stat info, stat buffer already allocated. */
@@ -943,7 +943,7 @@ fts_stat(sp, p, follow)
}
} else if (lstat64(p->fts_accpath, sbp)) {
p->fts_errno = errno;
-err: memset(sbp, 0, sizeof(struct __stat64));
+err: memset(sbp, 0, sizeof(struct stat));
return (FTS_NS);
}
@@ -1041,7 +1041,7 @@ fts_alloc(sp, name, namelen)
struct ftsent_withstat {
FTSENT ent;
- struct __stat64 statbuf;
+ struct stat statbuf;
};
/*
@@ -1177,7 +1177,7 @@ fts_safe_changedir(sp, p, fd, path)
const char *path;
{
int ret, oerrno, newfd;
- struct __stat64 sb;
+ struct stat sb;
newfd = fd;
if (ISSET(FTS_NOCHDIR))
diff --git a/winsup/cygwin/libc/ftw.c b/winsup/cygwin/libc/ftw.c
index 9863e1621..61d1e7c21 100644
--- a/winsup/cygwin/libc/ftw.c
+++ b/winsup/cygwin/libc/ftw.c
@@ -41,8 +41,8 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/lib/libc/gen/ftw.c,v 1.4 2004/08/24 13:0
#include <limits.h>
int
-ftw(const char *path, int (*fn)(const char *, const struct __stat64 *, int),
- int nfds)
+ftw(const char *path, int (*fn)(const char *, const struct stat *, int),
+ int nfds __attribute__ ((unused)))
{
char * const paths[2] = { (char *)path, NULL };
FTSENT *cur;
diff --git a/winsup/cygwin/libc/inet_network.c b/winsup/cygwin/libc/inet_network.c
index 01e1a7682..43a394cf4 100644
--- a/winsup/cygwin/libc/inet_network.c
+++ b/winsup/cygwin/libc/inet_network.c
@@ -62,7 +62,7 @@ cygwin_inet_network(cp)
in_addr_t val, base, n;
char c;
in_addr_t parts[4], *pp = parts;
- int i, digit;
+ unsigned int i, digit;
again:
val = 0; base = 10; digit = 0;
diff --git a/winsup/cygwin/libc/minires-os-if.c b/winsup/cygwin/libc/minires-os-if.c
index 46e8297fd..94460ffb2 100644
--- a/winsup/cygwin/libc/minires-os-if.c
+++ b/winsup/cygwin/libc/minires-os-if.c
@@ -37,7 +37,7 @@ details. */
***********************************************************************/
#define PUTDOMAIN(d,p)\
- {int res = dn_comp(d, p, EndPtr - p, dnptrs, lastdnptr); p += res < 0 ? strlen(d) : res; }
+ {int res = dn_comp(d, p, EndPtr - p, dnptrs, lastdnptr); p += res < 0 ? (int) strlen(d) : res; }
static u_char * write_record(unsigned char * ptr, PDNS_RECORD rr, unsigned char * EndPtr,
unsigned char ** dnptrs, unsigned char ** lastdnptr, int debug)
@@ -187,7 +187,8 @@ static int cygwin_query(res_state statp, const char * DomName, int Class, int Ty
{
DNS_STATUS res;
PDNS_RECORD pQueryResultsSet, rr;
- int section, len, counts[4] = {0, 0, 0, 0}, debug = statp->options & RES_DEBUG;
+ DWORD section;
+ int len, counts[4] = {0, 0, 0, 0}, debug = statp->options & RES_DEBUG;
unsigned char * dnptrs[256], * ptr;
dnptrs[0] = AnsPtr;
@@ -309,7 +310,7 @@ static void get_registry_dns_items(PUNICODE_STRING in, res_state statp,
size_t size = wcstombs (list, in->Buffer, in->Length);
if (what == 0) { /* Get the addresses */
char *ap, *srch;
- int numAddresses = 0;
+ size_t numAddresses = 0;
for (ap = list; ap < list + size && *ap; ap = srch) {
/* The separation character can be 0, ' ', or ','. */
for (srch = ap; *srch && (isdigit((unsigned) *srch) || *srch == '.' );
@@ -418,7 +419,7 @@ void get_dns_info(res_state statp)
DWORD dwRetVal;
IP_ADDR_STRING * pIPAddr;
FIXED_INFO * pFixedInfo;
- int numAddresses = 0;
+ size_t numAddresses = 0;
if (statp->use_os)
{
diff --git a/winsup/cygwin/libc/minires.c b/winsup/cygwin/libc/minires.c
index 0b3a7f3ac..c73ad3c58 100644
--- a/winsup/cygwin/libc/minires.c
+++ b/winsup/cygwin/libc/minires.c
@@ -177,9 +177,9 @@ static void get_resolv(res_state statp)
if (!have_address
&& !strncasecmp("nameserver", words[0], sizes[0])) {
for ( j = 1; j < i ; j++) {
- unsigned int address;
+ in_addr_t address;
address = cygwin_inet_addr(words[j]);
- if (address == -1) {
+ if (address == INADDR_NONE) {
DPRINTF(debug, "invalid server \"%s\"\n", words[j]);
}
else if (ns >= MAXNS) {
@@ -295,7 +295,7 @@ int res_ninit(res_state statp)
Mix the upper and lower bits as they are not used equally */
i = getpid();
statp->id = (ushort) (getppid() ^ (i << 8) ^ (i >> 8));
- for (i = 0; i < DIM(statp->dnsrch); i++) statp->dnsrch[i] = 0;
+ for (i = 0; i < (int) DIM(statp->dnsrch); i++) statp->dnsrch[i] = 0;
/* resolv.conf (dns servers & search list)*/
get_resolv(statp);
@@ -424,7 +424,7 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
int MsgLength, unsigned char * AnsPtr, int AnsLength)
{
/* Current server, shared by all tasks */
- volatile static unsigned int SServ = 0XFFFFFFFF;
+ static volatile unsigned int SServ = 0XFFFFFFFF;
int tcp;
const int debug = statp->options & RES_DEBUG;
@@ -459,7 +459,7 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
/* Close the socket if it had been opened before a fork.
Reuse of pid's cannot hurt */
- if ((statp->sockfd != -1) && (statp->mypid != getpid())) {
+ if ((statp->sockfd != -1) && ((pid_t) statp->mypid != getpid())) {
res_nclose(statp);
}
@@ -625,8 +625,10 @@ int res_send( const unsigned char * MsgPtr, int MsgLength,
*****************************************************************/
int res_nmkquery (res_state statp,
int op, const char * dnameptr, int qclass, int qtype,
- const unsigned char * dataptr, int datalen,
- const unsigned char * newrr, unsigned char * buf, int buflen)
+ const unsigned char * dataptr __attribute__ ((unused)),
+ int datalen __attribute__ ((unused)),
+ const unsigned char * newrr __attribute__ ((unused)),
+ unsigned char * buf, int buflen)
{
int i, len;
const char * ptr;
@@ -722,7 +724,7 @@ int res_nquerydomain( res_state statp, const char * Name, const char * DomName,
int Class, int Type, unsigned char * AnsPtr, int AnsLength)
{
char fqdn[MAXDNAME], *ptr;
- int nlen;
+ size_t nlen;
if (!DomName)
ptr = (char *) Name;
diff --git a/winsup/cygwin/libc/nftw.c b/winsup/cygwin/libc/nftw.c
index bb1c92381..1def24160 100644
--- a/winsup/cygwin/libc/nftw.c
+++ b/winsup/cygwin/libc/nftw.c
@@ -41,8 +41,8 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/lib/libc/gen/nftw.c,v 1.1.2.1 2004/08/29
#include <limits.h>
int
-nftw(const char *path, int (*fn)(const char *, const struct __stat64 *, int,
- struct FTW *), int nfds, int ftwflags)
+nftw(const char *path, int (*fn)(const char *, const struct stat *, int,
+ struct FTW *), int nfds __attribute__ ((unused)), int ftwflags)
{
char * const paths[2] = { (char *)path, NULL };
struct FTW ftw;
diff --git a/winsup/cygwin/libc/rcmd.cc b/winsup/cygwin/libc/rcmd.cc
index 16c05b01b..4ebdd062a 100644
--- a/winsup/cygwin/libc/rcmd.cc
+++ b/winsup/cygwin/libc/rcmd.cc
@@ -103,7 +103,7 @@ extern "C" {
int cygwin_rresvport_af(int *alport, int family);
int cygwin_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
int cygwin_socket (int, int, int);
- int seteuid32 (__uid32_t);
+ int seteuid32 (uid_t);
}
#endif
@@ -421,7 +421,7 @@ iruserok_sa(const void *ra, int rlen, int superuser, const char *ruser,
const char *luser)
{
const char *cp;
- struct __stat64 sbuf;
+ struct stat sbuf;
struct passwd *pwd;
FILE *hostf;
uid_t uid;
diff --git a/winsup/cygwin/libc/rexec.cc b/winsup/cygwin/libc/rexec.cc
index a09828675..d5548bf15 100644
--- a/winsup/cygwin/libc/rexec.cc
+++ b/winsup/cygwin/libc/rexec.cc
@@ -155,7 +155,7 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct)
char myname[INTERNET_MAX_HOST_NAME_LENGTH + 1];
const char *mydomain;
int t, i, c, usedefault = 0;
- struct __stat64 stb;
+ struct stat stb;
hdir = getenv("HOME");
if (hdir == NULL)
diff --git a/winsup/cygwin/libstdcxx_wrapper.cc b/winsup/cygwin/libstdcxx_wrapper.cc
index a6492f243..80861b738 100755
--- a/winsup/cygwin/libstdcxx_wrapper.cc
+++ b/winsup/cygwin/libstdcxx_wrapper.cc
@@ -22,23 +22,34 @@ details. */
around the standard C++ memory management operators; these are the wrappers,
but we want the compiler to know they are the malloc operators and not have
it think they're just any old function matching 'extern "C" _wrap_*'. */
+#ifdef __x86_64__
+#define MANGLED_ZNWX "__wrap__Znwm"
+#define MANGLED_ZNAX "__wrap__Znam"
+#define MANGLED_ZNWX_NOTHROW_T "__wrap__ZnwmRKSt9nothrow_t"
+#define MANGLED_ZNAX_NOTHROW_T "__wrap__ZnamRKSt9nothrow_t"
+#else
+#define MANGLED_ZNWX "___wrap__Znwj"
+#define MANGLED_ZNAX "___wrap__Znaj"
+#define MANGLED_ZNWX_NOTHROW_T "___wrap__ZnwjRKSt9nothrow_t"
+#define MANGLED_ZNAX_NOTHROW_T "___wrap__ZnajRKSt9nothrow_t"
+#endif
extern void *operator new(std::size_t sz) throw (std::bad_alloc)
- __asm__ ("___wrap__Znwj");
+ __asm__ (MANGLED_ZNWX);
extern void *operator new[](std::size_t sz) throw (std::bad_alloc)
- __asm__ ("___wrap__Znaj");
+ __asm__ (MANGLED_ZNAX);
extern void operator delete(void *p) throw()
- __asm__ ("___wrap__ZdlPv");
+ __asm__ (_SYMSTR (__wrap__ZdlPv));
extern void operator delete[](void *p) throw()
- __asm__ ("___wrap__ZdaPv");
+ __asm__ (_SYMSTR (__wrap__ZdaPv));
extern void *operator new(std::size_t sz, const std::nothrow_t &nt) throw()
- __asm__ ("___wrap__ZnwjRKSt9nothrow_t");
+ __asm__ (MANGLED_ZNWX_NOTHROW_T);
extern void *operator new[](std::size_t sz, const std::nothrow_t &nt) throw()
- __asm__ ("___wrap__ZnajRKSt9nothrow_t");
+ __asm__ (MANGLED_ZNAX_NOTHROW_T);
extern void operator delete(void *p, const std::nothrow_t &nt) throw()
- __asm__ ("___wrap__ZdlPvRKSt9nothrow_t");
+ __asm__ (_SYMSTR (__wrap__ZdlPvRKSt9nothrow_t));
extern void operator delete[](void *p, const std::nothrow_t &nt) throw()
- __asm__ ("___wrap__ZdaPvRKSt9nothrow_t");
+ __asm__ (_SYMSTR (__wrap__ZdaPvRKSt9nothrow_t));
extern void *
operator new(std::size_t sz) throw (std::bad_alloc)
diff --git a/winsup/cygwin/localtime.cc b/winsup/cygwin/localtime.cc
index 239aaffdd..19eef6759 100644
--- a/winsup/cygwin/localtime.cc
+++ b/winsup/cygwin/localtime.cc
@@ -1,6 +1,14 @@
+/* $NetBSD: localtime.c,v 1.72 2012/10/28 19:02:29 christos Exp $ */
+
+/* Don't reformat the code arbitrarily.
+
+ It uses in wide parts the exact formatting as the upstream NetBSD
+ versions. The purpose is to simplify subsequent diffs to the NetBSD
+ version, should the need arise again at one point. */
+
/*
** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
+** 1996-06-05 by Arthur David Olson.
*/
/* Temporarily merged private.h and tzfile.h for ease of management - DJ */
@@ -15,16 +23,17 @@
#ifndef lint
#ifndef NOID
-static char elsieid[] = "@(#)localtime.c 7.66";
+static char elsieid[] = "@(#)localtime.c 8.17";
#endif /* !defined NOID */
#endif /* !defined lint */
/*
-** Leap second handling from Bradley White (bww@k.gp.cs.cmu.edu).
-** POSIX-style TZ environment variable handling from Guy Harris
-** (guy@auspex.com).
+** Leap second handling from Bradley White.
+** POSIX-style TZ environment variable handling from Guy Harris.
*/
+#define NO_ERROR_IN_DST_GAP
+
/*LINTLIBRARY*/
#ifndef PRIVATE_H
@@ -33,7 +42,7 @@ static char elsieid[] = "@(#)localtime.c 7.66";
/*
** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
+** 1996-06-05 by Arthur David Olson
*/
/*
@@ -55,145 +64,33 @@ static char privatehid[] = "@(#)private.h 7.48";
#endif /* !defined lint */
/*
-** Defaults for preprocessor symbols.
-** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
-*/
-
-#ifndef HAVE_ADJTIME
-#define HAVE_ADJTIME 1
-#endif /* !defined HAVE_ADJTIME */
-
-#ifndef HAVE_GETTEXT
-#define HAVE_GETTEXT 0
-#endif /* !defined HAVE_GETTEXT */
-
-#ifndef HAVE_SETTIMEOFDAY
-#define HAVE_SETTIMEOFDAY 3
-#endif /* !defined HAVE_SETTIMEOFDAY */
-
-#ifndef HAVE_STRERROR
-#define HAVE_STRERROR 0
-#endif /* !defined HAVE_STRERROR */
-
-#ifndef HAVE_SYMLINK
-#define HAVE_SYMLINK 1
-#endif /* !defined HAVE_SYMLINK */
-
-#ifndef HAVE_UNISTD_H
-#define HAVE_UNISTD_H 1
-#endif /* !defined HAVE_UNISTD_H */
-
-#ifndef HAVE_UTMPX_H
-#define HAVE_UTMPX_H 0
-#endif /* !defined HAVE_UTMPX_H */
-
-#ifndef LOCALE_HOME
-#define LOCALE_HOME "/usr/lib/locale"
-#endif /* !defined LOCALE_HOME */
-
-/*
** Nested includes
*/
#include "stdio.h"
#include "limits.h" /* for CHAR_BIT */
#include "stdlib.h"
-
-#if HAVE_GETTEXT - 0
-#endif /* HAVE_GETTEXT - 0 */
-
-#if HAVE_UNISTD_H - 0
#include "unistd.h" /* for F_OK and R_OK */
-#endif /* HAVE_UNISTD_H - 0 */
-
-#if !(HAVE_UNISTD_H - 0)
-#ifndef F_OK
-#define F_OK 0
-#endif /* !defined F_OK */
-#ifndef R_OK
-#define R_OK 4
-#endif /* !defined R_OK */
-#endif /* !(HAVE_UNISTD_H - 0) */
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
-/*
-** Workarounds for compilers/systems.
-*/
-
-/*
-** SunOS 4.1.1 cc lacks const.
-*/
-
-#ifndef const
-#ifndef __STDC__
-#define const
-#endif /* !defined __STDC__ */
-#endif /* !defined const */
-
-/*
-** SunOS 4.1.1 cc lacks prototypes.
-*/
-
-#ifndef P
-#ifdef __STDC__
-#define P(x) x
-#endif /* defined __STDC__ */
-#ifndef __STDC__
-#define P(x) ()
-#endif /* !defined __STDC__ */
-#endif /* !defined P */
-
-/*
-** SunOS 4.1.1 headers lack EXIT_SUCCESS.
-*/
-
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#endif /* !defined EXIT_SUCCESS */
-
-/*
-** SunOS 4.1.1 headers lack EXIT_FAILURE.
-*/
-
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#endif /* !defined EXIT_FAILURE */
-
-/*
-** SunOS 4.1.1 headers lack FILENAME_MAX.
-*/
-
-#ifndef FILENAME_MAX
-
-#ifndef MAXPATHLEN
-#ifdef unix
-#endif /* defined unix */
-#endif /* !defined MAXPATHLEN */
-
-#ifdef MAXPATHLEN
-#define FILENAME_MAX MAXPATHLEN
-#endif /* defined MAXPATHLEN */
-#ifndef MAXPATHLEN
-#define FILENAME_MAX 1024 /* Pure guesswork */
-#endif /* !defined MAXPATHLEN */
-
-#endif /* !defined FILENAME_MAX */
-
-/*
-** SunOS 4.1.1 libraries lack remove.
-*/
-
-#ifndef remove
-extern int unlink P((const char * filename));
-#define remove unlink
-#endif /* !defined remove */
+#ifndef __pure
+#if 2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)
+# define __pure __attribute__ ((__pure__))
+#else
+# define __pure /* empty */
+#endif
+#endif
/*
** Finally, some convenience items.
*/
+#ifndef TYPE_INTEGRAL
+#define TYPE_INTEGRAL(type) (/*CONSTCOND*/((type) 0.5) != 0.5)
+#endif /* !defined TYPE_INTEGRAL */
+
#ifndef TYPE_BIT
#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
#endif /* !defined TYPE_BIT */
@@ -237,23 +134,29 @@ extern int unlink P((const char * filename));
#endif /* !defined GNUC_or_lint */
#endif /* !defined INITIALIZE */
+#ifndef TZ_DOMAIN
+#define TZ_DOMAIN "tz"
+#endif /* !defined TZ_DOMAIN */
+
+#ifndef YEARSPERREPEAT
+#define YEARSPERREPEAT 400 /* years before a Gregorian repeat */
+#endif /* !defined YEARSPERREPEAT */
+
/*
-** For the benefit of GNU folk...
-** `_(MSGID)' uses the current locale's message library string for MSGID.
-** The default is to use gettext if available, and use MSGID otherwise.
+** The Gregorian year averages 365.2425 days, which is 31556952 seconds.
*/
-#ifndef _
-#if HAVE_GETTEXT - 0
-#define _(msgid) gettext(msgid)
-#else /* !(HAVE_GETTEXT - 0) */
-#define _(msgid) msgid
-#endif /* !(HAVE_GETTEXT - 0) */
-#endif /* !defined _ */
+#ifndef AVGSECSPERYEAR
+#define AVGSECSPERYEAR 31556952L
+#endif /* !defined AVGSECSPERYEAR */
-#ifndef TZ_DOMAIN
-#define TZ_DOMAIN "tz"
-#endif /* !defined TZ_DOMAIN */
+#ifndef SECSPERREPEAT
+#define SECSPERREPEAT ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
+#endif /* !defined SECSPERREPEAT */
+
+#ifndef SECSPERREPEAT_BITS
+#define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */
+#endif /* !defined SECSPERREPEAT_BITS */
/*
** UNIX was a registered trademark of UNIX System Laboratories in 1993.
@@ -267,7 +170,7 @@ extern int unlink P((const char * filename));
/*
** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
+** 1996-06-05 by Arthur David Olson.
*/
/*
@@ -312,7 +215,8 @@ static char tzfilehid[] = "@(#)tzfile.h 7.14";
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
- char tzh_reserved[16]; /* reserved for future use */
+ char tzh_version[1]; /* '\0' or '2' as of 2005 */
+ char tzh_reserved[15]; /* reserved for future use */
char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
@@ -334,19 +238,29 @@ struct tzhead {
** tzh_leapcnt repetitions of
** one (char [4]) coded leap second transition times
** one (char [4]) total correction after above
-** tzh_ttisstdcnt (char)s indexed by type; if true, transition
-** time is standard time, if false,
+** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
+** time is standard time, if FALSE,
** transition time is wall clock time
** if absent, transition times are
** assumed to be wall clock time
-** tzh_ttisgmtcnt (char)s indexed by type; if true, transition
-** time is UTC, if false,
+** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition
+** time is UTC, if FALSE,
** transition time is local time
** if absent, transition times are
** assumed to be local time
*/
/*
+** If tzh_version is '2' or greater, the above is followed by a second instance
+** of tzhead and a second instance of the data in which each coded transition
+** time uses 8 rather than 4 chars,
+** then a POSIX-TZ-environment-variable-style string for use in handling
+** instants after the last transition time stored in the file
+** (with nothing between the newlines if there is no POSIX representation for
+** such instants).
+*/
+
+/*
** In the current implementation, "tzset()" refuses to deal with files that
** exceed any of the limits below.
*/
@@ -358,7 +272,7 @@ struct tzhead {
** 138 years of Pacific Presidential Election time
** (where there are three time zone transitions every fourth year).
*/
-#define TZ_MAX_TIMES 370
+#define TZ_MAX_TIMES 1200
#endif /* !defined TZ_MAX_TIMES */
#ifndef TZ_MAX_TYPES
@@ -368,7 +282,7 @@ struct tzhead {
#ifdef NOSOLAR
/*
** Must be at least 14 for Europe/Riga as of Jan 12 1995,
-** as noted by Earl Chew <earl@hpato.aus.hp.com>.
+** as noted by Earl Chew.
*/
#define TZ_MAX_TYPES 20 /* Maximum number of local time types */
#endif /* !defined NOSOLAR */
@@ -426,28 +340,6 @@ struct tzhead {
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
-#ifndef USG
-
-/*
-** Use of the underscored variants may cause problems if you move your code to
-** certain System-V-based systems; for maximum portability, use the
-** underscore-free variants. The underscored variants are provided for
-** backward compatibility only; they may disappear from future versions of
-** this file.
-*/
-
-#define SECS_PER_MIN SECSPERMIN
-#define MINS_PER_HOUR MINSPERHOUR
-#define HOURS_PER_DAY HOURSPERDAY
-#define DAYS_PER_WEEK DAYSPERWEEK
-#define DAYS_PER_NYEAR DAYSPERNYEAR
-#define DAYS_PER_LYEAR DAYSPERLYEAR
-#define SECS_PER_HOUR SECSPERHOUR
-#define SECS_PER_DAY SECSPERDAY
-#define MONS_PER_YEAR MONSPERYEAR
-
-#endif /* !defined USG */
-
#endif /* !defined TZFILE_H */
#include "fcntl.h"
@@ -477,25 +369,36 @@ struct tzhead {
** 5. They might reference tm.TM_ZONE after calling offtime.
** What's best to do in the above cases is open to debate;
** for now, we just set things up so that in any of the five cases
-** WILDABBR is used. Another possibility: initialize tzname[0] to the
+** WILDABBR is used. Another possibility: initialize tzname[0] to the
** string "tzname[0] used before set", and similarly for the other cases.
-** And another: initialize tzname[0] to "ERA", with an explanation in the
+** And another: initialize tzname[0] to "ERA", with an explanation in the
** manual page of what this "time zone abbreviation" means (doing this so
** that tzname[0] has the "normal" length of three characters).
*/
#define WILDABBR " "
#endif /* !defined WILDABBR */
-static char wildabbr[] NO_COPY = WILDABBR;
+static const char wildabbr[] = WILDABBR;
-static char gmt[] NO_COPY = "GMT";
+static const char gmt[] = "GMT";
+
+/*
+** The DST rules to use if TZ has no rules and we can't load TZDEFRULES.
+** We default to US rules as of 1999-08-17.
+** POSIX 1003.1 section 8.1.1 says that the default DST rules are
+** implementation dependent; for historical reasons, US rules are a
+** common default.
+*/
+#ifndef TZDEFRULESTRING
+#define TZDEFRULESTRING ",M4.1.0,M10.5.0"
+#endif /* !defined TZDEFDST */
struct ttinfo { /* time type information */
long tt_gmtoff; /* UTC offset in seconds */
int tt_isdst; /* used to set tm_isdst */
int tt_abbrind; /* abbreviation list index */
- int tt_ttisstd; /* true if transition is std time */
- int tt_ttisgmt; /* true if transition is UTC */
+ int tt_ttisstd; /* TRUE if transition is std time */
+ int tt_ttisgmt; /* TRUE if transition is UTC */
};
struct lsinfo { /* leap second information */
@@ -512,19 +415,23 @@ struct lsinfo { /* leap second information */
#define MY_TZNAME_MAX 255
#endif /* !defined TZNAME_MAX */
-struct state {
+struct __state {
int leapcnt;
int timecnt;
int typecnt;
int charcnt;
+ int goback;
+ int goahead;
time_t ats[TZ_MAX_TIMES];
unsigned char types[TZ_MAX_TIMES];
struct ttinfo ttis[TZ_MAX_TYPES];
- char chars[BIGGEST(BIGGEST(TZ_MAX_CHARS + 1, sizeof gmt),
- (2 * (MY_TZNAME_MAX + 1)))];
+ char chars[/*CONSTCOND*/BIGGEST(BIGGEST(TZ_MAX_CHARS + 1,
+ sizeof gmt), (2 * (MY_TZNAME_MAX + 1)))];
struct lsinfo lsis[TZ_MAX_LEAPS];
};
+typedef struct __state *timezone_t;
+
struct rule {
int r_type; /* type of rule--see below */
int r_day; /* day number of rule */
@@ -537,59 +444,60 @@ struct rule {
#define DAY_OF_YEAR 1 /* n - day of year */
#define MONTH_NTH_DAY_OF_WEEK 2 /* Mm.n.d - month, week, day of week */
+typedef struct tm *(*subfun_t)(const timezone_t sp, const time_t *timep,
+ long offset, struct tm *tmp);
+
/*
** Prototypes for static functions.
*/
-static long detzcode P((const char * codep));
-static const char * getzname P((const char * strp));
-static const char * getnum P((const char * strp, int * nump, int min,
- int max));
-static const char * getsecs P((const char * strp, long * secsp));
-static const char * getoffset P((const char * strp, long * offsetp));
-static const char * getrule P((const char * strp, struct rule * rulep));
-static void gmtload P((struct state * sp));
-static void gmtsub P((const time_t * timep, long offset,
- struct tm * tmp));
-static void localsub P((const time_t * timep, long offset,
- struct tm * tmp));
-static int increment_overflow P((int * number, int delta));
-static int normalize_overflow P((int * tensptr, int * unitsptr,
- int base));
-static void settzname P((void));
-static time_t time1 P((struct tm * tmp,
- void(*funcp) P((const time_t *,
- long, struct tm *)),
- long offset));
-static time_t time2 P((struct tm *tmp,
- void(*funcp) P((const time_t *,
- long, struct tm*)),
- long offset, int * okayp));
-static time_t time2sub P((struct tm *tmp,
- void(*funcp) P((const time_t *,
- long, struct tm*)),
- long offset, int * okayp, int do_norm_secs));
-static void timesub P((const time_t * timep, long offset,
- const struct state * sp, struct tm * tmp));
-static int tmcomp P((const struct tm * atmp,
- const struct tm * btmp));
-static time_t transtime P((time_t janfirst, int year,
- const struct rule * rulep, long offset));
-static int tzload P((const char * name, struct state * sp));
-static int tzparse P((const char * name, struct state * sp,
- int lastditch));
-
-#ifdef ALL_STATE
-static struct state * lclptr;
-static struct state * gmtptr;
-#endif /* defined ALL_STATE */
-
-#ifndef ALL_STATE
-static struct state lclmem;
-static struct state gmtmem;
-#define lclptr (&lclmem)
-#define gmtptr (&gmtmem)
-#endif /* State Farm */
+static long detzcode(const char * codep);
+static time_t detzcode64(const char * codep);
+static int differ_by_repeat(time_t t1, time_t t0);
+static const char * getzname(const char * strp) __pure;
+static const char * getqzname(const char * strp, const int delim) __pure;
+static const char * getnum(const char * strp, int * nump, int min,
+ int max);
+static const char * getsecs(const char * strp, long * secsp);
+static const char * getoffset(const char * strp, long * offsetp);
+static const char * getrule(const char * strp, struct rule * rulep);
+static void gmtload(timezone_t sp);
+static struct tm * gmtsub(const timezone_t sp, const time_t *timep,
+ long offset, struct tm * tmp);
+static struct tm * localsub(const timezone_t sp, const time_t *timep,
+ long offset, struct tm *tmp);
+static int increment_overflow(int * number, int delta);
+static int leaps_thru_end_of(int y) __pure;
+static int long_increment_overflow(long * number, int delta);
+static int long_normalize_overflow(long * tensptr,
+ int * unitsptr, int base);
+static int normalize_overflow(int * tensptr, int * unitsptr,
+ int base);
+static void settzname(void);
+static time_t time1(const timezone_t sp, struct tm * const tmp,
+ subfun_t funcp, const long offset);
+static time_t time2(const timezone_t sp, struct tm * const tmp,
+ subfun_t funcp,
+ const long offset, int *const okayp);
+static time_t time2sub(const timezone_t sp, struct tm * const tmp,
+ subfun_t funcp, const long offset,
+ int *const okayp, const int do_norm_secs);
+static struct tm * timesub(const timezone_t sp, const time_t * timep,
+ long offset, struct tm * tmp);
+static int tmcomp(const struct tm * atmp,
+ const struct tm * btmp);
+static time_t transtime(time_t janfirst, int year,
+ const struct rule * rulep, long offset) __pure;
+static int typesequiv(const timezone_t sp, int a, int b);
+static int tzload(timezone_t sp, const char * name,
+ int doextend);
+static int tzparse(timezone_t sp, const char * name,
+ int lastditch);
+static void tzset_unlocked(void);
+static long leapcorr(const timezone_t sp, time_t * timep);
+
+static timezone_t lclptr;
+static timezone_t gmtptr;
#ifndef TZ_STRLEN_MAX
#define TZ_STRLEN_MAX 255
@@ -609,8 +517,8 @@ static int gmt_is_set;
#undef _tzname
char * tzname[2] = {
- wildabbr,
- wildabbr
+ (char *) wildabbr,
+ (char *) wildabbr
};
/*
@@ -618,12 +526,11 @@ char * tzname[2] = {
** Except for the strftime function, these functions [asctime,
** ctime, gmtime, localtime] return values in one of two static
** objects: a broken-down time structure and an array of char.
-** Thanks to Paul Eggert (eggert@twinsun.com) for noting this.
+** Thanks to Paul Eggert for noting this.
*/
static struct tm tm;
-
/* These variables are initialized by tzset. The macro versions are
defined in time.h, and indirect through the __imp_ pointers. */
@@ -633,34 +540,46 @@ static struct tm tm;
#undef _daylight
#ifdef USG_COMPAT
-long timezone; /* was time_t but POSIX requires long. */
-int daylight;
+long timezone = 0;
+int daylight;
#endif /* defined USG_COMPAT */
#ifdef ALTZONE
-time_t altzone;
+time_t altzone = 0;
#endif /* defined ALTZONE */
static long
-detzcode(const char *codep)
+detzcode(const char *const codep)
{
- register long result;
- register int i;
+ long result;
+ int i;
- result = (codep[0] & 0x80) ? ~0L : 0L;
+ result = (codep[0] & 0x80) ? ~0L : 0;
for (i = 0; i < 4; ++i)
result = (result << 8) | (codep[i] & 0xff);
return result;
}
+static time_t
+detzcode64(const char *const codep)
+{
+ time_t result;
+ int i;
+
+ result = (time_t)((codep[0] & 0x80) ? (~(int_fast64_t) 0) : 0);
+ for (i = 0; i < 8; ++i)
+ result = result * 256 + (codep[i] & 0xff);
+ return result;
+}
+
static void
-settzname P((void))
+settzname (void)
{
- register struct state * const sp = lclptr;
- register int i;
+ timezone_t const sp = lclptr;
+ int i;
- tzname[0] = wildabbr;
- tzname[1] = wildabbr;
+ tzname[0] = (char *) wildabbr;
+ tzname[1] = (char *) wildabbr;
#ifdef USG_COMPAT
daylight = 0;
timezone = 0;
@@ -668,25 +587,23 @@ settzname P((void))
#ifdef ALTZONE
altzone = 0;
#endif /* defined ALTZONE */
-#ifdef ALL_STATE
if (sp == NULL) {
- tzname[0] = tzname[1] = gmt;
+ tzname[0] = tzname[1] = (char *) gmt;
return;
}
-#endif /* defined ALL_STATE */
for (i = 0; i < sp->typecnt; ++i) {
- register const struct ttinfo * const ttisp = &sp->ttis[i];
+ const struct ttinfo * const ttisp = &sp->ttis[i];
tzname[ttisp->tt_isdst] =
&sp->chars[ttisp->tt_abbrind];
#ifdef USG_COMPAT
if (ttisp->tt_isdst)
daylight = 1;
- if (i == 0 || !ttisp->tt_isdst)
+ if (!ttisp->tt_isdst)
timezone = -(ttisp->tt_gmtoff);
#endif /* defined USG_COMPAT */
#ifdef ALTZONE
- if (i == 0 || ttisp->tt_isdst)
+ if (ttisp->tt_isdst)
altzone = -(ttisp->tt_gmtoff);
#endif /* defined ALTZONE */
}
@@ -694,9 +611,7 @@ settzname P((void))
** And to get the latest zone names into tzname. . .
*/
for (i = 0; i < sp->timecnt; ++i) {
- register const struct ttinfo * const ttisp =
- &sp->ttis[
- sp->types[i]];
+ const struct ttinfo *const ttisp = &sp->ttis[sp->types[i]];
tzname[ttisp->tt_isdst] =
&sp->chars[ttisp->tt_abbrind];
@@ -706,17 +621,40 @@ settzname P((void))
#include "tz_posixrules.h"
static int
-tzload(const char *name, struct state *sp)
+differ_by_repeat(const time_t t1, const time_t t0)
{
- register const char * p;
- register int i;
- register int fid;
+ if (TYPE_INTEGRAL(time_t) &&
+ TYPE_BIT(time_t) - TYPE_SIGNED(time_t) < SECSPERREPEAT_BITS)
+ return 0;
+ return (int_fast64_t)t1 - (int_fast64_t)t0 == SECSPERREPEAT;
+}
+
+static int
+tzload(timezone_t sp, const char *name, const int doextend)
+{
+ const char * p;
+ int i;
+ int fid;
+ int stored;
+ ssize_t nread;
+ typedef union {
+ struct tzhead tzhead;
+ char buf[2 * sizeof(struct tzhead) +
+ 2 * sizeof *sp +
+ 4 * TZ_MAX_TIMES];
+ } u_t;
+ u_t * up;
save_errno save;
- if (name == NULL && (name = TZDEFAULT) == NULL)
+ up = (u_t *) calloc(1, sizeof *up);
+ if (up == NULL)
return -1;
+
+ sp->goback = sp->goahead = FALSE;
+ if (name == NULL && (name = TZDEFAULT) == NULL)
+ goto oops;
{
- register int doaccess;
+ int doaccess;
/*
** Section 4.9.1 of the C standard says that
** "FILENAME_MAX expands to an integral constant expression
@@ -731,24 +669,21 @@ tzload(const char *name, struct state *sp)
doaccess = name[0] == '/';
if (!doaccess) {
if ((p = TZDIR) == NULL)
- return -1;
+ goto oops;
if ((strlen(p) + strlen(name) + 1) >= sizeof fullname)
- return -1;
- strcpy(fullname, p);
- strcat(fullname, "/");
- strcat(fullname, name);
+ goto oops;
+ (void) strcpy(fullname, p); /* XXX strcpy is safe */
+ (void) strcat(fullname, "/"); /* XXX strcat is safe */
+ (void) strcat(fullname, name); /* XXX strcat is safe */
/*
** Set doaccess if '.' (as in "../") shows up in name.
*/
if (strchr(name, '.') != NULL)
- doaccess = true;
+ doaccess = TRUE;
name = fullname;
}
-#if 0
- if (doaccess && access(name, R_OK) != 0)
- return -1;
-#endif
- if ((fid = open(name, OPEN_MODE)) == -1)
+ if ((doaccess && access(name, R_OK) != 0)
+ || (fid = open(name, OPEN_MODE)) == -1)
{
const char *base = strrchr(name, '/');
if (base)
@@ -762,110 +697,202 @@ tzload(const char *name, struct state *sp)
fid = -2;
}
}
- {
- struct tzhead * tzhp;
- union {
- struct tzhead tzhead;
- char buf[sizeof *sp + sizeof *tzhp];
- } u;
+ if (fid == -2)
+ {
+ memcpy(up->buf, _posixrules_data, sizeof (_posixrules_data));
+ nread = sizeof (_posixrules_data);
+ }
+ else
+ {
+ nread = read(fid, up->buf, sizeof up->buf);
+ if (close(fid) < 0 || nread <= 0)
+ goto oops;
+ }
+ for (stored = 4; stored <= 8; stored *= 2) {
int ttisstdcnt;
int ttisgmtcnt;
- if (fid == -2)
- {
- memcpy(u.buf, _posixrules_data, sizeof (_posixrules_data));
- i = sizeof (_posixrules_data);
- }
- else
- {
- i = read(fid, u.buf, sizeof u.buf);
- if (close(fid) != 0)
- return -1;
- }
- ttisstdcnt = (int) detzcode(u.tzhead.tzh_ttisgmtcnt);
- ttisgmtcnt = (int) detzcode(u.tzhead.tzh_ttisstdcnt);
- sp->leapcnt = (int) detzcode(u.tzhead.tzh_leapcnt);
- sp->timecnt = (int) detzcode(u.tzhead.tzh_timecnt);
- sp->typecnt = (int) detzcode(u.tzhead.tzh_typecnt);
- sp->charcnt = (int) detzcode(u.tzhead.tzh_charcnt);
- p = u.tzhead.tzh_charcnt + sizeof u.tzhead.tzh_charcnt;
+ ttisstdcnt = (int) detzcode(up->tzhead.tzh_ttisstdcnt);
+ ttisgmtcnt = (int) detzcode(up->tzhead.tzh_ttisgmtcnt);
+ sp->leapcnt = (int) detzcode(up->tzhead.tzh_leapcnt);
+ sp->timecnt = (int) detzcode(up->tzhead.tzh_timecnt);
+ sp->typecnt = (int) detzcode(up->tzhead.tzh_typecnt);
+ sp->charcnt = (int) detzcode(up->tzhead.tzh_charcnt);
+ p = up->tzhead.tzh_charcnt + sizeof up->tzhead.tzh_charcnt;
if (sp->leapcnt < 0 || sp->leapcnt > TZ_MAX_LEAPS ||
sp->typecnt <= 0 || sp->typecnt > TZ_MAX_TYPES ||
sp->timecnt < 0 || sp->timecnt > TZ_MAX_TIMES ||
sp->charcnt < 0 || sp->charcnt > TZ_MAX_CHARS ||
(ttisstdcnt != sp->typecnt && ttisstdcnt != 0) ||
(ttisgmtcnt != sp->typecnt && ttisgmtcnt != 0))
- return -1;
- if (i - (p - u.buf) < sp->timecnt * 4 + /* ats */
+ goto oops;
+ if (nread - (p - up->buf) <
+ sp->timecnt * stored + /* ats */
sp->timecnt + /* types */
- sp->typecnt * (4 + 2) + /* ttinfos */
+ sp->typecnt * 6 + /* ttinfos */
sp->charcnt + /* chars */
- sp->leapcnt * (4 + 4) + /* lsinfos */
+ sp->leapcnt * (stored + 4) + /* lsinfos */
ttisstdcnt + /* ttisstds */
ttisgmtcnt) /* ttisgmts */
- return -1;
+ goto oops;
for (i = 0; i < sp->timecnt; ++i) {
- sp->ats[i] = detzcode(p);
- p += 4;
+ sp->ats[i] = (time_t)((stored == 4) ?
+ detzcode(p) : detzcode64(p));
+ p += stored;
}
for (i = 0; i < sp->timecnt; ++i) {
sp->types[i] = (unsigned char) *p++;
if (sp->types[i] >= sp->typecnt)
- return -1;
+ goto oops;
}
for (i = 0; i < sp->typecnt; ++i) {
- register struct ttinfo * ttisp;
+ struct ttinfo * ttisp;
ttisp = &sp->ttis[i];
ttisp->tt_gmtoff = detzcode(p);
p += 4;
ttisp->tt_isdst = (unsigned char) *p++;
if (ttisp->tt_isdst != 0 && ttisp->tt_isdst != 1)
- return -1;
+ goto oops;
ttisp->tt_abbrind = (unsigned char) *p++;
if (ttisp->tt_abbrind < 0 ||
ttisp->tt_abbrind > sp->charcnt)
- return -1;
+ goto oops;
}
for (i = 0; i < sp->charcnt; ++i)
sp->chars[i] = *p++;
sp->chars[i] = '\0'; /* ensure '\0' at end */
for (i = 0; i < sp->leapcnt; ++i) {
- register struct lsinfo * lsisp;
+ struct lsinfo * lsisp;
lsisp = &sp->lsis[i];
- lsisp->ls_trans = detzcode(p);
- p += 4;
+ lsisp->ls_trans = (time_t)((stored == 4) ?
+ detzcode(p) : detzcode64(p));
+ p += stored;
lsisp->ls_corr = detzcode(p);
p += 4;
}
for (i = 0; i < sp->typecnt; ++i) {
- register struct ttinfo * ttisp;
+ struct ttinfo * ttisp;
ttisp = &sp->ttis[i];
if (ttisstdcnt == 0)
- ttisp->tt_ttisstd = false;
+ ttisp->tt_ttisstd = FALSE;
else {
ttisp->tt_ttisstd = *p++;
- if (ttisp->tt_ttisstd != true &&
- ttisp->tt_ttisstd != false)
- return -1;
+ if (ttisp->tt_ttisstd != TRUE &&
+ ttisp->tt_ttisstd != FALSE)
+ goto oops;
}
}
for (i = 0; i < sp->typecnt; ++i) {
- register struct ttinfo * ttisp;
+ struct ttinfo * ttisp;
ttisp = &sp->ttis[i];
if (ttisgmtcnt == 0)
- ttisp->tt_ttisgmt = false;
+ ttisp->tt_ttisgmt = FALSE;
else {
ttisp->tt_ttisgmt = *p++;
- if (ttisp->tt_ttisgmt != true &&
- ttisp->tt_ttisgmt != false)
- return -1;
+ if (ttisp->tt_ttisgmt != TRUE &&
+ ttisp->tt_ttisgmt != FALSE)
+ goto oops;
}
}
+ /*
+ ** Out-of-sort ats should mean we're running on a
+ ** signed time_t system but using a data file with
+ ** unsigned values (or vice versa).
+ */
+ for (i = 0; i < sp->timecnt - 2; ++i)
+ if (sp->ats[i] > sp->ats[i + 1]) {
+ ++i;
+ if (TYPE_SIGNED(time_t)) {
+ /*
+ ** Ignore the end (easy).
+ */
+ sp->timecnt = i;
+ } else {
+ /*
+ ** Ignore the beginning (harder).
+ */
+ int j;
+
+ for (j = 0; j + i < sp->timecnt; ++j) {
+ sp->ats[j] = sp->ats[j + i];
+ sp->types[j] = sp->types[j + i];
+ }
+ sp->timecnt = j;
+ }
+ break;
+ }
+ /*
+ ** If this is an old file, we're done.
+ */
+ if (up->tzhead.tzh_version[0] == '\0')
+ break;
+ nread -= p - up->buf;
+ for (i = 0; i < nread; ++i)
+ up->buf[i] = p[i];
+ /*
+ ** If this is a narrow integer time_t system, we're done.
+ */
+ if (stored >= (int) sizeof(time_t)
+/* CONSTCOND */
+ && TYPE_INTEGRAL(time_t))
+ break;
+ }
+ if (doextend && nread > 2 &&
+ up->buf[0] == '\n' && up->buf[nread - 1] == '\n' &&
+ sp->typecnt + 2 <= TZ_MAX_TYPES) {
+ struct __state ts;
+ int result;
+
+ up->buf[nread - 1] = '\0';
+ result = tzparse(&ts, &up->buf[1], FALSE);
+ if (result == 0 && ts.typecnt == 2 &&
+ sp->charcnt + ts.charcnt <= TZ_MAX_CHARS) {
+ for (i = 0; i < 2; ++i)
+ ts.ttis[i].tt_abbrind +=
+ sp->charcnt;
+ for (i = 0; i < ts.charcnt; ++i)
+ sp->chars[sp->charcnt++] =
+ ts.chars[i];
+ i = 0;
+ while (i < ts.timecnt &&
+ ts.ats[i] <=
+ sp->ats[sp->timecnt - 1])
+ ++i;
+ while (i < ts.timecnt &&
+ sp->timecnt < TZ_MAX_TIMES) {
+ sp->ats[sp->timecnt] =
+ ts.ats[i];
+ sp->types[sp->timecnt] =
+ sp->typecnt +
+ ts.types[i];
+ ++sp->timecnt;
+ ++i;
+ }
+ sp->ttis[sp->typecnt++] = ts.ttis[0];
+ sp->ttis[sp->typecnt++] = ts.ttis[1];
+ }
+ }
+ if (sp->timecnt > 1) {
+ for (i = 1; i < sp->timecnt; ++i)
+ if (typesequiv(sp, sp->types[i], sp->types[0]) &&
+ differ_by_repeat(sp->ats[i], sp->ats[0])) {
+ sp->goback = TRUE;
+ break;
+ }
+ for (i = sp->timecnt - 2; i >= 0; --i)
+ if (typesequiv(sp, sp->types[sp->timecnt - 1],
+ sp->types[i]) &&
+ differ_by_repeat(sp->ats[sp->timecnt - 1],
+ sp->ats[i])) {
+ sp->goahead = TRUE;
+ break;
+ }
}
+ free(up);
if (sp == lclptr)
{
__gettzinfo ()->__tzrule[0].offset
@@ -874,6 +901,31 @@ tzload(const char *name, struct state *sp)
= -sp->ttis[0].tt_gmtoff;
}
return 0;
+oops:
+ free(up);
+ return -1;
+}
+
+static int
+typesequiv(const timezone_t sp, const int a, const int b)
+{
+ int result;
+
+ if (sp == NULL ||
+ a < 0 || a >= sp->typecnt ||
+ b < 0 || b >= sp->typecnt)
+ result = FALSE;
+ else {
+ const struct ttinfo * ap = &sp->ttis[a];
+ const struct ttinfo * bp = &sp->ttis[b];
+ result = ap->tt_gmtoff == bp->tt_gmtoff &&
+ ap->tt_isdst == bp->tt_isdst &&
+ ap->tt_ttisstd == bp->tt_ttisstd &&
+ ap->tt_ttisgmt == bp->tt_ttisgmt &&
+ strcmp(&sp->chars[ap->tt_abbrind],
+ &sp->chars[bp->tt_abbrind]) == 0;
+ }
+ return result;
}
static const int mon_lengths[2][MONSPERYEAR] = {
@@ -887,14 +939,14 @@ static const int year_lengths[2] = {
/*
** Given a pointer into a time zone string, scan until a character that is not
-** a valid character in a zone name is found. Return a pointer to that
+** a valid character in a zone name is found. Return a pointer to that
** character.
*/
static const char *
getzname(const char *strp)
{
- register char c;
+ char c;
while ((c = *strp) != '\0' && !is_digit(c) && c != ',' && c != '-' &&
c != '+')
@@ -903,6 +955,25 @@ getzname(const char *strp)
}
/*
+** Given a pointer into an extended time zone string, scan until the ending
+** delimiter of the zone name is located. Return a pointer to the delimiter.
+**
+** As with getzname above, the legal character set is actually quite
+** restricted, with other characters producing undefined results.
+** We don't do any checking here; checking is done later in common-case code.
+*/
+
+static const char *
+getqzname(const char *strp, const int delim)
+{
+ int c;
+
+ while ((c = *strp) != '\0' && c != delim)
+ ++strp;
+ return strp;
+}
+
+/*
** Given a pointer into a time zone string, extract a number from that string.
** Check that the number is within a specified range; if it is not, return
** NULL.
@@ -910,22 +981,28 @@ getzname(const char *strp)
*/
static const char *
-getnum(const char *strp, int *nump, const int min, const int max)
+getnum(const char *strp, int *const nump, const int min, const int max)
{
- register char c;
- register int num;
+ char c;
+ int num;
- if (strp == NULL || !is_digit(c = *strp))
+ if (strp == NULL || !is_digit(c = *strp)) {
+ errno = EINVAL;
return NULL;
+ }
num = 0;
do {
num = num * 10 + (c - '0');
- if (num > max)
+ if (num > max) {
+ errno = EOVERFLOW;
return NULL; /* illegal value */
+ }
c = *++strp;
} while (is_digit(c));
- if (num < min)
+ if (num < min) {
+ errno = EINVAL;
return NULL; /* illegal value */
+ }
*nump = num;
return strp;
}
@@ -939,7 +1016,7 @@ getnum(const char *strp, int *nump, const int min, const int max)
*/
static const char *
-getsecs(const char *strp, long *secsp)
+getsecs(const char *strp, long *const secsp)
{
int num;
@@ -961,7 +1038,7 @@ getsecs(const char *strp, long *secsp)
*secsp += num * SECSPERMIN;
if (*strp == ':') {
++strp;
- /* `SECSPERMIN' allows for leap seconds. */
+ /* `SECSPERMIN' allows for leap seconds. */
strp = getnum(strp, &num, 0, SECSPERMIN);
if (strp == NULL)
return NULL;
@@ -979,9 +1056,9 @@ getsecs(const char *strp, long *secsp)
*/
static const char *
-getoffset(const char *strp, long *offsetp)
+getoffset(const char *strp, long *const offsetp)
{
- register int neg = 0;
+ int neg = 0;
if (*strp == '-') {
neg = 1;
@@ -998,13 +1075,13 @@ getoffset(const char *strp, long *offsetp)
/*
** Given a pointer into a time zone string, extract a rule in the form
-** date[/time]. See POSIX section 8 for the format of "date" and "time".
+** date[/time]. See POSIX section 8 for the format of "date" and "time".
** If a valid rule is not found, return NULL.
** Otherwise, return a pointer to the first character not part of the rule.
*/
static const char *
-getrule(const char *strp, struct rule *rulep)
+getrule(const char *strp, struct rule *const rulep)
{
if (*strp == 'J') {
/*
@@ -1056,12 +1133,12 @@ getrule(const char *strp, struct rule *rulep)
*/
static time_t
-transtime(const time_t janfirst, const int year, const struct rule *rulep,
- long offset)
+transtime(const time_t janfirst, const int year, const struct rule *const rulep,
+ const long offset)
{
- register int leapyear;
- register time_t value;
- register int i;
+ int leapyear;
+ time_t value;
+ int i;
int d, m1, yy0, yy1, yy2, dow;
INITIALIZE(value);
@@ -1076,7 +1153,7 @@ transtime(const time_t janfirst, const int year, const struct rule *rulep,
** add SECSPERDAY times the day number-1 to the time of
** January 1, midnight, to get the day.
*/
- value = janfirst + (rulep->r_day - 1) * SECSPERDAY;
+ value = (time_t)(janfirst + (rulep->r_day - 1) * SECSPERDAY);
if (leapyear && rulep->r_day >= 60)
value += SECSPERDAY;
break;
@@ -1087,7 +1164,7 @@ transtime(const time_t janfirst, const int year, const struct rule *rulep,
** Just add SECSPERDAY times the day number to the time of
** January 1, midnight, to get the day.
*/
- value = janfirst + rulep->r_day * SECSPERDAY;
+ value = (time_t)(janfirst + rulep->r_day * SECSPERDAY);
break;
case MONTH_NTH_DAY_OF_WEEK:
@@ -1096,7 +1173,7 @@ transtime(const time_t janfirst, const int year, const struct rule *rulep,
*/
value = janfirst;
for (i = 0; i < rulep->r_mon - 1; ++i)
- value += mon_lengths[leapyear][i] * SECSPERDAY;
+ value += (time_t)(mon_lengths[leapyear][i] * SECSPERDAY);
/*
** Use Zeller's Congruence to get day-of-week of first day of
@@ -1112,7 +1189,7 @@ transtime(const time_t janfirst, const int year, const struct rule *rulep,
dow += DAYSPERWEEK;
/*
- ** "dow" is the day-of-week of the first day of the month. Get
+ ** "dow" is the day-of-week of the first day of the month. Get
** the day-of-month (zero-origin) of the first "dow" day of the
** month.
*/
@@ -1129,17 +1206,17 @@ transtime(const time_t janfirst, const int year, const struct rule *rulep,
/*
** "d" is the day-of-month (zero-origin) of the day we want.
*/
- value += d * SECSPERDAY;
+ value += (time_t)(d * SECSPERDAY);
break;
}
/*
** "value" is the Epoch-relative time of 00:00:00 UTC on the day in
- ** question. To get the Epoch-relative time of the specified local
+ ** question. To get the Epoch-relative time of the specified local
** time on that day, add the transition time and the current offset
** from UTC.
*/
- return value + rulep->r_time + offset;
+ return (time_t)(value + rulep->r_time + offset);
}
/*
@@ -1148,7 +1225,7 @@ transtime(const time_t janfirst, const int year, const struct rule *rulep,
*/
static int
-tzparse(const char *name, struct state *sp, const int lastditch)
+tzparse(timezone_t sp, const char *name, const int lastditch)
{
const char * stdname;
const char * dstname;
@@ -1156,10 +1233,10 @@ tzparse(const char *name, struct state *sp, const int lastditch)
size_t dstlen;
long stdoffset;
long dstoffset;
- register time_t * atp;
- register unsigned char * typep;
- register char * cp;
- register int load_result;
+ time_t * atp;
+ unsigned char * typep;
+ char * cp;
+ int load_result;
INITIALIZE(dstname);
stdname = name;
@@ -1170,35 +1247,52 @@ tzparse(const char *name, struct state *sp, const int lastditch)
stdlen = (sizeof sp->chars) - 1;
stdoffset = 0;
} else {
- name = getzname(name);
- stdlen = name - stdname;
- if (stdlen < 3)
- return -1;
+ if (*name == '<') {
+ name++;
+ stdname = name;
+ name = getqzname(name, '>');
+ if (*name != '>')
+ return (-1);
+ stdlen = name - stdname;
+ name++;
+ } else {
+ name = getzname(name);
+ stdlen = name - stdname;
+ }
if (*name == '\0')
return -1;
name = getoffset(name, &stdoffset);
if (name == NULL)
return -1;
}
- load_result = tzload(TZDEFRULES, sp);
+ load_result = tzload(sp, TZDEFRULES, FALSE);
if (load_result != 0)
sp->leapcnt = 0; /* so, we're off a little */
if (*name != '\0') {
- dstname = name;
- name = getzname(name);
- dstlen = name - dstname; /* length of DST zone name */
- if (dstlen < 3)
- return -1;
+ if (*name == '<') {
+ dstname = ++name;
+ name = getqzname(name, '>');
+ if (*name != '>')
+ return -1;
+ dstlen = name - dstname;
+ name++;
+ } else {
+ dstname = name;
+ name = getzname(name);
+ dstlen = name - dstname; /* length of DST zone name */
+ }
if (*name != '\0' && *name != ',' && *name != ';') {
name = getoffset(name, &dstoffset);
if (name == NULL)
return -1;
} else dstoffset = stdoffset - SECSPERHOUR;
+ if (*name == '\0' && load_result != 0)
+ name = TZDEFRULESTRING;
if (*name == ',' || *name == ';') {
struct rule start;
struct rule end;
- register int year;
- register time_t janfirst;
+ int year;
+ time_t janfirst;
time_t starttime;
time_t endtime;
@@ -1213,21 +1307,24 @@ tzparse(const char *name, struct state *sp, const int lastditch)
return -1;
sp->typecnt = 2; /* standard time and DST */
/*
- ** Two transitions per year, from EPOCH_YEAR to 2037.
+ ** Two transitions per year, from EPOCH_YEAR forward.
*/
- sp->timecnt = 2 * (2037 - EPOCH_YEAR + 1);
- if (sp->timecnt > TZ_MAX_TIMES)
- return -1;
+ memset(sp->ttis, 0, sizeof(sp->ttis));
sp->ttis[0].tt_gmtoff = -dstoffset;
sp->ttis[0].tt_isdst = 1;
- sp->ttis[0].tt_abbrind = stdlen + 1;
+ sp->ttis[0].tt_abbrind = (int)(stdlen + 1);
sp->ttis[1].tt_gmtoff = -stdoffset;
sp->ttis[1].tt_isdst = 0;
sp->ttis[1].tt_abbrind = 0;
atp = sp->ats;
typep = sp->types;
janfirst = 0;
- for (year = EPOCH_YEAR; year <= 2037; ++year) {
+ sp->timecnt = 0;
+ for (year = EPOCH_YEAR;
+ sp->timecnt + 2 <= TZ_MAX_TIMES;
+ ++year) {
+ time_t newfirst;
+
starttime = transtime(janfirst, year, &start,
stdoffset);
endtime = transtime(janfirst, year, &end,
@@ -1243,8 +1340,13 @@ tzparse(const char *name, struct state *sp, const int lastditch)
*atp++ = endtime;
*typep++ = 1; /* DST ends */
}
- janfirst += year_lengths[isleap(year)] *
- SECSPERDAY;
+ sp->timecnt += 2;
+ newfirst = janfirst;
+ newfirst += (time_t)
+ (year_lengths[isleap(year)] * SECSPERDAY);
+ if (newfirst <= janfirst)
+ break;
+ janfirst = newfirst;
}
if (sp == lclptr)
{
@@ -1254,17 +1356,15 @@ tzparse(const char *name, struct state *sp, const int lastditch)
= -sp->ttis[0].tt_gmtoff;
}
} else {
- register long theirstdoffset;
- register long theirdstoffset;
- register long theiroffset;
- register int isdst;
- register int i;
- register int j;
+ long theirstdoffset;
+ long theirdstoffset;
+ long theiroffset;
+ int isdst;
+ int i;
+ int j;
if (*name != '\0')
return -1;
- if (load_result != 0)
- return -1;
/*
** Initial values of theirstdoffset and theirdstoffset.
*/
@@ -1289,7 +1389,7 @@ tzparse(const char *name, struct state *sp, const int lastditch)
/*
** Initially we're assumed to be in standard time.
*/
- isdst = false;
+ isdst = FALSE;
theiroffset = theirstdoffset;
/*
** Now juggle transition times and types
@@ -1316,28 +1416,29 @@ tzparse(const char *name, struct state *sp, const int lastditch)
** offset.
*/
if (isdst && !sp->ttis[j].tt_ttisstd) {
- sp->ats[i] += dstoffset -
- theirdstoffset;
+ sp->ats[i] += (time_t)
+ (dstoffset - theirdstoffset);
} else {
- sp->ats[i] += stdoffset -
- theirstdoffset;
+ sp->ats[i] += (time_t)
+ (stdoffset - theirstdoffset);
}
}
theiroffset = -sp->ttis[j].tt_gmtoff;
- if (sp->ttis[j].tt_isdst)
- theirdstoffset = theiroffset;
- else theirstdoffset = theiroffset;
+ if (!sp->ttis[j].tt_isdst)
+ theirstdoffset = theiroffset;
+ else theirdstoffset = theiroffset;
}
/*
** Finally, fill in ttis.
- ** ttisstd and ttisgmt need not be handled.
+ ** ttisstd and ttisgmt need not be handled
*/
+ memset(sp->ttis, 0, sizeof(sp->ttis));
sp->ttis[0].tt_gmtoff = -stdoffset;
- sp->ttis[0].tt_isdst = false;
+ sp->ttis[0].tt_isdst = FALSE;
sp->ttis[0].tt_abbrind = 0;
sp->ttis[1].tt_gmtoff = -dstoffset;
- sp->ttis[1].tt_isdst = true;
- sp->ttis[1].tt_abbrind = stdlen + 1;
+ sp->ttis[1].tt_isdst = TRUE;
+ sp->ttis[1].tt_abbrind = (int)(stdlen + 1);
sp->typecnt = 2;
if (sp == lclptr)
{
@@ -1351,6 +1452,7 @@ tzparse(const char *name, struct state *sp, const int lastditch)
dstlen = 0;
sp->typecnt = 1; /* only standard time */
sp->timecnt = 0;
+ memset(sp->ttis, 0, sizeof(sp->ttis));
sp->ttis[0].tt_gmtoff = -stdoffset;
sp->ttis[0].tt_isdst = 0;
sp->ttis[0].tt_abbrind = 0;
@@ -1360,27 +1462,27 @@ tzparse(const char *name, struct state *sp, const int lastditch)
__gettzinfo ()->__tzrule[1].offset = -sp->ttis[0].tt_gmtoff;
}
}
- sp->charcnt = stdlen + 1;
+ sp->charcnt = (int)(stdlen + 1);
if (dstlen != 0)
- sp->charcnt += dstlen + 1;
+ sp->charcnt += (int)(dstlen + 1);
if ((size_t) sp->charcnt > sizeof sp->chars)
return -1;
cp = sp->chars;
- strncpy(cp, stdname, stdlen);
+ (void) strncpy(cp, stdname, stdlen);
cp += stdlen;
*cp++ = '\0';
if (dstlen != 0) {
- strncpy(cp, dstname, dstlen);
+ (void) strncpy(cp, dstname, dstlen);
*(cp + dstlen) = '\0';
}
return 0;
}
static void
-gmtload(struct state *sp)
+gmtload(timezone_t sp)
{
- if (tzload(gmt, sp) != 0)
- tzparse(gmt, sp, true);
+ if (tzload(sp, gmt, TRUE) != 0)
+ (void) tzparse(sp, gmt, TRUE);
}
#ifndef STD_INSPIRED
@@ -1391,21 +1493,20 @@ gmtload(struct state *sp)
static
#endif /* !defined STD_INSPIRED */
void
-tzsetwall P((void))
+tzsetwall (void)
{
if (lcl_is_set == lcl_setting)
return;
lcl_is_set = lcl_setting;
-#ifdef ALL_STATE
if (lclptr == NULL) {
- lclptr = (struct state *) malloc(sizeof *lclptr);
+ save_errno save;
+ lclptr = (timezone_t) calloc(1, sizeof *lclptr);
if (lclptr == NULL) {
settzname(); /* all we can do */
return;
}
}
-#endif /* defined ALL_STATE */
#if defined (__CYGWIN__)
{
TIME_ZONE_INFORMATION tz;
@@ -1470,7 +1571,7 @@ tzsetwall P((void))
sprintf(cp=strchr(cp, 0), ":%d", tz.StandardDate.wSecond);
}
/* printf("TZ deduced as `%s'\n", buf); */
- if (tzparse(buf, lclptr, false) == 0) {
+ if (tzparse(lclptr, buf, FALSE) == 0) {
settzname();
lcl_is_set = lcl_from_default;
strlcpy(lcl_TZname, buf, sizeof (lcl_TZname));
@@ -1483,85 +1584,130 @@ tzsetwall P((void))
}
}
#endif
- if (tzload((char *) NULL, lclptr) != 0)
+ if (tzload(lclptr, NULL, TRUE) != 0)
gmtload(lclptr);
settzname();
}
static NO_COPY muto tzset_guard;
-extern "C" void
-tzset P((void))
+#ifndef STD_INSPIRED
+/*
+** A non-static declaration of tzsetwall in a system header file
+** may cause a warning about this upcoming static declaration...
+*/
+static
+#endif /* !defined STD_INSPIRED */
+void
+tzset_unlocked(void)
{
- tzset_guard.init ("tzset_guard")->acquire ();
- const char * name = getenv("TZ");
+ const char * name;
+ name = getenv("TZ");
if (name == NULL) {
if (lcl_is_set != lcl_from_default)
tzsetwall();
- goto out;
+ return;
}
- if (lcl_is_set > 0 && strncmp(lcl_TZname, name, sizeof(lcl_TZname) - 1) == 0)
- goto out;
+ if (lcl_is_set > 0 && strcmp(lcl_TZname, name) == 0)
+ return;
lcl_is_set = (strlen(name) < sizeof (lcl_TZname)) ? lcl_from_environment : lcl_unset;
if (lcl_is_set != lcl_unset)
- strlcpy(lcl_TZname, name, sizeof (lcl_TZname));
+ (void)strlcpy(lcl_TZname, name, sizeof (lcl_TZname));
-#ifdef ALL_STATE
if (lclptr == NULL) {
- lclptr = (struct state *) malloc(sizeof *lclptr);
+ save_errno save;
+ lclptr = (timezone_t) calloc(1, sizeof *lclptr);
if (lclptr == NULL) {
settzname(); /* all we can do */
- goto out;
+ return;
}
}
-#endif /* defined ALL_STATE */
if (*name == '\0') {
/*
** User wants it fast rather than right.
*/
lclptr->leapcnt = 0; /* so, we're off a little */
lclptr->timecnt = 0;
+ lclptr->typecnt = 0;
+ lclptr->ttis[0].tt_isdst = 0;
lclptr->ttis[0].tt_gmtoff = 0;
lclptr->ttis[0].tt_abbrind = 0;
- strcpy(lclptr->chars, gmt);
- } else if (tzload(name, lclptr) != 0) {
- if (name[0] == ':' || tzparse(name, lclptr, false) != 0)
- gmtload(lclptr);
- }
+ (void) strlcpy(lclptr->chars, gmt, sizeof(lclptr->chars));
+ } else if (tzload(lclptr, name, TRUE) != 0)
+ if (name[0] == ':' || tzparse(lclptr, name, FALSE) != 0)
+ (void) gmtload(lclptr);
settzname();
-out:
+}
+
+extern "C" void
+tzset(void)
+{
+ tzset_guard.init ("tzset_guard")->acquire ();
+ tzset_unlocked();
tzset_guard.release ();
}
/*
** The easy way to behave "as if no library function calls" localtime
** is to not call it--so we drop its guts into "localsub", which can be
-** freely called. (And no, the PANS doesn't require the above behavior--
+** freely called. (And no, the PANS doesn't require the above behavior--
** but it *is* desirable.)
**
** The unused offset argument is for the benefit of mktime variants.
*/
/*ARGSUSED*/
-static void
-localsub (const time_t * const timep,
- const long offset,
- struct tm * const tmp)
+static struct tm *
+localsub(const timezone_t sp, const time_t * const timep, const long offset,
+ struct tm *const tmp)
{
- register struct state * sp;
- register const struct ttinfo * ttisp;
- register int i;
+ const struct ttinfo * ttisp;
+ int i;
+ struct tm * result;
const time_t t = *timep;
- sp = lclptr;
-#ifdef ALL_STATE
- if (sp == NULL) {
- gmtsub(timep, offset, tmp);
- return;
+ if ((sp->goback && t < sp->ats[0]) ||
+ (sp->goahead && t > sp->ats[sp->timecnt - 1])) {
+ time_t newt = t;
+ time_t seconds;
+ time_t tcycles;
+ int_fast64_t icycles;
+
+ if (t < sp->ats[0])
+ seconds = sp->ats[0] - t;
+ else seconds = t - sp->ats[sp->timecnt - 1];
+ --seconds;
+ tcycles = (time_t)
+ (seconds / YEARSPERREPEAT / AVGSECSPERYEAR);
+ ++tcycles;
+ icycles = tcycles;
+ if (tcycles - icycles >= 1 || icycles - tcycles >= 1)
+ return NULL;
+ seconds = (time_t) icycles;
+ seconds *= YEARSPERREPEAT;
+ seconds *= AVGSECSPERYEAR;
+ if (t < sp->ats[0])
+ newt += seconds;
+ else newt -= seconds;
+ if (newt < sp->ats[0] ||
+ newt > sp->ats[sp->timecnt - 1])
+ return NULL; /* "cannot happen" */
+ result = localsub(sp, &newt, offset, tmp);
+ if (result == tmp) {
+ time_t newy;
+
+ newy = tmp->tm_year;
+ if (t < sp->ats[0])
+ newy -= (time_t)icycles * YEARSPERREPEAT;
+ else newy += (time_t)icycles * YEARSPERREPEAT;
+ tmp->tm_year = (int)newy;
+ if (tmp->tm_year != newy)
+ return NULL;
+ }
+ return result;
}
-#endif /* defined ALL_STATE */
if (sp->timecnt == 0 || t < sp->ats[0]) {
i = 0;
while (sp->ttis[i].tt_isdst)
@@ -1570,10 +1716,17 @@ localsub (const time_t * const timep,
break;
}
} else {
- for (i = 1; i < sp->timecnt; ++i)
- if (t < sp->ats[i])
- break;
- i = sp->types[i - 1];
+ int lo = 1;
+ int hi = sp->timecnt;
+
+ while (lo < hi) {
+ int mid = (lo + hi) / 2;
+
+ if (t < sp->ats[mid])
+ hi = mid;
+ else lo = mid + 1;
+ }
+ i = (int) sp->types[lo - 1];
}
ttisp = &sp->ttis[i];
/*
@@ -1582,49 +1735,58 @@ localsub (const time_t * const timep,
** t += ttisp->tt_gmtoff;
** timesub(&t, 0L, sp, tmp);
*/
- timesub(&t, ttisp->tt_gmtoff, sp, tmp);
+ result = timesub(sp, &t, ttisp->tt_gmtoff, tmp);
tmp->tm_isdst = ttisp->tt_isdst;
- tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind];
+ if (sp == lclptr)
+ tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind];
#ifdef TM_ZONE
tmp->TM_ZONE = &sp->chars[ttisp->tt_abbrind];
#endif /* defined TM_ZONE */
+ return result;
}
+/*
+** Re-entrant version of localtime.
+*/
extern "C" struct tm *
-localtime(const time_t *timep)
+localtime_r(const time_t *timep, struct tm *tmp)
{
- tzset();
- localsub(timep, 0L, &tm);
- return &tm;
+ tzset_guard.init ("tzset_guard")->acquire ();
+ tzset_unlocked();
+ tmp = localsub(lclptr, timep, 0L, tmp);
+ tzset_guard.release ();
+ if (tmp == NULL)
+ errno = EOVERFLOW;
+ return tmp;
}
-/*
- * Re-entrant version of localtime
- */
extern "C" struct tm *
-localtime_r(const time_t *timep, struct tm *tm)
+localtime(const time_t *const timep)
{
- tzset();
- localsub(timep, 0L, tm);
- return tm;
+ return localtime_r(timep, &tm);
}
/*
** gmtsub is to gmtime as localsub is to localtime.
*/
+static NO_COPY muto gmt_guard;
-static void
-gmtsub(const time_t *timep, const long offset, struct tm *tmp)
+static struct tm *
+gmtsub(const timezone_t sp, const time_t *const timep, const long offset,
+ struct tm *tmp)
{
+ struct tm * result;
+
+ gmt_guard.init ("gmt_guard")->acquire ();
if (!gmt_is_set) {
- gmt_is_set = true;
-#ifdef ALL_STATE
- gmtptr = (struct state *) malloc(sizeof *gmtptr);
+ save_errno save;
+ gmt_is_set = TRUE;
+ gmtptr = (timezone_t) calloc(1, sizeof *gmtptr);
if (gmtptr != NULL)
-#endif /* defined ALL_STATE */
gmtload(gmtptr);
}
- timesub(timep, offset, gmtptr, tmp);
+ gmt_guard.release ();
+ result = timesub(gmtptr, timep, offset, tmp);
#ifdef TM_ZONE
/*
** Could get fancy here and deliver something such as
@@ -1634,68 +1796,84 @@ gmtsub(const time_t *timep, const long offset, struct tm *tmp)
if (offset != 0)
tmp->TM_ZONE = wildabbr;
else {
-#ifdef ALL_STATE
if (gmtptr == NULL)
tmp->TM_ZONE = gmt;
else tmp->TM_ZONE = gmtptr->chars;
-#endif /* defined ALL_STATE */
-#ifndef ALL_STATE
- tmp->TM_ZONE = gmtptr->chars;
-#endif /* State Farm */
}
#endif /* defined TM_ZONE */
+ return result;
}
extern "C" struct tm *
-gmtime(const time_t *timep)
+gmtime(const time_t *const timep)
{
- gmtsub(timep, 0L, &tm);
- return &tm;
+ struct tm *tmp = gmtsub(NULL, timep, 0L, &tm);
+
+ if (tmp == NULL)
+ errno = EOVERFLOW;
+
+ return tmp;
}
/*
- * Re-entrant version of gmtime
- */
+** Re-entrant version of gmtime.
+*/
+
extern "C" struct tm *
-gmtime_r(const time_t *timep, struct tm *tm)
+gmtime_r(const time_t * const timep, struct tm *tmp)
{
- gmtsub(timep, 0L, tm);
- return tm;
+ tmp = gmtsub(NULL, timep, 0L, tmp);
+
+ if (tmp == NULL)
+ errno = EOVERFLOW;
+
+ return tmp;
}
#ifdef STD_INSPIRED
extern "C" struct tm *
-offtime(const time_t *timep, const long offset)
+offtime(const time_t *const timep, long offset)
{
- gmtsub(timep, offset, &tm);
- return &tm;
+ struct tm *tmp = gmtsub(NULL, timep, offset, &tm);
+
+ if (tmp == NULL)
+ errno = EOVERFLOW;
+
+ return tmp;
}
#endif /* defined STD_INSPIRED */
-static void
-timesub(const time_t *timep, const long offset, const struct state *sp,
- struct tm *tmp)
+/*
+** Return the number of leap years through the end of the given year
+** where, to make the math easy, the answer for year zero is defined as zero.
+*/
+
+static int
+leaps_thru_end_of(const int y)
{
- register const struct lsinfo * lp;
- register long days;
- register long rem;
- register int y;
- register int yleap;
- register const int * ip;
- register long corr;
- register int hit;
- register int i;
+ return (y >= 0) ? (y / 4 - y / 100 + y / 400) :
+ -(leaps_thru_end_of(-(y + 1)) + 1);
+}
+
+static struct tm *
+timesub(const timezone_t sp, const time_t *const timep, const long offset,
+ struct tm *const tmp)
+{
+ const struct lsinfo * lp;
+ time_t tdays;
+ int idays; /* unsigned would be so 2003 */
+ long rem;
+ int y;
+ const int * ip;
+ long corr;
+ int hit;
+ int i;
corr = 0;
hit = 0;
-#ifdef ALL_STATE
i = (sp == NULL) ? 0 : sp->leapcnt;
-#endif /* defined ALL_STATE */
-#ifndef ALL_STATE
- i = sp->leapcnt;
-#endif /* State Farm */
while (--i >= 0) {
lp = &sp->lsis[i];
if (*timep >= lp->ls_trans) {
@@ -1716,115 +1894,170 @@ timesub(const time_t *timep, const long offset, const struct state *sp,
break;
}
}
- days = *timep / SECSPERDAY;
- rem = *timep % SECSPERDAY;
-#ifdef mc68k
- if (*timep == 0x80000000) {
- /*
- ** A 3B1 muffs the division on the most negative number.
- */
- days = -24855;
- rem = -11648;
+ y = EPOCH_YEAR;
+ tdays = (time_t)(*timep / SECSPERDAY);
+ rem = (long) (*timep - tdays * SECSPERDAY);
+ while (tdays < 0 || tdays >= year_lengths[isleap(y)]) {
+ int newy;
+ time_t tdelta;
+ int idelta;
+ int leapdays;
+
+ tdelta = tdays / DAYSPERLYEAR;
+ idelta = (int) tdelta;
+ if (tdelta - idelta >= 1 || idelta - tdelta >= 1)
+ return NULL;
+ if (idelta == 0)
+ idelta = (tdays < 0) ? -1 : 1;
+ newy = y;
+ if (increment_overflow(&newy, idelta))
+ return NULL;
+ leapdays = leaps_thru_end_of(newy - 1) -
+ leaps_thru_end_of(y - 1);
+ tdays -= ((time_t) newy - y) * DAYSPERNYEAR;
+ tdays -= leapdays;
+ y = newy;
+ }
+ {
+ long seconds;
+
+ seconds = tdays * SECSPERDAY + 0.5;
+ tdays = (time_t)(seconds / SECSPERDAY);
+ rem += (long) (seconds - tdays * SECSPERDAY);
}
-#endif /* defined mc68k */
- rem += (offset - corr);
+ /*
+ ** Given the range, we can now fearlessly cast...
+ */
+ idays = (int) tdays;
+ rem += offset - corr;
while (rem < 0) {
rem += SECSPERDAY;
- --days;
+ --idays;
}
while (rem >= SECSPERDAY) {
rem -= SECSPERDAY;
- ++days;
+ ++idays;
+ }
+ while (idays < 0) {
+ if (increment_overflow(&y, -1))
+ return NULL;
+ idays += year_lengths[isleap(y)];
}
+ while (idays >= year_lengths[isleap(y)]) {
+ idays -= year_lengths[isleap(y)];
+ if (increment_overflow(&y, 1))
+ return NULL;
+ }
+ tmp->tm_year = y;
+ if (increment_overflow(&tmp->tm_year, -TM_YEAR_BASE))
+ return NULL;
+ tmp->tm_yday = idays;
+ /*
+ ** The "extra" mods below avoid overflow problems.
+ */
+ tmp->tm_wday = EPOCH_WDAY +
+ ((y - EPOCH_YEAR) % DAYSPERWEEK) *
+ (DAYSPERNYEAR % DAYSPERWEEK) +
+ leaps_thru_end_of(y - 1) -
+ leaps_thru_end_of(EPOCH_YEAR - 1) +
+ idays;
+ tmp->tm_wday %= DAYSPERWEEK;
+ if (tmp->tm_wday < 0)
+ tmp->tm_wday += DAYSPERWEEK;
tmp->tm_hour = (int) (rem / SECSPERHOUR);
- rem = rem % SECSPERHOUR;
+ rem %= SECSPERHOUR;
tmp->tm_min = (int) (rem / SECSPERMIN);
/*
** A positive leap second requires a special
- ** representation. This uses "... ??:59:60" et seq.
+ ** representation. This uses "... ??:59:60" et seq.
*/
tmp->tm_sec = (int) (rem % SECSPERMIN) + hit;
- tmp->tm_wday = (int) ((EPOCH_WDAY + days) % DAYSPERWEEK);
- if (tmp->tm_wday < 0)
- tmp->tm_wday += DAYSPERWEEK;
- y = EPOCH_YEAR;
-#define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400)
- while (days < 0 || days >= (long) year_lengths[yleap = isleap(y)]) {
- register int newy;
-
- newy = y + days / DAYSPERNYEAR;
- if (days < 0)
- --newy;
- days -= (newy - y) * DAYSPERNYEAR +
- LEAPS_THRU_END_OF(newy - 1) -
- LEAPS_THRU_END_OF(y - 1);
- y = newy;
- }
- tmp->tm_year = y - TM_YEAR_BASE;
- tmp->tm_yday = (int) days;
- ip = mon_lengths[yleap];
- for (tmp->tm_mon = 0; days >= (long) ip[tmp->tm_mon]; ++(tmp->tm_mon))
- days = days - (long) ip[tmp->tm_mon];
- tmp->tm_mday = (int) (days + 1);
+ ip = mon_lengths[isleap(y)];
+ for (tmp->tm_mon = 0; idays >= ip[tmp->tm_mon]; ++(tmp->tm_mon))
+ idays -= ip[tmp->tm_mon];
+ tmp->tm_mday = (int) (idays + 1);
tmp->tm_isdst = 0;
#ifdef TM_GMTOFF
tmp->TM_GMTOFF = offset;
#endif /* defined TM_GMTOFF */
+ return tmp;
}
extern "C" char *
-ctime(const time_t *timep)
+ctime(const time_t *const timep)
{
/*
** Section 4.12.3.2 of X3.159-1989 requires that
** The ctime function converts the calendar time pointed to by timer
-** to local time in the form of a string. It is equivalent to
+** to local time in the form of a string. It is equivalent to
** asctime(localtime(timer))
*/
- return asctime(localtime(timep));
+ struct tm *rtm = localtime(timep);
+ if (rtm == NULL)
+ return NULL;
+ return asctime(rtm);
}
extern "C" char *
-ctime_r(const time_t *timep, char *buf)
+ctime_r(const time_t *const timep, char *buf)
{
- struct tm tm;
+ struct tm mytm, *rtm;
- return asctime_r(localtime_r(timep, &tm), buf);
+ rtm = localtime_r(timep, &mytm);
+ if (rtm == NULL)
+ return NULL;
+ return asctime_r(rtm, buf);
}
/*
** Adapted from code provided by Robert Elz, who writes:
** The "best" way to do mktime I think is based on an idea of Bob
** Kridle's (so its said...) from a long time ago.
-** [kridle@xinet.com as of 1996-01-16.]
-** It does a binary search of the time_t space. Since time_t's are
+** It does a binary search of the time_t space. Since time_t's are
** just 32 bits, its a max of 32 iterations (even at 64 bits it
** would still be very reasonable).
*/
#ifndef WRONG
-#define WRONG (-1)
+#define WRONG ((time_t)-1)
#endif /* !defined WRONG */
/*
-** Simplified normalize logic courtesy Paul Eggert (eggert@twinsun.com).
+** Simplified normalize logic courtesy Paul Eggert.
*/
-/* Mark as noinline to prevent a compiler warning. */
-static int __attribute__((noinline))
-increment_overflow(int *number, int delta)
+static int
+increment_overflow(int *const ip, int j)
{
- int number0;
+ int i = *ip;
- number0 = *number;
- *number += delta;
- return (*number < number0) != (delta < 0);
+ /*
+ ** If i >= 0 there can only be overflow if i + j > INT_MAX
+ ** or if j > INT_MAX - i; given i >= 0, INT_MAX - i cannot overflow.
+ ** If i < 0 there can only be overflow if i + j < INT_MIN
+ ** or if j < INT_MIN - i; given i < 0, INT_MIN - i cannot overflow.
+ */
+ if ((i >= 0) ? (j > INT_MAX - i) : (j < INT_MIN - i))
+ return TRUE;
+ *ip += j;
+ return FALSE;
+}
+
+static int
+long_increment_overflow(long *const lp, int m)
+{
+ long l = *lp;
+
+ if ((l >= 0) ? (m > LONG_MAX - l) : (m < LONG_MIN - l))
+ return TRUE;
+ *lp += m;
+ return FALSE;
}
static int
-normalize_overflow(int *tensptr, int *unitsptr, const int base)
+normalize_overflow(int *const tensptr, int *const unitsptr, const int base)
{
- register int tensdelta;
+ int tensdelta;
tensdelta = (*unitsptr >= 0) ?
(*unitsptr / base) :
@@ -1834,9 +2067,22 @@ normalize_overflow(int *tensptr, int *unitsptr, const int base)
}
static int
-tmcomp(register const struct tm *atmp, register const struct tm *btmp)
+long_normalize_overflow(long *const tensptr, int *const unitsptr,
+ const int base)
{
- register int result;
+ int tensdelta;
+
+ tensdelta = (*unitsptr >= 0) ?
+ (*unitsptr / base) :
+ (-1 - (-1 - *unitsptr) / base);
+ *unitsptr -= tensdelta * base;
+ return long_increment_overflow(tensptr, tensdelta);
+}
+
+static int
+tmcomp(const struct tm *const atmp, const struct tm *const btmp)
+{
+ int result;
if ((result = (atmp->tm_year - btmp->tm_year)) == 0 &&
(result = (atmp->tm_mon - btmp->tm_mon)) == 0 &&
@@ -1848,63 +2094,77 @@ tmcomp(register const struct tm *atmp, register const struct tm *btmp)
}
static time_t
-time2sub(struct tm *tmp, void (*funcp) P((const time_t*, long, struct tm*)),
- const long offset, int *okayp, const int do_norm_secs)
+time2sub(const timezone_t sp, struct tm *const tmp, subfun_t funcp,
+ const long offset, int *const okayp, const int do_norm_secs)
{
- register const struct state * sp;
- register int dir;
- register int bits;
- register int i, j ;
- register int saved_seconds;
+ int dir;
+ int i, j;
+ int saved_seconds;
+ long li;
+ time_t lo;
+ time_t hi;
+#ifdef NO_ERROR_IN_DST_GAP
+ time_t ilo;
+#endif
+ long y;
time_t newt;
time_t t;
struct tm yourtm, mytm;
- *okayp = false;
+ *okayp = FALSE;
yourtm = *tmp;
+#ifdef NO_ERROR_IN_DST_GAP
+again:
+#endif
if (do_norm_secs) {
if (normalize_overflow(&yourtm.tm_min, &yourtm.tm_sec,
- SECSPERMIN))
- return WRONG;
+ SECSPERMIN))
+ goto overflow;
}
if (normalize_overflow(&yourtm.tm_hour, &yourtm.tm_min, MINSPERHOUR))
- return WRONG;
+ goto overflow;
if (normalize_overflow(&yourtm.tm_mday, &yourtm.tm_hour, HOURSPERDAY))
- return WRONG;
- if (normalize_overflow(&yourtm.tm_year, &yourtm.tm_mon, MONSPERYEAR))
- return WRONG;
+ goto overflow;
+ y = yourtm.tm_year;
+ if (long_normalize_overflow(&y, &yourtm.tm_mon, MONSPERYEAR))
+ goto overflow;
/*
- ** Turn yourtm.tm_year into an actual year number for now.
+ ** Turn y into an actual year number for now.
** It is converted back to an offset from TM_YEAR_BASE later.
*/
- if (increment_overflow(&yourtm.tm_year, TM_YEAR_BASE))
- return WRONG;
+ if (long_increment_overflow(&y, TM_YEAR_BASE))
+ goto overflow;
while (yourtm.tm_mday <= 0) {
- if (increment_overflow(&yourtm.tm_year, -1))
- return WRONG;
- i = yourtm.tm_year + (1 < yourtm.tm_mon);
- yourtm.tm_mday += year_lengths[isleap(i)];
+ if (long_increment_overflow(&y, -1))
+ goto overflow;
+ li = y + (1 < yourtm.tm_mon);
+ yourtm.tm_mday += year_lengths[isleap(li)];
}
while (yourtm.tm_mday > DAYSPERLYEAR) {
- i = yourtm.tm_year + (1 < yourtm.tm_mon);
- yourtm.tm_mday -= year_lengths[isleap(i)];
- if (increment_overflow(&yourtm.tm_year, 1))
- return WRONG;
+ li = y + (1 < yourtm.tm_mon);
+ yourtm.tm_mday -= year_lengths[isleap(li)];
+ if (long_increment_overflow(&y, 1))
+ goto overflow;
}
for ( ; ; ) {
- i = mon_lengths[isleap(yourtm.tm_year)][yourtm.tm_mon];
+ i = mon_lengths[isleap(y)][yourtm.tm_mon];
if (yourtm.tm_mday <= i)
break;
yourtm.tm_mday -= i;
if (++yourtm.tm_mon >= MONSPERYEAR) {
yourtm.tm_mon = 0;
- if (increment_overflow(&yourtm.tm_year, 1))
- return WRONG;
+ if (long_increment_overflow(&y, 1))
+ goto overflow;
}
}
- if (increment_overflow(&yourtm.tm_year, -TM_YEAR_BASE))
- return WRONG;
- if (yourtm.tm_year + TM_YEAR_BASE < EPOCH_YEAR) {
+ if (long_increment_overflow(&y, -TM_YEAR_BASE))
+ goto overflow;
+ yourtm.tm_year = (int)y;
+ if (yourtm.tm_year != y)
+ goto overflow;
+ if (yourtm.tm_sec >= 0 && yourtm.tm_sec < SECSPERMIN)
+ saved_seconds = 0;
+ else if (y + TM_YEAR_BASE < EPOCH_YEAR) {
/*
** We can't set tm_sec to 0, because that might push the
** time below the minimum representable time.
@@ -1914,7 +2174,7 @@ time2sub(struct tm *tmp, void (*funcp) P((const time_t*, long, struct tm*)),
** which is a safer assumption than using 58 would be.
*/
if (increment_overflow(&yourtm.tm_sec, 1 - SECSPERMIN))
- return WRONG;
+ goto overflow;
saved_seconds = yourtm.tm_sec;
yourtm.tm_sec = SECSPERMIN - 1;
} else {
@@ -1922,27 +2182,71 @@ time2sub(struct tm *tmp, void (*funcp) P((const time_t*, long, struct tm*)),
yourtm.tm_sec = 0;
}
/*
- ** Divide the search space in half
- ** (this works whether time_t is signed or unsigned).
+ ** Do a binary search (this works whatever time_t's type is).
*/
- bits = TYPE_BIT(time_t) - 1;
- /*
- ** If time_t is signed, then 0 is just above the median,
- ** assuming two's complement arithmetic.
- ** If time_t is unsigned, then (1 << bits) is just above the median.
- */
- t = TYPE_SIGNED(time_t) ? 0 : (((time_t) 1) << bits);
+ /* LINTED const not */
+ if (!TYPE_SIGNED(time_t)) {
+ lo = 0;
+ hi = lo - 1;
+ /* LINTED const not */
+ } else {
+ lo = 1;
+ for (i = 0; i < (int) TYPE_BIT(time_t) - 1; ++i)
+ lo *= 2;
+ hi = -(lo + 1);
+ }
+#ifdef NO_ERROR_IN_DST_GAP
+ ilo = lo;
+#endif
for ( ; ; ) {
- (*funcp)(&t, offset, &mytm);
- dir = tmcomp(&mytm, &yourtm);
+ t = lo / 2 + hi / 2;
+ if (t < lo)
+ t = lo;
+ else if (t > hi)
+ t = hi;
+ if ((*funcp)(sp, &t, offset, &mytm) == NULL) {
+ /*
+ ** Assume that t is too extreme to be represented in
+ ** a struct tm; arrange things so that it is less
+ ** extreme on the next pass.
+ */
+ dir = (t > 0) ? 1 : -1;
+ } else dir = tmcomp(&mytm, &yourtm);
if (dir != 0) {
- if (bits-- < 0)
- return WRONG;
- if (bits < 0)
- --t; /* may be needed if new t is minimal */
- else if (dir > 0)
- t -= ((time_t) 1) << bits;
- else t += ((time_t) 1) << bits;
+ if (t == lo) {
+ ++t;
+ if (t <= lo)
+ goto overflow;
+ ++lo;
+ } else if (t == hi) {
+ --t;
+ if (t >= hi)
+ goto overflow;
+ --hi;
+ }
+#ifdef NO_ERROR_IN_DST_GAP
+ if (ilo != lo && lo - 1 == hi && yourtm.tm_isdst < 0 &&
+ do_norm_secs) {
+ for (i = sp->typecnt - 1; i >= 0; --i) {
+ for (j = sp->typecnt - 1; j >= 0; --j) {
+ time_t off;
+ if (sp->ttis[j].tt_isdst ==
+ sp->ttis[i].tt_isdst)
+ continue;
+ off = sp->ttis[j].tt_gmtoff -
+ sp->ttis[i].tt_gmtoff;
+ yourtm.tm_sec += off < 0 ?
+ -off : off;
+ goto again;
+ }
+ }
+ }
+#endif
+ if (lo > hi)
+ goto invalid;
+ if (dir > 0)
+ hi = t;
+ else lo = t;
continue;
}
if (yourtm.tm_isdst < 0 || mytm.tm_isdst == yourtm.tm_isdst)
@@ -1953,25 +2257,18 @@ time2sub(struct tm *tmp, void (*funcp) P((const time_t*, long, struct tm*)),
** It's okay to guess wrong since the guess
** gets checked.
*/
- /*
- ** The (void *) casts are the benefit of SunOS 3.3 on Sun 2's.
- */
- sp = (const struct state *)
- (((void *) funcp == (void *) localsub) ?
- lclptr : gmtptr);
-#ifdef ALL_STATE
if (sp == NULL)
- return WRONG;
-#endif /* defined ALL_STATE */
+ goto invalid;
for (i = sp->typecnt - 1; i >= 0; --i) {
if (sp->ttis[i].tt_isdst != yourtm.tm_isdst)
continue;
for (j = sp->typecnt - 1; j >= 0; --j) {
if (sp->ttis[j].tt_isdst == yourtm.tm_isdst)
continue;
- newt = t + sp->ttis[j].tt_gmtoff -
- sp->ttis[i].tt_gmtoff;
- (*funcp)(&newt, offset, &mytm);
+ newt = (time_t)(t + sp->ttis[j].tt_gmtoff -
+ sp->ttis[i].tt_gmtoff);
+ if ((*funcp)(sp, &newt, offset, &mytm) == NULL)
+ continue;
if (tmcomp(&mytm, &yourtm) != 0)
continue;
if (mytm.tm_isdst != yourtm.tm_isdst)
@@ -1983,21 +2280,28 @@ time2sub(struct tm *tmp, void (*funcp) P((const time_t*, long, struct tm*)),
goto label;
}
}
- return WRONG;
+ goto invalid;
}
label:
newt = t + saved_seconds;
if ((newt < t) != (saved_seconds < 0))
- return WRONG;
+ goto overflow;
t = newt;
- (*funcp)(&t, offset, tmp);
- *okayp = true;
- return t;
+ if ((*funcp)(sp, &t, offset, tmp)) {
+ *okayp = TRUE;
+ return t;
+ }
+overflow:
+ errno = EOVERFLOW;
+ return WRONG;
+invalid:
+ errno = EINVAL;
+ return WRONG;
}
static time_t
-time2(struct tm *tmp, void (*funcp) P((const time_t*, long, struct tm*)),
- const long offset, int *okayp)
+time2(const timezone_t sp, struct tm *const tmp, subfun_t funcp,
+ const long offset, int *const okayp)
{
time_t t;
@@ -2006,46 +2310,33 @@ time2(struct tm *tmp, void (*funcp) P((const time_t*, long, struct tm*)),
** (in case tm_sec contains a value associated with a leap second).
** If that fails, try with normalization of seconds.
*/
- t = time2sub(tmp, funcp, offset, okayp, false);
- if (*okayp)
- return t;
- t = time2sub(tmp, funcp, offset, okayp, true);
- if (*okayp)
- return t;
- /* Workaround for the spring forward gap problem which results in
- the autoconf mktime usability test failing.
- What we do here is this: The gap has 3600 seconds. If we
- subtract 3600 from the tm_sec value and get a valid result,
- then we can simply add 3600 to the return value and are done.
- If the result is still not valid, the problem is not the
- spring forward gap and we can give up. */
- struct tm tmp2 = *tmp;
- tmp2.tm_sec -= 3600;
- t = time2sub(&tmp2, funcp, offset, okayp, true);
- if (*okayp)
- {
- if (t + 3600 < 0) /* Sanity check */
- return WRONG;
- return t + 3600;
- }
- return t;
+ t = time2sub(sp, tmp, funcp, offset, okayp, FALSE);
+ return *okayp ? t : time2sub(sp, tmp, funcp, offset, okayp, TRUE);
}
static time_t
-time1(struct tm *tmp, void (*funcp) P((const time_t *, long, struct tm *)),
- const long offset)
+time1(const timezone_t sp, struct tm *const tmp, subfun_t funcp,
+ const long offset)
{
- register time_t t;
- register const struct state * sp;
- register int samei, otheri;
+ time_t t;
+ int samei, otheri;
+ int sameind, otherind;
+ int i;
+ int nseen;
+ int seen[TZ_MAX_TYPES];
+ int types[TZ_MAX_TYPES];
int okay;
+ if (tmp == NULL) {
+ errno = EINVAL;
+ return WRONG;
+ }
if (tmp->tm_isdst > 1)
tmp->tm_isdst = 1;
- t = time2(tmp, funcp, offset, &okay);
+ t = time2(sp, tmp, funcp, offset, &okay);
#ifdef PCTS
/*
- ** PCTS code courtesy Grant Sullivan (grant@osf.org).
+ ** PCTS code courtesy Grant Sullivan.
*/
if (okay)
return t;
@@ -2062,63 +2353,83 @@ time1(struct tm *tmp, void (*funcp) P((const time_t *, long, struct tm *)),
** We try to divine the type they started from and adjust to the
** type they need.
*/
- /*
- ** The (void *) casts are the benefit of SunOS 3.3 on Sun 2's.
- */
- sp = (const struct state *) (((void *) funcp == (void *) localsub) ?
- lclptr : gmtptr);
-#ifdef ALL_STATE
- if (sp == NULL)
+ if (sp == NULL) {
+ errno = EINVAL;
return WRONG;
-#endif /* defined ALL_STATE */
- for (samei = sp->typecnt - 1; samei >= 0; --samei) {
+ }
+ for (i = 0; i < sp->typecnt; ++i)
+ seen[i] = FALSE;
+ nseen = 0;
+ for (i = sp->timecnt - 1; i >= 0; --i)
+ if (!seen[sp->types[i]]) {
+ seen[sp->types[i]] = TRUE;
+ types[nseen++] = sp->types[i];
+ }
+ for (sameind = 0; sameind < nseen; ++sameind) {
+ samei = types[sameind];
if (sp->ttis[samei].tt_isdst != tmp->tm_isdst)
continue;
- for (otheri = sp->typecnt - 1; otheri >= 0; --otheri) {
+ for (otherind = 0; otherind < nseen; ++otherind) {
+ otheri = types[otherind];
if (sp->ttis[otheri].tt_isdst == tmp->tm_isdst)
continue;
- tmp->tm_sec += sp->ttis[otheri].tt_gmtoff -
- sp->ttis[samei].tt_gmtoff;
+ tmp->tm_sec += (int)(sp->ttis[otheri].tt_gmtoff -
+ sp->ttis[samei].tt_gmtoff);
tmp->tm_isdst = !tmp->tm_isdst;
- t = time2(tmp, funcp, offset, &okay);
+ t = time2(sp, tmp, funcp, offset, &okay);
if (okay)
return t;
- tmp->tm_sec -= sp->ttis[otheri].tt_gmtoff -
- sp->ttis[samei].tt_gmtoff;
+ tmp->tm_sec -= (int)(sp->ttis[otheri].tt_gmtoff -
+ sp->ttis[samei].tt_gmtoff);
tmp->tm_isdst = !tmp->tm_isdst;
}
}
+ errno = EOVERFLOW;
return WRONG;
}
extern "C" time_t
-mktime(struct tm *tmp)
+mktime(struct tm *const tmp)
{
- tzset();
- return time1(tmp, localsub, 0L);
+ time_t result;
+
+ tzset_guard.init ("tzset_guard")->acquire ();
+ tzset_unlocked();
+ result = time1(lclptr, tmp, localsub, 0L);
+ tzset_guard.release ();
+ return result;
}
#ifdef STD_INSPIRED
extern "C" time_t
-timelocal(struct tm *tmp)
+timelocal(struct tm *const tmp)
{
- tmp->tm_isdst = -1; /* in case it wasn't initialized */
+ if (tmp != NULL)
+ tmp->tm_isdst = -1; /* in case it wasn't initialized */
return mktime(tmp);
}
extern "C" time_t
-timegm(struct tm *tmp)
+timegm(struct tm *const tmp)
{
- tmp->tm_isdst = 0;
- return time1(tmp, gmtsub, 0L);
+ time_t t;
+
+ if (tmp != NULL)
+ tmp->tm_isdst = 0;
+ t = time1(gmtptr, tmp, gmtsub, 0L);
+ return t;
}
extern "C" time_t
-timeoff(struct tm *tmp, const long offset)
+timeoff(struct tm *const tmp, const long offset)
{
- tmp->tm_isdst = 0;
- return time1(tmp, gmtsub, offset);
+ time_t t;
+
+ if (tmp != NULL)
+ tmp->tm_isdst = 0;
+ t = time1(gmtptr, tmp, gmtsub, offset);
+ return t;
}
#endif /* defined STD_INSPIRED */
@@ -2131,9 +2442,9 @@ timeoff(struct tm *tmp, const long offset)
*/
extern "C" long
-gtime(struct tm *tmp)
+gtime(struct tm *const tmp)
{
- const time_t t = mktime(tmp);
+ const time_t t = mktime(tmp);
if (t == WRONG)
return -1;
@@ -2157,13 +2468,11 @@ gtime(struct tm *tmp)
*/
static long
-leapcorr(time_t *timep)
+leapcorr(const timezone_t sp, time_t *timep)
{
- register struct state * sp;
- register struct lsinfo * lp;
- register int i;
+ struct lsinfo * lp;
+ int i;
- sp = lclptr;
i = sp->leapcnt;
while (--i >= 0) {
lp = &sp->lsis[i];
@@ -2176,8 +2485,12 @@ leapcorr(time_t *timep)
extern "C" time_t
time2posix(time_t t)
{
- tzset();
- return t - leapcorr(&t);
+ time_t result;
+ tzset_guard.init ("tzset_guard")->acquire ();
+ tzset_unlocked();
+ result = t - leapcorr(lclptr, &t);
+ tzset_guard.release ();
+ return (result);
}
extern "C" time_t
@@ -2186,30 +2499,34 @@ posix2time(time_t t)
time_t x;
time_t y;
- tzset();
+ tzset_guard.init ("tzset_guard")->acquire ();
+ tzset_unlocked();
/*
** For a positive leap second hit, the result
- ** is not unique. For a negative leap second
+ ** is not unique. For a negative leap second
** hit, the corresponding time doesn't exist,
** so we return an adjacent second.
*/
- x = t + leapcorr(&t);
- y = x - leapcorr(&x);
+ x = (time_t)(t + leapcorr(lclptr, &t));
+ y = (time_t)(x - leapcorr(lclptr, &x));
if (y < t) {
do {
x++;
- y = x - leapcorr(&x);
+ y = (time_t)(x - leapcorr(lclptr, &x));
} while (y < t);
- if (t != y)
+ if (t != y) {
return x - 1;
+ }
} else if (y > t) {
do {
--x;
- y = x - leapcorr(&x);
+ y = (time_t)(x - leapcorr(lclptr, &x));
} while (y > t);
- if (t != y)
+ if (t != y) {
return x + 1;
+ }
}
+ tzset_guard.release ();
return x;
}
diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc
index 2adacba9c..c5271588f 100644
--- a/winsup/cygwin/malloc_wrapper.cc
+++ b/winsup/cygwin/malloc_wrapper.cc
@@ -61,7 +61,7 @@ malloc (size_t size)
res = dlmalloc (size);
__malloc_unlock ();
}
- malloc_printf ("(%d) = %x, called by %p", size, res, __builtin_return_address (0));
+ malloc_printf ("(%ld) = %p, called by %p", size, res, __builtin_return_address (0));
return res;
}
@@ -77,7 +77,7 @@ realloc (void *p, size_t size)
res = dlrealloc (p, size);
__malloc_unlock ();
}
- malloc_printf ("(%x, %d) = %x, called by %x", p, size, res, __builtin_return_address (0));
+ malloc_printf ("(%p, %ld) = %p, called by %p", p, size, res, __builtin_return_address (0));
return res;
}
@@ -104,7 +104,7 @@ calloc (size_t nmemb, size_t size)
res = dlcalloc (nmemb, size);
__malloc_unlock ();
}
- malloc_printf ("(%d, %d) = %x, called by %x", nmemb, size, res, __builtin_return_address (0));
+ malloc_printf ("(%ld, %ld) = %p, called by %p", nmemb, size, res, __builtin_return_address (0));
return res;
}
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 4f9c9df9d..d0748ea6c 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -32,7 +32,7 @@ details. */
long tls_ix = -1;
-const char case_folded_lower[] NO_COPY = {
+const unsigned char case_folded_lower[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, '!', '"', '#', '$', '%', '&', 39, '(', ')', '*', '+', ',', '-', '.', '/',
@@ -51,7 +51,7 @@ const char case_folded_lower[] NO_COPY = {
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
};
-const char case_folded_upper[] NO_COPY = {
+const unsigned char case_folded_upper[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, '!', '"', '#', '$', '%', '&', 39, '(', ')', '*', '+', ',', '-', '.', '/',
@@ -70,7 +70,7 @@ const char case_folded_upper[] NO_COPY = {
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
};
-const char isalpha_array[] NO_COPY = {
+const char isalpha_array[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -177,7 +177,7 @@ cygwin_strupr (char *string)
return string;
}
-int __stdcall
+int __reg2
check_invalid_virtual_addr (const void *s, unsigned sz)
{
MEMORY_BASIC_INFORMATION mbuf;
@@ -236,7 +236,11 @@ check_iovec (const struct iovec *iov, int iovcnt, bool forwrite)
return (ssize_t) tot;
}
-/* Try hard to schedule another thread. */
+/* Try hard to schedule another thread.
+
+ Note: Don't call yield under _cygtls::lock conditions. It results in
+ potential starvation, especially on a single-CPU system, because
+ _cygtls::lock also calls yield when waiting for the lock. */
void
yield ()
{
@@ -244,11 +248,13 @@ yield ()
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
for (int i = 0; i < 2; i++)
{
- /* MSDN implies that SleepEx(0,...) will force scheduling of other
- threads. Unlike SwitchToThread() the documentation does not mention
- other cpus so, presumably (hah!), this + using a lower priority will
- stall this thread temporarily and cause another to run. */
- SleepEx (0, false);
+ /* MSDN implies that SleepEx will force scheduling of other threads.
+ Unlike SwitchToThread() the documentation does not mention other
+ cpus so, presumably (hah!), this + using a lower priority will
+ stall this thread temporarily and cause another to run.
+ Note: Don't use 0 timeout. This takes a lot of CPU if something
+ goes wrong. */
+ SleepEx (1L, false);
}
SetThreadPriority (GetCurrentThread (), prio);
}
@@ -282,7 +288,7 @@ winprio_to_nice (DWORD prio)
DWORD
nice_to_winprio (int &nice)
{
- static const DWORD priority[] NO_COPY =
+ static const DWORD priority[] =
{
REALTIME_PRIORITY_CLASS, /* 0 */
HIGH_PRIORITY_CLASS, /* 1 */
@@ -443,7 +449,11 @@ __import_address (void *imp)
if (efault.faulted ())
return NULL;
const char *ptr = (const char *) imp;
+#ifdef __x86_64__
+ const uintptr_t *jmpto = (uintptr_t *) (ptr + 6 + *(int32_t *)(ptr + 2));
+#else
const uintptr_t *jmpto = (uintptr_t *) *((uintptr_t *) (ptr + 2));
+#endif
return (void *) *jmpto;
}
@@ -463,12 +473,15 @@ struct thread_wrapper_arg
};
static DWORD WINAPI
-thread_wrapper (VOID *arg)
+thread_wrapper (PVOID arg)
{
/* Just plain paranoia. */
if (!arg)
return ERROR_INVALID_PARAMETER;
+ /* The process is now threaded. Note the fact for later usage. */
+ __isthreaded = 1;
+
/* Fetch thread wrapper info and free from cygheap. */
thread_wrapper_arg wrapper_arg = *(thread_wrapper_arg *) arg;
cfree (arg);
@@ -496,7 +509,7 @@ thread_wrapper (VOID *arg)
/* Initialize new _cygtls. */
_my_tls.init_thread (wrapper_arg.stackbase - CYGTLS_PADSIZE,
(DWORD (*)(void*, void*)) wrapper_arg.func);
-
+#ifndef __x86_64__
/* Copy exception list over to new stack. I'm not quite sure how the
exception list is extended by Windows itself. What's clear is that it
always grows downwards and that it starts right at the stackbase.
@@ -529,9 +542,34 @@ thread_wrapper (VOID *arg)
old_start = old_start->prev;
}
}
-
+#endif
+#ifdef __x86_64__
+ __asm__ ("\n\
+ movq %[WRAPPER_ARG], %%rbx # Load &wrapper_arg into rbx \n\
+ movq (%%rbx), %%r12 # Load thread func into r12 \n\
+ movq 8(%%rbx), %%r13 # Load thread arg into r13 \n\
+ movq 16(%%rbx), %%rcx # Load stackaddr into rcx \n\
+ movq 24(%%rbx), %%rsp # Load stackbase into rsp \n\
+ subq %[CYGTLS], %%rsp # Subtract CYGTLS_PADSIZE \n\
+ # (here we are 16 bytes aligned)\n\
+ subq $32, %%rsp # Subtract another 32 bytes \n\
+ # (shadow space for arg regs) \n\
+ xorq %%rbp, %%rbp # Set rbp to 0 \n\
+ # We moved to the new stack. \n\
+ # Now it's safe to release the OS stack. \n\
+ movl $0x8000, %%r8d # dwFreeType: MEM_RELEASE \n\
+ xorl %%edx, %%edx # dwSize: 0 \n\
+ # dwAddress is already in the correct arg register rcx \n\
+ call VirtualFree \n\
+ # All set. We can copy the thread arg from the safe \n\
+ # register r13 and then just call the function. \n\
+ movq %%r13, %%rcx # Move thread arg to 1st arg reg\n\
+ call *%%r12 # Call thread func \n"
+ : : [WRAPPER_ARG] "r" (&wrapper_arg),
+ [CYGTLS] "i" (CYGTLS_PADSIZE));
+#else
__asm__ ("\n\
- movl %[WRAPPER_ARG], %%ebx # Load &wrapper_arg into ebx \n\
+ movl %[WRAPPER_ARG], %%ebx # Load &wrapper_arg into ebx \n\
movl (%%ebx), %%eax # Load thread func into eax \n\
movl 4(%%ebx), %%ecx # Load thread arg into ecx \n\
movl 8(%%ebx), %%edx # Load stackaddr into edx \n\
@@ -560,10 +598,74 @@ thread_wrapper (VOID *arg)
call *%%eax # Call thread func \n"
: : [WRAPPER_ARG] "r" (&wrapper_arg),
[CYGTLS] "i" (CYGTLS_PADSIZE));
+#endif
/* Never return from here. */
ExitThread (0);
}
+#ifdef __x86_64__
+/* The memory region used for thread stacks */
+#define THREAD_STORAGE_LOW 0x080000000L
+#define THREAD_STORAGE_HIGH 0x100000000L
+/* We provide the stacks always in 1 Megabyte slots */
+#define THREAD_STACK_SLOT 0x100000L /* 1 Meg */
+/* Maximum stack size returned from the pool. */
+#define THREAD_STACK_MAX 0x20000000L /* 512 Megs */
+
+class thread_allocator
+{
+ UINT_PTR current;
+public:
+ thread_allocator () : current (THREAD_STORAGE_HIGH) {}
+ PVOID alloc (SIZE_T size)
+ {
+ SIZE_T real_size = roundup2 (size, THREAD_STACK_SLOT);
+ BOOL overflow = FALSE;
+ PVOID real_stackaddr = NULL;
+
+ /* If an application requests a monster stack, we fulfill this request
+ from outside of our pool, top down. */
+ if (real_size > THREAD_STACK_MAX)
+ return VirtualAlloc (NULL, real_size, MEM_RESERVE | MEM_TOP_DOWN,
+ PAGE_READWRITE);
+ /* Simple round-robin. Keep looping until VirtualAlloc succeeded, or
+ until we overflowed and hit the current address. */
+ for (UINT_PTR addr = current - real_size;
+ !real_stackaddr && (!overflow || addr >= current);
+ addr -= THREAD_STACK_SLOT)
+ {
+ if (addr < THREAD_STORAGE_LOW)
+ {
+ addr = THREAD_STORAGE_HIGH - real_size;
+ overflow = TRUE;
+ }
+ real_stackaddr = VirtualAlloc ((PVOID) addr, real_size,
+ MEM_RESERVE, PAGE_READWRITE);
+ if (!real_stackaddr)
+ {
+ /* So we couldn't grab this space. Let's check the state.
+ If this area is free, simply try the next lower 1 Meg slot.
+ Otherwise, shift the next try down to the AllocationBase
+ of the current address, minus the requested slot size.
+ Add THREAD_STACK_SLOT since that's subtracted in the next
+ run of the loop anyway. */
+ MEMORY_BASIC_INFORMATION mbi;
+ VirtualQuery ((PVOID) addr, &mbi, sizeof mbi);
+ if (mbi.State != MEM_FREE)
+ addr = (UINT_PTR) mbi.AllocationBase - real_size
+ + THREAD_STACK_SLOT;
+ }
+ }
+ /* If we got an address, remember it for the next allocation attempt. */
+ if (real_stackaddr)
+ current = (UINT_PTR) real_stackaddr;
+ return real_stackaddr;
+ }
+};
+
+thread_allocator thr_alloc NO_COPY;
+#endif
+
HANDLE WINAPI
CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, PVOID thread_arg,
PVOID stackaddr, ULONG stacksize, ULONG guardsize,
@@ -607,14 +709,18 @@ CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, PVOID thread_arg,
/* Now roundup the result to the next allocation boundary. */
real_stacksize = roundup2 (real_stacksize,
wincap.allocation_granularity ());
- /* Reserve stack.
- FIXME? If the TOP_DOWN method tends to collide too much with
+ /* Reserve stack. */
+#ifdef __x86_64__
+ real_stackaddr = thr_alloc.alloc (real_stacksize);
+#else
+ /* FIXME? If the TOP_DOWN method tends to collide too much with
other stuff, we should provide our own mechanism to find a
suitable place for the stack. Top down from the start of
the Cygwin DLL comes to mind. */
real_stackaddr = VirtualAlloc (NULL, real_stacksize,
MEM_RESERVE | MEM_TOP_DOWN,
PAGE_READWRITE);
+#endif
if (!real_stackaddr)
return NULL;
/* Set up committed region. Two cases: */
@@ -659,11 +765,9 @@ CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, PVOID thread_arg,
wrapper_arg->stacklimit = real_stacklimit;
}
/* Use the STACK_SIZE_PARAM_IS_A_RESERVATION parameter so only the
- minimum size for a thread stack is reserved by the OS. This doesn't
- work on Windows 2000, but we deallocate the OS stack in thread_wrapper
- anyway, so this should be a problem only in a tight memory condition.
- Note that we reserve a 256K stack, not 64K, otherwise the thread creation
- might crash the process due to a stack overflow. */
+ minimum size for a thread stack is reserved by the OS. Note that we
+ reserve a 256K stack, not 64K, otherwise the thread creation might
+ crash the process due to a stack overflow. */
thread = CreateThread (&sec_none_nih, 4 * PTHREAD_STACK_MIN,
thread_wrapper, wrapper_arg,
creation_flags | STACK_SIZE_PARAM_IS_A_RESERVATION,
@@ -680,3 +784,25 @@ err:
}
return thread;
}
+
+#ifdef __x86_64__
+// TODO: The equivalent newlib functions only work for SYSV ABI so far.
+#undef RtlFillMemory
+#undef RtlCopyMemory
+extern "C" void NTAPI RtlFillMemory (PVOID, SIZE_T, BYTE);
+extern "C" void NTAPI RtlCopyMemory (PVOID, const VOID *, SIZE_T);
+
+extern "C" void *
+memset (void *s, int c, size_t n)
+{
+ RtlFillMemory (s, n, c);
+ return s;
+}
+
+extern "C" void *
+memcpy(void *dest, const void *src, size_t n)
+{
+ RtlCopyMemory (dest, src, n);
+ return dest;
+}
+#endif
diff --git a/winsup/cygwin/mkimport b/winsup/cygwin/mkimport
index 1dfcab3f4..2b08dfe3d 100755
--- a/winsup/cygwin/mkimport
+++ b/winsup/cygwin/mkimport
@@ -5,8 +5,8 @@ use File::Spec;
use Getopt::Long;
my $dir = tempdir(CLEANUP => 1);
-my ($ar, $as, $nm, $objcopy, %replace);
-GetOptions('ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy, 'replace=s'=>\%replace);
+my ($cpu, $ar, $as, $nm, $objcopy, %replace);
+GetOptions('cpu=s'=>\$cpu, 'ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy, 'replace=s'=>\%replace);
# Args::
# 1) import lib to create
@@ -22,6 +22,10 @@ open my $nm_fd, '-|', $nm, '-Apg', '--defined-only', $inpdll;
my %text = ();
my %import = ();
my %symfile = ();
+
+my $is64bit = ($cpu eq 'x86_64' ? 1 : 0);
+my $sym_prefix = ($is64bit ? '' : '_');
+
while (<$nm_fd>) {
chomp;
my ($fn, $type, $sym) = /^$inpdll:(.*?):\S+\s+(\S)\s+(\S+)$/o;
@@ -34,12 +38,12 @@ close $nm_fd or exit 1;
for my $sym (keys %replace) {
my $fn;
- my $_sym = '_' . $sym;
+ my $_sym = $sym_prefix . $sym;
if (!defined($fn = $symfile{$_sym})) {
$fn = "$sym.o";
$text{$fn} = $_sym;
}
- my $imp_sym = '__imp__' . $replace{$sym};
+ my $imp_sym = '__imp_' . $sym_prefix . $replace{$sym};
$import{$fn} = $imp_sym;
}
@@ -48,18 +52,28 @@ for my $f (keys %text) {
my $glob_sym = $text{$f};
if (!defined $imp_sym) {
delete $text{$f};
- } elsif ($imp_sym eq '__imp__') {
+ } elsif ($imp_sym eq '__imp_' . $sym_prefix) {
$text{$f} = 0;
} else {
$text{$f} = 1;
open my $as_fd, '|-', $as, '-o', "$dir/t-$f", "-";
- print $as_fd <<EOF;
+ if ($is64bit) {
+ print $as_fd <<EOF;
+ .text
+ .extern $imp_sym
+ .global $glob_sym
+$glob_sym:
+ jmp *$imp_sym(%rip)
+EOF
+ } else {
+ print $as_fd <<EOF;
.text
.extern $imp_sym
.global $glob_sym
$glob_sym:
jmp *$imp_sym
EOF
+ }
close $as_fd or exit 1;
}
}
diff --git a/winsup/cygwin/mktemp.cc b/winsup/cygwin/mktemp.cc
index 7770c3bff..4dc157da4 100644
--- a/winsup/cygwin/mktemp.cc
+++ b/winsup/cygwin/mktemp.cc
@@ -11,7 +11,6 @@ See the copyright at the bottom of this file. */
#include <unistd.h>
static int _gettemp(char *, int *, int, size_t, int);
-static uint32_t arc4random ();
static const char padchar[] =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
@@ -93,7 +92,7 @@ _gettemp(char *path, int *doopen, int domkdir, size_t suffixlen, int flags)
/*
* check the target directory.
*/
- struct __stat64 sbuf;
+ struct stat sbuf;
if (doopen != NULL || domkdir)
{
for (; trv > path; trv--)
@@ -153,20 +152,6 @@ _gettemp(char *path, int *doopen, int domkdir, size_t suffixlen, int flags)
/*NOTREACHED*/
}
-static uint32_t
-arc4random ()
-{
- union
- {
- uint32_t rand;
- char buf[sizeof (int) / 8];
- } r;
- int fd = open ("/dev/urandom", O_RDONLY);
- read (fd, r.buf, 4);
- close (fd);
- return r.rand;
-}
-
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index d32f6fa06..697ec4099 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -137,13 +137,13 @@ gen_protect (int prot, int flags)
}
static HANDLE
-CreateMapping (HANDLE fhdl, size_t len, _off64_t off, DWORD openflags,
+CreateMapping (HANDLE fhdl, size_t len, off_t off, DWORD openflags,
int prot, int flags)
{
HANDLE h;
NTSTATUS status;
- LARGE_INTEGER sectionsize = { QuadPart: len };
+ LARGE_INTEGER sectionsize = { QuadPart: (LONGLONG) len };
ULONG protect = gen_create_protect (openflags, flags);
ULONG attributes = attached (prot) ? SEC_RESERVE : SEC_COMMIT;
@@ -191,16 +191,20 @@ CreateMapping (HANDLE fhdl, size_t len, _off64_t off, DWORD openflags,
static void *
MapView (HANDLE h, void *addr, size_t len, DWORD openflags,
- int prot, int flags, _off64_t off)
+ int prot, int flags, off_t off)
{
NTSTATUS status;
LARGE_INTEGER offset = { QuadPart:off };
DWORD protect = gen_create_protect (openflags, flags);
void *base = addr;
- ULONG commitsize = attached (prot) ? 0 : len;
- ULONG viewsize = len;
+ SIZE_T commitsize = attached (prot) ? 0 : len;
+ SIZE_T viewsize = len;
+#ifdef __x86_64__ /* AT_ROUND_TO_PAGE isn't supported on 64 bit systems. */
+ ULONG alloc_type = MEM_TOP_DOWN;
+#else
ULONG alloc_type = (base && !wincap.is_wow64 () ? AT_ROUND_TO_PAGE : 0)
| MEM_TOP_DOWN;
+#endif
/* Try mapping using the given address first, even if it's NULL.
If it failed, and addr was not NULL and flags is not MAP_FIXED,
@@ -222,8 +226,8 @@ MapView (HANDLE h, void *addr, size_t len, DWORD openflags,
base = NULL;
SetLastError (RtlNtStatusToDosError (status));
}
- debug_printf ("%p (status %p) = NtMapViewOfSection (h:%x, addr:%x, len:%u,"
- " off:%X, protect:%x, type:%x)",
+ debug_printf ("%p (status %p) = NtMapViewOfSection (h:%p, addr:%p, len:%lu,"
+ " off:%Y, protect:%y, type:%y)",
base, status, h, addr, len, off, protect, 0);
return base;
}
@@ -253,28 +257,31 @@ class mmap_record
LIST_ENTRY (mmap_record) mr_next;
private:
- int fd;
+ /* 4 byte on 32 bit, 8 byte on 64 bit */
HANDLE mapping_hdl;
+ SIZE_T len;
+ caddr_t base_address;
+ /* Always 8 bytes */
+ off_t offset;
+ /* Always 4 bytes */
+ int fd;
DWORD openflags;
int prot;
int flags;
- _off64_t offset;
- DWORD len;
- caddr_t base_address;
- int dev;
+ dev_t dev;
DWORD page_map[0];
public:
- mmap_record (int nfd, HANDLE h, DWORD of, int p, int f, _off64_t o, DWORD l,
+ mmap_record (int nfd, HANDLE h, DWORD of, int p, int f, off_t o, DWORD l,
caddr_t b) :
- fd (nfd),
mapping_hdl (h),
+ len (l),
+ base_address (b),
+ offset (o),
+ fd (nfd),
openflags (of),
prot (p),
- flags (f),
- offset (o),
- len (l),
- base_address (b)
+ flags (f)
{
dev = 0;
if (fd >= 0 && !cygheap->fdtab.not_open (fd))
@@ -296,17 +303,17 @@ class mmap_record
bool autogrow () const { return ::autogrow (flags); }
bool attached () const { return ::attached (prot); }
bool filler () const { return ::filler (prot); }
- _off64_t get_offset () const { return offset; }
- DWORD get_len () const { return len; }
+ off_t get_offset () const { return offset; }
+ SIZE_T get_len () const { return len; }
caddr_t get_address () const { return base_address; }
void init_page_map (mmap_record &r);
DWORD find_unused_pages (DWORD pages) const;
- bool match (caddr_t addr, DWORD len, caddr_t &m_addr, DWORD &m_len);
- _off64_t map_pages (_off64_t off, DWORD len);
- bool map_pages (caddr_t addr, DWORD len);
- bool unmap_pages (caddr_t addr, DWORD len);
+ bool match (caddr_t addr, SIZE_T len, caddr_t &m_addr, DWORD &m_len);
+ off_t map_pages (off_t off, SIZE_T len);
+ bool map_pages (caddr_t addr, SIZE_T len);
+ bool unmap_pages (caddr_t addr, SIZE_T len);
int access (caddr_t address);
fhandler_base *alloc_fh ();
@@ -328,17 +335,17 @@ class mmap_list
private:
int fd;
- __ino64_t hash;
+ ino_t hash;
public:
int get_fd () const { return fd; }
- __ino64_t get_hash () const { return hash; }
+ ino_t get_hash () const { return hash; }
bool anonymous () const { return fd == -1; }
- void set (int nfd, struct __stat64 *st);
+ void set (int nfd, struct stat *st);
mmap_record *add_record (mmap_record &r);
bool del_record (mmap_record *rec);
- caddr_t try_map (void *addr, size_t len, int flags, _off64_t off);
+ caddr_t try_map (void *addr, size_t len, int flags, off_t off);
};
class mmap_areas
@@ -346,8 +353,8 @@ class mmap_areas
public:
LIST_HEAD (, mmap_list) lists;
- mmap_list *get_list_by_fd (int fd, struct __stat64 *st);
- mmap_list *add_list (int fd, struct __stat64 *st);
+ mmap_list *get_list_by_fd (int fd, struct stat *st);
+ mmap_list *add_list (int fd, struct stat *st);
void del_list (mmap_list *ml);
};
@@ -383,7 +390,7 @@ mmap_record::find_unused_pages (DWORD pages) const
}
bool
-mmap_record::match (caddr_t addr, DWORD len, caddr_t &m_addr, DWORD &m_len)
+mmap_record::match (caddr_t addr, SIZE_T len, caddr_t &m_addr, DWORD &m_len)
{
caddr_t low = (addr >= get_address ()) ? addr : get_address ();
caddr_t high = get_address ();
@@ -410,24 +417,24 @@ mmap_record::init_page_map (mmap_record &r)
if (real_protect != start_protect && !noreserve ()
&& !VirtualProtect (get_address (), get_len (),
real_protect, &start_protect))
- system_printf ("Warning: VirtualProtect (addr: %p, len: 0x%x, "
- "new_prot: 0x%x, old_prot: 0x%x), %E",
+ system_printf ("Warning: VirtualProtect (addr: %p, len: %ly, "
+ "new_prot: %y, old_prot: %y), %E",
get_address (), get_len (),
real_protect, start_protect);
- DWORD len = PAGE_CNT (get_len ());
+ SIZE_T len = PAGE_CNT (get_len ());
while (len-- > 0)
MAP_SET (len);
}
-_off64_t
-mmap_record::map_pages (_off64_t off, DWORD len)
+off_t
+mmap_record::map_pages (off_t off, SIZE_T len)
{
/* Used ONLY if this mapping matches into the chunk of another already
performed mapping in a special case of MAP_ANON|MAP_PRIVATE.
Otherwise it's job is now done by init_page_map(). */
DWORD old_prot;
- debug_printf ("map_pages (fd=%d, off=%D, len=%u)", get_fd (), off, len);
+ debug_printf ("map_pages (fd=%d, off=%Y, len=%lu)", get_fd (), off, len);
len = PAGE_CNT (len);
if ((off = find_unused_pages (len)) == (DWORD)-1)
@@ -438,7 +445,7 @@ mmap_record::map_pages (_off64_t off, DWORD len)
&old_prot))
{
__seterrno ();
- return (_off64_t)-1;
+ return (off_t)-1;
}
while (len-- > 0)
@@ -447,9 +454,9 @@ mmap_record::map_pages (_off64_t off, DWORD len)
}
bool
-mmap_record::map_pages (caddr_t addr, DWORD len)
+mmap_record::map_pages (caddr_t addr, SIZE_T len)
{
- debug_printf ("map_pages (addr=%x, len=%u)", addr, len);
+ debug_printf ("map_pages (addr=%p, len=%lu)", addr, len);
DWORD old_prot;
DWORD off = addr - get_address ();
off /= wincap.page_size ();
@@ -475,7 +482,7 @@ mmap_record::map_pages (caddr_t addr, DWORD len)
}
bool
-mmap_record::unmap_pages (caddr_t addr, DWORD len)
+mmap_record::unmap_pages (caddr_t addr, SIZE_T len)
{
DWORD old_prot;
DWORD off = addr - get_address ();
@@ -553,7 +560,7 @@ mmap_list::add_record (mmap_record &r)
}
void
-mmap_list::set (int nfd, struct __stat64 *st)
+mmap_list::set (int nfd, struct stat *st)
{
fd = nfd;
if (!anonymous ())
@@ -561,7 +568,7 @@ mmap_list::set (int nfd, struct __stat64 *st)
/* The fd isn't sufficient since it could already be the fd of another
file. So we use the inode number as evaluated by fstat to identify
the file. */
- hash = st ? st->st_ino : (__ino64_t) 0;
+ hash = st ? st->st_ino : (ino_t) 0;
}
LIST_INIT (&recs);
}
@@ -577,7 +584,7 @@ mmap_list::del_record (mmap_record *rec)
}
caddr_t
-mmap_list::try_map (void *addr, size_t len, int flags, _off64_t off)
+mmap_list::try_map (void *addr, size_t len, int flags, off_t off)
{
mmap_record *rec;
@@ -585,13 +592,13 @@ mmap_list::try_map (void *addr, size_t len, int flags, _off64_t off)
{
/* If MAP_FIXED isn't given, check if this mapping matches into the
chunk of another already performed mapping. */
- DWORD plen = PAGE_CNT (len);
+ SIZE_T plen = PAGE_CNT (len);
LIST_FOREACH (rec, &recs, mr_next)
if (rec->find_unused_pages (plen) != (DWORD) -1)
break;
if (rec && rec->compatible_flags (flags))
{
- if ((off = rec->map_pages (off, len)) == (_off64_t) -1)
+ if ((off = rec->map_pages (off, len)) == (off_t) -1)
return (caddr_t) MAP_FAILED;
return (caddr_t) rec->get_address () + off;
}
@@ -627,7 +634,7 @@ mmap_list::try_map (void *addr, size_t len, int flags, _off64_t off)
}
mmap_list *
-mmap_areas::get_list_by_fd (int fd, struct __stat64 *st)
+mmap_areas::get_list_by_fd (int fd, struct stat *st)
{
mmap_list *ml;
LIST_FOREACH (ml, &lists, ml_next)
@@ -644,7 +651,7 @@ mmap_areas::get_list_by_fd (int fd, struct __stat64 *st)
}
mmap_list *
-mmap_areas::add_list (int fd, struct __stat64 *st)
+mmap_areas::add_list (int fd, struct stat *st)
{
mmap_list *ml = (mmap_list *) cmalloc (HEAP_MMAP, sizeof (mmap_list));
if (!ml)
@@ -771,7 +778,7 @@ out:
static caddr_t
mmap_worker (mmap_list *map_list, fhandler_base *fh, caddr_t base, size_t len,
- int prot, int flags, int fd, _off64_t off, struct __stat64 *st)
+ int prot, int flags, int fd, off_t off, struct stat *st)
{
HANDLE h = fh->mmap (&base, len, prot, flags, off);
if (h == INVALID_HANDLE_VALUE)
@@ -793,10 +800,96 @@ mmap_worker (mmap_list *map_list, fhandler_base *fh, caddr_t base, size_t len,
return base;
}
+#ifdef __x86_64__
+
+/* The memory region used for memory maps */
+#define MMAP_STORAGE_LOW 0x00800000000L /* Leave 8 Gigs for heap. */
+#define MMAP_STORAGE_HIGH 0x70000000000L /* Leave enough room for OS. */
+
+/* FIXME? Unfortunately the OS doesn't support a top down allocation with
+ a ceiling value. The ZeroBits mechanism only works for
+ NtMapViewOfSection and it only evaluates the high bit of ZeroBits
+ on 64 bit, so it's pretty much useless for our purposes.
+
+ If the below simple mechanism to perform top-down allocations
+ turns out to be too dumb, we need something else. One idea is to
+ dived the space in (3835) 4 Gig chunks and simply store the
+ available free space per slot. Then we can go top down from slot
+ to slot and only try slots which are supposed to have enough space.
+ Bookkeeping would be very simple and fast. */
+class mmap_allocator
+{
+ caddr_t mmap_current_low;
+
+public:
+ mmap_allocator () : mmap_current_low ((caddr_t) MMAP_STORAGE_HIGH) {}
+
+ PVOID alloc (PVOID in_addr, SIZE_T in_size, bool fixed)
+ {
+ MEMORY_BASIC_INFORMATION mbi;
+
+ SIZE_T size = roundup2 (in_size, wincap.allocation_granularity ());
+ /* First check for the given address. */
+ if (in_addr)
+ {
+ /* If it points to a free area, big enough to fulfill the request,
+ return the address. */
+ if (VirtualQuery (in_addr, &mbi, sizeof mbi)
+ && mbi.State == MEM_FREE
+ && mbi.RegionSize >= size)
+ return in_addr;
+ /* Otherwise, if MAP_FIXED was given, give up. */
+ if (fixed)
+ return NULL;
+ /* Otherwise, fall through to the usual free space search mechanism. */
+ }
+ /* Start with the last allocation start address - requested size. */
+ caddr_t addr = mmap_current_low - size;
+ bool merry_go_round = false;
+ do
+ {
+ /* Did we hit the lower ceiling? If so, restart from the upper
+ ceiling, but note that we did it. */
+ if (addr < (caddr_t) MMAP_STORAGE_LOW)
+ {
+ addr = (caddr_t) MMAP_STORAGE_HIGH - size;
+ merry_go_round = true;
+ }
+ /* Shouldn't fail, but better test. */
+ if (!VirtualQuery ((PVOID) addr, &mbi, sizeof mbi))
+ return NULL;
+ /* If the region is free... */
+ if (mbi.State == MEM_FREE)
+ {
+ /* ...and the region is big enough to fulfill the request... */
+ if (mbi.RegionSize >= size)
+ {
+ /* ...note the address as next start address for our simple
+ merry-go-round and return the address. */
+ mmap_current_low = addr;
+ return (PVOID) addr;
+ }
+ /* Otherwise, subtract what's missing in size and try again. */
+ addr -= size - mbi.RegionSize;
+ }
+ /* If the region isn't free, skip to address below AllocationBase
+ and try again. */
+ else
+ addr = (caddr_t) mbi.AllocationBase - size;
+ }
+ /* Repeat until we had a full ride on the merry_go_round. */
+ while (!merry_go_round || addr >= mmap_current_low);
+ return NULL;
+ }
+};
+
+static mmap_allocator mmap_alloc; /* Inherited by forked child. */
+#endif
+
extern "C" void *
-mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
+mmap64 (void *addr, size_t len, int prot, int flags, int fd, off_t off)
{
- syscall_printf ("addr %x, len %u, prot %x, flags %x, fd %d, off %D",
+ syscall_printf ("addr %p, len %lu, prot %y, flags %y, fd %d, off %Y",
addr, len, prot, flags, fd, off);
caddr_t ret = (caddr_t) MAP_FAILED;
@@ -806,7 +899,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
mmap_list *map_list = NULL;
size_t orig_len = 0;
caddr_t base = NULL;
- struct __stat64 st;
+ struct stat st;
DWORD pagesize = wincap.allocation_granularity ();
@@ -862,7 +955,11 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
If all these requirements are given, we just return an anonymous map.
This will help to get over the autoconf test even on 64 bit systems.
The tests are ordered for speed. */
+#ifdef __x86_64__
+ if (1)
+#else
if (wincap.is_wow64 ())
+#endif
{
UNICODE_STRING fname;
IO_STATUS_BLOCK io;
@@ -944,7 +1041,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
__seterrno ();
goto out;
}
- _off64_t fsiz = st.st_size;
+ off_t fsiz = st.st_size;
/* Don't allow file mappings beginning beyond EOF since Windows can't
handle that POSIX like, unless MAP_AUTOGROW flag is set, which
@@ -966,15 +1063,17 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
}
fsiz -= off;
/* We're creating the pages beyond EOF as reserved, anonymous pages.
- Note that this isn't done in WOW64 environments since apparently
- WOW64 does not support the AT_ROUND_TO_PAGE flag which is required
- to get this right. Too bad. */
+ Note that this isn't done in 64 bit environments since apparently
+ 64 bit systems don't support the AT_ROUND_TO_PAGE flag, which is
+ required to get this right. Too bad. */
+#ifndef __x86_64__
if (!wincap.is_wow64 ()
- && ((len > fsiz && !autogrow (flags))
+ && (((off_t) len > fsiz && !autogrow (flags))
|| roundup2 (len, wincap.page_size ())
< roundup2 (len, pagesize)))
orig_len = len;
- if (len > fsiz)
+#endif
+ if ((off_t) len > fsiz)
{
if (autogrow (flags))
{
@@ -995,7 +1094,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
/* If the requested offset + len is <= file size, drop MAP_AUTOGROW.
This simplifes fhandler::mmap's job. */
- if (autogrow (flags) && (off + len) <= fsiz)
+ if (autogrow (flags) && (off + (off_t) len) <= fsiz)
flags &= ~MAP_AUTOGROW;
}
@@ -1023,6 +1122,9 @@ go_ahead:
}
}
+#ifdef __x86_64__
+ addr = mmap_alloc.alloc (addr, orig_len ?: len, fixed (flags));
+#else
if (orig_len)
{
/* If the requested length is bigger than the file size, we try to
@@ -1053,6 +1155,7 @@ go_ahead:
}
addr = newaddr;
}
+#endif
base = mmap_worker (map_list, fh, (caddr_t) addr, len, prot, flags, fd, off,
&st);
@@ -1126,18 +1229,22 @@ out:
return ret;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (mmap64, mmap)
+#else
extern "C" void *
mmap (void *addr, size_t len, int prot, int flags, int fd, _off_t off)
{
- return mmap64 (addr, len, prot, flags, fd, (_off64_t)off);
+ return mmap64 (addr, len, prot, flags, fd, (off_t)off);
}
+#endif
/* munmap () removes all mmapped pages between addr and addr+len. */
extern "C" int
munmap (void *addr, size_t len)
{
- syscall_printf ("munmap (addr %x, len %u)", addr, len);
+ syscall_printf ("munmap (addr %p, len %lu)", addr, len);
/* Error conditions according to SUSv3 */
if (!addr || !len || check_invalid_virtual_addr (addr, len))
@@ -1191,7 +1298,7 @@ munmap (void *addr, size_t len)
}
LIST_UNLOCK ();
- syscall_printf ("0 = munmap(): %x", addr);
+ syscall_printf ("0 = munmap(): %p", addr);
return 0;
}
@@ -1203,7 +1310,7 @@ msync (void *addr, size_t len, int flags)
int ret = -1;
mmap_list *map_list;
- syscall_printf ("msync (addr: %p, len %u, flags %x)", addr, len, flags);
+ syscall_printf ("msync (addr: %p, len %lu, flags %y)", addr, len, flags);
pthread_testcancel ();
@@ -1265,7 +1372,7 @@ mprotect (void *addr, size_t len, int prot)
DWORD old_prot;
DWORD new_prot = 0;
- syscall_printf ("mprotect (addr: %p, len %u, prot %x)", addr, len, prot);
+ syscall_printf ("mprotect (addr: %p, len %lu, prot %y)", addr, len, prot);
/* See comment in mmap64 for a description. */
size_t pagesize = wincap.allocation_granularity ();
@@ -1356,7 +1463,8 @@ mlock (const void *addr, size_t len)
/* Align address and length values to page size. */
size_t pagesize = wincap.allocation_granularity ();
PVOID base = (PVOID) rounddown((uintptr_t) addr, pagesize);
- ULONG size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len, pagesize);
+ SIZE_T size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len,
+ pagesize);
NTSTATUS status = 0;
do
{
@@ -1374,7 +1482,7 @@ mlock (const void *addr, size_t len)
and retry, until either we fail to raise the working set size
further, or until NtLockVirtualMemory returns successfully (or
with another error). */
- ULONG min, max;
+ SIZE_T min, max;
if (!GetProcessWorkingSetSize (GetCurrentProcess (), &min, &max))
{
set_errno (ENOMEM);
@@ -1401,7 +1509,7 @@ mlock (const void *addr, size_t len)
}
while (status == STATUS_WORKING_SET_QUOTA);
- syscall_printf ("%R = mlock(%p, %u)", ret, addr, len);
+ syscall_printf ("%R = mlock(%p, %lu)", ret, addr, len);
return ret;
}
@@ -1413,7 +1521,8 @@ munlock (const void *addr, size_t len)
/* Align address and length values to page size. */
size_t pagesize = wincap.allocation_granularity ();
PVOID base = (PVOID) rounddown((uintptr_t) addr, pagesize);
- ULONG size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len, pagesize);
+ SIZE_T size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len,
+ pagesize);
NTSTATUS status = NtUnlockVirtualMemory (NtCurrentProcess (), &base, &size,
MAP_PROCESS);
if (!NT_SUCCESS (status))
@@ -1421,7 +1530,7 @@ munlock (const void *addr, size_t len)
else
ret = 0;
- syscall_printf ("%R = munlock(%p, %u)", ret, addr, len);
+ syscall_printf ("%R = munlock(%p, %lu)", ret, addr, len);
return ret;
}
@@ -1451,7 +1560,7 @@ posix_madvise (void *addr, size_t len, int advice)
ret = 0;
}
- syscall_printf ("%d = posix_madvise(%p, %u, %d)", ret, addr, len, advice);
+ syscall_printf ("%d = posix_madvise(%p, %lu, %d)", ret, addr, len, advice);
/* Eventually do nothing. */
return 0;
}
@@ -1470,7 +1579,7 @@ posix_madvise (void *addr, size_t len, int advice)
*/
HANDLE
fhandler_base::mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off)
+ int flags, off_t off)
{
set_errno (ENODEV);
return INVALID_HANDLE_VALUE;
@@ -1492,7 +1601,7 @@ fhandler_base::msync (HANDLE h, caddr_t addr, size_t len, int flags)
bool
fhandler_base::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
+ off_t offset, DWORD size,
void *address)
{
set_errno (ENODEV);
@@ -1503,7 +1612,7 @@ fhandler_base::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
quite the natural way. */
HANDLE
fhandler_dev_zero::mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off)
+ int flags, off_t off)
{
HANDLE h;
void *base;
@@ -1590,7 +1699,7 @@ fhandler_dev_zero::msync (HANDLE h, caddr_t addr, size_t len, int flags)
bool
fhandler_dev_zero::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
+ off_t offset, DWORD size,
void *address)
{
/* Re-create the map */
@@ -1609,8 +1718,8 @@ fhandler_dev_zero::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
{
MEMORY_BASIC_INFORMATION m;
VirtualQuery (address, &m, sizeof (m));
- system_printf ("requested %p != %p mem alloc base %p, state %p, "
- "size %d, %E", address, base, m.AllocationBase, m.State,
+ system_printf ("requested %p != %p mem alloc base %p, state %y, "
+ "size %lu, %E", address, base, m.AllocationBase, m.State,
m.RegionSize);
}
return base == address;
@@ -1619,7 +1728,7 @@ fhandler_dev_zero::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
/* Implementation for disk files and anonymous mappings. */
HANDLE
fhandler_disk_file::mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off)
+ int flags, off_t off)
{
HANDLE h = CreateMapping (get_handle (), len, off, get_access (),
prot, flags);
@@ -1686,7 +1795,7 @@ fhandler_disk_file::msync (HANDLE h, caddr_t addr, size_t len, int flags)
bool
fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
+ off_t offset, DWORD size,
void *address)
{
/* Re-create the map */
@@ -1695,8 +1804,8 @@ fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
{
MEMORY_BASIC_INFORMATION m;
VirtualQuery (address, &m, sizeof (m));
- system_printf ("requested %p != %p mem alloc base %p, state %p, "
- "size %d, %E", address, base, m.AllocationBase, m.State,
+ system_printf ("requested %p != %p mem alloc base %p, state %y, "
+ "size %lu, %E", address, base, m.AllocationBase, m.State,
m.RegionSize);
}
return base == address;
@@ -1704,10 +1813,10 @@ fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
HANDLE
fhandler_dev_mem::mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off)
+ int flags, off_t off)
{
- if (off >= mem_size
- || (DWORD) len >= mem_size
+ if (off >= (off_t) mem_size
+ || len >= mem_size
|| off + len >= mem_size)
{
set_errno (EINVAL);
@@ -1780,7 +1889,7 @@ fhandler_dev_mem::msync (HANDLE h, caddr_t addr, size_t len, int flags)
bool
fhandler_dev_mem::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
+ off_t offset, DWORD size,
void *address)
{
void *base = MapView (h, address, size, get_access (), prot,
@@ -1789,8 +1898,8 @@ fhandler_dev_mem::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
{
MEMORY_BASIC_INFORMATION m;
VirtualQuery (address, &m, sizeof (m));
- system_printf ("requested %p != %p mem alloc base %p, state %p, "
- "size %d, %E", address, base, m.AllocationBase, m.State,
+ system_printf ("requested %p != %p mem alloc base %p, state %y, "
+ "size %lu, %E", address, base, m.AllocationBase, m.State,
m.RegionSize);
}
return base == address;
@@ -1812,8 +1921,8 @@ fixup_mmaps_after_fork (HANDLE parent)
mmap_record *rec;
LIST_FOREACH (rec, &map_list->recs, mr_next)
{
- debug_printf ("fd %d, h 0x%x, address %p, len 0x%x, prot: 0x%x, "
- "flags: 0x%x, offset %X",
+ debug_printf ("fd %d, h %p, address %p, len %ly, prot: %y, "
+ "flags: %y, offset %Y",
rec->get_fd (), rec->get_handle (), rec->get_address (),
rec->get_len (), rec->get_prot (), rec->get_flags (),
rec->get_offset ());
@@ -1908,10 +2017,10 @@ fixup_mmaps_after_fork (HANDLE parent)
VirtualQuery (address, &m, sizeof m);
system_printf ("VirtualProtect failed for "
"address %p, "
- "parentstate: 0x%x, "
- "state: 0x%x, "
- "parentprot: 0x%x, "
- "prot: 0x%x, %E",
+ "parentstate: %y, "
+ "state: %y, "
+ "parentprot: %y, "
+ "prot: %y, %E",
address, mbi.State, m.State,
mbi.Protect, m.Protect);
return -1;
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 4ff42693d..0d943f727 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -224,7 +224,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
}
if (!NT_SUCCESS (status))
{
- debug_printf ("Cannot access path %S, status %08lx",
+ debug_printf ("Cannot access path %S, status %y",
attr.ObjectName, status);
return false;
}
@@ -262,7 +262,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
FileFsAttributeInformation);
if (no_media || !NT_SUCCESS (status))
{
- debug_printf ("Cannot get volume attributes (%S), %08lx",
+ debug_printf ("Cannot get volume attributes (%S), %y",
attr.ObjectName, status);
if (!in_vol)
NtClose (vol);
@@ -275,7 +275,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
if (is_remote_drive ())
{
/* Should be reevaluated for each new OS. Right now this mask is valid up
- to Vista. The important point here is to test only flags indicating
+ to Windows 8. The important point here is to test only flags indicating
capabilities and to ignore flags indicating a specific state of this
volume. At present these flags to ignore are FILE_VOLUME_IS_COMPRESSED,
FILE_READ_ONLY_VOLUME, and FILE_SEQUENTIAL_WRITE_ONCE. The additional
@@ -306,14 +306,20 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
| FILE_CASE_PRESERVED_NAMES \
| FILE_UNICODE_ON_DISK \
| FILE_NAMED_STREAMS)
-/* These are the minimal flags supported by NTFS since NT4. Every filesystem
- not supporting these flags is not a native NTFS. We subsume them under
- the filesystem type "cifs". */
+/* These are the minimal flags supported by NTFS since Windows 2000. Every
+ filesystem not supporting these flags is not a native NTFS. We subsume
+ them under the filesystem type "cifs". */
#define MINIMAL_WIN_NTFS_FLAGS (FILE_CASE_SENSITIVE_SEARCH \
| FILE_CASE_PRESERVED_NAMES \
| FILE_UNICODE_ON_DISK \
| FILE_PERSISTENT_ACLS \
- | FILE_FILE_COMPRESSION)
+ | FILE_FILE_COMPRESSION \
+ | FILE_VOLUME_QUOTAS \
+ | FILE_SUPPORTS_SPARSE_FILES \
+ | FILE_SUPPORTS_REPARSE_POINTS \
+ | FILE_SUPPORTS_OBJECT_IDS \
+ | FILE_SUPPORTS_ENCRYPTION \
+ | FILE_NAMED_STREAMS)
#define FS_IS_WINDOWS_NTFS TEST_GVI(flags () & MINIMAL_WIN_NTFS_FLAGS, \
MINIMAL_WIN_NTFS_FLAGS)
/* These are the exact flags of a real Windows FAT/FAT32 filesystem.
@@ -365,7 +371,10 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
&& !is_ncfsd (RtlEqualUnicodeString (&fsname, &ro_u_ncfsd, FALSE))
/* UNIXFS == TotalNet Advanced Server (TAS). Doesn't support
FileIdBothDirectoryInformation. See below. */
- && !is_unixfs (RtlEqualUnicodeString (&fsname, &ro_u_unixfs, FALSE)))
+ && !is_unixfs (RtlEqualUnicodeString (&fsname, &ro_u_unixfs, FALSE))
+ /* AFSRDRFsd == Andrew File System. Doesn't support DOS attributes.
+ Only native symlinks are supported. */
+ && !is_afs (RtlEqualUnicodeString (&fsname, &ro_u_afs, FALSE)))
{
/* Known remote file system with buggy open calls. Further
explanation in fhandler.cc (fhandler_disk_file::open_fs). */
@@ -479,7 +488,7 @@ mount_info::init ()
{
char native[PATH_MAX];
if (root_idx < 0)
- api_fatal ("root_idx %d, user_shared magic %p, nmounts %d", root_idx, user_shared->version, nmounts);
+ api_fatal ("root_idx %d, user_shared magic %y, nmounts %d", root_idx, user_shared->version, nmounts);
char *p = stpcpy (native, mount[root_idx].native_path);
if (!got_usr_bin)
{
@@ -503,12 +512,12 @@ set_flags (unsigned *flags, unsigned val)
if (!(*flags & PATH_BINARY))
{
*flags |= PATH_TEXT;
- debug_printf ("flags: text (%p)", *flags & (PATH_TEXT | PATH_BINARY));
+ debug_printf ("flags: text (%y)", *flags & (PATH_TEXT | PATH_BINARY));
}
else
{
*flags |= PATH_BINARY;
- debug_printf ("flags: binary (%p)", *flags & (PATH_TEXT | PATH_BINARY));
+ debug_printf ("flags: binary (%y)", *flags & (PATH_TEXT | PATH_BINARY));
}
}
@@ -717,7 +726,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
}
out_no_chroot_check:
- debug_printf ("src_path %s, dst %s, flags %p, rc %d", src_path, dst, *flags, rc);
+ debug_printf ("src_path %s, dst %s, flags %y, rc %d", src_path, dst, *flags, rc);
return rc;
}
@@ -1195,7 +1204,7 @@ mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end)
| FILE_OPEN_FOR_BACKUP_INTENT);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtOpenFile(%S) failed, %p", &upath, status);
+ debug_printf ("NtOpenFile(%S) failed, %y", &upath, status);
return false;
}
@@ -1444,7 +1453,7 @@ mount_info::add_item (const char *native, const char *posix,
else
posixerr = normalize_posix_path (posix, posixtmp, posixtail);
- debug_printf ("%s[%s], %s[%s], %p",
+ debug_printf ("%s[%s], %s[%s], %y",
native, nativeerr ? error : nativetmp,
posix, posixerr ? error : posixtmp, mountflags);
@@ -1592,6 +1601,7 @@ fs_names_t fs_names[] = {
{ "cifs", false },
{ "nwfs", false },
{ "ncfsd", false },
+ { "afs", false },
{ NULL, false }
};
@@ -1808,7 +1818,7 @@ mount (const char *win32_path, const char *posix_path, unsigned flags)
res = mount_table->add_item (w32_path, posix_path, flags);
}
- syscall_printf ("%R = mount(%s, %s, %p)", res, win32_path, posix_path, flags);
+ syscall_printf ("%R = mount(%s, %s, %y)", res, win32_path, posix_path, flags);
return res;
}
@@ -1940,41 +1950,6 @@ endmntent (FILE *)
return 1;
}
-static bool
-get_volume_path_names_for_volume_name (LPCWSTR vol, LPWSTR mounts)
-{
- DWORD len;
- if (GetVolumePathNamesForVolumeNameW (vol, mounts, NT_MAX_PATH, &len))
- return true;
-
- /* Windows 2000 doesn't have GetVolumePathNamesForVolumeNameW.
- Just assume that mount points are not longer than MAX_PATH. */
- WCHAR drives[MAX_PATH], dvol[MAX_PATH], mp[MAX_PATH + 3];
- if (!GetLogicalDriveStringsW (MAX_PATH, drives))
- return false;
- for (PWCHAR drive = drives; *drive; drive = wcschr (drive, '\0') + 1)
- {
- if (!GetVolumeNameForVolumeMountPointW (drive, dvol, MAX_PATH))
- continue;
- if (!wcscasecmp (vol, dvol))
- mounts = wcpcpy (mounts, drive) + 1;
- wcscpy (mp, drive);
- HANDLE h = FindFirstVolumeMountPointW (dvol, mp + 3, MAX_PATH);
- if (h == INVALID_HANDLE_VALUE)
- continue;
- do
- {
- if (GetVolumeNameForVolumeMountPointW (mp, dvol, MAX_PATH))
- if (!wcscasecmp (vol, dvol))
- mounts = wcpcpy (mounts, drive) + 1;
- }
- while (FindNextVolumeMountPointW (h, mp, MAX_PATH));
- FindVolumeMountPointClose (h);
- }
- *mounts = L'\0';
- return true;
-}
-
dos_drive_mappings::dos_drive_mappings ()
: mappings(0)
{
@@ -1993,7 +1968,8 @@ dos_drive_mappings::dos_drive_mappings ()
do
{
/* Skip drives which are not mounted. */
- if (!get_volume_path_names_for_volume_name (vol, mounts)
+ DWORD len;
+ if (!GetVolumePathNamesForVolumeNameW (vol, mounts, NT_MAX_PATH, &len)
|| mounts[0] == L'\0')
continue;
*wcsrchr (vol, L'\\') = L'\0';
@@ -2045,7 +2021,7 @@ dos_drive_mappings::dos_drive_mappings ()
}
else
debug_printf ("Unable to determine the native mapping for %ls "
- "(error %lu)", vol, GetLastError ());
+ "(error %u)", vol, GetLastError ());
}
while (FindNextVolumeW (sh, vol, 64));
FindVolumeClose (sh);
diff --git a/winsup/cygwin/mount.h b/winsup/cygwin/mount.h
index 74f108c7d..203bfff33 100644
--- a/winsup/cygwin/mount.h
+++ b/winsup/cygwin/mount.h
@@ -44,6 +44,7 @@ enum fs_info_type
cifs,
nwfs,
ncfsd,
+ afs,
/* Always last. */
max_fs_type
};
@@ -114,6 +115,7 @@ class fs_info
IMPLEMENT_FS_FLAG (cifs)
IMPLEMENT_FS_FLAG (nwfs)
IMPLEMENT_FS_FLAG (ncfsd)
+ IMPLEMENT_FS_FLAG (afs)
fs_info_type what_fs () const { return status.fs_type; }
bool got_fs () const { return status.fs_type != none; }
diff --git a/winsup/cygwin/msg.cc b/winsup/cygwin/msg.cc
index 2ae6ccdad..f970121c9 100644
--- a/winsup/cygwin/msg.cc
+++ b/winsup/cygwin/msg.cc
@@ -91,7 +91,7 @@ client_request_msg::client_request_msg (int msqid,
extern "C" int
msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
- syscall_printf ("msgctl (msqid = %d, cmd = 0x%x, buf = %p)",
+ syscall_printf ("msgctl (msqid = %d, cmd = %y, buf = %p)",
msqid, cmd, buf);
myfault efault;
if (efault.faulted (EFAULT))
@@ -128,7 +128,7 @@ msgctl (int msqid, int cmd, struct msqid_ds *buf)
extern "C" int
msgget (key_t key, int msgflg)
{
- syscall_printf ("msgget (key = %U, msgflg = 0x%x)", key, msgflg);
+ syscall_printf ("msgget (key = %U, msgflg = %y)", key, msgflg);
client_request_msg request (key, msgflg);
if (request.make_request () == -1 || request.retval () == -1)
{
@@ -144,8 +144,8 @@ msgget (key_t key, int msgflg)
extern "C" ssize_t
msgrcv (int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg)
{
- syscall_printf ("msgrcv (msqid = %d, msgp = %p, msgsz = %d, "
- "msgtyp = %d, msgflg = 0x%x)",
+ syscall_printf ("msgrcv (msqid = %d, msgp = %p, msgsz = %ld, "
+ "msgtyp = %d, msgflg = %y)",
msqid, msgp, msgsz, msgtyp, msgflg);
myfault efault;
if (efault.faulted (EFAULT))
@@ -165,7 +165,7 @@ msgrcv (int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg)
extern "C" int
msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
{
- syscall_printf ("msgsnd (msqid = %d, msgp = %p, msgsz = %d, msgflg = 0x%x)",
+ syscall_printf ("msgsnd (msqid = %d, msgp = %p, msgsz = %ld, msgflg = %y)",
msqid, msgp, msgsz, msgflg);
myfault efault;
if (efault.faulted (EFAULT))
diff --git a/winsup/cygwin/mtinfo.h b/winsup/cygwin/mtinfo.h
index cccaed8b7..157fe1bf9 100644
--- a/winsup/cygwin/mtinfo.h
+++ b/winsup/cygwin/mtinfo.h
@@ -1,6 +1,6 @@
/* mtinfo.h: Defininitions for the Cygwin tape driver class.
- Copyright 2004, 2005, 2006, 2008 Red Hat, Inc.
+ Copyright 2004, 2005, 2006, 2008, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -46,26 +46,30 @@ enum lock_state
class mtinfo_part
{
public:
- long block; /* logical block no */
- long file; /* current file no */
- long fblock; /* relative block no */
+ int32_t block; /* logical block no */
+ int32_t file; /* current file no */
+ int32_t fblock; /* relative block no */
bool smark; /* At setmark? */
eom_val emark; /* "end-of"-mark */
- void initialize (long nblock = -1);
+ void initialize (int32_t nblock = -1);
};
class mtinfo_drive
{
int drive;
int lasterr;
- long partition;
- long block;
+ int32_t partition;
+ int32_t block;
dirty_state dirty;
lock_state lock;
TAPE_GET_DRIVE_PARAMETERS _dp;
TAPE_GET_MEDIA_PARAMETERS _mp;
- OVERLAPPED ov;
+ /* sizeof(OVERLAPPED) == 20 on 32 bit, 32 on 64 bit. A drive is always
+ opened exclusively by a single process, though, so instead of the
+ OVERLAPPED structure, we just keep track of the pointer to the
+ OVERLAPPED structure in the application's fhandler. */
+ LPOVERLAPPED ov;
struct status_flags
{
unsigned buffer_writes : 1;
@@ -90,17 +94,17 @@ class mtinfo_drive
? ((_dp.FeaturesHigh & parm) != 0)
: ((_dp.FeaturesLow & parm) != 0));
}
- int get_pos (HANDLE mt, long *ppartition = NULL, long *pblock = NULL);
- int _set_pos (HANDLE mt, int mode, long count, int partition, BOOL dont_wait);
- int create_partitions (HANDLE mt, long count);
- int set_partition (HANDLE mt, long count);
+ int get_pos (HANDLE mt, int32_t *ppartition = NULL, int32_t *pblock = NULL);
+ int _set_pos (HANDLE mt, int mode, int32_t count, int partition, BOOL dont_wait);
+ int create_partitions (HANDLE mt, int32_t count);
+ int set_partition (HANDLE mt, int32_t count);
int write_marks (HANDLE mt, int marktype, DWORD count);
int erase (HANDLE mt, int mode);
int prepare (HANDLE mt, int action, bool is_auto = false);
- int set_compression (HANDLE mt, long count);
- int set_blocksize (HANDLE mt, long count);
+ int set_compression (HANDLE mt, int32_t count);
+ int set_blocksize (HANDLE mt, DWORD count);
int get_status (HANDLE mt, struct mtget *get);
- int set_options (HANDLE mt, long options);
+ int set_options (HANDLE mt, int32_t options);
int async_wait (HANDLE mt, DWORD *bytes_written);
public:
@@ -109,10 +113,10 @@ public:
int get_mp (HANDLE mt);
int open (HANDLE mt);
int close (HANDLE mt, bool rewind);
- int read (HANDLE mt, HANDLE mt_evt, void *ptr, size_t &ulen);
- int write (HANDLE mt, HANDLE mt_evt, const void *ptr, size_t &len);
+ int read (HANDLE mt, LPOVERLAPPED pov, void *ptr, size_t &ulen);
+ int write (HANDLE mt, LPOVERLAPPED pov, const void *ptr, size_t &len);
int ioctl (HANDLE mt, unsigned int cmd, void *buf);
- int set_pos (HANDLE mt, int mode, long count, bool sfm_func);
+ int set_pos (HANDLE mt, int mode, int32_t count, bool sfm_func);
IMPLEMENT_STATUS_FLAG (bool, buffer_writes)
IMPLEMENT_STATUS_FLAG (bool, async_writes)
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 8a0c5b5a4..0454d9b32 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -1,7 +1,7 @@
/* net.cc: network-related routines.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -157,7 +157,7 @@ struct tl
int e;
};
-static NO_COPY struct tl errmap[] = {
+static const struct tl errmap[] = {
{WSAEINTR, "WSAEINTR", EINTR},
{WSAEWOULDBLOCK, "WSAEWOULDBLOCK", EWOULDBLOCK},
{WSAEINPROGRESS, "WSAEINPROGRESS", EINPROGRESS},
@@ -219,14 +219,14 @@ __set_winsock_errno (const char *fn, int ln)
int err = find_winsock_errno (werr);
set_errno (err);
- syscall_printf ("%s:%d - winsock error %d -> errno %d", fn, ln, werr, err);
+ syscall_printf ("%s:%d - winsock error %u -> errno %d", fn, ln, werr, err);
}
/*
* Since the member `s' isn't used for debug output we can use it
* for the error text returned by herror and hstrerror.
*/
-static NO_COPY struct tl host_errmap[] = {
+static const struct tl host_errmap[] = {
{WSAHOST_NOT_FOUND, "Unknown host", HOST_NOT_FOUND},
{WSATRY_AGAIN, "Host name lookup failure", TRY_AGAIN},
{WSANO_RECOVERY, "Unknown server error", NO_RECOVERY},
@@ -305,6 +305,22 @@ realloc_ent (int sz, hostent *)
The 'unionent' struct is a union of all of the currently used
*ent structure. */
+#ifdef __x86_64__
+/* For some baffling reason, somebody at Microsoft decided that it would be
+ a good idea to exchange the s_port and s_proto members in the servent
+ structure. */
+struct win64_servent
+{
+ char *s_name;
+ char **s_aliases;
+ char *s_proto;
+ short s_port;
+};
+#define WIN_SERVENT(x) ((win64_servent *)(x))
+#else
+#define WIN_SERVENT(x) ((servent *)(x))
+#endif
+
#ifdef DEBUGGING
static void *
#else
@@ -369,8 +385,8 @@ dup_ent (unionent *&dst, unionent *src, unionent::struct_type type)
int addr_list_len = 0;
if (type == unionent::t_servent)
{
- if (src->s_proto)
- sz += (protolen = strlen_round (src->s_proto));
+ if (WIN_SERVENT (src)->s_proto)
+ sz += (protolen = strlen_round (WIN_SERVENT (src)->s_proto));
}
else if (type == unionent::t_hostent)
{
@@ -392,8 +408,12 @@ dup_ent (unionent *&dst, unionent *src, unionent::struct_type type)
{
memset (dst, 0, sz);
/* This field is common to all *ent structures but named differently
- in each, of course. */
- dst->port_proto_addrtype = src->port_proto_addrtype;
+ in each, of course. Also, take 64 bit Windows servent weirdness
+ into account. */
+ if (type == unionent::t_servent)
+ dst->port_proto_addrtype = WIN_SERVENT (src)->s_port;
+ else
+ dst->port_proto_addrtype = src->port_proto_addrtype;
char *dp = ((char *) dst) + struct_sz;
if (namelen)
@@ -420,12 +440,12 @@ dup_ent (unionent *&dst, unionent *src, unionent::struct_type type)
/* Do servent/protoent/hostent specific processing. */
if (type == unionent::t_protoent)
- debug_printf ("protoent %s %x %x", dst->name, dst->list, dst->port_proto_addrtype);
+ debug_printf ("protoent %s %p %y", dst->name, dst->list, dst->port_proto_addrtype);
else if (type == unionent::t_servent)
{
- if (src->s_proto)
+ if (WIN_SERVENT (src)->s_proto)
{
- strcpy (dst->s_proto = dp, src->s_proto);
+ strcpy (dst->s_proto = dp, WIN_SERVENT (src)->s_proto);
dp += protolen;
}
}
@@ -534,7 +554,7 @@ fdsock (cygheap_fdmanip& fd, const device *dev, SOCKET soc)
ret = WSAIoctl (soc, SIO_BASE_HANDLE, NULL, 0, (void *) &base_soc,
sizeof (base_soc), &bret, NULL, NULL);
if (ret)
- debug_printf ("WSAIoctl: %lu", WSAGetLastError ());
+ debug_printf ("WSAIoctl: %u", WSAGetLastError ());
else if (base_soc != soc)
{
/* LSPs are often BLODAs as well. So we print an info about
@@ -585,26 +605,35 @@ fdsock (cygheap_fdmanip& fd, const device *dev, SOCKET soc)
handle inheritance. An explanation for this weird behaviour would
be nice, though.
+ NOTE 2. Testing on x86_64 (XP, Vista, 2008 R2, W8) indicates that
+ this is no problem on 64 bit. So we set the default buffer size to
+ the default values in current 3.x Linux versions.
+
(*) Maximum normal TCP window size. Coincidence? */
+#ifdef __x86_64__
+ ((fhandler_socket *) fd)->rmem () = 212992;
+ ((fhandler_socket *) fd)->wmem () = 212992;
+#else
((fhandler_socket *) fd)->rmem () = 65535;
((fhandler_socket *) fd)->wmem () = 65535;
+#endif
if (::setsockopt (soc, SOL_SOCKET, SO_RCVBUF,
(char *) &((fhandler_socket *) fd)->rmem (), sizeof (int)))
{
- debug_printf ("setsockopt(SO_RCVBUF) failed, %lu", WSAGetLastError ());
+ debug_printf ("setsockopt(SO_RCVBUF) failed, %u", WSAGetLastError ());
if (::getsockopt (soc, SOL_SOCKET, SO_RCVBUF,
(char *) &((fhandler_socket *) fd)->rmem (),
(size = sizeof (int), &size)))
- system_printf ("getsockopt(SO_RCVBUF) failed, %lu", WSAGetLastError ());
+ system_printf ("getsockopt(SO_RCVBUF) failed, %u", WSAGetLastError ());
}
if (::setsockopt (soc, SOL_SOCKET, SO_SNDBUF,
(char *) &((fhandler_socket *) fd)->wmem (), sizeof (int)))
{
- debug_printf ("setsockopt(SO_SNDBUF) failed, %lu", WSAGetLastError ());
+ debug_printf ("setsockopt(SO_SNDBUF) failed, %u", WSAGetLastError ());
if (::getsockopt (soc, SOL_SOCKET, SO_SNDBUF,
(char *) &((fhandler_socket *) fd)->wmem (),
(size = sizeof (int), &size)))
- system_printf ("getsockopt(SO_SNDBUF) failed, %lu", WSAGetLastError ());
+ system_printf ("getsockopt(SO_SNDBUF) failed, %u", WSAGetLastError ());
}
return true;
@@ -620,7 +649,7 @@ cygwin_socket (int af, int type, int protocol)
int flags = type & _SOCK_FLAG_MASK;
type &= ~_SOCK_FLAG_MASK;
- debug_printf ("socket (%d, %d (flags %p), %d)", af, type, flags, protocol);
+ debug_printf ("socket (%d, %d (flags %y), %d)", af, type, flags, protocol);
if ((flags & ~(SOCK_NONBLOCK | SOCK_CLOEXEC)) != 0)
{
@@ -670,7 +699,7 @@ cygwin_socket (int af, int type, int protocol)
DWORD blen;
if (WSAIoctl (soc, SIO_UDP_CONNRESET, &cr, sizeof cr, NULL, 0,
&blen, NULL, NULL) == SOCKET_ERROR)
- debug_printf ("Reset SIO_UDP_CONNRESET: WinSock error %lu",
+ debug_printf ("Reset SIO_UDP_CONNRESET: WinSock error %u",
WSAGetLastError ());
}
res = fd;
@@ -678,17 +707,19 @@ cygwin_socket (int af, int type, int protocol)
}
done:
- syscall_printf ("%R = socket(%d, %d (flags %p), %d)",
+ syscall_printf ("%R = socket(%d, %d (flags %y), %d)",
res, af, type, flags, protocol);
return res;
}
/* exported as sendto: standards? */
-extern "C" int
+extern "C" ssize_t
cygwin_sendto (int fd, const void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen)
{
- int res;
+ ssize_t res;
+
+ pthread_testcancel ();
fhandler_socket *fh = get (fd);
@@ -698,17 +729,19 @@ cygwin_sendto (int fd, const void *buf, size_t len, int flags,
else
res = fh->sendto (buf, len, flags, to, tolen);
- syscall_printf ("%R = sendto(%d, %p, %d, %x, %p, %d)",
+ syscall_printf ("%lR = sendto(%d, %p, %ld, %y, %p, %d)",
res, fd, buf, len, flags, to, tolen);
return res;
}
/* exported as recvfrom: standards? */
-extern "C" int
+extern "C" ssize_t
cygwin_recvfrom (int fd, void *buf, size_t len, int flags,
struct sockaddr *from, socklen_t *fromlen)
{
- int res;
+ ssize_t res;
+
+ pthread_testcancel ();
fhandler_socket *fh = get (fd);
@@ -722,7 +755,7 @@ cygwin_recvfrom (int fd, void *buf, size_t len, int flags,
to deliver valid error conditions and peer address. */
res = fh->recvfrom (buf, len, flags, from, fromlen);
- syscall_printf ("%R = recvfrom(%d, %p, %d, %x, %p, %p)",
+ syscall_printf ("%lR = recvfrom(%d, %p, %ld, %y, %p, %p)",
res, fd, buf, len, flags, from, fromlen);
return res;
}
@@ -786,8 +819,8 @@ cygwin_setsockopt (int fd, int level, int optname, const void *optval,
res = setsockopt (fh->get_socket (), level, optname,
(const char *) optval, optlen);
- if (optlen == 4)
- syscall_printf ("setsockopt optval=%x", *(long *) optval);
+ if (optlen == sizeof (int))
+ syscall_printf ("setsockopt optval=%x", *(int *) optval);
if (res)
{
@@ -837,7 +870,7 @@ cygwin_setsockopt (int fd, int level, int optname, const void *optval,
}
}
- syscall_printf ("%R = setsockopt(%d, %d, %x, %p, %d)",
+ syscall_printf ("%R = setsockopt(%d, %d, %y, %p, %d)",
res, fd, level, optname, optval, optlen);
return res;
}
@@ -897,13 +930,13 @@ cygwin_getsockopt (int fd, int level, int optname, void *optval,
}
}
- syscall_printf ("%R = getsockopt(%d, %d, 0x%x, %p, %p)",
+ syscall_printf ("%R = getsockopt(%d, %d, %y, %p, %p)",
res, fd, level, optname, optval, optlen);
return res;
}
extern "C" int
-getpeereid (int fd, __uid32_t *euid, __gid32_t *egid)
+getpeereid (int fd, uid_t *euid, gid_t *egid)
{
fhandler_socket *fh = get (fd);
if (fh)
@@ -917,6 +950,8 @@ cygwin_connect (int fd, const struct sockaddr *name, socklen_t namelen)
{
int res;
+ pthread_testcancel ();
+
fhandler_socket *fh = get (fd);
myfault efault;
@@ -1293,6 +1328,8 @@ cygwin_accept (int fd, struct sockaddr *peer, socklen_t *len)
{
int res;
+ pthread_testcancel ();
+
fhandler_socket *fh = get (fd);
myfault efault;
@@ -1310,6 +1347,8 @@ accept4 (int fd, struct sockaddr *peer, socklen_t *len, int flags)
{
int res;
+ pthread_testcancel ();
+
fhandler_socket *fh = get (fd);
myfault efault;
@@ -1323,7 +1362,7 @@ accept4 (int fd, struct sockaddr *peer, socklen_t *len, int flags)
else
res = fh->accept4 (peer, len, flags);
- syscall_printf ("%R = accept4(%d, %p, %p, %p)", res, fd, peer, len, flags);
+ syscall_printf ("%R = accept4(%d, %p, %p, %y)", res, fd, peer, len, flags);
return res;
}
@@ -1457,15 +1496,18 @@ cygwin_getpeername (int fd, struct sockaddr *name, socklen_t *len)
else
res = fh->getpeername (name, len);
- syscall_printf ("%R = getpeername(%d) %d", res, fd, (fh ? fh->get_socket () : -1));
+ syscall_printf ("%R = getpeername(%d) %p", res, fd,
+ (fh ? fh->get_socket () : (SOCKET) -1));
return res;
}
/* exported as recv: standards? */
-extern "C" int
+extern "C" ssize_t
cygwin_recv (int fd, void *buf, size_t len, int flags)
{
- int res;
+ ssize_t res;
+
+ pthread_testcancel ();
fhandler_socket *fh = get (fd);
@@ -1479,15 +1521,17 @@ cygwin_recv (int fd, void *buf, size_t len, int flags)
to deliver valid error conditions. */
res = fh->recvfrom (buf, len, flags, NULL, NULL);
- syscall_printf ("%R = recv(%d, %p, %d, %x)", res, fd, buf, len, flags);
+ syscall_printf ("%lR = recv(%d, %p, %ld, %y)", res, fd, buf, len, flags);
return res;
}
/* exported as send: standards? */
-extern "C" int
+extern "C" ssize_t
cygwin_send (int fd, const void *buf, size_t len, int flags)
{
- int res;
+ ssize_t res;
+
+ pthread_testcancel ();
fhandler_socket *fh = get (fd);
@@ -1497,7 +1541,7 @@ cygwin_send (int fd, const void *buf, size_t len, int flags)
else
res = fh->sendto (buf, len, flags, NULL, 0);
- syscall_printf ("%R = send(%d, %p, %d, %x)", res, fd, buf, len, flags);
+ syscall_printf ("%lR = send(%d, %p, %ld, %y)", res, fd, buf, len, flags);
return res;
}
@@ -1855,12 +1899,12 @@ get_hwaddr (struct ifall *ifp, PIP_ADAPTER_ADDRESSES pap)
else
ifp->ifa_hwaddr.sa_data[i] = pap->PhysicalAddress[i];
}
+
/*
- * Get network interfaces XP SP1 and above.
- * Use IP Helper function GetAdaptersAddresses.
+ * Get network interfaces. Use IP Helper function GetAdaptersAddresses.
*/
static struct ifall *
-get_xp_ifs (ULONG family)
+get_ifs (ULONG family)
{
PIP_ADAPTER_ADDRESSES pa0 = NULL, pap;
PIP_ADAPTER_UNICAST_ADDRESS pua;
@@ -2038,201 +2082,6 @@ done:
return ifret;
}
-/*
- * Get network interfaces up to XP w/o service packs.
- */
-static struct ifall *
-get_2k_ifs ()
-{
- int ethId = 0, pppId = 0, slpId = 0, tokId = 0;
-
- DWORD ip_cnt;
- DWORD siz_ip_table = 0;
- PMIB_IPADDRTABLE ipt;
- PMIB_IFROW ifrow;
- struct ifall *ifret = NULL, *ifp = NULL;
- struct sockaddr_in *if_sin;
-
- struct ifcount_t
- {
- DWORD ifIndex;
- size_t count;
- unsigned int enumerated; // for eth0:1
- unsigned int classId; // for eth0, tok0 ...
-
- };
- ifcount_t *iflist, *ifEntry;
-
- if (GetIpAddrTable (NULL, &siz_ip_table, TRUE) == ERROR_INSUFFICIENT_BUFFER
- && (ifrow = (PMIB_IFROW) alloca (sizeof (MIB_IFROW)))
- && (ipt = (PMIB_IPADDRTABLE) alloca (siz_ip_table))
- && !GetIpAddrTable (ipt, &siz_ip_table, TRUE))
- {
- if (!(ifret = (struct ifall *) calloc (ipt->dwNumEntries, sizeof (struct ifall))))
- goto done;
- ifp = ifret;
-
- iflist =
- (ifcount_t *) alloca (sizeof (ifcount_t) * (ipt->dwNumEntries + 1));
- memset (iflist, 0, sizeof (ifcount_t) * (ipt->dwNumEntries + 1));
- for (ip_cnt = 0; ip_cnt < ipt->dwNumEntries; ++ip_cnt)
- {
- ifEntry = iflist;
- /* search for matching entry (and stop at first free entry) */
- while (ifEntry->count != 0)
- {
- if (ifEntry->ifIndex == ipt->table[ip_cnt].dwIndex)
- break;
- ifEntry++;
- }
- if (ifEntry->count == 0)
- {
- ifEntry->count = 1;
- ifEntry->ifIndex = ipt->table[ip_cnt].dwIndex;
- }
- else
- {
- ifEntry->count++;
- }
- }
- /* reset the last element. This is just the stopper for the loop. */
- iflist[ipt->dwNumEntries].count = 0;
-
- /* Iterate over all configured IP-addresses */
- for (ip_cnt = 0; ip_cnt < ipt->dwNumEntries; ++ip_cnt)
- {
- memset (ifrow, 0, sizeof (MIB_IFROW));
- ifrow->dwIndex = ipt->table[ip_cnt].dwIndex;
- if (GetIfEntry (ifrow) != NO_ERROR)
- continue;
-
- ifcount_t *ifEntry = iflist;
-
- /* search for matching entry (and stop at first free entry) */
- while (ifEntry->count != 0)
- {
- if (ifEntry->ifIndex == ipt->table[ip_cnt].dwIndex)
- break;
- ifEntry++;
- }
-
- /* Next in chain */
- ifp->ifa_ifa.ifa_next = (struct ifaddrs *) &ifp[1].ifa_ifa;
- /* Interface name */
- if (ifrow->dwType == IF_TYPE_SOFTWARE_LOOPBACK)
- strcpy (ifp->ifa_name, "lo");
- else
- {
- const char *name = "";
- switch (ifrow->dwType)
- {
- case IF_TYPE_ISO88025_TOKENRING:
- name = "tok";
- if (ifEntry->enumerated == 0)
- ifEntry->classId = tokId++;
- break;
- case IF_TYPE_ETHERNET_CSMACD:
- name = "eth";
- if (ifEntry->enumerated == 0)
- ifEntry->classId = ethId++;
- break;
- case IF_TYPE_PPP:
- name = "ppp";
- if (ifEntry->enumerated == 0)
- ifEntry->classId = pppId++;
- break;
- case IF_TYPE_SLIP:
- name = "slp";
- if (ifEntry->enumerated == 0)
- ifEntry->classId = slpId++;
- break;
- default:
- continue;
- }
- __small_sprintf (ifp->ifa_name,
- ifEntry->enumerated ? "%s%u:%u" : "%s%u",
- name, ifEntry->classId, ifEntry->enumerated);
- ifEntry->enumerated++;
- }
- ifp->ifa_ifa.ifa_name = ifp->ifa_name;
- /* Flags */
- if (ifrow->dwType == IF_TYPE_SOFTWARE_LOOPBACK)
- ifp->ifa_ifa.ifa_flags |= IFF_LOOPBACK;
- else if (ifrow->dwType == IF_TYPE_PPP
- || ifrow->dwType == IF_TYPE_SLIP)
- ifp->ifa_ifa.ifa_flags |= IFF_POINTOPOINT | IFF_NOARP;
- else
- ifp->ifa_ifa.ifa_flags |= IFF_BROADCAST;
- if (ifrow->dwAdminStatus == IF_ADMIN_STATUS_UP)
- {
- ifp->ifa_ifa.ifa_flags |= IFF_UP | IFF_LOWER_UP;
- if (ifrow->dwOperStatus >= IF_OPER_STATUS_CONNECTED)
- ifp->ifa_ifa.ifa_flags |= IFF_RUNNING;
- }
- /* Address */
- if_sin = (struct sockaddr_in *) &ifp->ifa_addr;
- if_sin->sin_addr.s_addr = ipt->table[ip_cnt].dwAddr;
- if_sin->sin_family = AF_INET;
- ifp->ifa_ifa.ifa_addr = (struct sockaddr *) &ifp->ifa_addr;
- /* Netmask */
- if_sin = (struct sockaddr_in *) &ifp->ifa_netmask;
- if_sin->sin_addr.s_addr = ipt->table[ip_cnt].dwMask;
- if_sin->sin_family = AF_INET;
- ifp->ifa_ifa.ifa_netmask = (struct sockaddr *) &ifp->ifa_netmask;
- if_sin = (struct sockaddr_in *) &ifp->ifa_brddstaddr;
- if (ifrow->dwType == IF_TYPE_PPP
- || ifrow->dwType == IF_TYPE_SLIP)
- {
- /* Destination address */
- if_sin->sin_addr.s_addr =
- get_routedst (ipt->table[ip_cnt].dwIndex);
- ifp->ifa_ifa.ifa_dstaddr = (struct sockaddr *)
- &ifp->ifa_brddstaddr;
- }
- else
- {
- /* Broadcast address */
-#if 0
- /* Unfortunately, the field returns only crap. */
- if_sin->sin_addr.s_addr = ipt->table[ip_cnt].dwBCastAddr;
-#else
- uint32_t mask = ipt->table[ip_cnt].dwMask;
- if_sin->sin_addr.s_addr = (ipt->table[ip_cnt].dwAddr & mask) | ~mask;
-#endif
- ifp->ifa_ifa.ifa_broadaddr = (struct sockaddr *)
- &ifp->ifa_brddstaddr;
- }
- if_sin->sin_family = AF_INET;
- /* Hardware address */
- for (UINT i = 0; i < IFHWADDRLEN; ++i)
- if (i >= ifrow->dwPhysAddrLen)
- ifp->ifa_hwaddr.sa_data[i] = '\0';
- else
- ifp->ifa_hwaddr.sa_data[i] = ifrow->bPhysAddr[i];
- /* Metric */
- ifp->ifa_metric = 1;
- /* MTU */
- ifp->ifa_mtu = ifrow->dwMtu;
- /* Interface index */
- ifp->ifa_ifindex = ifrow->dwIndex;
- /* Friendly name */
- struct ifreq_frndlyname *iff = (struct ifreq_frndlyname *)
- &ifp->ifa_frndlyname;
- iff->ifrf_len = sys_wcstombs (iff->ifrf_friendlyname,
- IFRF_FRIENDLYNAMESIZ,
- ifrow->wszName);
- ++ifp;
- }
- }
- /* Since every entry is set to the next entry, the last entry points to an
- invalid next entry now. Fix it retroactively. */
- if (ifp > ifret)
- ifp[-1].ifa_ifa.ifa_next = NULL;
-
-done:
- return ifret;
-}
-
extern "C" int
getifaddrs (struct ifaddrs **ifap)
{
@@ -2242,10 +2091,7 @@ getifaddrs (struct ifaddrs **ifap)
return -1;
}
struct ifall *ifp;
- if (wincap.has_gaa_prefixes () && !CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ)
- ifp = get_xp_ifs (AF_UNSPEC);
- else
- ifp = get_2k_ifs ();
+ ifp = get_ifs (AF_UNSPEC);
*ifap = &ifp->ifa_ifa;
return ifp ? 0 : -1;
}
@@ -2272,10 +2118,7 @@ get_ifconf (struct ifconf *ifc, int what)
}
struct ifall *ifret, *ifp;
- if (wincap.has_gaa_prefixes () && !CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ)
- ifret = get_xp_ifs (AF_INET);
- else
- ifret = get_2k_ifs ();
+ ifret = get_ifs (AF_INET);
if (!ifret)
return -1;
@@ -2354,8 +2197,7 @@ if_nametoindex (const char *name)
if (efault.faulted (EFAULT))
return 0;
- if (wincap.has_gaa_prefixes ()
- && get_adapters_addresses (&pa0, AF_UNSPEC))
+ if (get_adapters_addresses (&pa0, AF_UNSPEC))
{
char lname[IF_NAMESIZE], *c;
@@ -2384,8 +2226,7 @@ if_indextoname (unsigned ifindex, char *ifname)
if (efault.faulted (EFAULT))
return NULL;
- if (wincap.has_gaa_prefixes ()
- && get_adapters_addresses (&pa0, AF_UNSPEC))
+ if (get_adapters_addresses (&pa0, AF_UNSPEC))
{
for (pap = pa0; pap; pap = pap->Next)
if (ifindex == (pap->Ipv6IfIndex ?: pap->IfIndex))
@@ -2424,8 +2265,7 @@ if_nameindex (void)
if (efault.faulted (EFAULT))
return NULL;
- if (wincap.has_gaa_prefixes ()
- && get_adapters_addresses (&pa0, AF_UNSPEC))
+ if (get_adapters_addresses (&pa0, AF_UNSPEC))
{
int cnt = 0;
for (pap = pa0; pap; pap = pap->Next)
@@ -2780,10 +2620,12 @@ endhostent (void)
}
/* exported as recvmsg: standards? */
-extern "C" int
+extern "C" ssize_t
cygwin_recvmsg (int fd, struct msghdr *msg, int flags)
{
- int res;
+ ssize_t res;
+
+ pthread_testcancel ();
fhandler_socket *fh = get (fd);
@@ -2801,15 +2643,17 @@ cygwin_recvmsg (int fd, struct msghdr *msg, int flags)
res = fh->recvmsg (msg, flags);
}
- syscall_printf ("%R = recvmsg(%d, %p, %x)", res, fd, msg, flags);
+ syscall_printf ("%lR = recvmsg(%d, %p, %y)", res, fd, msg, flags);
return res;
}
/* exported as sendmsg: standards? */
-extern "C" int
+extern "C" ssize_t
cygwin_sendmsg (int fd, const struct msghdr *msg, int flags)
{
- int res;
+ ssize_t res;
+
+ pthread_testcancel ();
fhandler_socket *fh = get (fd);
@@ -2823,7 +2667,7 @@ cygwin_sendmsg (int fd, const struct msghdr *msg, int flags)
res = fh->sendmsg (msg, flags);
}
- syscall_printf ("%R = sendmsg(%d, %p, %x)", res, fd, msg, flags);
+ syscall_printf ("%lR = sendmsg(%d, %p, %y)", res, fd, msg, flags);
return res;
}
@@ -4144,11 +3988,9 @@ w32_to_gai_err (int w32_err)
return w32_err;
}
-/* We can't use autoload here because we don't know where the functions
- are loaded from. On Win2K, the functions are available in the
- ipv6 technology preview lib called wship6.dll, in XP and above they
- are implemented in ws2_32.dll. For older systems we use the ipv4-only
- version above. */
+/* We can't use autoload here because we don't know if the functions
+ are available (pre-Vista). For those systems we redirect to the
+ ipv4-only version above. */
static void (WINAPI *ws_freeaddrinfo)(const struct addrinfo *);
static int (WINAPI *ws_getaddrinfo)(const char *, const char *,
@@ -4195,13 +4037,6 @@ load_ipv6_funcs ()
goto out;
FreeLibrary (lib);
}
- wcpcpy (lib_name, L"wship6.dll");
- if ((lib = LoadLibraryW (lib_path)))
- {
- if (get_ipv6_funcs (lib))
- goto out;
- FreeLibrary (lib);
- }
ws_freeaddrinfo = NULL;
ws_getaddrinfo = NULL;
ws_getnameinfo = NULL;
diff --git a/winsup/cygwin/netdb.cc b/winsup/cygwin/netdb.cc
index c6d8624b6..3e3b35498 100644
--- a/winsup/cygwin/netdb.cc
+++ b/winsup/cygwin/netdb.cc
@@ -1,6 +1,6 @@
/* netdb.cc: network database related routines.
- Copyright 2002, 2003, 2007, 2008, 2010, 2011 Red Hat, Inc.
+ Copyright 2002, 2003, 2007, 2008, 2010, 2011, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -115,7 +115,7 @@ get_entire_line (FILE *fd)
/* Characters representing whitespace. Used by parse_* routines to
delimit tokens. */
-static const NO_COPY char *SPACE = " \t\n\r\f";
+static const char *SPACE = " \t\n\r\f";
/* Parse a list aliases from a network database file. Returns a
char** structure terminated by a NULL. */
diff --git a/winsup/cygwin/nfs.h b/winsup/cygwin/nfs.h
index f185fe0b1..72a0179c7 100644
--- a/winsup/cygwin/nfs.h
+++ b/winsup/cygwin/nfs.h
@@ -22,6 +22,13 @@ enum ftype3 {
NF3FIFO = 7
};
+#pragma pack (push, 4)
+struct nfs_timestruc_t
+{
+ int32_t tv_sec;
+ uint32_t tv_nsec;
+};
+
struct fattr3 {
uint32_t type;
uint32_t mode;
@@ -38,10 +45,11 @@ struct fattr3 {
} rdev;
uint64_t fsid;
uint64_t fileid;
- timestruc_t atime;
- timestruc_t mtime;
- timestruc_t ctime;
+ struct nfs_timestruc_t atime;
+ struct nfs_timestruc_t mtime;
+ struct nfs_timestruc_t ctime;
};
+#pragma pack (pop)
struct nfs_aol_ffei_t {
ULONG NextEntryOffset;
diff --git a/winsup/cygwin/nlsfuncs.cc b/winsup/cygwin/nlsfuncs.cc
index f2df9123d..0bbd4759c 100644
--- a/winsup/cygwin/nlsfuncs.cc
+++ b/winsup/cygwin/nlsfuncs.cc
@@ -1,6 +1,6 @@
/* nlsfuncs.cc: NLS helper functions
- Copyright 2010, 2011, 2012 Red Hat, Inc.
+ Copyright 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -41,11 +41,6 @@ details. */
#define has_modifier(x) ((x)[0] && !strcmp (modifier, (x)))
-/* Vista and later. Not defined in w32api yet. */
-extern "C" {
-WINBASEAPI LCID WINAPI LocaleNameToLCID (LPCWSTR, DWORD);
-};
-
static char last_locale[ENCODING_LEN + 1];
static LCID last_lcid;
@@ -66,7 +61,7 @@ __get_lcid_from_locale (const char *name)
/* Speed up reusing the same locale as before, for instance in LC_ALL case. */
if (!strcmp (name, last_locale))
{
- debug_printf ("LCID=0x%04x", last_lcid);
+ debug_printf ("LCID=%04y", last_lcid);
return last_lcid;
}
stpcpy (last_locale, name);
@@ -145,7 +140,7 @@ __get_lcid_from_locale (const char *name)
}
}
last_lcid = lcid ?: (LCID) -1;
- debug_printf ("LCID=0x%04x", last_lcid);
+ debug_printf ("LCID=%04y", last_lcid);
return last_lcid;
}
/* Pre-Vista we have to loop through the LCID values and see if they
@@ -230,7 +225,7 @@ __get_lcid_from_locale (const char *name)
lcid = MAKELANGID (lcid & 0x3ff, (lcid >> 10) + 1);
}
last_lcid = lcid ?: (LCID) -1;
- debug_printf ("LCID=0x%04x", last_lcid);
+ debug_printf ("LCID=%04y", last_lcid);
return last_lcid;
}
@@ -1196,8 +1191,8 @@ strcoll (const char *s1, const char *s2)
extern "C" int
__collate_range_cmp (int c1, int c2)
{
- char s1[2] = { c1, '\0' };
- char s2[2] = { c2, '\0' };
+ char s1[2] = { (char) c1, '\0' };
+ char s2[2] = { (char) c2, '\0' };
return strcoll (s1, s2);
}
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index e4ac38595..2582bf25f 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -1,7 +1,7 @@
/* ntdll.h. Contains ntdll specific stuff not defined elsewhere.
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011, 2012 Red Hat, Inc.
+ 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -16,8 +16,16 @@
/* custom status code: */
#define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((NTSTATUS) 0xe0000269)
-#define NtCurrentProcess() ((HANDLE) 0xffffffff)
-#define NtCurrentThread() ((HANDLE) 0xfffffffe)
+/* As of March 2013, Mingw doesn't define these status codes yet. */
+#ifndef STATUS_NETWORK_OPEN_RESTRICTION
+#define STATUS_NETWORK_OPEN_RESTRICTION ((NTSTATUS)0xC0000201)
+#endif
+#ifndef STATUS_SYMLINK_CLASS_DISABLED
+#define STATUS_SYMLINK_CLASS_DISABLED ((NTSTATUS)0xC0000715)
+#endif
+
+#define NtCurrentProcess() ((HANDLE) (LONG_PTR) -1)
+#define NtCurrentThread() ((HANDLE) (LONG_PTR) -2)
/* Creation information returned in IO_STATUS_BLOCK. */
#define FILE_SUPERSEDED 0
@@ -111,6 +119,7 @@
#define PDI_MODULES 0x01
#define PDI_HEAPS 0x04
#define PDI_HEAP_BLOCKS 0x10
+#define PDI_WOW64_MODULES 0x40
/* VM working set list protection values. Returned by NtQueryVirtualMemory. */
#define WSLE_PAGE_READONLY 0x001
@@ -181,6 +190,7 @@ typedef enum _FILE_INFORMATION_CLASS
FileMaximumInformation
} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
+/* Checked on 64 bit. */
typedef struct _FILE_NAMES_INFORMATION
{
ULONG NextEntryOffset;
@@ -189,7 +199,9 @@ typedef struct _FILE_NAMES_INFORMATION
WCHAR FileName[1];
} FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
-typedef struct _FILE_DIRECTORY_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_DIRECTORY_INFORMATION
+{
ULONG NextEntryOffset;
ULONG FileIndex;
LARGE_INTEGER CreationTime;
@@ -203,7 +215,8 @@ typedef struct _FILE_DIRECTORY_INFORMATION {
WCHAR FileName[1];
} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
-typedef struct _FILE_BOTH_DIRECTORY_INFORMATION
+/* Checked on 64 bit. */
+typedef struct _FILE_BOTH_DIR_INFORMATION
{
ULONG NextEntryOffset;
ULONG FileIndex;
@@ -219,8 +232,9 @@ typedef struct _FILE_BOTH_DIRECTORY_INFORMATION
CCHAR ShortNameLength;
WCHAR ShortName[12];
WCHAR FileName[1];
-} FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION;
+} FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_ID_BOTH_DIR_INFORMATION
{
ULONG NextEntryOffset;
@@ -240,20 +254,19 @@ typedef struct _FILE_ID_BOTH_DIR_INFORMATION
WCHAR FileName[1];
} FILE_ID_BOTH_DIR_INFORMATION, *PFILE_ID_BOTH_DIR_INFORMATION;
-typedef ULONG KAFFINITY;
-
typedef enum _SYSTEM_INFORMATION_CLASS
{
SystemBasicInformation = 0,
SystemPerformanceInformation = 2,
SystemTimeOfDayInformation = 3,
- SystemProcessesAndThreadsInformation = 5,
- SystemProcessorTimes = 8,
+ SystemProcessInformation = 5,
+ SystemProcessorPerformanceInformation = 8,
SystemHandleInformation = 16,
SystemPagefileInformation = 18,
/* There are a lot more of these... */
} SYSTEM_INFORMATION_CLASS;
+/* Checked on 64 bit. */
typedef struct _SYSTEM_BASIC_INFORMATION
{
ULONG Unknown;
@@ -263,12 +276,13 @@ typedef struct _SYSTEM_BASIC_INFORMATION
ULONG LowestPhysicalPage;
ULONG HighestPhysicalPage;
ULONG AllocationGranularity;
- ULONG LowestUserAddress;
- ULONG HighestUserAddress;
- ULONG ActiveProcessors;
+ ULONG_PTR LowestUserAddress;
+ ULONG_PTR HighestUserAddress;
+ ULONG_PTR ActiveProcessors;
UCHAR NumberProcessors;
} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _SYSTEM_PAGEFILE_INFORMATION
{
ULONG NextEntryOffset;
@@ -278,7 +292,8 @@ typedef struct _SYSTEM_PAGEFILE_INFORMATION
UNICODE_STRING FileName;
} SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION;
-typedef struct __attribute__ ((aligned (8))) _SYSTEM_PROCESSOR_TIMES
+/* Checked on 64 bit. */
+typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
{
LARGE_INTEGER IdleTime;
LARGE_INTEGER KernelTime;
@@ -286,24 +301,27 @@ typedef struct __attribute__ ((aligned (8))) _SYSTEM_PROCESSOR_TIMES
LARGE_INTEGER DpcTime;
LARGE_INTEGER InterruptTime;
ULONG InterruptCount;
-} SYSTEM_PROCESSOR_TIMES, *PSYSTEM_PROCESSOR_TIMES;
+} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
typedef LONG KPRIORITY;
+
+/* Checked on 64 bit. */
typedef struct _VM_COUNTERS
{
- ULONG PeakVirtualSize;
- ULONG VirtualSize;
+ SIZE_T PeakVirtualSize;
+ SIZE_T VirtualSize;
ULONG PageFaultCount;
- ULONG PeakWorkingSetSize;
- ULONG WorkingSetSize;
- ULONG QuotaPeakPagedPoolUsage;
- ULONG QuotaPagedPoolUsage;
- ULONG QuotaPeakNonPagedPoolUsage;
- ULONG QuotaNonPagedPoolUsage;
- ULONG PagefileUsage;
- ULONG PeakPagefileUsage;
+ SIZE_T PeakWorkingSetSize;
+ SIZE_T WorkingSetSize;
+ SIZE_T QuotaPeakPagedPoolUsage;
+ SIZE_T QuotaPagedPoolUsage;
+ SIZE_T QuotaPeakNonPagedPoolUsage;
+ SIZE_T QuotaNonPagedPoolUsage;
+ SIZE_T PagefileUsage;
+ SIZE_T PeakPagefileUsage;
} VM_COUNTERS, *PVM_COUNTERS;
+/* Checked on 64 bit. */
typedef struct _CLIENT_ID
{
HANDLE UniqueProcess;
@@ -354,6 +372,7 @@ typedef enum
MaximumWaitReason
} KWAIT_REASON;
+/* Checked on 64 bit. */
typedef struct _SYSTEM_THREADS
{
LARGE_INTEGER KernelTime;
@@ -370,31 +389,39 @@ typedef struct _SYSTEM_THREADS
DWORD Reserved;
} SYSTEM_THREADS, *PSYSTEM_THREADS;
-typedef struct _SYSTEM_PROCESSES
+/* Checked on 64 bit. */
+typedef struct _SYSTEM_PROCESS_INFORMATION
{
- ULONG NextEntryDelta;
- ULONG ThreadCount;
+ ULONG NextEntryOffset;
+ ULONG NumberOfThreads;
ULONG Reserved1[6];
LARGE_INTEGER CreateTime;
LARGE_INTEGER UserTime;
LARGE_INTEGER KernelTime;
- UNICODE_STRING ProcessName;
+ UNICODE_STRING ImageName;
KPRIORITY BasePriority;
- ULONG ProcessId;
- ULONG InheritedFromProcessId;
+ HANDLE UniqueProcessId;
+ HANDLE InheritedFromUniqueProcessId;
ULONG HandleCount;
- ULONG Reserved2[2];
- VM_COUNTERS VmCounters;
+ ULONG SessionId;
+ ULONG PageDirectoryBase;
+ VM_COUNTERS VirtualMemoryCounters;
+ SIZE_T PrivatePageCount;
IO_COUNTERS IoCounters;
SYSTEM_THREADS Threads[1];
-} SYSTEM_PROCESSES, *PSYSTEM_PROCESSES;
+} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _IO_STATUS_BLOCK
{
- NTSTATUS Status;
- ULONG Information;
+ union {
+ NTSTATUS Status;
+ PVOID Pointer;
+ };
+ ULONG_PTR Information;
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
+/* Checked on 64 bit. */
typedef struct _SYSTEM_PERFORMANCE_INFORMATION
{
LARGE_INTEGER IdleTime;
@@ -472,13 +499,15 @@ typedef struct _SYSTEM_PERFORMANCE_INFORMATION
ULONG SystemCalls;
} SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
-typedef struct __attribute__ ((aligned(8))) _SYSTEM_TIME_OF_DAY_INFORMATION
+/* Checked on 64 bit. */
+typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
{
LARGE_INTEGER BootTime;
LARGE_INTEGER CurrentTime;
LARGE_INTEGER TimeZoneBias;
ULONG CurrentTimeZoneId;
-} SYSTEM_TIME_OF_DAY_INFORMATION, *PSYSTEM_TIME_OF_DAY_INFORMATION;
+ BYTE Reserved1[20]; /* Per MSDN. Always 0. */
+} SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION;
typedef enum _PROCESSINFOCLASS
{
@@ -491,34 +520,36 @@ typedef enum _PROCESSINFOCLASS
ProcessImageFileName = 27
} PROCESSINFOCLASS;
+/* Checked on 64 bit. */
typedef struct _DEBUG_BUFFER
{
HANDLE SectionHandle;
PVOID SectionBase;
PVOID RemoteSectionBase;
- ULONG SectionBaseDelta;
+ ULONG_PTR SectionBaseDelta;
HANDLE EventPairHandle;
- ULONG Unknown[2];
+ ULONG_PTR Unknown[2];
HANDLE RemoteThreadHandle;
ULONG InfoClassMask;
- ULONG SizeOfInfo;
- ULONG AllocatedSize;
- ULONG SectionSize;
+ ULONG_PTR SizeOfInfo;
+ ULONG_PTR AllocatedSize;
+ ULONG_PTR SectionSize;
PVOID ModuleInformation;
PVOID BackTraceInformation;
PVOID HeapInformation;
PVOID LockInformation;
- PVOID Reserved[9];
+ PVOID Reserved[8];
} DEBUG_BUFFER, *PDEBUG_BUFFER;
+/* Checked on 64 bit. */
typedef struct _DEBUG_HEAP_INFORMATION
{
- ULONG Base;
+ ULONG_PTR Base;
ULONG Flags;
USHORT Granularity;
USHORT Unknown;
- ULONG Allocated;
- ULONG Committed;
+ ULONG_PTR Allocated;
+ ULONG_PTR Committed;
ULONG TagCount;
ULONG BlockCount;
ULONG Reserved[7];
@@ -526,24 +557,27 @@ typedef struct _DEBUG_HEAP_INFORMATION
PVOID Blocks;
} DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _DEBUG_HEAP_ARRAY
{
ULONG Count;
DEBUG_HEAP_INFORMATION Heaps[1];
} DEBUG_HEAP_ARRAY, *PDEBUG_HEAP_ARRAY;
+/* Checked on 64 bit. */
typedef struct _DEBUG_HEAP_BLOCK
{
- ULONG Size;
+ ULONG_PTR Size;
ULONG Flags;
- ULONG Committed;
- ULONG Address;
+ ULONG_PTR Committed;
+ ULONG_PTR Address;
} DEBUG_HEAP_BLOCK, *PDEBUG_HEAP_BLOCK;
+/* Checked on 64 bit. */
typedef struct _DEBUG_MODULE_INFORMATION
{
- ULONG Reserved[2];
- ULONG Base;
+ ULONG_PTR Reserved[2];
+ ULONG_PTR Base;
ULONG Size;
ULONG Flags;
USHORT Index;
@@ -553,12 +587,14 @@ typedef struct _DEBUG_MODULE_INFORMATION
CHAR ImageName[256];
} DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _DEBUG_MODULE_ARRAY
{
ULONG Count;
DEBUG_MODULE_INFORMATION Modules[1];
} DEBUG_MODULE_ARRAY, *PDEBUG_MODULE_ARRAY;
+/* Checked on 64 bit. */
typedef struct _KERNEL_USER_TIMES
{
LARGE_INTEGER CreateTime;
@@ -567,8 +603,12 @@ typedef struct _KERNEL_USER_TIMES
LARGE_INTEGER UserTime;
} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
+/* Checked on 64 bit. */
typedef struct _LDR_DATA_TABLE_ENTRY
{
+ /* Heads up! The pointers within the LIST_ENTRYs don't point to the
+ start of the next LDR_DATA_TABLE_ENTRY, but rather they point to the
+ start of their respective LIST_ENTRY *within* LDR_DATA_TABLE_ENTRY. */
LIST_ENTRY InLoadOrderLinks;
LIST_ENTRY InMemoryOrderLinks;
LIST_ENTRY InInitializationOrderLinks;
@@ -578,23 +618,28 @@ typedef struct _LDR_DATA_TABLE_ENTRY
UNICODE_STRING FullDllName;
UNICODE_STRING BaseDllName;
ULONG Flags;
- WORD LoadCount;
+ USHORT LoadCount;
/* More follows. Left out since it's just not used. The aforementioned
- part of the structure is stable from at least NT4 up to Windows 7,
+ part of the structure is stable from at least NT4 up to Windows 8,
including WOW64. */
} LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
+/* Checked on 64 bit. */
typedef struct _PEB_LDR_DATA
{
ULONG Length;
- UCHAR Initialized;
+ BOOLEAN Initialized;
PVOID SsHandle;
+ /* Heads up! The pointers within the LIST_ENTRYs don't point to the
+ start of the next LDR_DATA_TABLE_ENTRY, but rather they point to the
+ start of their respective LIST_ENTRY *within* LDR_DATA_TABLE_ENTRY. */
LIST_ENTRY InLoadOrderModuleList;
LIST_ENTRY InMemoryOrderModuleList;
LIST_ENTRY InInitializationOrderModuleList;
PVOID EntryInProgress;
} PEB_LDR_DATA, *PPEB_LDR_DATA;
+/* Checked on 64 bit. */
typedef struct _RTL_USER_PROCESS_PARAMETERS
{
ULONG AllocationSize;
@@ -627,23 +672,35 @@ typedef struct _RTL_USER_PROCESS_PARAMETERS
UNICODE_STRING RuntimeInfo;
} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
+/* Checked on 64 bit. */
typedef struct _PEB
{
BYTE Reserved1[2];
BYTE BeingDebugged;
- BYTE Reserved2[9];
+ BYTE Reserved2[1];
+ PVOID Reserved3[2];
PPEB_LDR_DATA Ldr;
PRTL_USER_PROCESS_PARAMETERS ProcessParameters;
- BYTE Reserved3[4];
+ PVOID Reserved4;
PVOID ProcessHeap;
PRTL_CRITICAL_SECTION FastPebLock;
- BYTE Reserved4[8];
+ PVOID Reserved5[2];
ULONG EnvironmentUpdateCount;
- BYTE Reserved5[424];
+ BYTE Reserved6[228];
+ PVOID Reserved7[49];
ULONG SessionId;
+ /* A lot more follows... */
} PEB, *PPEB;
-/* Simplified definition, just to get stuff we're interested in. */
+/* Checked on 64 bit. */
+typedef struct _GDI_TEB_BATCH
+{
+ ULONG Offset;
+ HANDLE HDC;
+ ULONG Buffer[0x136];
+} GDI_TEB_BATCH, *PGDI_TEB_BATCH;
+
+/* Checked on 64 bit. */
typedef struct _TEB
{
NT_TIB Tib;
@@ -654,33 +711,47 @@ typedef struct _TEB
PPEB Peb;
ULONG LastErrorValue;
ULONG CountOfOwnedCriticalSections;
- PVOID _reserved1[2];
- ULONG _reserved2[31];
+ PVOID CsrClientThread;
+ PVOID Win32ThreadInfo;
+ ULONG User32Reserved[26];
+ ULONG UserReserved[5];
PVOID WOW32Reserved;
- ULONG CurrentLocale;
+ LCID CurrentLocale;
ULONG FpSoftwareStatusRegister;
PVOID SystemReserved1[54];
LONG ExceptionCode;
PVOID ActivationContextStackPointer;
- UCHAR SpareBytes1[36];
+ UCHAR SpareBytes1[0x30 - 3 * sizeof(PVOID)];
ULONG TxFsContext;
- ULONG GdiTebBatch[312];
+ GDI_TEB_BATCH GdiTebBatch;
CLIENT_ID RealClientId;
PVOID GdiCachedProcessHandle;
ULONG GdiClientPID;
ULONG GdiClientTID;
PVOID GdiThreadLocalInfo;
- ULONG Win32ClientInfo[62];
+ SIZE_T Win32ClientInfo[62];
PVOID glDispatchTable[233];
- ULONG glReserved1[29];
- PVOID glReserved2[6];
+ SIZE_T glReserved1[29];
+ PVOID glReserved2;
+ PVOID glSectionInfo;
+ PVOID glSection;
+ PVOID glTable;
+ PVOID glCurrentRC;
+ PVOID glContext;
ULONG LastStatusValue;
UNICODE_STRING StaticUnicodeString;
WCHAR StaticUnicodeBuffer[261];
PVOID DeallocationStack;
+ PVOID TlsSlots[64];
+ BYTE Reserved3[8];
+ PVOID Reserved4[26];
+ PVOID ReservedForOle;
+ PVOID Reserved5[4];
+ PVOID TlsExpansionSlots;
/* A lot more follows... */
} TEB, *PTEB;
+/* Checked on 64 bit. */
typedef struct _KSYSTEM_TIME
{
ULONG LowPart;
@@ -688,6 +759,7 @@ typedef struct _KSYSTEM_TIME
LONG High2Time;
} KSYSTEM_TIME, *PKSYSTEM_TIME;
+/* Checked on 64 bit. */
typedef struct _KUSER_SHARED_DATA
{
BYTE Reserved1[0x08];
@@ -697,16 +769,18 @@ typedef struct _KUSER_SHARED_DATA
/* A lot more follows... */
} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
+/* Checked on 64 bit. */
typedef struct _PROCESS_BASIC_INFORMATION
{
NTSTATUS ExitStatus;
PPEB PebBaseAddress;
KAFFINITY AffinityMask;
- KPRIORITY BasePriority;
- ULONG UniqueProcessId;
- ULONG InheritedFromUniqueProcessId;
+ KPRIORITY BasePriority; /* !!!Broken on WOW64!!! */
+ ULONG_PTR UniqueProcessId;
+ ULONG_PTR InheritedFromUniqueProcessId;
} PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _PROCESS_SESSION_INFORMATION
{
ULONG SessionId;
@@ -720,18 +794,22 @@ typedef enum _MEMORY_INFORMATION_CLASS
MemoryBasicVlmInformation
} MEMORY_INFORMATION_CLASS;
+/* Checked on 64 bit. */
typedef struct _MEMORY_WORKING_SET_LIST
{
ULONG NumberOfPages;
- ULONG WorkingSetList[1];
+ ULONG_PTR WorkingSetList[1];
} MEMORY_WORKING_SET_LIST, *PMEMORY_WORKING_SET_LIST;
+/* Checked on 64 bit. */
typedef struct _MEMORY_SECTION_NAME
{
UNICODE_STRING SectionFileName;
} MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
-typedef struct _FILE_BASIC_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_BASIC_INFORMATION
+{
LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime;
LARGE_INTEGER LastWriteTime;
@@ -739,7 +817,9 @@ typedef struct _FILE_BASIC_INFORMATION {
ULONG FileAttributes;
} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
-typedef struct _FILE_STANDARD_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_STANDARD_INFORMATION
+{
LARGE_INTEGER AllocationSize;
LARGE_INTEGER EndOfFile;
ULONG NumberOfLinks;
@@ -747,7 +827,9 @@ typedef struct _FILE_STANDARD_INFORMATION {
BOOLEAN Directory;
} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
-typedef struct _FILE_NETWORK_OPEN_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_NETWORK_OPEN_INFORMATION
+{
LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime;
LARGE_INTEGER LastWriteTime;
@@ -757,57 +839,80 @@ typedef struct _FILE_NETWORK_OPEN_INFORMATION {
ULONG FileAttributes;
} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
-typedef struct _FILE_INTERNAL_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_INTERNAL_INFORMATION
+{
LARGE_INTEGER FileId;
} FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
-typedef struct _FILE_EA_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_EA_INFORMATION
+{
ULONG EaSize;
} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
-typedef struct _FILE_ACCESS_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_ACCESS_INFORMATION
+{
ACCESS_MASK AccessFlags;
} FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
-typedef struct _FILE_DISPOSITION_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_DISPOSITION_INFORMATION
+{
BOOLEAN DeleteFile;
} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
-typedef struct _FILE_POSITION_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_POSITION_INFORMATION
+{
LARGE_INTEGER CurrentByteOffset;
} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
-typedef struct _FILE_END_OF_FILE_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_END_OF_FILE_INFORMATION
+{
LARGE_INTEGER EndOfFile;
} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
-typedef struct _FILE_MODE_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_MODE_INFORMATION
+{
ULONG Mode;
} FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
-typedef struct _FILE_ALIGNMENT_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_ALIGNMENT_INFORMATION
+{
ULONG AlignmentRequirement;
} FILE_ALIGNMENT_INFORMATION;
-typedef struct _FILE_NAME_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_NAME_INFORMATION
+{
ULONG FileNameLength;
WCHAR FileName[1];
} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
-typedef struct _FILE_LINK_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_LINK_INFORMATION
+{
BOOLEAN ReplaceIfExists;
HANDLE RootDirectory;
ULONG FileNameLength;
WCHAR FileName[1];
} FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
-typedef struct _FILE_RENAME_INFORMATION {
+/* Checked on 64 bit. */
+typedef struct _FILE_RENAME_INFORMATION
+{
BOOLEAN ReplaceIfExists;
HANDLE RootDirectory;
ULONG FileNameLength;
WCHAR FileName[1];
} FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_ALL_INFORMATION {
FILE_BASIC_INFORMATION BasicInformation;
FILE_STANDARD_INFORMATION StandardInformation;
@@ -828,6 +933,7 @@ enum
FILE_PIPE_CLOSING_STATE = 4
};
+/* Checked on 64 bit. */
typedef struct _FILE_PIPE_LOCAL_INFORMATION
{
ULONG NamedPipeType;
@@ -842,6 +948,7 @@ typedef struct _FILE_PIPE_LOCAL_INFORMATION
ULONG NamedPipeEnd;
} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_COMPRESSION_INFORMATION
{
LARGE_INTEGER CompressedFileSize;
@@ -852,12 +959,14 @@ typedef struct _FILE_COMPRESSION_INFORMATION
UCHAR Reserved[3];
} FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_FS_DEVICE_INFORMATION
{
ULONG DeviceType;
ULONG Characteristics;
} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
{
ULONG FileSystemAttributes;
@@ -866,6 +975,7 @@ typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
WCHAR FileSystemName[1];
} FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
+/* Checked on 64 bit. */
#pragma pack(push,4)
typedef struct _FILE_FS_VOLUME_INFORMATION
{
@@ -878,6 +988,7 @@ typedef struct _FILE_FS_VOLUME_INFORMATION
} FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
#pragma pack(pop)
+/* Checked on 64 bit. */
typedef struct _FILE_FS_SIZE_INFORMATION
{
LARGE_INTEGER TotalAllocationUnits;
@@ -886,6 +997,7 @@ typedef struct _FILE_FS_SIZE_INFORMATION
ULONG BytesPerSector;
} FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_FS_FULL_SIZE_INFORMATION
{
LARGE_INTEGER TotalAllocationUnits;
@@ -895,9 +1007,11 @@ typedef struct _FILE_FS_FULL_SIZE_INFORMATION
ULONG BytesPerSector;
} FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION;
-typedef struct _FILE_FS_OBJECTID_INFORMATION {
- UCHAR ObjectId[16];
- UCHAR ExtendedInfo[48];
+/* Checked on 64 bit. */
+typedef struct _FILE_FS_OBJECTID_INFORMATION
+{
+ UCHAR ObjectId[16];
+ UCHAR ExtendedInfo[48];
} FILE_FS_OBJECTID_INFORMATION, *PFILE_FS_OBJECTID_INFORMATION;
typedef enum _FSINFOCLASS {
@@ -921,6 +1035,7 @@ typedef enum _OBJECT_INFORMATION_CLASS
// and many more
} OBJECT_INFORMATION_CLASS;
+/* Checked on 64 bit. */
typedef struct _OBJECT_BASIC_INFORMATION
{
ULONG Attributes;
@@ -936,24 +1051,28 @@ typedef struct _OBJECT_BASIC_INFORMATION
LARGE_INTEGER CreateTime;
} OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _OBJECT_NAME_INFORMATION
{
UNICODE_STRING Name;
} OBJECT_NAME_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _DIRECTORY_BASIC_INFORMATION
{
UNICODE_STRING ObjectName;
UNICODE_STRING ObjectTypeName;
} DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_GET_EA_INFORMATION
{
- ULONG NextEntryOffset;
- UCHAR EaNameLength;
- CHAR EaName[1];
+ ULONG NextEntryOffset;
+ UCHAR EaNameLength;
+ CHAR EaName[1];
} FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_FULL_EA_INFORMATION
{
ULONG NextEntryOffset;
@@ -963,6 +1082,7 @@ typedef struct _FILE_FULL_EA_INFORMATION
CHAR EaName[1];
} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
+/* Checked on 64 bit. */
typedef struct _FILE_MAILSLOT_SET_INFORMATION
{
LARGE_INTEGER ReadTimeout;
@@ -970,6 +1090,7 @@ typedef struct _FILE_MAILSLOT_SET_INFORMATION
typedef VOID NTAPI (*PIO_APC_ROUTINE)(PVOID, PIO_STATUS_BLOCK, ULONG);
+/* Checked on 64 bit. */
typedef struct _EVENT_BASIC_INFORMATION
{
EVENT_TYPE EventType;
@@ -988,13 +1109,15 @@ typedef enum _THREAD_INFORMATION_CLASS
ThreadImpersonationToken = 5
} THREAD_INFORMATION_CLASS, *PTHREAD_INFORMATION_CLASS;
-typedef struct _THREAD_BASIC_INFORMATION {
- NTSTATUS ExitStatus;
- PNT_TIB TebBaseAddress;
- CLIENT_ID ClientId;
- KAFFINITY AffinityMask;
- KPRIORITY Priority;
- KPRIORITY BasePriority;
+/* Checked on 64 bit. */
+typedef struct _THREAD_BASIC_INFORMATION
+{
+ NTSTATUS ExitStatus;
+ PNT_TIB TebBaseAddress;
+ CLIENT_ID ClientId;
+ KAFFINITY AffinityMask;
+ KPRIORITY Priority;
+ KPRIORITY BasePriority;
} THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
typedef enum _TIMER_INFORMATION_CLASS {
@@ -1047,9 +1170,9 @@ typedef VOID (APIENTRY *PTIMER_APC_ROUTINE)(PVOID, ULONG, ULONG);
standard Win32 header. */
#ifdef __cplusplus
-/* This is the mapping of the KUSER_SHARED_DATA structure into the 32 bit
- user address space. We need it here to access the current DismountCount
- and InterruptTime. */
+/* This is the mapping of the KUSER_SHARED_DATA structure into the user
+ address space on BOTH architectures, 32 and 64 bit!
+ We need it here to access the current DismountCount and InterruptTime. */
static volatile KUSER_SHARED_DATA &SharedUserData
= *(volatile KUSER_SHARED_DATA *) 0x7ffe0000;
@@ -1101,9 +1224,12 @@ extern "C"
PVOID, ULONG);
NTSTATUS NTAPI NtFlushBuffersFile (HANDLE, PIO_STATUS_BLOCK);
NTSTATUS NTAPI NtLoadKey (POBJECT_ATTRIBUTES, POBJECT_ATTRIBUTES);
- NTSTATUS NTAPI NtLockVirtualMemory (HANDLE, PVOID *, ULONG *, ULONG);
- NTSTATUS NTAPI NtMapViewOfSection (HANDLE, HANDLE, PVOID *, ULONG, ULONG,
- PLARGE_INTEGER, PULONG, SECTION_INHERIT,
+ NTSTATUS NTAPI NtLockFile (HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID,
+ PIO_STATUS_BLOCK, PLARGE_INTEGER, PLARGE_INTEGER,
+ ULONG, BOOLEAN, BOOLEAN);
+ NTSTATUS NTAPI NtLockVirtualMemory (HANDLE, PVOID *, PSIZE_T, ULONG);
+ NTSTATUS NTAPI NtMapViewOfSection (HANDLE, HANDLE, PVOID *, ULONG_PTR, SIZE_T,
+ PLARGE_INTEGER, PSIZE_T, SECTION_INHERIT,
ULONG, ULONG);
NTSTATUS NTAPI NtNotifyChangeDirectoryFile (HANDLE, HANDLE, PIO_APC_ROUTINE,
PVOID, PIO_STATUS_BLOCK,
@@ -1162,7 +1288,7 @@ extern "C"
KEY_VALUE_INFORMATION_CLASS, PVOID, ULONG,
PULONG);
NTSTATUS NTAPI NtQueryVirtualMemory (HANDLE, PVOID, MEMORY_INFORMATION_CLASS,
- PVOID, ULONG, PULONG);
+ PVOID, SIZE_T, PSIZE_T);
NTSTATUS NTAPI NtQueryVolumeInformationFile (HANDLE, IO_STATUS_BLOCK *,
VOID *, ULONG,
FS_INFORMATION_CLASS);
@@ -1185,7 +1311,9 @@ extern "C"
NTSTATUS NTAPI NtSetTimerResolution (ULONG, BOOLEAN, PULONG);
NTSTATUS NTAPI NtSetValueKey (HANDLE, PUNICODE_STRING, ULONG, ULONG, PVOID,
ULONG);
- NTSTATUS NTAPI NtUnlockVirtualMemory (HANDLE, PVOID *, ULONG *, ULONG);
+ NTSTATUS NTAPI NtUnlockFile (HANDLE, PIO_STATUS_BLOCK, PLARGE_INTEGER,
+ PLARGE_INTEGER, ULONG);
+ NTSTATUS NTAPI NtUnlockVirtualMemory (HANDLE, PVOID *, PSIZE_T, ULONG);
NTSTATUS NTAPI NtUnmapViewOfSection (HANDLE, PVOID);
NTSTATUS NTAPI NtWriteFile (HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID,
PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER,
@@ -1232,7 +1360,7 @@ extern "C"
BOOLEAN NTAPI RtlEqualUnicodeString (PUNICODE_STRING, PUNICODE_STRING,
BOOLEAN);
VOID NTAPI RtlFreeAnsiString (PANSI_STRING);
- BOOLEAN NTAPI RtlFreeHeap (PVOID, ULONG, PVOID);
+ BOOLEAN NTAPI RtlFreeHeap (HANDLE, ULONG, PVOID);
VOID NTAPI RtlFreeOemString (POEM_STRING);
VOID NTAPI RtlFreeUnicodeString (PUNICODE_STRING);
BOOLEAN NTAPI RtlFirstFreeAce (PACL, PVOID *);
diff --git a/winsup/cygwin/ntea.cc b/winsup/cygwin/ntea.cc
index c0eab1e95..3c860096e 100644
--- a/winsup/cygwin/ntea.cc
+++ b/winsup/cygwin/ntea.cc
@@ -30,7 +30,7 @@ details. */
#define NEXT_FEA(p) ((PFILE_FULL_EA_INFORMATION) (p->NextEntryOffset \
? (char *) p + p->NextEntryOffset : NULL))
-ssize_t __stdcall
+ssize_t __reg3
read_ea (HANDLE hdl, path_conv &pc, const char *name, char *value, size_t size)
{
OBJECT_ATTRIBUTES attr;
@@ -216,7 +216,7 @@ out:
return ret;
}
-int __stdcall
+int __reg3
write_ea (HANDLE hdl, path_conv &pc, const char *name, const char *value,
size_t size, int flags)
{
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc
index 42ad38c24..9cb9c2ed2 100644
--- a/winsup/cygwin/passwd.cc
+++ b/winsup/cygwin/passwd.cc
@@ -69,12 +69,12 @@ pwdgrp::read_passwd ()
&& (!(pw = internal_getpwnam (cygheap->user.name ()))
|| !user_shared->cb
|| (myself->uid != ILLEGAL_UID
- && myself->uid != (__uid32_t) pw->pw_uid
+ && myself->uid != pw->pw_uid
&& !internal_getpwuid (myself->uid))))
{
static char linebuf[1024]; // must be static and
// should not be NO_COPY
- snprintf (linebuf, sizeof (linebuf), "%s:*:%lu:%lu:,%s:%s:/bin/sh",
+ snprintf (linebuf, sizeof (linebuf), "%s:*:%u:%u:,%s:%s:/bin/sh",
cygheap->user.name (),
(!user_shared->cb || myself->uid == ILLEGAL_UID)
? UNKNOWN_UID : myself->uid,
@@ -111,12 +111,12 @@ internal_getpwsid (cygpsid &sid)
}
struct passwd *
-internal_getpwuid (__uid32_t uid, bool check)
+internal_getpwuid (uid_t uid, bool check)
{
pr.refresh (check);
for (int i = 0; i < pr.curr_lines; i++)
- if (uid == (__uid32_t) passwd_buf[i].pw_uid)
+ if (uid == passwd_buf[i].pw_uid)
return passwd_buf + i;
return NULL;
}
@@ -135,21 +135,25 @@ internal_getpwnam (const char *name, bool check)
extern "C" struct passwd *
-getpwuid32 (__uid32_t uid)
+getpwuid32 (uid_t uid)
{
struct passwd *temppw = internal_getpwuid (uid, true);
pthread_testcancel ();
return temppw;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getpwuid32, getpwuid)
+#else
extern "C" struct passwd *
getpwuid (__uid16_t uid)
{
return getpwuid32 (uid16touid32 (uid));
}
+#endif
extern "C" int
-getpwuid_r32 (__uid32_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
+getpwuid_r32 (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
{
*result = NULL;
@@ -181,11 +185,15 @@ getpwuid_r32 (__uid32_t uid, struct passwd *pwd, char *buffer, size_t bufsize, s
return 0;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getpwuid_r32, getpwuid_r)
+#else
extern "C" int
getpwuid_r (__uid16_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
{
return getpwuid_r32 (uid16touid32 (uid), pwd, buffer, bufsize, result);
}
+#endif
extern "C" struct passwd *
getpwnam (const char *name)
@@ -245,11 +253,13 @@ getpwent (void)
return NULL;
}
+#ifndef __x86_64__
extern "C" struct passwd *
getpwduid (__uid16_t)
{
return NULL;
}
+#endif
extern "C" void
setpwent (void)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index cfda6bb27..16571b12e 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -343,7 +343,7 @@ path_conv::add_ext_from_sym (symlink_info &sym)
static void __reg2 mkrelpath (char *dst, bool caseinsensitive);
-static void __stdcall
+static void __reg2
mkrelpath (char *path, bool caseinsensitive)
{
tmp_pathbuf tp;
@@ -527,7 +527,7 @@ getfileattr (const char *path, bool caseinsensitive) /* path has to be always ab
directory query. */
UNICODE_STRING dirname, basename;
HANDLE dir;
- FILE_BOTH_DIRECTORY_INFORMATION fdi;
+ FILE_BOTH_DIR_INFORMATION fdi;
RtlSplitUnicodePath (&upath, &dirname, &basename);
InitializeObjectAttributes (&attr, &dirname,
@@ -1213,11 +1213,10 @@ file_get_fnoi (HANDLE h, bool skip_network_open_inf,
status = skip_network_open_inf ? STATUS_INVALID_PARAMETER
: NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi,
FileNetworkOpenInformation);
- if (status == STATUS_INVALID_PARAMETER || status == STATUS_NOT_IMPLEMENTED)
+ if (status == STATUS_INVALID_PARAMETER)
{
/* Apart from accessing Netapps, this also occurs when accessing SMB
- share root dirs hosted on NT4 (STATUS_INVALID_PARAMETER), or when
- accessing SMB share root dirs from NT4 (STATUS_NOT_IMPLEMENTED). */
+ share root dirs hosted on NT4. */
FILE_BASIC_INFORMATION fbi;
FILE_STANDARD_INFORMATION fsi;
@@ -1363,7 +1362,7 @@ normalize_win32_path (const char *src, char *dst, char *&tail)
/* nofinalslash: Remove trailing / and \ from SRC (except for the
first one). It is ok for src == dst. */
-void __stdcall
+void __reg2
nofinalslash (const char *src, char *dst)
{
int len = strlen (src);
@@ -1476,27 +1475,108 @@ conv_path_list (const char *src, char *dst, size_t size,
extern "C" int
symlink (const char *oldpath, const char *newpath)
{
- return symlink_worker (oldpath, newpath, allow_winsymlinks, false);
+ return symlink_worker (oldpath, newpath, false);
+}
+
+static int
+symlink_nfs (const char *oldpath, path_conv &win32_newpath)
+{
+ /* On NFS, create symlinks by calling NtCreateFile with an EA of type
+ NfsSymlinkTargetName containing ... the symlink target name. */
+ tmp_pathbuf tp;
+ PFILE_FULL_EA_INFORMATION pffei;
+ NTSTATUS status;
+ HANDLE fh;
+ OBJECT_ATTRIBUTES attr;
+ IO_STATUS_BLOCK io;
+
+ pffei = (PFILE_FULL_EA_INFORMATION) tp.w_get ();
+ pffei->NextEntryOffset = 0;
+ pffei->Flags = 0;
+ pffei->EaNameLength = sizeof (NFS_SYML_TARGET) - 1;
+ char *EaValue = stpcpy (pffei->EaName, NFS_SYML_TARGET) + 1;
+ pffei->EaValueLength = sizeof (WCHAR) *
+ (sys_mbstowcs ((PWCHAR) EaValue, NT_MAX_PATH, oldpath) - 1);
+ status = NtCreateFile (&fh, FILE_WRITE_DATA | FILE_WRITE_EA | SYNCHRONIZE,
+ win32_newpath.get_object_attr (attr, sec_none_nih),
+ &io, NULL, FILE_ATTRIBUTE_SYSTEM,
+ FILE_SHARE_VALID_FLAGS, FILE_CREATE,
+ FILE_SYNCHRONOUS_IO_NONALERT
+ | FILE_OPEN_FOR_BACKUP_INTENT,
+ pffei, NT_MAX_PATH * sizeof (WCHAR));
+ if (!NT_SUCCESS (status))
+ {
+ __seterrno_from_nt_status (status);
+ return -1;
+ }
+ NtClose (fh);
+ return 0;
+}
+
+static int
+symlink_native (const char *oldpath, path_conv &win32_newpath)
+{
+ tmp_pathbuf tp;
+ path_conv win32_oldpath;
+ PUNICODE_STRING final_oldpath, final_newpath;
+
+ if (isabspath (oldpath))
+ {
+ win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW, stat_suffixes);
+ final_oldpath = win32_oldpath.get_nt_native_path ();
+ final_oldpath->Buffer[1] = L'\\';
+ }
+ else
+ {
+ /* The symlink target is relative to the directory in which
+ the symlink gets created, not relative to the cwd. Therefore
+ we have to mangle the path quite a bit before calling path_conv. */
+ ssize_t len = strrchr (win32_newpath.normalized_path, '/')
+ - win32_newpath.normalized_path + 1;
+ char *absoldpath = tp.t_get ();
+ stpcpy (stpncpy (absoldpath, win32_newpath.normalized_path, len),
+ oldpath);
+ win32_oldpath.check (absoldpath, PC_SYM_NOFOLLOW, stat_suffixes);
+ UNICODE_STRING dirpath;
+ RtlSplitUnicodePath (win32_newpath.get_nt_native_path (), &dirpath, NULL);
+ final_oldpath = win32_oldpath.get_nt_native_path ();
+ final_oldpath->Buffer += dirpath.Length / sizeof (WCHAR);
+ }
+ /* If the symlink target doesn't exist, don't create native symlink.
+ Otherwise the directory flag in the symlink is potentially wrong
+ when the target comes into existence, and native tools will fail.
+ This is so screwball. This is no problem on AFS, fortunately. */
+ if (!win32_oldpath.exists () && !win32_oldpath.fs_is_afs ())
+ {
+ SetLastError (ERROR_FILE_NOT_FOUND);
+ return -1;
+ }
+ /* Convert native path to DOS UNC path. */
+ final_newpath = win32_newpath.get_nt_native_path ();
+ final_newpath->Buffer[1] = L'\\';
+ /* Try to create native symlink. */
+ if (!CreateSymbolicLinkW (final_newpath->Buffer, final_oldpath->Buffer,
+ win32_oldpath.isdir ()
+ ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0))
+ {
+ /* Repair native path, we still need it. */
+ final_newpath->Buffer[1] = L'?';
+ return -1;
+ }
+ return 0;
}
int
-symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
- bool isdevice)
+symlink_worker (const char *oldpath, const char *newpath, bool isdevice)
{
int res = -1;
size_t len;
- path_conv win32_newpath, win32_oldpath;
+ path_conv win32_newpath;
char *buf, *cp;
- SECURITY_ATTRIBUTES sa = sec_none_nih;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- NTSTATUS status;
- HANDLE fh;
- ULONG access = DELETE | FILE_GENERIC_WRITE;
tmp_pathbuf tp;
unsigned check_opt;
- bool mk_winsym = use_winsym;
bool has_trailing_dirsep = false;
+ winsym_t wsym_type;
/* POSIX says that empty 'newpath' is invalid input while empty
'oldpath' is valid -- it's symlink resolver job to verify if
@@ -1528,11 +1608,35 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
check_opt = PC_SYM_NOFOLLOW | PC_POSIX | (isdevice ? PC_NOWARN : 0);
/* We need the normalized full path below. */
win32_newpath.check (newpath, check_opt, stat_suffixes);
+
+ /* Default symlink type is determined by global allow_winsymlinks variable.
+ Device files are always shortcuts. */
+ wsym_type = isdevice ? WSYM_lnk : allow_winsymlinks;
+ /* NFS has its own, dedicated way to create symlinks. */
+ if (win32_newpath.fs_is_nfs ())
+ wsym_type = WSYM_nfs;
/* MVFS doesn't handle the SYSTEM DOS attribute, but it handles the R/O
attribute. Therefore we create symlinks on MVFS always as shortcuts. */
- mk_winsym |= win32_newpath.fs_is_mvfs ();
+ else if (win32_newpath.fs_is_mvfs ())
+ wsym_type = WSYM_lnk;
+ /* AFS only supports native symlinks. */
+ else if (win32_newpath.fs_is_afs ())
+ {
+ /* Bail out if OS doesn't support native symlinks. */
+ if (wincap.max_sys_priv () < SE_CREATE_SYMBOLIC_LINK_PRIVILEGE)
+ {
+ set_errno (EPERM);
+ goto done;
+ }
+ wsym_type = WSYM_nativestrict;
+ }
+ /* Don't try native symlinks on filesystems not supporting reparse points. */
+ else if ((wsym_type == WSYM_native || wsym_type == WSYM_nativestrict)
+ && !(win32_newpath.fs_flags () & FILE_SUPPORTS_REPARSE_POINTS))
+ wsym_type = WSYM_sysfile;
- if (mk_winsym && !win32_newpath.exists ()
+ /* Attach .lnk suffix when shortcut is requested. */
+ if (wsym_type == WSYM_lnk && !win32_newpath.exists ()
&& (isdevice || !win32_newpath.fs_is_nfs ()))
{
char *newplnk = tp.c_get ();
@@ -1546,8 +1650,8 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
goto done;
}
- syscall_printf ("symlink (%s, %S)", oldpath,
- win32_newpath.get_nt_native_path ());
+ syscall_printf ("symlink (%s, %S) wsym_type %d", oldpath,
+ win32_newpath.get_nt_native_path (), wsym_type);
if ((!isdevice && win32_newpath.exists ())
|| win32_newpath.is_auto_device ())
@@ -1561,36 +1665,33 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
goto done;
}
- if (!isdevice && win32_newpath.fs_is_nfs ())
- {
- /* On NFS, create symlinks by calling NtCreateFile with an EA of type
- NfsSymlinkTargetName containing ... the symlink target name. */
- PFILE_FULL_EA_INFORMATION pffei = (PFILE_FULL_EA_INFORMATION) tp.w_get ();
- pffei->NextEntryOffset = 0;
- pffei->Flags = 0;
- pffei->EaNameLength = sizeof (NFS_SYML_TARGET) - 1;
- char *EaValue = stpcpy (pffei->EaName, NFS_SYML_TARGET) + 1;
- pffei->EaValueLength = sizeof (WCHAR) *
- (sys_mbstowcs ((PWCHAR) EaValue, NT_MAX_PATH, oldpath) - 1);
- status = NtCreateFile (&fh, FILE_WRITE_DATA | FILE_WRITE_EA | SYNCHRONIZE,
- win32_newpath.get_object_attr (attr, sa),
- &io, NULL, FILE_ATTRIBUTE_SYSTEM,
- FILE_SHARE_VALID_FLAGS, FILE_CREATE,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT,
- pffei, NT_MAX_PATH * sizeof (WCHAR));
- if (!NT_SUCCESS (status))
+ /* Handle NFS and native symlinks in their own functions. */
+ switch (wsym_type)
+ {
+ case WSYM_nfs:
+ res = symlink_nfs (oldpath, win32_newpath);
+ goto done;
+ case WSYM_native:
+ case WSYM_nativestrict:
+ res = symlink_native (oldpath, win32_newpath);
+ if (!res)
+ goto done;
+ /* Strictly native? Too bad. */
+ if (wsym_type == WSYM_nativestrict)
{
- __seterrno_from_nt_status (status);
+ __seterrno ();
goto done;
}
- NtClose (fh);
- res = 0;
- goto done;
+ /* Otherwise, fall back to default symlink type. */
+ wsym_type = WSYM_sysfile;
+ break;
+ default:
+ break;
}
- if (mk_winsym)
+ if (wsym_type == WSYM_lnk)
{
+ path_conv win32_oldpath;
ITEMIDLIST *pidl = NULL;
size_t full_len = 0;
unsigned short oldpath_len, desc_len, relpath_len, pidl_len = 0;
@@ -1605,11 +1706,11 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
/* The symlink target is relative to the directory in which
the symlink gets created, not relative to the cwd. Therefore
we have to mangle the path quite a bit before calling path_conv. */
- if (isabspath (oldpath))
- win32_oldpath.check (oldpath,
- PC_SYM_NOFOLLOW,
- stat_suffixes);
- else
+ if (isabspath (oldpath))
+ win32_oldpath.check (oldpath,
+ PC_SYM_NOFOLLOW,
+ stat_suffixes);
+ else
{
len = strrchr (win32_newpath.normalized_path, '/')
- win32_newpath.normalized_path + 1;
@@ -1650,12 +1751,11 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
full_len += sizeof (unsigned short) + pidl_len;
oldpath_len = strlen (oldpath);
/* Unfortunately the length of the description is restricted to a
- length of MAX_PATH up to NT4, and to a length of 2000 bytes
- since W2K. We don't want to add considerations for the different
- lengths and even 2000 bytes is not enough for long path names.
- So what we do here is to set the description to the POSIX path
- only if the path is not longer than MAX_PATH characters. We
- append the full path name after the regular shortcut data
+ length of 2000 bytes. We don't want to add considerations for
+ the different lengths and even 2000 bytes is not enough for long
+ path names. So what we do here is to set the description to the
+ POSIX path only if the path is not longer than MAX_PATH characters.
+ We append the full path name after the regular shortcut data
(see below), which works fine with Windows Explorer as well
as older Cygwin versions (as long as the whole file isn't bigger
than 8K). The description field is only used for backward
@@ -1679,7 +1779,7 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
full_len += sizeof (unsigned short) + oldpath_len;
/* 1 byte more for trailing 0 written by stpcpy. */
if (full_len < NT_MAX_PATH * sizeof (WCHAR))
- buf = (char *) tp.w_get ();
+ buf = tp.t_get ();
else
buf = (char *) alloca (full_len + 1);
@@ -1723,7 +1823,7 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
else
{
/* Default technique creating a symlink. */
- buf = (char *) tp.w_get ();
+ buf = tp.t_get ();
cp = stpcpy (buf, SYMLINK_COOKIE);
*(PWCHAR) cp = 0xfeff; /* BOM */
cp += 2;
@@ -1731,10 +1831,17 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
cp += sys_mbstowcs ((PWCHAR) cp, NT_MAX_PATH, oldpath) * sizeof (WCHAR);
}
+ OBJECT_ATTRIBUTES attr;
+ IO_STATUS_BLOCK io;
+ NTSTATUS status;
+ ULONG access;
+ HANDLE fh;
+
+ access = DELETE | FILE_GENERIC_WRITE;
if (isdevice && win32_newpath.exists ())
{
status = NtOpenFile (&fh, FILE_WRITE_ATTRIBUTES,
- win32_newpath.get_object_attr (attr, sa),
+ win32_newpath.get_object_attr (attr, sec_none_nih),
&io, 0, FILE_OPEN_FOR_BACKUP_INTENT);
if (!NT_SUCCESS (status))
{
@@ -1760,7 +1867,8 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
so for now we don't request WRITE_DAC on remote drives. */
access |= READ_CONTROL | WRITE_DAC;
- status = NtCreateFile (&fh, access, win32_newpath.get_object_attr (attr, sa),
+ status = NtCreateFile (&fh, access,
+ win32_newpath.get_object_attr (attr, sec_none_nih),
&io, NULL, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_VALID_FLAGS,
isdevice ? FILE_OVERWRITE_IF : FILE_CREATE,
@@ -1780,10 +1888,11 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
status = NtWriteFile (fh, NULL, NULL, NULL, &io, buf, cp - buf, NULL, NULL);
if (NT_SUCCESS (status) && io.Information == (ULONG) (cp - buf))
{
- status = NtSetAttributesFile (fh, mk_winsym ? FILE_ATTRIBUTE_READONLY
- : FILE_ATTRIBUTE_SYSTEM);
+ status = NtSetAttributesFile (fh, wsym_type == WSYM_lnk
+ ? FILE_ATTRIBUTE_READONLY
+ : FILE_ATTRIBUTE_SYSTEM);
if (!NT_SUCCESS (status))
- debug_printf ("Setting attributes failed, status = %p", status);
+ debug_printf ("Setting attributes failed, status = %y", status);
res = 0;
}
else
@@ -1793,13 +1902,13 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
status = NtSetInformationFile (fh, &io, &fdi, sizeof fdi,
FileDispositionInformation);
if (!NT_SUCCESS (status))
- debug_printf ("Setting delete dispostion failed, status = %p", status);
+ debug_printf ("Setting delete dispostion failed, status = %y", status);
}
NtClose (fh);
done:
- syscall_printf ("%d = symlink_worker(%s, %s, %d, %d)", res, oldpath,
- newpath, mk_winsym, isdevice);
+ syscall_printf ("%d = symlink_worker(%s, %s, %d)",
+ res, oldpath, newpath, isdevice);
if (has_trailing_dirsep)
free ((void *) newpath);
return res;
@@ -1838,7 +1947,7 @@ symlink_info::check_shortcut (HANDLE h)
set_error (EIO);
return 0;
}
- if (fsi.EndOfFile.QuadPart <= sizeof (win_shortcut_hdr)
+ if (fsi.EndOfFile.QuadPart <= (LONGLONG) sizeof (win_shortcut_hdr)
|| fsi.EndOfFile.QuadPart > 4 * 65536)
return 0;
if (fsi.EndOfFile.LowPart < NT_MAX_PATH * sizeof (WCHAR))
@@ -1913,7 +2022,7 @@ symlink_info::check_sysfile (HANDLE h)
sizeof (cookie_buf), &off, NULL);
if (!NT_SUCCESS (status))
{
- debug_printf ("ReadFile1 failed %p", status);
+ debug_printf ("ReadFile1 failed %y", status);
if (status != STATUS_END_OF_FILE)
set_error (EIO);
return 0;
@@ -2000,7 +2109,7 @@ symlink_info::check_reparse_point (HANDLE h, bool remote)
}
if (!NT_SUCCESS (status))
{
- debug_printf ("NtFsControlFile(FSCTL_GET_REPARSE_POINT) failed, %p",
+ debug_printf ("NtFsControlFile(FSCTL_GET_REPARSE_POINT) failed, %y",
status);
set_error (EIO);
return 0;
@@ -2412,7 +2521,7 @@ restart:
FILE_OPEN_REPARSE_POINT
| FILE_OPEN_FOR_BACKUP_INTENT,
eabuf, easize);
- debug_printf ("%p = NtCreateFile (%S)", status, &upath);
+ debug_printf ("%y = NtCreateFile (%S)", status, &upath);
/* No right to access EAs or EAs not supported? */
if (!NT_SUCCESS (status)
&& (status == STATUS_ACCESS_DENIED
@@ -2435,7 +2544,7 @@ restart:
&attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_REPARSE_POINT
| FILE_OPEN_FOR_BACKUP_INTENT);
- debug_printf ("%p = NtOpenFile (no-EAs %S)", status, &upath);
+ debug_printf ("%y = NtOpenFile (no-EAs %S)", status, &upath);
}
if (status == STATUS_OBJECT_NAME_NOT_FOUND)
{
@@ -2451,7 +2560,7 @@ restart:
&attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_REPARSE_POINT
| FILE_OPEN_FOR_BACKUP_INTENT);
- debug_printf ("%p = NtOpenFile (broken-UDF, %S)", status, &upath);
+ debug_printf ("%y = NtOpenFile (broken-UDF, %S)", status, &upath);
attr.Attributes = 0;
if (NT_SUCCESS (status))
{
@@ -2504,6 +2613,22 @@ restart:
}
}
}
+ else if (status == STATUS_NETWORK_OPEN_RESTRICTION
+ || status == STATUS_SYMLINK_CLASS_DISABLED)
+ {
+ /* These status codes are returned if you try to open a native
+ symlink and the usage of this kind of symlink is forbidden
+ (see fsutil). Since we can't open them at all, not even for
+ stat purposes, we have to return a POSIX error code which is
+ at least a bit helpful.
+
+ Additionally Windows 8 introduces a bug in NFS: If you have
+ a symlink to a directory, with symlinks underneath, resolving
+ the second level of symlinks fails if remote->remote symlinks
+ are disabled in fsutil. Unfortunately that's the default. */
+ set_error (ELOOP);
+ break;
+ }
if (NT_SUCCESS (status)
/* Check file system while we're having the file open anyway.
@@ -2526,7 +2651,7 @@ restart:
}
if (!NT_SUCCESS (status))
{
- debug_printf ("%p = NtQueryInformationFile (%S)", status, &upath);
+ debug_printf ("%y = NtQueryInformationFile (%S)", status, &upath);
fileattr = INVALID_FILE_ATTRIBUTES;
/* One of the inner path components is invalid, or the path contains
@@ -2559,7 +2684,7 @@ restart:
OBJECT_ATTRIBUTES dattr;
HANDLE dir;
struct {
- FILE_BOTH_DIRECTORY_INFORMATION fdi;
+ FILE_BOTH_DIR_INFORMATION fdi;
WCHAR dummy_buf[NAME_MAX + 1];
} fdi_buf;
@@ -2573,7 +2698,7 @@ restart:
| FILE_DIRECTORY_FILE);
if (!NT_SUCCESS (status))
{
- debug_printf ("%p = NtOpenFile(%S)", status, &dirname);
+ debug_printf ("%y = NtOpenFile(%S)", status, &dirname);
/* There's a special case if the file is itself the root
of a drive which is not accessible by the current user.
This case is only recognized by the length of the
@@ -2593,7 +2718,7 @@ restart:
NtClose (dir);
if (!NT_SUCCESS (status))
{
- debug_printf ("%p = NtQueryDirectoryFile(%S)",
+ debug_printf ("%y = NtQueryDirectoryFile(%S)",
status, &dirname);
if (status == STATUS_NO_SUCH_FILE)
{
@@ -2771,7 +2896,7 @@ restart:
NtClose (h);
}
- syscall_printf ("%d = symlink.check(%s, %p) (%p)",
+ syscall_printf ("%d = symlink.check(%s, %p) (%y)",
res, suffix.path, contents, pflags);
return res;
}
@@ -2809,7 +2934,7 @@ readlink (const char *path, char *buf, size_t buflen)
if (pathbuf.error)
{
set_errno (pathbuf.error);
- syscall_printf ("-1 = readlink (%s, %p, %d)", path, buf, buflen);
+ syscall_printf ("-1 = readlink (%s, %p, %lu)", path, buf, buflen);
return -1;
}
@@ -2841,8 +2966,8 @@ readlink (const char *path, char *buf, size_t buflen)
done during the opendir call and the hash or the filename within
the directory. FIXME: Not bullet-proof. */
/* Cygwin internal */
-__ino64_t __stdcall
-hash_path_name (__ino64_t hash, PUNICODE_STRING name)
+ino_t __reg2
+hash_path_name (ino_t hash, PUNICODE_STRING name)
{
if (name->Length == 0)
return hash;
@@ -2855,20 +2980,20 @@ hash_path_name (__ino64_t hash, PUNICODE_STRING name)
return hash;
}
-__ino64_t __stdcall
-hash_path_name (__ino64_t hash, PCWSTR name)
+ino_t __reg2
+hash_path_name (ino_t hash, PCWSTR name)
{
UNICODE_STRING uname;
RtlInitUnicodeString (&uname, name);
return hash_path_name (hash, &uname);
}
-__ino64_t __stdcall
-hash_path_name (__ino64_t hash, const char *name)
+ino_t __reg2
+hash_path_name (ino_t hash, const char *name)
{
UNICODE_STRING uname;
RtlCreateUnicodeStringFromAsciiz (&uname, name);
- __ino64_t ret = hash_path_name (hash, &uname);
+ ino_t ret = hash_path_name (hash, &uname);
RtlFreeUnicodeString (&uname);
return ret;
}
@@ -2899,7 +3024,7 @@ get_current_dir_name (void)
{
const char *pwd = getenv ("PWD");
char *cwd = getcwd (NULL, 0);
- struct __stat64 pwdbuf, cwdbuf;
+ struct stat pwdbuf, cwdbuf;
if (pwd && strcmp (pwd, cwd) != 0
&& stat64 (pwd, &pwdbuf) == 0
@@ -2941,7 +3066,7 @@ chdir (const char *in_dir)
int res = -1;
const char *posix_cwd = NULL;
- int devn = path.get_devn ();
+ dev_t devn = path.get_device ();
if (!path.exists ())
set_errno (ENOENT);
else if (!path.isdir ())
@@ -3177,6 +3302,7 @@ cygwin_create_path (cygwin_conv_path_t what, const void *from)
return to;
}
+#ifndef __x86_64__ /* Disable deprecated functions on x86_64. */
extern "C" int
cygwin_conv_to_win32_path (const char *path, char *win32_path)
@@ -3208,6 +3334,8 @@ cygwin_conv_to_full_posix_path (const char *path, char *posix_path)
MAX_PATH);
}
+#endif /* !__x86_64__ */
+
/* The realpath function is required by POSIX:2008. */
extern "C" char *
@@ -3344,6 +3472,14 @@ conv_path_list_buf_size (const char *path_list, bool to_posix)
return size;
}
+extern "C" ssize_t
+env_PATH_to_posix (const void *win32, void *posix, size_t size)
+{
+ return_with_errno (conv_path_list ((const char *) win32, (char *) posix,
+ size, ENV_CVT));
+}
+
+#ifndef __x86_64__ /* Disable deprecated functions on x86_64. */
extern "C" int
cygwin_win32_to_posix_path_list_buf_size (const char *path_list)
@@ -3357,13 +3493,6 @@ cygwin_posix_to_win32_path_list_buf_size (const char *path_list)
return conv_path_list_buf_size (path_list, false);
}
-extern "C" ssize_t
-env_PATH_to_posix (const void *win32, void *posix, size_t size)
-{
- return_with_errno (conv_path_list ((const char *) win32, (char *) posix,
- size, ENV_CVT));
-}
-
extern "C" int
cygwin_win32_to_posix_path_list (const char *win32, char *posix)
{
@@ -3378,6 +3507,8 @@ cygwin_posix_to_win32_path_list (const char *posix, char *win32)
CCP_POSIX_TO_WIN_A | CCP_RELATIVE));
}
+#endif /* !__x86_64__ */
+
extern "C" ssize_t
cygwin_conv_path_list (cygwin_conv_path_t what, const void *from, void *to,
size_t size)
@@ -3385,7 +3516,6 @@ cygwin_conv_path_list (cygwin_conv_path_t what, const void *from, void *to,
int ret;
char *winp = NULL;
void *orig_to = NULL;
- size_t orig_size = (size_t) -1;
tmp_pathbuf tp;
switch (what & CCP_CONVTYPE_MASK)
@@ -3403,7 +3533,6 @@ cygwin_conv_path_list (cygwin_conv_path_t what, const void *from, void *to,
* sizeof (WCHAR);
what = (what & ~CCP_CONVTYPE_MASK) | CCP_POSIX_TO_WIN_A;
orig_to = to;
- orig_size = size;
to = (void *) tp.w_get ();
size = 65536;
break;
@@ -3685,8 +3814,6 @@ fcwd_access_t::SetVersionFromPointer (PBYTE buf_p, bool is_buffer)
fast_cwd_version () = FCWD_OLD;
}
-#define peek32(x) (*(uint32_t *)(x))
-
/* This function scans the code in ntdll.dll to find the address of the
global variable used to access the CWD starting with Vista. While the
pointer is global, it's not exported from the DLL, unfortunately.
@@ -3696,6 +3823,99 @@ fcwd_access_t::SetVersionFromPointer (PBYTE buf_p, bool is_buffer)
Windows 7 32/64 bit, Server 2008 R2 (which is only 64 bit anyway),
and W8CP 32/64 bit. There's some hope this will still work for
Windows 8 RTM... */
+
+#ifdef __x86_64__
+
+#define peek32(x) (*(int32_t *)(x))
+
+static fcwd_access_t **
+find_fast_cwd_pointer ()
+{
+ /* Fetch entry points of relevant functions in ntdll.dll. */
+ HMODULE ntdll = GetModuleHandle ("ntdll.dll");
+ if (!ntdll)
+ return NULL;
+ const uint8_t *get_dir = (const uint8_t *)
+ GetProcAddress (ntdll, "RtlGetCurrentDirectory_U");
+ const uint8_t *ent_crit = (const uint8_t *)
+ GetProcAddress (ntdll, "RtlEnterCriticalSection");
+ if (!get_dir || !ent_crit)
+ return NULL;
+ /* Search first relative call instruction in RtlGetCurrentDirectory_U. */
+ const uint8_t *rcall = (const uint8_t *) memchr (get_dir, 0xe8, 40);
+ if (!rcall)
+ return NULL;
+ /* Fetch offset from instruction and compute address of called function.
+ This function actually fetches the current FAST_CWD instance and
+ performs some other actions, not important to us. */
+ const uint8_t *use_cwd = rcall + 5 + peek32 (rcall + 1);
+ /* Next we search for the locking mechanism and perform a sanity check.
+ On Pre-Windows 8 we basically look for the RtlEnterCriticalSection call.
+ Windows 8 does not call RtlEnterCriticalSection. The code manipulates
+ the FastPebLock manually, probably because RtlEnterCriticalSection has
+ been converted to an inline function. Either way, we test if the code
+ uses the FastPebLock. */
+ const uint8_t *movrbx;
+ const uint8_t *lock = (const uint8_t *)
+ memmem ((const char *) use_cwd, 80,
+ "\xf0\x0f\xba\x35", 4);
+ if (lock)
+ {
+ /* The lock instruction tweaks the LockCount member, which is not at
+ the start of the PRTL_CRITICAL_SECTION structure. So we have to
+ subtract the offset of LockCount to get the real address. */
+ PRTL_CRITICAL_SECTION lockaddr =
+ (PRTL_CRITICAL_SECTION) (lock + 9 + peek32 (lock + 4)
+ - offsetof (RTL_CRITICAL_SECTION, LockCount));
+ /* Test if lock address is FastPebLock. */
+ if (lockaddr != NtCurrentTeb ()->Peb->FastPebLock)
+ return NULL;
+ /* Search `mov rbx, rel(rip)'. This is the instruction fetching the
+ address of the current fcwd_access_t pointer, and it should be pretty
+ near to the locking stuff. */
+ movrbx = (const uint8_t *) memmem ((const char *) lock, 40,
+ "\x48\x8b\x1d", 3);
+ }
+ else
+ {
+ /* Search lea rcx, rel(rip). This loads the address of the lock into
+ $rcx for the subsequent RtlEnterCriticalSection call. */
+ lock = (const uint8_t *) memmem ((const char *) use_cwd, 80,
+ "\x48\x8d\x0d", 3);
+ if (!lock)
+ return NULL;
+ PRTL_CRITICAL_SECTION lockaddr =
+ (PRTL_CRITICAL_SECTION) (lock + 7 + peek32 (lock + 3));
+ /* Test if lock address is FastPebLock. */
+ if (lockaddr != NtCurrentTeb ()->Peb->FastPebLock)
+ return NULL;
+ /* Next is the call RtlEnterCriticalSection. */
+ lock += 7;
+ if (lock[0] != 0xe8)
+ return NULL;
+ const uint8_t *call_addr = (const uint8_t *)
+ (lock + 5 + peek32 (lock + 1));
+ if (call_addr != ent_crit)
+ return NULL;
+ /* In contrast to the above Windows 8 code, we don't have to search
+ for the `mov rbx, rel(rip)' instruction. It follows right after
+ the call to RtlEnterCriticalSection. */
+ movrbx = lock + 5;
+ }
+ if (!movrbx)
+ return NULL;
+ /* Check that the next instruction tests if the fetched value is NULL. */
+ const uint8_t *testrbx = (const uint8_t *)
+ memmem (movrbx + 7, 3, "\x48\x85\xdb", 3);
+ if (!testrbx)
+ return NULL;
+ /* Compute address of the fcwd_access_t ** pointer. */
+ return (fcwd_access_t **) (testrbx + peek32 (movrbx + 3));
+}
+#else
+
+#define peek32(x) (*(uint32_t *)(x))
+
static fcwd_access_t **
find_fast_cwd_pointer ()
{
@@ -3726,9 +3946,8 @@ find_fast_cwd_pointer ()
const uint8_t *mov_pfast_cwd;
if (movedi[0] == 0x8b && movedi[1] == 0xff) /* mov edi,edi -> W8 */
{
- /* Windows 8 CP 32 bit (after a Windows Update?) does not call
- RtlEnterCriticalSection. For some reason the function manipulates
- the FastPebLock manually, kind of like RtlEnterCriticalSection has
+ /* Windows 8 does not call RtlEnterCriticalSection. The code manipulates
+ the FastPebLock manually, probably because RtlEnterCriticalSection has
been converted to an inline function.
Next we search for a `mov eax, some address'. This address points
@@ -3782,6 +4001,7 @@ find_fast_cwd_pointer ()
return NULL;
return (fcwd_access_t **) peek32 (mov_pfast_cwd + 2);
}
+#endif
static fcwd_access_t **
find_fast_cwd ()
@@ -3906,7 +4126,7 @@ cwdstuff::override_win32_cwd (bool init, ULONG old_dismount_count)
RtlSetCurrentDirectory_U (error ? &ro_u_pipedir : &win32);
if (!NT_SUCCESS (status))
{
- debug_printf ("RtlSetCurrentDirectory_U(%S) failed, %p",
+ debug_printf ("RtlSetCurrentDirectory_U(%S) failed, %y",
error ? &ro_u_pipedir : &win32, status);
return;
}
@@ -4276,7 +4496,7 @@ cwdstuff::get (char *buf, int need_posix, int with_chroot, unsigned ulen)
cwd_lock.release ();
out:
- syscall_printf ("(%s) = cwdstuff::get (%p, %d, %d, %d), errno %d",
+ syscall_printf ("(%s) = cwdstuff::get (%p, %u, %d, %d), errno %d",
buf, buf, ulen, need_posix, with_chroot, errno);
MALLOC_CHECK;
return buf;
@@ -4317,7 +4537,7 @@ etc::test_file_change (int n)
{
res = true;
memset (last_modified + n, 0, sizeof (last_modified[n]));
- debug_printf ("NtQueryFullAttributesFile (%S) failed, %p",
+ debug_printf ("NtQueryFullAttributesFile (%S) failed, %y",
fn[n].ObjectName, status);
}
else
@@ -4355,7 +4575,7 @@ etc::dir_changed (int n)
if (!NT_SUCCESS (status))
{
#ifdef DEBUGGING
- system_printf ("NtOpenFile (%S) failed, %p",
+ system_printf ("NtOpenFile (%S) failed, %y",
dir.get_nt_native_path (), status);
#endif
changed_h = INVALID_HANDLE_VALUE;
@@ -4370,7 +4590,7 @@ etc::dir_changed (int n)
if (!NT_SUCCESS (status))
{
#ifdef DEBUGGING
- system_printf ("NtNotifyChangeDirectoryFile (1) failed, %p",
+ system_printf ("NtNotifyChangeDirectoryFile (1) failed, %y",
status);
#endif
NtClose (changed_h);
@@ -4392,7 +4612,7 @@ etc::dir_changed (int n)
if (!NT_SUCCESS (status))
{
#ifdef DEBUGGING
- system_printf ("NtNotifyChangeDirectoryFile (2) failed, %p",
+ system_printf ("NtNotifyChangeDirectoryFile (2) failed, %y",
status);
#endif
NtClose (changed_h);
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index b9d7defbc..090754a02 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -80,11 +80,15 @@ enum path_types
PATH_NO_ACCESS_CHECK = PC_NO_ACCESS_CHECK,
PATH_CTTY = 0x00400000, /* could later be used as ctty */
PATH_OPEN = 0x00800000, /* use open semantics */
+ /* FIXME? PATH_OPEN collides with
+ PATH_NO_ACCESS_CHECK, but it looks
+ like they are never used together. */
PATH_LNK = 0x01000000,
PATH_TEXT = 0x02000000,
PATH_REP = 0x04000000,
PATH_HAS_SYMLINKS = 0x10000000,
- PATH_SOCKET = 0x40000000
+ PATH_SOCKET = 0x40000000,
+ PATH_64BITEXEC = 0x80000000
};
class symlink_info;
@@ -153,7 +157,7 @@ class path_conv
ULONG objcaseinsensitive () const {return caseinsensitive;}
bool has_acls () const {return !(path_flags & PATH_NOACL) && fs.has_acls (); }
bool hasgood_inode () const {return !(path_flags & PATH_IHASH); }
- bool isgood_inode (__ino64_t ino) const;
+ bool isgood_inode (ino_t ino) const;
bool support_sparse () const
{
return (path_flags & PATH_SPARSE)
@@ -186,6 +190,12 @@ class path_conv
int is_lnk_special () const {return is_fs_device () || isfifo () || is_lnk_symlink ();}
int issocket () const {return dev.is_device (FH_UNIX);}
int iscygexec () const {return path_flags & PATH_CYGWIN_EXEC;}
+ int iscygexec32 () const
+ {return (path_flags & (PATH_CYGWIN_EXEC | PATH_64BITEXEC))
+ == PATH_CYGWIN_EXEC;}
+ int iscygexec64 () const
+ {return (path_flags & (PATH_CYGWIN_EXEC | PATH_64BITEXEC))
+ == (PATH_CYGWIN_EXEC | PATH_64BITEXEC);}
int isopen () const {return path_flags & PATH_OPEN;}
int isctty_capable () const {return path_flags & PATH_CTTY;}
void set_cygexec (bool isset)
@@ -195,6 +205,17 @@ class path_conv
else
path_flags &= ~PATH_CYGWIN_EXEC;
}
+ void set_cygexec (void *target)
+ {
+ if (target)
+ {
+ path_flags |= PATH_CYGWIN_EXEC;
+ if (target == (void *) 64)
+ path_flags |= PATH_64BITEXEC;
+ }
+ else
+ path_flags &= ~PATH_CYGWIN_EXEC;
+ }
bool isro () const {return !!(path_flags & PATH_RO);}
bool exists () const {return fileattr != INVALID_FILE_ATTRIBUTES;}
bool has_attribute (DWORD x) const {return exists () && (fileattr & x);}
@@ -344,8 +365,7 @@ class path_conv
{
return eq_worker (pc, pc.path, pc.normalized_path);
}
- DWORD get_devn () {return (DWORD) dev;}
- short get_unitn () const {return dev.get_minor ();}
+ dev_t get_device () {return dev.get_device ();}
DWORD file_attributes () const {return fileattr;}
void file_attributes (DWORD new_attr) {fileattr = new_attr;}
DWORD fs_flags () const {return fs.flags ();}
@@ -362,6 +382,7 @@ class path_conv
bool fs_is_cifs () const {return fs.is_cifs ();}
bool fs_is_nwfs () const {return fs.is_nwfs ();}
bool fs_is_ncfsd () const {return fs.is_ncfsd ();}
+ bool fs_is_afs () const {return fs.is_afs ();}
fs_info_type fs_type () const {return fs.what_fs ();}
ULONG fs_serial_number () const {return fs.serial_number ();}
inline const char *set_path (const char *p)
@@ -380,7 +401,7 @@ class path_conv
void reset_conv_handle () { conv_handle.set (NULL); }
void close_conv_handle () { conv_handle.close (); }
- __ino64_t get_ino_by_handle (HANDLE h);
+ ino_t get_ino_by_handle (HANDLE h);
#if 0 /* obsolete, method still exists in fhandler_disk_file.cc */
unsigned __stdcall ndisk_links (DWORD);
#endif
@@ -453,3 +474,5 @@ class etc
static bool test_file_change (int);
friend class pwdgrp;
};
+
+int __reg3 symlink_worker (const char *, const char *, bool);
diff --git a/winsup/cygwin/perprocess.h b/winsup/cygwin/perprocess.h
index c0a555983..13cf17716 100644
--- a/winsup/cygwin/perprocess.h
+++ b/winsup/cygwin/perprocess.h
@@ -1,6 +1,6 @@
/* per_process.h: main Cygwin header file.
- Copyright 2000, 2001 Red Hat, Inc.
+ Copyright 2000, 2001, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -21,7 +21,11 @@ extern struct per_process __cygwin_user_data;
/* We use the following to test that sizeof hasn't changed. When adding
or deleting members, insert fillers or use the reserved entries.
Do not change this value. */
+#ifdef __x86_64__
+#define SIZEOF_PER_PROCESS (41 * 8)
+#else
#define SIZEOF_PER_PROCESS (42 * 4)
+#endif
#ifdef __cplusplus
}
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 79eb25e01..51d01322c 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -120,7 +120,7 @@ pinfo::status_exit (DWORD x)
char posix_prog[NT_MAX_PATH];
path_conv pc;
if (!procinfo)
- pc.check ("/dev/null");
+ pc.check ("/dev/null");
else
{
UNICODE_STRING uc;
@@ -128,7 +128,8 @@ pinfo::status_exit (DWORD x)
pc.check (&uc, PC_NOWARN);
}
mount_table->conv_to_posix_path (pc.get_win32 (), posix_prog, 1);
- small_printf ("%s: error while loading shared libraries: %s: cannot open shared object file: No such file or directory\n",
+ small_printf ("%s: error while loading shared libraries: %s: cannot "
+ "open shared object file: No such file or directory\n",
posix_prog, find_first_notloaded_dll (pc));
x = 127 << 8;
}
@@ -143,8 +144,21 @@ pinfo::status_exit (DWORD x)
case STATUS_ILLEGAL_INSTRUCTION:
x = SIGILL;
break;
+ case STATUS_NO_MEMORY:
+ /* If the PATH environment variable is longer than about 30K and the full
+ Windows environment is > 32K, startup of an exec'ed process fails with
+ STATUS_NO_MEMORY. This happens with all Cygwin executables, as well
+ as, for instance, notepad, but it does not happen with CMD for some
+ reason (but note, the environment *in* CMD is broken and shortened).
+ This occurs at a point where there's no return to the exec'ing parent
+ process, so we have to find some way to inform the user what happened.
+
+ FIXME: For now, just return with SIGBUS set. Maybe it's better to add
+ a lengthy small_printf instead. */
+ x = SIGBUS;
+ break;
default:
- debug_printf ("*** STATUS_%p\n", x);
+ debug_printf ("*** STATUS_%y\n", x);
x = 127 << 8;
}
return EXITCODE_SET | x;
@@ -174,7 +188,7 @@ pinfo::maybe_set_exit_code_from_windows ()
GetExitCodeProcess (hProcess, &x);
set_exit_code (x);
}
- sigproc_printf ("pid %d, exit value - old %p, windows %p, cygwin %p",
+ sigproc_printf ("pid %d, exit value - old %y, windows %y, cygwin %y",
self->pid, oexitcode, x, self->exitcode);
}
@@ -208,7 +222,7 @@ pinfo::exit (DWORD n)
int exitcode = self->exitcode & 0xffff;
if (!self->cygstarted)
exitcode = ((exitcode & 0xff) << 8) | ((exitcode >> 8) & 0xff);
- sigproc_printf ("Calling ExitProcess n %p, exitcode %p", n, exitcode);
+ sigproc_printf ("Calling ExitProcess n %y, exitcode %y", n, exitcode);
if (!TerminateProcess (GetCurrentProcess (), exitcode))
system_printf ("TerminateProcess failed, %E");
ExitProcess (exitcode);
@@ -324,7 +338,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
if (procinfo->process_state & PID_EXECED)
{
pid_t realpid = procinfo->pid;
- debug_printf ("execed process windows pid %d, cygwin pid %d", n, realpid);
+ debug_printf ("execed process windows pid %u, cygwin pid %d", n, realpid);
if (realpid == n)
api_fatal ("retrieval of execed process info for pid %d failed due to recursion.", n);
@@ -389,9 +403,9 @@ pinfo::set_acl()
RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
status = RtlSetDaclSecurityDescriptor (&sd, TRUE, acl_buf, FALSE);
if (!NT_SUCCESS (status))
- debug_printf ("RtlSetDaclSecurityDescriptor %p", status);
+ debug_printf ("RtlSetDaclSecurityDescriptor %y", status);
else if ((status = NtSetSecurityObject (h, DACL_SECURITY_INFORMATION, &sd)))
- debug_printf ("NtSetSecurityObject %p", status);
+ debug_printf ("NtSetSecurityObject %y", status);
}
pinfo::pinfo (HANDLE parent, pinfo_minimal& from, pid_t pid):
@@ -441,7 +455,7 @@ bool
_pinfo::set_ctty (fhandler_termios *fh, int flags)
{
tty_min& tc = *fh->tc ();
- debug_printf ("old %s, ctty device number %p, tc.ntty device number %p flags & O_NOCTTY %p", __ctty (), ctty, tc.ntty, flags & O_NOCTTY);
+ debug_printf ("old %s, ctty device number %y, tc.ntty device number %y flags & O_NOCTTY %y", __ctty (), ctty, tc.ntty, flags & O_NOCTTY);
if (fh && &tc && (ctty <= 0 || ctty == tc.ntty) && !(flags & O_NOCTTY))
{
ctty = tc.ntty;
@@ -491,7 +505,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags)
/* Test to determine if a process really exists and is processing signals.
*/
-bool __stdcall
+bool __reg1
_pinfo::exists ()
{
return this && process_state && !(process_state & (PID_EXITED | PID_REAPED | PID_EXECED));
@@ -641,7 +655,7 @@ commune_process (void *arg)
{
DWORD res = WaitForSingleObject (process_sync, 5000);
if (res != WAIT_OBJECT_0)
- sigproc_printf ("WFSO failed - %d, %E", res);
+ sigproc_printf ("WFSO failed - %u, %E", res);
else
sigproc_printf ("synchronized with pid %d", si.si_pid);
ForceCloseHandle (process_sync);
@@ -688,7 +702,7 @@ _pinfo::commune_request (__uint32_t code, ...)
va_end (args);
char name_buf[MAX_PATH];
- request_sync = CreateSemaphore (&sec_none_nih, 0, LONG_MAX,
+ request_sync = CreateSemaphore (&sec_none_nih, 0, INT32_MAX,
shared_name (name_buf, "commune", myself->pid));
if (!request_sync)
goto err;
@@ -702,7 +716,7 @@ _pinfo::commune_request (__uint32_t code, ...)
goto err;
}
- size_t n;
+ DWORD n;
switch (code)
{
case PICOM_CMDLINE:
@@ -711,7 +725,7 @@ _pinfo::commune_request (__uint32_t code, ...)
case PICOM_FDS:
case PICOM_FD:
case PICOM_PIPE_FHANDLER:
- if (!ReadPipeOverlapped (fromthem, &n, sizeof n, &nr, 500L)
+ if (!ReadPipeOverlapped (fromthem, &n, sizeof n, &nr, 1000L)
|| nr != sizeof n)
{
__seterrno ();
@@ -724,7 +738,7 @@ _pinfo::commune_request (__uint32_t code, ...)
res.s = (char *) cmalloc_abort (HEAP_COMMUNE, n);
char *p;
for (p = res.s;
- n && ReadPipeOverlapped (fromthem, p, n, &nr, 500L);
+ n && ReadPipeOverlapped (fromthem, p, n, &nr, 1000L);
p += nr, n -= nr)
continue;
if (n)
@@ -999,7 +1013,7 @@ pinfo::wait ()
else
{
wait_thread = h;
- sigproc_printf ("created tracking thread for pid %d, winpid %p, rd_proc_pipe %p",
+ sigproc_printf ("created tracking thread for pid %d, winpid %y, rd_proc_pipe %p",
(*this)->pid, (*this)->dwProcessId, rd_proc_pipe);
}
@@ -1254,11 +1268,11 @@ winpids::enum_processes (bool winpid)
if (winpid)
{
static DWORD szprocs;
- static PSYSTEM_PROCESSES procs;
+ static PSYSTEM_PROCESS_INFORMATION procs;
if (!szprocs)
{
- procs = (PSYSTEM_PROCESSES)
+ procs = (PSYSTEM_PROCESS_INFORMATION)
malloc (sizeof (*procs) + (szprocs = 200 * sizeof (*procs)));
if (!procs)
{
@@ -1271,16 +1285,16 @@ winpids::enum_processes (bool winpid)
for (;;)
{
status =
- NtQuerySystemInformation (SystemProcessesAndThreadsInformation,
+ NtQuerySystemInformation (SystemProcessInformation,
procs, szprocs, NULL);
if (NT_SUCCESS (status))
break;
if (status == STATUS_INFO_LENGTH_MISMATCH)
{
- PSYSTEM_PROCESSES new_p;
+ PSYSTEM_PROCESS_INFORMATION new_p;
- new_p = (PSYSTEM_PROCESSES)
+ new_p = (PSYSTEM_PROCESS_INFORMATION)
realloc (procs, szprocs += 200 * sizeof (*procs));
if (!new_p)
{
@@ -1292,30 +1306,30 @@ winpids::enum_processes (bool winpid)
}
else
{
- system_printf ("error %p reading system process information",
+ system_printf ("error %y reading system process information",
status);
return 0;
}
}
- PSYSTEM_PROCESSES px = procs;
+ PSYSTEM_PROCESS_INFORMATION px = procs;
for (;;)
{
- if (px->ProcessId)
+ if (px->UniqueProcessId)
{
bool do_add = true;
for (unsigned i = 0; i < cygwin_pid_nelem; ++i)
- if (pidlist[i] == px->ProcessId)
+ if (pidlist[i] == (uintptr_t) px->UniqueProcessId)
{
do_add = false;
break;
}
if (do_add)
- add (nelem, true, px->ProcessId);
+ add (nelem, true, (DWORD) (uintptr_t) px->UniqueProcessId);
}
- if (!px->NextEntryDelta)
+ if (!px->NextEntryOffset)
break;
- px = (PSYSTEM_PROCESSES) ((char *) px + px->NextEntryDelta);
+ px = (PSYSTEM_PROCESS_INFORMATION) ((char *) px + px->NextEntryOffset);
}
}
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h
index 2f97dcb90..0a13c4bf8 100644
--- a/winsup/cygwin/pinfo.h
+++ b/winsup/cygwin/pinfo.h
@@ -17,7 +17,7 @@ details. */
struct commune_result
{
char *s;
- int n;
+ DWORD n;
HANDLE handles[2];
};
@@ -78,11 +78,11 @@ public:
if not found. This data resides in the shared data area (allowing
tasks to store whatever they want here) so it's for informational
purposes only. */
- __uid32_t uid; /* User ID */
- __gid32_t gid; /* Group ID */
- pid_t pgid; /* Process group ID */
- pid_t sid; /* Session ID */
- int ctty; /* Control tty */
+ uid_t uid; /* User ID */
+ gid_t gid; /* Group ID */
+ pid_t pgid; /* Process group ID */
+ pid_t sid; /* Session ID */
+ int ctty; /* Control tty */
bool has_pgid_children;/* True if we've forked or spawned children with our GID. */
/* Resources used by process. */
@@ -110,6 +110,7 @@ public:
char *root (size_t &);
char *cwd (size_t &);
char *cmdline (size_t &);
+ char *win_heap_info (size_t &);
bool set_ctty (class fhandler_termios *, int);
bool alert_parent (char);
int __reg2 kill (siginfo_t&);
@@ -178,9 +179,9 @@ public:
int operator == (pinfo &x) const {return x.procinfo == procinfo;}
int operator == (_pinfo *x) const {return x == procinfo;}
int operator == (void *x) const {return procinfo == x;}
- int operator == (int x) const {return (int) procinfo == (int) x;}
_pinfo *operator * () const {return procinfo;}
operator _pinfo * () const {return procinfo;}
+ int operator !() const {return !procinfo;}
void preserve () { destroy = false; }
void allow_remove () { destroy = true; }
#ifndef SIG_BAD_MASK // kludge to ensure that sigproc.h included
@@ -189,14 +190,14 @@ public:
#else
int reattach ()
{
- int res = proc_subproc (PROC_REATTACH_CHILD, (DWORD) this);
+ int res = proc_subproc (PROC_REATTACH_CHILD, (uintptr_t) this);
destroy = res ? false : true;
return res;
}
int remember (bool detach)
{
int res = proc_subproc (detach ? PROC_DETACHED_CHILD : PROC_ADDCHILD,
- (DWORD) this);
+ (uintptr_t) this);
destroy = res ? false : true;
return res;
}
diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc
index 4a420ea32..9159dddb0 100644
--- a/winsup/cygwin/pipe.cc
+++ b/winsup/cygwin/pipe.cc
@@ -1,7 +1,7 @@
/* pipe.cc: pipe for Cygwin.
Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012 Hat, Inc.
+ 2008, 2009, 2010, 2011, 2012, 2013 Hat, Inc.
This file is part of Cygwin.
@@ -72,7 +72,8 @@ fhandler_pipe::open (int flags, mode_t mode)
int pid, rwflags = (flags & O_ACCMODE);
bool inh;
- sscanf (get_name (), "/proc/%d/fd/pipe:[%d]", &pid, (int *) &pipe_hdl);
+ sscanf (get_name (), "/proc/%d/fd/pipe:[%lu]",
+ &pid, (unsigned long *) &pipe_hdl);
if (pid == myself->pid)
{
cygheap_fdenum cfd (true);
@@ -142,23 +143,23 @@ out:
return 0;
}
-_off64_t
-fhandler_pipe::lseek (_off64_t offset, int whence)
+off_t
+fhandler_pipe::lseek (off_t offset, int whence)
{
- debug_printf ("(%d, %d)", offset, whence);
+ debug_printf ("(%D, %d)", offset, whence);
set_errno (ESPIPE);
return -1;
}
int
-fhandler_pipe::fadvise (_off64_t offset, _off64_t length, int advice)
+fhandler_pipe::fadvise (off_t offset, off_t length, int advice)
{
set_errno (ESPIPE);
return -1;
}
int
-fhandler_pipe::ftruncate (_off64_t length, bool allow_truncate)
+fhandler_pipe::ftruncate (off_t length, bool allow_truncate)
{
set_errno (allow_truncate ? EINVAL : ESPIPE);
return -1;
@@ -167,7 +168,7 @@ fhandler_pipe::ftruncate (_off64_t length, bool allow_truncate)
char *
fhandler_pipe::get_proc_fd_name (char *buf)
{
- __small_sprintf (buf, "pipe:[%d]", get_handle ());
+ __small_sprintf (buf, "pipe:[%lu]", get_handle ());
return buf;
}
@@ -213,7 +214,9 @@ fhandler_pipe::create (LPSECURITY_ATTRIBUTES sa_ptr, PHANDLE r, PHANDLE w,
char pipename[MAX_PATH];
size_t len = __small_sprintf (pipename, PIPE_INTRO "%S-",
&cygheap->installation_key);
- DWORD pipe_mode = PIPE_READMODE_BYTE;
+ DWORD pipe_mode = PIPE_READMODE_BYTE
+ | (wincap.has_pipe_reject_remote_clients ()
+ ? PIPE_REJECT_REMOTE_CLIENTS : 0);
if (!name)
pipe_mode |= pipe_byte ? PIPE_TYPE_BYTE : PIPE_TYPE_MESSAGE;
else
@@ -228,7 +231,7 @@ fhandler_pipe::create (LPSECURITY_ATTRIBUTES sa_ptr, PHANDLE r, PHANDLE w,
if (name)
len += __small_sprintf (pipename + len, "%s", name);
- open_mode |= PIPE_ACCESS_INBOUND;
+ open_mode |= PIPE_ACCESS_INBOUND | FILE_FLAG_FIRST_PIPE_INSTANCE;
/* Retry CreateNamedPipe as long as the pipe name is in use.
Retrying will probably never be necessary, but we want
@@ -241,7 +244,7 @@ fhandler_pipe::create (LPSECURITY_ATTRIBUTES sa_ptr, PHANDLE r, PHANDLE w,
__small_sprintf (pipename + len, "pipe-%p",
InterlockedIncrement ((LONG *) &pipe_unique_id));
- debug_printf ("name %s, size %lu, mode %s", pipename, psize,
+ debug_printf ("name %s, size %u, mode %s", pipename, psize,
(pipe_mode & PIPE_TYPE_MESSAGE)
? "PIPE_TYPE_MESSAGE" : "PIPE_TYPE_BYTE");
@@ -252,8 +255,7 @@ fhandler_pipe::create (LPSECURITY_ATTRIBUTES sa_ptr, PHANDLE r, PHANDLE w,
a waste, since only a single direction is actually used.
It's important to only allow a single instance, to ensure that
the pipe was not created earlier by some other process, even if
- the pid has been reused. We avoid FILE_FLAG_FIRST_PIPE_INSTANCE
- because that is only available for Win2k SP2 and WinXP.
+ the pid has been reused.
Note that the write side of the pipe is opened as PIPE_TYPE_MESSAGE.
This *seems* to more closely mimic Linux pipe behavior and is
@@ -361,7 +363,7 @@ fhandler_pipe::create (fhandler_pipe *fhs[2], unsigned psize, int mode)
res = 0;
}
- debug_printf ("%R = pipe([%p, %p], %d, %p)", res, fhs[0], fhs[1], psize, mode);
+ debug_printf ("%R = pipe([%p, %p], %d, %y)", res, fhs[0], fhs[1], psize, mode);
return res;
}
@@ -392,7 +394,7 @@ fhandler_pipe::ioctl (unsigned int cmd, void *p)
return 0;
}
-int __stdcall
+int __reg2
fhandler_pipe::fstatvfs (struct statvfs *sfs)
{
set_errno (EBADF);
@@ -433,7 +435,7 @@ _pipe (int filedes[2], unsigned int psize, int mode)
read = filedes[0];
write = filedes[1];
}
- syscall_printf ("%R = _pipe([%d, %d], %u, %p)", res, read, write, psize, mode);
+ syscall_printf ("%R = _pipe([%d, %d], %u, %y)", res, read, write, psize, mode);
return res;
}
@@ -465,6 +467,6 @@ pipe2 (int filedes[2], int mode)
read = filedes[0];
write = filedes[1];
}
- syscall_printf ("%R = pipe2([%d, %d], %p)", res, read, write, mode);
+ syscall_printf ("%R = pipe2([%d, %d], %y)", res, read, write, mode);
return res;
}
diff --git a/winsup/cygwin/poll.cc b/winsup/cygwin/poll.cc
index b936245cd..8ce4a28be 100644
--- a/winsup/cygwin/poll.cc
+++ b/winsup/cygwin/poll.cc
@@ -9,8 +9,6 @@
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
-#define __INSIDE_CYGWIN_NET__
-
#define FD_SETSIZE 16384 // lots of fds
#include "winsup.h"
#include <sys/poll.h>
diff --git a/winsup/cygwin/posix.sgml b/winsup/cygwin/posix.sgml
index b532e6e5c..b88ecb973 100644
--- a/winsup/cygwin/posix.sgml
+++ b/winsup/cygwin/posix.sgml
@@ -954,6 +954,13 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
<sect1 id="std-bsd"><title>System interfaces compatible with BSD functions:</title>
<screen>
+ __b64_ntop
+ __b64_pton
+ arc4random
+ arc4random_addrandom
+ arc4random_buf
+ arc4random_stir
+ arc4random_uniform
bindresvport
bindresvport_sa
cfmakeraw
@@ -1460,10 +1467,32 @@ CLOCK_REALTIME and CLOCK_MONOTONIC. <function>clock_setres</function>,
<function>clock_settime</function>, and <function>timer_create</function>
currently support only CLOCK_REALTIME.</para>
+<para>POSIX file locks via <function>fcntl</function> or
+<function>lockf</function>, as well as BSD <function>flock</function> locks
+are advisory locks. They don't interact with Windows mandatory locks, nor
+do POSIX fcntl locks interfere with BSD flock locks or vice versa.</para>
+
<para>BSD file locks created via <function>flock</function> are only
propagated to the direct parent process, not to grand parents or sibling
-processes. The locks are only valid in the creating process, its parent,
-and subsequently started child processes sharing the same file descriptor.
+processes. The locks are only valid in the creating process, its parent
+process, and subsequently started child processes sharing the same file
+descriptor.</para>
+
+<para>In very rare circumstances an application would want to use Windows
+mandatory locks to interact with non-Cygwin Windows processes accessing the
+same file (databases, etc). For these purposes, the entire locking mechanism
+(fcntl/flock/lockf) can be switched to Windows mandatory locks on a
+per-descriptor/per-process basis. For this purpose, use the call
+
+<screen>
+ fcntl (fd, F_LCK_MANDATORY, 1);
+</screen>
+
+After that, all file locks on this descriptor will follow Windows mandatory
+record locking semantics: Locks are per-descriptor/per-process; locks are not
+propagated to child processes, not even via <function>execve</function>;
+no atomic replacement of read locks with write locks and vice versa on the
+same descriptor; locks have to be unlocked exactly as they have been locked.
</para>
<para><function>fpclassify</function>, <function>isfinite</function>,
diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc
index e3c72bf2d..682066d1b 100644
--- a/winsup/cygwin/posix_ipc.cc
+++ b/winsup/cygwin/posix_ipc.cc
@@ -110,7 +110,7 @@ ipc_mutex_init (HANDLE *pmtx, const char *name)
status = NtCreateMutant (pmtx, CYG_MUTANT_ACCESS, &attr, FALSE);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtCreateMutant: %p", status);
+ debug_printf ("NtCreateMutant: %y", status);
return geterrno_from_win_error (RtlNtStatusToDosError (status));
}
return 0;
@@ -163,7 +163,7 @@ ipc_cond_init (HANDLE *pevt, const char *name, char sr)
NotificationEvent, FALSE);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtCreateEvent: %p", status);
+ debug_printf ("NtCreateEvent: %y", status);
return geterrno_from_win_error (RtlNtStatusToDosError (status));
}
return 0;
@@ -284,7 +284,7 @@ ipc_cond_close (HANDLE evt)
class ipc_flock
{
- struct __flock64 fl;
+ struct flock fl;
public:
ipc_flock () { memset (&fl, 0, sizeof fl); }
@@ -348,29 +348,52 @@ shm_unlink (const char *name)
files are created under /dev/mqueue. mq_timedsend and mq_timedreceive
are implemented additionally. */
+/* The mq_attr structure is defined using long datatypes per POSIX.
+ For interoperability reasons between 32 and 64 bit processes, we have
+ to make sure to use a unified structure layout in the message queue file.
+ That's what the mq_fattr is, the in-file representation of the mq_attr
+ struct. */
+#pragma pack (push, 4)
+struct mq_fattr
+{
+ uint32_t mq_flags;
+ uint32_t mq_maxmsg;
+ uint32_t mq_msgsize;
+ uint32_t mq_curmsgs;
+};
+
struct mq_hdr
{
- struct mq_attr mqh_attr; /* the queue's attributes */
- long mqh_head; /* index of first message */
- long mqh_free; /* index of first free message */
- long mqh_nwait; /* #threads blocked in mq_receive() */
+ struct mq_fattr mqh_attr; /* the queue's attributes */
+ int32_t mqh_head; /* index of first message */
+ int32_t mqh_free; /* index of first free message */
+ int32_t mqh_nwait; /* #threads blocked in mq_receive() */
pid_t mqh_pid; /* nonzero PID if mqh_event set */
char mqh_uname[36]; /* unique name used to identify synchronization
objects connected to this queue */
- struct sigevent mqh_event; /* for mq_notify() */
+ union {
+ struct sigevent mqh_event; /* for mq_notify() */
+ /* Make sure sigevent takes the same space on 32 and 64 bit systems.
+ Other than that, it doesn't need to be compatible since only
+ one process can be notified at a time. */
+ uint64_t mqh_placeholder[8];
+ };
+ uint32_t mqh_magic; /* Expect MQI_MAGIC here, otherwise it's
+ an old-style message queue. */
};
struct msg_hdr
{
- long msg_next; /* index of next on linked list */
- ssize_t msg_len; /* actual length */
+ int32_t msg_next; /* index of next on linked list */
+ int32_t msg_len; /* actual length */
unsigned int msg_prio; /* priority */
};
+#pragma pack (pop)
struct mq_info
{
struct mq_hdr *mqi_hdr; /* start of mmap'ed region */
- unsigned long mqi_magic; /* magic number if open */
+ uint32_t mqi_magic; /* magic number if open */
int mqi_flags; /* flags for this process */
HANDLE mqi_lock; /* mutex lock */
HANDLE mqi_waitsend; /* and condition variable for full queue */
@@ -385,19 +408,19 @@ struct mq_info
struct mq_attr defattr = { 0, 10, 8192, 0 }; /* Linux defaults. */
-extern "C" _off64_t lseek64 (int, _off64_t, int);
-extern "C" void *mmap64 (void *, size_t, int, int, int, _off64_t);
+extern "C" off_t lseek64 (int, off_t, int);
+extern "C" void *mmap64 (void *, size_t, int, int, int, off_t);
extern "C" mqd_t
mq_open (const char *name, int oflag, ...)
{
int i, fd = -1, nonblock, created;
long msgsize, index;
- _off64_t filesize = 0;
+ off_t filesize = 0;
va_list ap;
mode_t mode;
int8_t *mptr;
- struct __stat64 statbuff;
+ struct stat statbuff;
struct mq_hdr *mqhdr;
struct msg_hdr *msghdr;
struct mq_attr *attr;
@@ -441,7 +464,12 @@ again:
/* First one to create the file initializes it */
if (attr == NULL)
attr = &defattr;
- else if (attr->mq_maxmsg <= 0 || attr->mq_msgsize <= 0)
+ /* Check minimum and maximum values. The max values are pretty much
+ arbitrary, taken from the linux mq_overview man page. However,
+ these max values make sure that the internal mq_fattr structure
+ can use 32 bit types. */
+ else if (attr->mq_maxmsg <= 0 || attr->mq_maxmsg > 32768
+ || attr->mq_msgsize <= 0 || attr->mq_msgsize > 1048576)
{
set_errno (EINVAL);
goto err;
@@ -481,6 +509,7 @@ again:
hash_path_name (0,mqname),
luid.HighPart, luid.LowPart);
mqhdr->mqh_head = 0;
+ mqhdr->mqh_magic = MQI_MAGIC;
index = sizeof (struct mq_hdr);
mqhdr->mqh_free = index;
for (i = 0; i < attr->mq_maxmsg - 1; i++)
@@ -555,6 +584,15 @@ exists:
if (!(mqinfo = (struct mq_info *) calloc (1, sizeof (struct mq_info))))
goto err;
mqinfo->mqi_hdr = mqhdr = (struct mq_hdr *) mptr;
+ if (mqhdr->mqh_magic != MQI_MAGIC)
+ {
+ system_printf (
+"Old message queue \"%s\" detected!\n"
+"This file is not usable as message queue anymore due to changes in the "
+"internal file layout. Please remove the file and try again.", mqname);
+ set_errno (EACCES);
+ goto err;
+ }
mqinfo->mqi_magic = MQI_MAGIC;
mqinfo->mqi_flags = nonblock;
@@ -603,7 +641,7 @@ mq_getattr (mqd_t mqd, struct mq_attr *mqstat)
{
int n;
struct mq_hdr *mqhdr;
- struct mq_attr *attr;
+ struct mq_fattr *attr;
struct mq_info *mqinfo;
myfault efault;
@@ -637,7 +675,7 @@ mq_setattr (mqd_t mqd, const struct mq_attr *mqstat, struct mq_attr *omqstat)
{
int n;
struct mq_hdr *mqhdr;
- struct mq_attr *attr;
+ struct mq_fattr *attr;
struct mq_info *mqinfo;
myfault efault;
@@ -733,7 +771,7 @@ _mq_send (mqd_t mqd, const char *ptr, size_t len, unsigned int prio,
int8_t *mptr;
struct sigevent *sigev;
struct mq_hdr *mqhdr;
- struct mq_attr *attr;
+ struct mq_fattr *attr;
struct msg_hdr *msghdr, *nmsghdr, *pmsghdr;
struct mq_info *mqinfo;
@@ -866,7 +904,7 @@ _mq_receive (mqd_t mqd, char *ptr, size_t maxlen, unsigned int *priop,
int8_t *mptr;
ssize_t len;
struct mq_hdr *mqhdr;
- struct mq_attr *attr;
+ struct mq_fattr *attr;
struct msg_hdr *msghdr;
struct mq_info *mqinfo;
@@ -963,7 +1001,7 @@ mq_close (mqd_t mqd)
{
long msgsize, filesize;
struct mq_hdr *mqhdr;
- struct mq_attr *attr;
+ struct mq_fattr *attr;
struct mq_info *mqinfo;
myfault efault;
@@ -1028,7 +1066,7 @@ sem_open (const char *name, int oflag, ...)
va_list ap;
mode_t mode = 0;
unsigned int value = 0;
- struct __stat64 statbuff;
+ struct stat statbuff;
sem_t *sem = SEM_FAILED;
sem_finfo sf;
bool wasopen = false;
@@ -1150,7 +1188,7 @@ _sem_close (sem_t *sem, bool do_close)
if (semaphore::getinternal (sem, &fd, &sf.hash, &sf.luid, &sf.value) == -1)
return -1;
if (!file.lock (fd, sizeof sf)
- && lseek64 (fd, 0LL, SEEK_SET) != (_off64_t) -1
+ && lseek64 (fd, 0LL, SEEK_SET) != (off_t) -1
&& write (fd, &sf, sizeof sf) == sizeof sf)
ret = do_close ? semaphore::close (sem) : 0;
diff --git a/winsup/cygwin/profil.c b/winsup/cygwin/profil.c
index 00e7b9682..4af7d3ad2 100644
--- a/winsup/cygwin/profil.c
+++ b/winsup/cygwin/profil.c
@@ -1,6 +1,6 @@
/* profil.c -- win32 profil.c equivalent
- Copyright 1998, 1999, 2000, 2001, 2003, 2009, 2010 Red Hat, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2003, 2009, 2010, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -21,20 +21,24 @@ static struct profinfo prof;
/* Get the pc for thread THR */
-static u_long
+static uintptr_t
get_thrpc (HANDLE thr)
{
CONTEXT ctx;
- u_long pc;
+ uintptr_t pc;
int res;
res = SuspendThread (thr);
if (res == -1)
- return (u_long) - 1;
+ return (uintptr_t) -1;
ctx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
- pc = (u_long) - 1;
+ pc = (uintptr_t) -1;
if (GetThreadContext (thr, &ctx))
+#ifdef __x86_64__
+ pc = ctx.Rip;
+#else
pc = ctx.Eip;
+#endif
ResumeThread (thr);
return pc;
}
@@ -58,13 +62,14 @@ static DWORD CALLBACK
profthr_func (LPVOID arg)
{
struct profinfo *p = (struct profinfo *) arg;
- u_long pc, idx;
+ uintptr_t pc;
+ size_t idx;
SetThreadPriority(p->profthr, THREAD_PRIORITY_TIME_CRITICAL);
for (;;)
{
- pc = (u_long) get_thrpc (p->targthr);
+ pc = (uintptr_t) get_thrpc (p->targthr);
if (pc >= p->lowpc && pc < p->highpc)
{
idx = PROFIDX (pc, p->lowpc, p->scale);
@@ -134,9 +139,9 @@ profile_on (struct profinfo *p)
*/
int
profile_ctl (struct profinfo * p, char *samples, size_t size,
- u_long offset, u_int scale)
+ size_t offset, unsigned int scale)
{
- u_long maxbin;
+ size_t maxbin;
if (scale > 65536)
{
@@ -150,7 +155,7 @@ profile_ctl (struct profinfo * p, char *samples, size_t size,
memset (samples, 0, size);
memset (p, 0, sizeof *p);
maxbin = size >> 1;
- prof.counter = (u_short *) samples;
+ prof.counter = (uint16_t *) samples;
prof.lowpc = offset;
prof.highpc = PROFADDR (maxbin, offset, scale);
prof.scale = scale;
@@ -166,8 +171,7 @@ profile_ctl (struct profinfo * p, char *samples, size_t size,
The word pointed to by this address is incremented. Buf is unused. */
int
-profil (char *samples, size_t size, u_long offset, u_int scale)
+profil (char *samples, size_t size, size_t offset, unsigned int scale)
{
return profile_ctl (&prof, samples, size, offset, scale);
}
-
diff --git a/winsup/cygwin/profil.h b/winsup/cygwin/profil.h
index a681da123..a25b6edf4 100644
--- a/winsup/cygwin/profil.h
+++ b/winsup/cygwin/profil.h
@@ -1,6 +1,6 @@
/* profil.h: gprof profiling header file
- Copyright 1998, 1999, 2000, 2001, 2003 Red Hat, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2003, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -8,6 +8,8 @@ This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
+#include <stdint.h>
+
/* profiling frequency. (No larger than 1000) */
#define PROF_HZ 100
@@ -34,11 +36,11 @@ typedef void *_WINHANDLE;
struct profinfo {
_WINHANDLE targthr; /* thread to profile */
_WINHANDLE profthr; /* profiling thread */
- u_short *counter; /* profiling counters */
- u_long lowpc, highpc; /* range to be profiled */
- u_int scale; /* scale value of bins */
+ uint16_t *counter; /* profiling counters */
+ uintptr_t lowpc, highpc; /* range to be profiled */
+ unsigned int scale; /* scale value of bins */
};
-int profile_ctl(struct profinfo *, char *, size_t, u_long, u_int);
-int profil(char *, size_t, u_long, u_int);
+int profile_ctl (struct profinfo *, char *, size_t, size_t, unsigned int);
+int profil (char *, size_t, size_t, unsigned int);
diff --git a/winsup/cygwin/pseudo-reloc.cc b/winsup/cygwin/pseudo-reloc.cc
index df91e5889..00c58d7a8 100644
--- a/winsup/cygwin/pseudo-reloc.cc
+++ b/winsup/cygwin/pseudo-reloc.cc
@@ -313,12 +313,12 @@ do_pseudo_reloc (void * start, void * end, void * base)
break;
case 32:
reldata = (ptrdiff_t) (*((unsigned int *)reloc_target));
-#ifdef _WIN64
+#if defined (__x86_64__) || defined (_WIN64)
if ((reldata & 0x80000000) != 0)
reldata |= ~((ptrdiff_t) 0xffffffff);
#endif
break;
-#ifdef _WIN64
+#if defined (__x86_64__) || defined (_WIN64)
case 64:
reldata = (ptrdiff_t) (*((unsigned long long *)reloc_target));
break;
@@ -344,9 +344,15 @@ do_pseudo_reloc (void * start, void * end, void * base)
__write_memory ((void *) reloc_target, &reldata, 2);
break;
case 32:
+#if defined (__CYGWIN__) && defined (__x86_64__) && !defined (__OPTIMIZE__)
+ if (reldata > (ptrdiff_t) __INT32_MAX__
+ || reldata < -((ptrdiff_t) __INT32_MAX__) - 1)
+ __report_error ("Invalid relocation. Offset %p at address %p "
+ "doesn't fit into 32 bits", reldata, reloc_target);
+#endif
__write_memory ((void *) reloc_target, &reldata, 4);
break;
-#ifdef _WIN64
+#if defined (__x86_64__) || defined (_WIN64)
case 64:
__write_memory ((void *) reloc_target, &reldata, 8);
break;
diff --git a/winsup/cygwin/pwdgrp.h b/winsup/cygwin/pwdgrp.h
index 00ef2e87a..fe3c3f2a1 100644
--- a/winsup/cygwin/pwdgrp.h
+++ b/winsup/cygwin/pwdgrp.h
@@ -14,12 +14,12 @@ details. */
the passwd and group lists */
extern struct passwd *internal_getpwsid (cygpsid &);
extern struct passwd *internal_getpwnam (const char *, bool = FALSE);
-extern struct passwd *internal_getpwuid (__uid32_t, bool = FALSE);
-extern struct __group32 *internal_getgrsid (cygpsid &);
-extern struct __group32 *internal_getgrgid (__gid32_t gid, bool = FALSE);
-extern struct __group32 *internal_getgrnam (const char *, bool = FALSE);
-extern struct __group32 *internal_getgrent (int);
-int internal_getgroups (int, __gid32_t *, cygpsid * = NULL);
+extern struct passwd *internal_getpwuid (uid_t, bool = FALSE);
+extern struct group *internal_getgrsid (cygpsid &);
+extern struct group *internal_getgrgid (gid_t gid, bool = FALSE);
+extern struct group *internal_getgrnam (const char *, bool = FALSE);
+extern struct group *internal_getgrent (int);
+int internal_getgroups (int, gid_t *, cygpsid * = NULL);
#include "sync.h"
#include "cygtls.h"
@@ -29,7 +29,7 @@ class pwdgrp
union
{
passwd **passwd_buf;
- __group32 **group_buf;
+ group **group_buf;
void **pwdgrp_buf;
};
void (pwdgrp::*read) ();
@@ -80,5 +80,5 @@ public:
}
pwdgrp (passwd *&pbuf);
- pwdgrp (__group32 *&gbuf);
+ pwdgrp (group *&gbuf);
};
diff --git a/winsup/cygwin/regex/engine.c b/winsup/cygwin/regex/engine.c
index 4afaf8d9a..94e418505 100644
--- a/winsup/cygwin/regex/engine.c
+++ b/winsup/cygwin/regex/engine.c
@@ -160,7 +160,7 @@ matcher(struct re_guts *g,
int i;
struct match mv;
struct match *m = &mv;
- const char *dp;
+ const char *dp = NULL;
const sopno gf = g->firststate+1; /* +1 for OEND */
const sopno gl = g->laststate;
const char *start;
@@ -391,7 +391,7 @@ dissect(struct match *m,
const char *ssp; /* start of string matched by subsubRE */
const char *sep; /* end of string matched by subsubRE */
const char *oldssp; /* previous ssp */
- const char *dp;
+ const char *dp __attribute__ ((unused));
AT("diss", start, stop, startst, stopst);
sp = start;
diff --git a/winsup/cygwin/regex/regcomp.c b/winsup/cygwin/regex/regcomp.c
index b44ba2c62..881c16099 100644
--- a/winsup/cygwin/regex/regcomp.c
+++ b/winsup/cygwin/regex/regcomp.c
@@ -63,8 +63,6 @@ __FBSDID("$FreeBSD: src/lib/libc/regex/regcomp.c,v 1.36 2007/06/11 03:05:54 delp
#include "cname.h"
#ifdef __CYGWIN__
-/* Don't pull in windows headers just for LCID. */
-typedef unsigned long LCID;
/* These are defined in nlsfuncs.cc. */
extern LCID collate_lcid;
extern char collate_charset[];
@@ -1477,8 +1475,8 @@ static void
findmust(struct parse *p, struct re_guts *g)
{
sop *scan;
- sop *start;
- sop *newstart;
+ sop *start = NULL;
+ sop *newstart = NULL;
sopno newlen;
sop s;
char *cp;
diff --git a/winsup/cygwin/registry.cc b/winsup/cygwin/registry.cc
index 8ea7f75b7..632260aae 100644
--- a/winsup/cygwin/registry.cc
+++ b/winsup/cygwin/registry.cc
@@ -238,7 +238,7 @@ get_registry_hive_path (PCWSTR name, PWCHAR path)
NULL, NULL);
if (!NT_SUCCESS (status) || buf.Length == 0)
{
- debug_printf ("ProfileImagePath for %W not found, status %p", name,
+ debug_printf ("ProfileImagePath for %W not found, status %y", name,
status);
return NULL;
}
@@ -280,11 +280,11 @@ load_registry_hive (PCWSTR name)
status = NtLoadKey (&key_attr, &path_attr);
if (!NT_SUCCESS (status))
{
- debug_printf ("Loading user registry hive %S into %S failed: %p",
+ debug_printf ("Loading user registry hive %S into %S failed: %y",
&upath, &ukey, status);
return;
}
- debug_printf ("Loading user registry hive %S into %S SUCCEEDED: %p",
+ debug_printf ("Loading user registry hive %S into %S SUCCEEDED: %y",
&upath, &ukey, status);
/* If loading the normal hive worked, try to load the classes hive into
the sibling *_Classes subkey, which is what the user is supposed to
@@ -300,9 +300,9 @@ load_registry_hive (PCWSTR name)
/* Load UsrClass.dat file into key. */
status = NtLoadKey (&key_attr, &path_attr);
if (!NT_SUCCESS (status))
- debug_printf ("Loading user classes hive %S into %S failed: %p",
+ debug_printf ("Loading user classes hive %S into %S failed: %y",
&upath, &ukey, status);
else
- debug_printf ("Loading user classes hive %S into %S SUCCEEDED: %p",
+ debug_printf ("Loading user classes hive %S into %S SUCCEEDED: %y",
&upath, &ukey, status);
}
diff --git a/winsup/cygwin/regparm.h b/winsup/cygwin/regparm.h
new file mode 100644
index 000000000..5b954261f
--- /dev/null
+++ b/winsup/cygwin/regparm.h
@@ -0,0 +1,21 @@
+/* regparm.h: Define macros for regparm functions and methods.
+
+ Copyright 2013 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#pragma once
+
+#if defined (__x86_64__) || defined (__CYGMAGIC__)
+# define __reg1
+# define __reg2
+# define __reg3
+#else
+# define __reg1 __stdcall __attribute__ ((regparm (1)))
+# define __reg2 __stdcall __attribute__ ((regparm (2)))
+# define __reg3 __stdcall __attribute__ ((regparm (3)))
+#endif
diff --git a/winsup/cygwin/release/1.7.19 b/winsup/cygwin/release/1.7.19
new file mode 100644
index 000000000..182fce32d
--- /dev/null
+++ b/winsup/cygwin/release/1.7.19
@@ -0,0 +1,45 @@
+What's new:
+-----------
+
+- Drop support for Windows 2000 and Windows XP pre-SP3.
+
+- Add support for building a 64 bit version of Cygwin on x86_64 natively.
+
+- Add support for creating native symlinks (CYGWIN=winsymlinks:native or
+ CYGWIN=winsymlinks:nativestrict).
+
+- Add support for the AFS filesystem.
+
+- Preliminary support for mandatory locking via fcntl/flock/lockf, using
+ Windows locking semantics. New F_LCK_MANDATORY fcntl command.
+
+- New APIs: __b64_ntop, __b64_pton, arc4random, arc4random_addrandom,
+ arc4random_buf, arc4random_stir, arc4random_uniform.
+
+Bug fixes:
+----------
+
+- getgrouplist now always creates a group list, even if it's empty.
+ Fixes: http://cygwin.com/ml/cygwin/2013-05/msg00157.html
+
+- In fork, call CreateProcessW with the same command line as the parent
+ process. This seems to make sure the stack is created in the same
+ memory location as in the parent.
+ Fixes: http://cygwin.com/ml/cygwin/2013-05/msg00340.html
+
+- Fix a build problem resulting in Cygwin functions picking up the wrong
+ new/delete.
+ Fixes: http://cygwin.com/ml/cygwin/2013-05/msg00331.html
+
+- Fix an incorrect condition which breaks fork after all dlopen'ed DLLs
+ have already been dlclose'd.
+ Fixes: http://cygwin.com/ml/cygwin/2013-05/msg00376.html
+
+- Fix buggy usage of NtReadFile when reading from device under /proc/sys.
+ Fixes: http://cygwin.com/ml/cygwin/2013-05/msg00392.html
+
+- Fix an include in <cygwin/if.h> to avoid circular dependency.
+ Fixes: http://cygwin.com/ml/cygwin/2013-05/msg00451.html
+
+- Fix a hang on exit when calling pthread_join in global desctructor.
+ Fixes: http://cygwin.com/ml/cygwin/2013-06/msg00017.html
diff --git a/winsup/cygwin/release/1.7.20 b/winsup/cygwin/release/1.7.20
new file mode 100644
index 000000000..2f33b9583
--- /dev/null
+++ b/winsup/cygwin/release/1.7.20
@@ -0,0 +1,9 @@
+What's new:
+-----------
+
+
+Bug fixes:
+----------
+
+- Fix starvation problem when handling SIGCONT.
+ Fixes: http://cygwin.com/ml/cygwin/2013-06/msg00084.html
diff --git a/winsup/cygwin/resource.cc b/winsup/cygwin/resource.cc
index d40567f4f..15ca2208a 100644
--- a/winsup/cygwin/resource.cc
+++ b/winsup/cygwin/resource.cc
@@ -1,7 +1,7 @@
/* resource.cc: getrusage () and friends.
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2008, 2009, 2010,
- 2011 Red Hat, Inc.
+ 2011, 2012, 2013 Red Hat, Inc.
Written by Steve Chamberlain (sac@cygnus.com), Doug Evans (dje@cygnus.com),
Geoffrey Noer (noer@cygnus.com) of Cygnus Support.
@@ -137,9 +137,9 @@ getrlimit (int resource, struct rlimit *rlp)
debug_printf ("couldn't get stack info, returning def.values. %E");
else
{
- rlp->rlim_cur = (DWORD) &m - (DWORD) m.AllocationBase;
- rlp->rlim_max = (DWORD) m.BaseAddress + m.RegionSize
- - (DWORD) m.AllocationBase;
+ rlp->rlim_cur = (rlim_t) &m - (rlim_t) m.AllocationBase;
+ rlp->rlim_max = (rlim_t) m.BaseAddress + m.RegionSize
+ - (rlim_t) m.AllocationBase;
}
break;
case RLIMIT_NOFILE:
@@ -167,17 +167,22 @@ setrlimit (int resource, const struct rlimit *rlp)
struct rlimit oldlimits;
- // Check if the request is to actually change the resource settings.
- // If it does not result in a change, take no action and do not
- // fail.
+ /* Check if the request is to actually change the resource settings.
+ If it does not result in a change, take no action and do not fail. */
if (getrlimit (resource, &oldlimits) < 0)
return -1;
if (oldlimits.rlim_cur == rlp->rlim_cur &&
oldlimits.rlim_max == rlp->rlim_max)
- // No change in resource requirements, succeed immediately
+ /* No change in resource requirements, succeed immediately */
return 0;
+ if (rlp->rlim_cur > rlp->rlim_max)
+ {
+ set_errno (EINVAL);
+ return -1;
+ }
+
switch (resource)
{
case RLIMIT_CORE:
diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc
index 0b0d0956b..b39400d02 100644
--- a/winsup/cygwin/sched.cc
+++ b/winsup/cygwin/sched.cc
@@ -1,7 +1,7 @@
/* sched.cc: scheduler interface for Cygwin
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012
- Red Hat, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012,
+ 2013 Red Hat, Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
@@ -20,30 +20,31 @@
#include "registry.h"
/* Win32 priority to UNIX priority Mapping.
+
For now, I'm just following the spec: any range of priorities is ok.
There are probably many many issues with this...
- We don't want process's going realtime. Well, they probably could, but the issues
- with avoiding the priority values 17-22 and 27-30 (not supported before win2k)
- make that inefficient.
- However to complicate things most unixes use lower is better priorities.
+ FIXME: We don't support pre-Windows 2000 so we should fix the priority
+ computation. Here's the description for the current code:
- So we map -14 to 15, and 15 to 1 via (16- ((n+16) >> 1))
- we then map 1 to 15 to various process class and thread priority combinations
+ We don't want process's going realtime. Well, they probably could, but
+ the issues with avoiding the priority values 17-22 and 27-30 (not
+ supported before win2k) make that inefficient.
- Then we need to look at the threads vi process priority. As win95 98 and NT 4
- Don't support opening threads cross-process (unless a thread HANDLE is passed around)
- for now, we'll just use the priority class.
+ However to complicate things most unixes use lower is better priorities.
- The code and logic are present to calculate the priority for thread
- , if a thread handle can be obtained. Alternatively, if the symbols wouldn't be
- resolved until they are used
- we could support this on windows 2000 and ME now, and just fall back to the
- class only on pre win2000 machines.
+ So we map -14 to 15, and 15 to 1 via (16- ((n+16) >> 1)). We then map 1
+ to 15 to various process class and thread priority combinations. Then we
+ need to look at the threads process priority. As win95, 98 and NT 4
+ don't support opening threads cross-process (unless a thread HANDLE is
+ passed around) for now, we'll just use the priority class.
- Lastly, because we can't assume that the pid we're given are Windows pids, we can't
- alter non-cygwin started programs.
-*/
+ The code and logic are present to calculate the priority for thread, if a
+ thread handle can be obtained. Alternatively, if the symbols wouldn't be
+ resolved until they are used we could support this.
+
+ Lastly, because we can't assume that the pid we're given are Windows pids,
+ we can't alter non-cygwin started programs. */
extern "C"
{
@@ -130,10 +131,7 @@ sched_getparam (pid_t pid, struct sched_param *param)
}
ThreadPriority = THREAD_PRIORITY_NORMAL;
- /* calculate the unix priority.
-
- FIXME: windows 2000 supports ABOVE_NORMAL and BELOW_NORMAL class's
- So this logic just defaults those class factors to NORMAL in the calculations */
+ /* calculate the unix priority. */
switch (Class)
{
@@ -241,11 +239,7 @@ sched_getscheduler (pid_t pid)
return SCHED_FIFO;
}
-/* get the time quantum for pid
-
- Implemented only for NT systems, it fails and sets errno to ESRCH
- for non-NT systems.
-*/
+/* get the time quantum for pid */
int
sched_rr_get_interval (pid_t pid, struct timespec *interval)
{
@@ -315,7 +309,6 @@ sched_setparam (pid_t pid, const struct sched_param *param)
pid_t localpid;
int winpri;
DWORD Class;
- int ThreadPriority;
HANDLE process;
if (!param || pid < 0)
@@ -342,70 +335,6 @@ sched_setparam (pid_t pid, const struct sched_param *param)
else
Class = NORMAL_PRIORITY_CLASS;
- switch (Class)
- {
- case IDLE_PRIORITY_CLASS:
- switch (winpri)
- {
- case 1:
- ThreadPriority = THREAD_PRIORITY_IDLE;
- break;
- case 2:
- ThreadPriority = THREAD_PRIORITY_LOWEST;
- break;
- case 3:
- ThreadPriority = THREAD_PRIORITY_BELOW_NORMAL;
- break;
- case 4:
- ThreadPriority = THREAD_PRIORITY_NORMAL;
- break;
- case 5:
- ThreadPriority = THREAD_PRIORITY_ABOVE_NORMAL;
- break;
- case 6:
- ThreadPriority = THREAD_PRIORITY_HIGHEST;
- break;
- }
- break;
- case NORMAL_PRIORITY_CLASS:
- switch (winpri)
- {
- case 7:
- ThreadPriority = THREAD_PRIORITY_LOWEST;
- break;
- case 8:
- ThreadPriority = THREAD_PRIORITY_BELOW_NORMAL;
- break;
- case 9:
- ThreadPriority = THREAD_PRIORITY_NORMAL;
- break;
- case 10:
- ThreadPriority = THREAD_PRIORITY_ABOVE_NORMAL;
- break;
- case 11:
- ThreadPriority = THREAD_PRIORITY_HIGHEST;
- break;
- }
- break;
- case HIGH_PRIORITY_CLASS:
- switch (winpri)
- {
- case 12:
- ThreadPriority = THREAD_PRIORITY_BELOW_NORMAL;
- break;
- case 13:
- ThreadPriority = THREAD_PRIORITY_NORMAL;
- break;
- case 14:
- ThreadPriority = THREAD_PRIORITY_ABOVE_NORMAL;
- break;
- case 15:
- ThreadPriority = THREAD_PRIORITY_HIGHEST;
- break;
- }
- break;
- }
-
localpid = pid ? pid : getpid ();
pinfo p (localpid);
@@ -414,7 +343,7 @@ sched_setparam (pid_t pid, const struct sched_param *param)
if (!p)
{
- set_errno (1); //ESRCH);
+ set_errno (ESRCH);
return -1;
}
process =
@@ -435,11 +364,11 @@ sched_setparam (pid_t pid, const struct sched_param *param)
return 0;
}
-/* we map -14 to 15, and 15 to 1 via (16- ((n+16) >> 1)). This lines up with the allowed
- * valueswe return elsewhere in the sched* functions. We then map in groups of three to
- * allowed thread priority's. The reason for dropping accuracy while still returning
- * a wide range of values is to allow more flexible code in the future.
- */
+/* we map -14 to 15, and 15 to 1 via (16- ((n+16) >> 1)). This lines up with
+ the allowed values we return elsewhere in the sched* functions. We then
+ map in groups of three to allowed thread priority's. The reason for dropping
+ accuracy while still returning a wide range of values is to allow more
+ flexible code in the future. */
int
sched_set_thread_priority (HANDLE thread, int priority)
{
diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc
index b9ffa49f6..2f7ac278d 100644
--- a/winsup/cygwin/sec_acl.cc
+++ b/winsup/cygwin/sec_acl.cc
@@ -26,7 +26,7 @@ details. */
#include "tls_pbuf.h"
static int
-searchace (__aclent32_t *aclp, int nentries, int type, __uid32_t id = ILLEGAL_UID)
+searchace (aclent_t *aclp, int nentries, int type, uid_t id = ILLEGAL_UID)
{
int i;
@@ -38,7 +38,7 @@ searchace (__aclent32_t *aclp, int nentries, int type, __uid32_t id = ILLEGAL_UI
}
int
-setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp,
+setacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp,
bool &writable)
{
security_descriptor sd_ret;
@@ -93,7 +93,7 @@ setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp,
cygsid sid;
struct passwd *pw;
- struct __group32 *gr;
+ struct group *gr;
int pos;
RtlCreateAcl (acl, ACL_MAXIMUM_SIZE, ACL_REVISION);
@@ -201,7 +201,7 @@ setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp,
}
/* Set AclSize to computed value. */
acl->AclSize = acl_len;
- debug_printf ("ACL-Size: %d", acl_len);
+ debug_printf ("ACL-Size: %u", acl_len);
/* Create DACL for local security descriptor. */
status = RtlSetDaclSecurityDescriptor (&sd, TRUE, acl, FALSE);
if (!NT_SUCCESS (status))
@@ -228,7 +228,7 @@ setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp,
__seterrno_from_nt_status (status);
return -1;
}
- debug_printf ("Created SD-Size: %d", sd_ret.size ());
+ debug_printf ("Created SD-Size: %u", sd_ret.size ());
return set_file_sd (handle, pc, sd_ret, false);
}
@@ -238,7 +238,7 @@ setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp,
#define DENY_X 010000
static void
-getace (__aclent32_t &acl, int type, int id, DWORD win_ace_mask,
+getace (aclent_t &acl, int type, int id, DWORD win_ace_mask,
DWORD win_ace_type)
{
acl.a_type = type;
@@ -270,7 +270,7 @@ getace (__aclent32_t &acl, int type, int id, DWORD win_ace_mask,
}
int
-getacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp)
+getacl (HANDLE handle, path_conv &pc, int nentries, aclent_t *aclbufp)
{
security_descriptor sd;
@@ -281,8 +281,8 @@ getacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp)
cygpsid group_sid;
NTSTATUS status;
BOOLEAN dummy;
- __uid32_t uid;
- __gid32_t gid;
+ uid_t uid;
+ gid_t gid;
status = RtlGetOwnerSecurityDescriptor (sd, (PSID *) &owner_sid, &dummy);
if (!NT_SUCCESS (status))
@@ -300,8 +300,8 @@ getacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp)
}
gid = group_sid.get_gid ();
- __aclent32_t lacl[MAX_ACL_ENTRIES];
- memset (&lacl, 0, MAX_ACL_ENTRIES * sizeof (__aclent32_t));
+ aclent_t lacl[MAX_ACL_ENTRIES];
+ memset (&lacl, 0, MAX_ACL_ENTRIES * sizeof (aclent_t));
lacl[0].a_type = USER_OBJ;
lacl[0].a_id = uid;
lacl[1].a_type = GROUP_OBJ;
@@ -435,7 +435,7 @@ getacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp)
set_errno (ENOSPC);
return -1;
}
- memcpy (aclbufp, lacl, pos * sizeof (__aclent32_t));
+ memcpy (aclbufp, lacl, pos * sizeof (aclent_t));
for (i = 0; i < pos; ++i)
aclbufp[i].a_perm &= ~(DENY_R | DENY_W | DENY_X);
aclsort32 (pos, 0, aclbufp);
@@ -445,7 +445,7 @@ getacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp)
}
extern "C" int
-acl32 (const char *path, int cmd, int nentries, __aclent32_t *aclbufp)
+acl32 (const char *path, int cmd, int nentries, aclent_t *aclbufp)
{
int res = -1;
@@ -466,16 +466,18 @@ acl32 (const char *path, int cmd, int nentries, __aclent32_t *aclbufp)
return res;
}
+#ifndef __x86_64__
extern "C" int
-lacl32 (const char *path, int cmd, int nentries, __aclent32_t *aclbufp)
+lacl32 (const char *path, int cmd, int nentries, aclent_t *aclbufp)
{
/* This call was an accident. Make it absolutely clear. */
set_errno (ENOSYS);
return -1;
}
+#endif
extern "C" int
-facl32 (int fd, int cmd, int nentries, __aclent32_t *aclbufp)
+facl32 (int fd, int cmd, int nentries, aclent_t *aclbufp)
{
cygheap_fdget cfd (fd);
if (cfd < 0)
@@ -489,18 +491,18 @@ facl32 (int fd, int cmd, int nentries, __aclent32_t *aclbufp)
}
extern "C" int
-aclcheck32 (__aclent32_t *aclbufp, int nentries, int *which)
+aclcheck32 (aclent_t *aclbufp, int nentries, int *which)
{
bool has_user_obj = false;
bool has_group_obj = false;
bool has_other_obj = false;
bool has_class_obj = false;
- bool has_ug_objs = false;
- bool has_def_user_obj = false;
+ bool has_ug_objs __attribute__ ((unused)) = false;
+ bool has_def_user_obj __attribute__ ((unused)) = false;
bool has_def_group_obj = false;
bool has_def_other_obj = false;
bool has_def_class_obj = false;
- bool has_def_ug_objs = false;
+ bool has_def_ug_objs __attribute__ ((unused)) = false;
int pos2;
for (int pos = 0; pos < nentries; ++pos)
@@ -623,7 +625,7 @@ aclcheck32 (__aclent32_t *aclbufp, int nentries, int *which)
static int
acecmp (const void *a1, const void *a2)
{
-#define ace(i) ((const __aclent32_t *) a##i)
+#define ace(i) ((const aclent_t *) a##i)
int ret = ace (1)->a_type - ace (2)->a_type;
if (!ret)
ret = ace (1)->a_id - ace (2)->a_id;
@@ -632,7 +634,7 @@ acecmp (const void *a1, const void *a2)
}
extern "C" int
-aclsort32 (int nentries, int, __aclent32_t *aclbufp)
+aclsort32 (int nentries, int, aclent_t *aclbufp)
{
if (aclcheck32 (aclbufp, nentries, NULL))
return -1;
@@ -641,12 +643,12 @@ aclsort32 (int nentries, int, __aclent32_t *aclbufp)
set_errno (EINVAL);
return -1;
}
- qsort ((void *) aclbufp, nentries, sizeof (__aclent32_t), acecmp);
+ qsort ((void *) aclbufp, nentries, sizeof (aclent_t), acecmp);
return 0;
}
extern "C" int
-acltomode32 (__aclent32_t *aclbufp, int nentries, mode_t *modep)
+acltomode32 (aclent_t *aclbufp, int nentries, mode_t *modep)
{
int pos;
@@ -685,7 +687,7 @@ acltomode32 (__aclent32_t *aclbufp, int nentries, mode_t *modep)
}
extern "C" int
-aclfrommode32 (__aclent32_t *aclbufp, int nentries, mode_t *modep)
+aclfrommode32 (aclent_t *aclbufp, int nentries, mode_t *modep)
{
int pos;
@@ -722,13 +724,13 @@ aclfrommode32 (__aclent32_t *aclbufp, int nentries, mode_t *modep)
}
extern "C" int
-acltopbits32 (__aclent32_t *aclbufp, int nentries, mode_t *pbitsp)
+acltopbits32 (aclent_t *aclbufp, int nentries, mode_t *pbitsp)
{
return acltomode32 (aclbufp, nentries, pbitsp);
}
extern "C" int
-aclfrompbits32 (__aclent32_t *aclbufp, int nentries, mode_t *pbitsp)
+aclfrompbits32 (aclent_t *aclbufp, int nentries, mode_t *pbitsp)
{
return aclfrommode32 (aclbufp, nentries, pbitsp);
}
@@ -746,7 +748,7 @@ permtostr (mode_t perm)
}
extern "C" char *
-acltotext32 (__aclent32_t *aclbufp, int aclcnt)
+acltotext32 (aclent_t *aclbufp, int aclcnt)
{
if (!aclbufp || aclcnt < 1 || aclcnt > MAX_ACL_ENTRIES
|| aclcheck32 (aclbufp, aclcnt, NULL))
@@ -821,7 +823,7 @@ permfromstr (char *perm)
return mode;
}
-extern "C" __aclent32_t *
+extern "C" aclent_t *
aclfromtext32 (char *acltextp, int *)
{
if (!acltextp)
@@ -830,7 +832,7 @@ aclfromtext32 (char *acltextp, int *)
return NULL;
}
char buf[strlen (acltextp) + 1];
- __aclent32_t lacl[MAX_ACL_ENTRIES];
+ aclent_t lacl[MAX_ACL_ENTRIES];
memset (lacl, 0, sizeof lacl);
int pos = 0;
strcpy (buf, acltextp);
@@ -882,7 +884,7 @@ aclfromtext32 (char *acltextp, int *)
c += 5;
if (isalpha (*c))
{
- struct __group32 *gr = internal_getgrnam (c);
+ struct group *gr = internal_getgrnam (c);
if (!gr)
{
set_errno (EINVAL);
@@ -927,17 +929,29 @@ aclfromtext32 (char *acltextp, int *)
}
++pos;
}
- __aclent32_t *aclp = (__aclent32_t *) malloc (pos * sizeof (__aclent32_t));
+ aclent_t *aclp = (aclent_t *) malloc (pos * sizeof (aclent_t));
if (aclp)
- memcpy (aclp, lacl, pos * sizeof (__aclent32_t));
+ memcpy (aclp, lacl, pos * sizeof (aclent_t));
return aclp;
}
-/* __aclent16_t and __aclent32_t have same size and same member offsets */
-static __aclent32_t *
+#ifdef __x86_64__
+EXPORT_ALIAS (acl32, acl)
+EXPORT_ALIAS (facl32, facl)
+EXPORT_ALIAS (aclcheck32, aclcheck)
+EXPORT_ALIAS (aclsort32, aclsort)
+EXPORT_ALIAS (acltomode32, acltomode)
+EXPORT_ALIAS (aclfrommode32, aclfrommode)
+EXPORT_ALIAS (acltopbits32, acltopbits)
+EXPORT_ALIAS (aclfrompbits32, aclfrompbits)
+EXPORT_ALIAS (acltotext32, acltotext)
+EXPORT_ALIAS (aclfromtext32, aclfromtext)
+#else
+/* __aclent16_t and aclent_t have same size and same member offsets */
+static aclent_t *
acl16to32 (__aclent16_t *aclbufp, int nentries)
{
- __aclent32_t *aclbufp32 = (__aclent32_t *) aclbufp;
+ aclent_t *aclbufp32 = (aclent_t *) aclbufp;
if (aclbufp32)
for (int i = 0; i < nentries; i++)
aclbufp32[i].a_id &= USHRT_MAX;
@@ -986,7 +1000,7 @@ acltomode (__aclent16_t *aclbufp, int nentries, mode_t *modep)
extern "C" int
aclfrommode (__aclent16_t *aclbufp, int nentries, mode_t *modep)
{
- return aclfrommode32 ((__aclent32_t *)aclbufp, nentries, modep);
+ return aclfrommode32 ((aclent_t *)aclbufp, nentries, modep);
}
extern "C" int
@@ -998,7 +1012,7 @@ acltopbits (__aclent16_t *aclbufp, int nentries, mode_t *pbitsp)
extern "C" int
aclfrompbits (__aclent16_t *aclbufp, int nentries, mode_t *pbitsp)
{
- return aclfrompbits32 ((__aclent32_t *)aclbufp, nentries, pbitsp);
+ return aclfrompbits32 ((aclent_t *)aclbufp, nentries, pbitsp);
}
extern "C" char *
@@ -1012,3 +1026,4 @@ aclfromtext (char *acltextp, int * aclcnt)
{
return (__aclent16_t *) aclfromtext32 (acltextp, aclcnt);
}
+#endif /* !__x86_64__ */
diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc
index 95e7d0bf1..dd5ee0627 100644
--- a/winsup/cygwin/sec_auth.cc
+++ b/winsup/cygwin/sec_auth.cc
@@ -1,7 +1,7 @@
/* sec_auth.cc: NT authentication functions
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -87,7 +87,7 @@ get_full_privileged_inheritable_token (HANDLE token)
void
set_imp_token (HANDLE token, int type)
{
- debug_printf ("set_imp_token (%d, %d)", token, type);
+ debug_printf ("set_imp_token (%p, %d)", token, type);
cygheap->user.external_token = (token == INVALID_HANDLE_VALUE
? NO_IMPERSONATION : token);
cygheap->user.ext_token_is_restricted = (type == CW_TOKEN_RESTRICTED);
@@ -108,7 +108,7 @@ extract_nt_dom_user (const struct passwd *pw, PWCHAR domain, PWCHAR user)
DWORD dlen = MAX_DOMAIN_NAME_LEN + 1;
SID_NAME_USE use;
- debug_printf ("pw_gecos %x (%s)", pw->pw_gecos, pw->pw_gecos);
+ debug_printf ("pw_gecos %p (%s)", pw->pw_gecos, pw->pw_gecos);
if (psid.getfrompw (pw)
&& LookupAccountSidW (NULL, psid, user, &ulen, domain, &dlen, &use))
@@ -283,7 +283,7 @@ get_user_groups (WCHAR *logonserver, cygsidlist &grp_list,
else if (legal_sid_type (use))
grp_list += gsid;
else
- debug_printf ("Global group %W invalid. Use: %d", dgroup, use);
+ debug_printf ("Global group %W invalid. Use: %u", dgroup, use);
}
NetApiBufferFree (buf);
@@ -332,7 +332,7 @@ get_user_local_groups (PWCHAR logonserver, PWCHAR domain,
else if (legal_sid_type (use))
grp_list += gsid;
else
- debug_printf ("Rejecting local %W. use: %d", dg_ptr, use);
+ debug_printf ("Rejecting local %W. use: %u", dg_ptr, use);
}
else if (GetLastError () == ERROR_NONE_MAPPED)
{
@@ -360,7 +360,7 @@ get_user_local_groups (PWCHAR logonserver, PWCHAR domain,
dom, &domlen, &use))
{
if (!legal_sid_type (use))
- debug_printf ("Rejecting local %W. use: %d", dg_ptr, use);
+ debug_printf ("Rejecting local %W. use: %u", dg_ptr, use);
else
grp_list *= gsid;
}
@@ -389,12 +389,12 @@ sid_in_token_groups (PTOKEN_GROUPS grps, cygpsid sid)
static void
get_unix_group_sidlist (struct passwd *pw, cygsidlist &grp_list)
{
- struct __group32 *gr;
+ struct group *gr;
cygsid gsid;
for (int gidx = 0; (gr = internal_getgrent (gidx)); ++gidx)
{
- if (gr->gr_gid == (__gid32_t) pw->pw_gid)
+ if (gr->gr_gid == pw->pw_gid)
goto found;
else if (gr->gr_mem)
for (int gi = 0; gr->gr_mem[gi]; ++gi)
@@ -689,7 +689,7 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern)
status = NtQueryInformationToken (token, TokenSource, &ts, sizeof ts,
&size);
if (!NT_SUCCESS (status))
- debug_printf ("NtQueryInformationToken(), %p", status);
+ debug_printf ("NtQueryInformationToken(), %y", status);
else
*pintern = intern = !memcmp (ts.SourceName, "Cygwin.1", 8);
}
@@ -698,7 +698,7 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern)
status = NtQueryInformationToken (token, TokenUser, &tok_usersid,
sizeof tok_usersid, &size);
if (!NT_SUCCESS (status))
- debug_printf ("NtQueryInformationToken(), %p", status);
+ debug_printf ("NtQueryInformationToken(), %y", status);
if (usersid != tok_usersid)
return false;
@@ -713,14 +713,14 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern)
status = NtQuerySecurityObject (token, GROUP_SECURITY_INFORMATION,
sd_buf, sd_buf_siz, &size);
if (!NT_SUCCESS (status))
- debug_printf ("NtQuerySecurityObject(), %p", status);
+ debug_printf ("NtQuerySecurityObject(), %y", status);
else
{
BOOLEAN dummy;
status = RtlGetGroupSecurityDescriptor (sd_buf, (PSID *) &gsid,
&dummy);
if (!NT_SUCCESS (status))
- debug_printf ("RtlGetGroupSecurityDescriptor(), %p", status);
+ debug_printf ("RtlGetGroupSecurityDescriptor(), %y", status);
}
if (well_known_null_sid != gsid)
return gsid == groups.pgsid;
@@ -731,14 +731,14 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern)
status = NtQueryInformationToken (token, TokenGroups, NULL, 0, &size);
if (!NT_SUCCESS (status) && status != STATUS_BUFFER_TOO_SMALL)
{
- debug_printf ("NtQueryInformationToken(token, TokenGroups), %p", status);
+ debug_printf ("NtQueryInformationToken(token, TokenGroups), %y", status);
return false;
}
my_grps = (PTOKEN_GROUPS) alloca (size);
status = NtQueryInformationToken (token, TokenGroups, my_grps, size, &size);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtQueryInformationToken(my_token, TokenGroups), %p",
+ debug_printf ("NtQueryInformationToken(my_token, TokenGroups), %y",
status);
return false;
}
@@ -748,7 +748,7 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern)
if (groups.issetgroups ()) /* setgroups was called */
{
cygsid gsid;
- struct __group32 *gr;
+ struct group *gr;
bool saw[groups.sgsids.count ()];
memset (saw, 0, sizeof(saw));
@@ -851,7 +851,7 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
&stats, sizeof stats, &size);
if (!NT_SUCCESS (status))
debug_printf ("NtQueryInformationToken(hProcToken, "
- "TokenStatistics), %p", status);
+ "TokenStatistics), %y", status);
else
auth_luid = stats.AuthenticationId;
}
@@ -861,7 +861,7 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
status = NtQueryInformationToken (hProcToken, TokenGroups, NULL, 0,
&size);
if (!NT_SUCCESS (status) && status != STATUS_BUFFER_TOO_SMALL)
- debug_printf ("NtQueryInformationToken(hProcToken, TokenGroups), %p",
+ debug_printf ("NtQueryInformationToken(hProcToken, TokenGroups), %y",
status);
else if (!(my_tok_gsids = (PTOKEN_GROUPS) malloc (size)))
debug_printf ("malloc (my_tok_gsids) failed.");
@@ -872,7 +872,7 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
if (!NT_SUCCESS (status))
{
debug_printf ("NtQueryInformationToken(hProcToken, TokenGroups), "
- "%p", status);
+ "%y", status);
free (my_tok_gsids);
my_tok_gsids = NULL;
}
@@ -995,7 +995,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
status = LsaRegisterLogonProcess (&name, &lsa_hdl, &sec_mode);
if (status != STATUS_SUCCESS)
{
- debug_printf ("LsaRegisterLogonProcess: %p", status);
+ debug_printf ("LsaRegisterLogonProcess: %y", status);
__seterrno_from_nt_status (status);
goto out;
}
@@ -1009,7 +1009,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
status = LsaLookupAuthenticationPackage (lsa_hdl, &name, &package_id);
if (status != STATUS_SUCCESS)
{
- debug_printf ("LsaLookupAuthenticationPackage: %p", status);
+ debug_printf ("LsaLookupAuthenticationPackage: %y", status);
__seterrno_from_nt_status (status);
goto out;
}
@@ -1033,11 +1033,6 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
else if (!get_initgroups_sidlist (tmp_gsids, usersid, new_groups.pgsid, pw,
NULL, auth_luid, auth_pos))
goto out;
- /* The logon SID entry is not generated automatically on Windows 2000
- and earlier for some reason. So add fake logon sid here, which is
- filled with logon id values in the authentication package. */
- if (wincap.needs_logon_sid_in_sid_list ())
- tmp_gsids += fake_logon_sid;
tmp_gsids.debug_print ("tmp_gsids");
@@ -1131,10 +1126,6 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
gsids->Groups[i].Attributes = SE_GROUP_MANDATORY
| SE_GROUP_ENABLED_BY_DEFAULT
| SE_GROUP_ENABLED;
- /* Mark logon SID as logon SID :) */
- if (wincap.needs_logon_sid_in_sid_list ()
- && tmp_gsids.sids[tmpidx] == fake_logon_sid)
- gsids->Groups[i].Attributes += SE_GROUP_LOGON_ID;
RtlCopySid (RtlLengthSid (tmp_gsids.sids[tmpidx]),
(PSID) ((PBYTE) &authinf->inf + sids_offset),
tmp_gsids.sids[tmpidx]);
@@ -1171,7 +1162,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
&sub_status);
if (status != STATUS_SUCCESS)
{
- debug_printf ("LsaLogonUser: %p (sub-status %p)", status, sub_status);
+ debug_printf ("LsaLogonUser: %y (sub-status %y)", status, sub_status);
__seterrno_from_nt_status (status);
goto out;
}
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index 285550c68..2d81cbd38 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -1,7 +1,7 @@
/* sec_helper.cc: NT security helper functions
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011, 2012 Red Hat, Inc.
+ 2011, 2012, 2013 Red Hat, Inc.
Written by Corinna Vinschen <corinna@vinschen.de>
@@ -26,10 +26,17 @@ details. */
#include "ntdll.h"
/* General purpose security attribute objects for global use. */
-SECURITY_ATTRIBUTES NO_COPY sec_none;
-SECURITY_ATTRIBUTES NO_COPY sec_none_nih;
-SECURITY_ATTRIBUTES NO_COPY sec_all;
-SECURITY_ATTRIBUTES NO_COPY sec_all_nih;
+static NO_COPY_RO SECURITY_DESCRIPTOR null_sdp =
+ { SECURITY_DESCRIPTOR_REVISION, 0, SE_DACL_PRESENT,
+ NULL, NULL, NULL, NULL };
+SECURITY_ATTRIBUTES NO_COPY_RO sec_none =
+ { sizeof (SECURITY_ATTRIBUTES), NULL, TRUE };
+SECURITY_ATTRIBUTES NO_COPY_RO sec_none_nih =
+ { sizeof (SECURITY_ATTRIBUTES), NULL, FALSE };
+SECURITY_ATTRIBUTES NO_COPY_RO sec_all =
+ { sizeof (SECURITY_ATTRIBUTES), &null_sdp, TRUE };
+SECURITY_ATTRIBUTES NO_COPY_RO sec_all_nih =
+ { sizeof (SECURITY_ATTRIBUTES), &null_sdp, FALSE };
MKSID (well_known_null_sid, "S-1-0-0",
SECURITY_NULL_SID_AUTHORITY, 1, SECURITY_NULL_RID);
@@ -67,8 +74,6 @@ MKSID (well_known_admins_sid, "S-1-5-32-544",
MKSID (well_known_users_sid, "S-1-5-32-545",
SECURITY_NT_AUTHORITY, 2, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_USERS);
-MKSID (fake_logon_sid, "S-1-5-5-0-0",
- SECURITY_NT_AUTHORITY, 3, SECURITY_LOGON_IDS_RID, 0, 0);
MKSID (mandatory_medium_integrity_sid, "S-1-16-8192",
SECURITY_MANDATORY_LABEL_AUTHORITY, 1, SECURITY_MANDATORY_MEDIUM_RID);
MKSID (mandatory_high_integrity_sid, "S-1-16-12288",
@@ -87,15 +92,15 @@ cygpsid::operator== (const char *nsidstr) const
return psid == nsid;
}
-__uid32_t
+uid_t
cygpsid::get_id (BOOL search_grp, int *type)
{
/* First try to get SID from group, then passwd */
- __uid32_t id = ILLEGAL_UID;
+ uid_t id = ILLEGAL_UID;
if (search_grp)
{
- struct __group32 *gr;
+ struct group *gr;
if (cygheap->user.groups.pgsid == psid)
id = myself->gid;
else if ((gr = internal_getgrsid (*this)))
@@ -205,7 +210,7 @@ cygsid::getfrompw (const struct passwd *pw)
}
BOOL
-cygsid::getfromgr (const struct __group32 *gr)
+cygsid::getfromgr (const struct group *gr)
{
char *sp = (gr && gr->gr_passwd) ? gr->gr_passwd : NULL;
return (*this = sp) != NULL;
@@ -254,10 +259,10 @@ cygsidlist::add (const PSID nsi, bool well_known)
}
bool
-get_sids_info (cygpsid owner_sid, cygpsid group_sid, __uid32_t * uidret, __gid32_t * gidret)
+get_sids_info (cygpsid owner_sid, cygpsid group_sid, uid_t * uidret, gid_t * gidret)
{
struct passwd *pw;
- struct __group32 *gr = NULL;
+ struct group *gr = NULL;
bool ret = false;
owner_sid.debug_print ("get_sids_info: owner SID =");
@@ -434,7 +439,7 @@ set_privilege (HANDLE token, DWORD privilege, bool enable)
out:
if (ret < 0)
- debug_printf ("%d = set_privilege((token %x) %W, %d)", ret, token,
+ debug_printf ("%d = set_privilege((token %p) %W, %d)", ret, token,
privilege_name (new_priv.Privileges[0].Luid), enable);
return ret;
}
@@ -456,44 +461,10 @@ set_cygwin_privileges (HANDLE token)
/* Allow to create global shared memory. This isn't required anymore since
Cygwin 1.7. It uses its own subdirectories in the global NT namespace
which isn't affected by the SE_CREATE_GLOBAL_PRIVILEGE restriction. */
- if (wincap.has_create_global_privilege ())
- set_privilege (token, SE_CREATE_GLOBAL_PRIVILEGE, true);
+ set_privilege (token, SE_CREATE_GLOBAL_PRIVILEGE, true);
#endif
}
-/* Function to return a common SECURITY_DESCRIPTOR that
- allows all access. */
-
-static inline PSECURITY_DESCRIPTOR
-get_null_sd ()
-{
- static NO_COPY SECURITY_DESCRIPTOR sd;
- static NO_COPY PSECURITY_DESCRIPTOR null_sdp;
-
- if (!null_sdp)
- {
- RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
- RtlSetDaclSecurityDescriptor (&sd, TRUE, NULL, FALSE);
- null_sdp = &sd;
- }
- return null_sdp;
-}
-
-/* Initialize global security attributes.
- Called from dcrt0.cc (_dll_crt0). */
-
-void
-init_global_security ()
-{
- sec_none.nLength = sec_none_nih.nLength =
- sec_all.nLength = sec_all_nih.nLength = sizeof (SECURITY_ATTRIBUTES);
- sec_none.bInheritHandle = sec_all.bInheritHandle = TRUE;
- sec_none_nih.bInheritHandle = sec_all_nih.bInheritHandle = FALSE;
- sec_none.lpSecurityDescriptor = sec_none_nih.lpSecurityDescriptor = NULL;
- sec_all.lpSecurityDescriptor = sec_all_nih.lpSecurityDescriptor =
- get_null_sd ();
-}
-
bool
sec_acl (PACL acl, bool original, bool admins, PSID sid1, PSID sid2, DWORD access2)
{
@@ -509,49 +480,49 @@ sec_acl (PACL acl, bool original, bool admins, PSID sid1, PSID sid2, DWORD acces
status = RtlCreateAcl (acl, acl_len, ACL_REVISION);
if (!NT_SUCCESS (status))
{
- debug_printf ("RtlCreateAcl: %p", status);
+ debug_printf ("RtlCreateAcl: %y", status);
return false;
}
if (sid1)
{
status = RtlAddAccessAllowedAce (acl, ACL_REVISION, GENERIC_ALL, sid1);
if (!NT_SUCCESS (status))
- debug_printf ("RtlAddAccessAllowedAce(sid1) %p", status);
+ debug_printf ("RtlAddAccessAllowedAce(sid1) %y", status);
}
if (original && (psid = cygheap->user.saved_sid ())
&& psid != sid1 && psid != well_known_system_sid)
{
status = RtlAddAccessAllowedAce (acl, ACL_REVISION, GENERIC_ALL, psid);
if (!NT_SUCCESS (status))
- debug_printf ("RtlAddAccessAllowedAce(original) %p", status);
+ debug_printf ("RtlAddAccessAllowedAce(original) %y", status);
}
if (sid2)
{
status = RtlAddAccessAllowedAce (acl, ACL_REVISION, access2, sid2);
if (!NT_SUCCESS (status))
- debug_printf ("RtlAddAccessAllowedAce(sid2) %p", status);
+ debug_printf ("RtlAddAccessAllowedAce(sid2) %y", status);
}
if (admins)
{
status = RtlAddAccessAllowedAce (acl, ACL_REVISION, GENERIC_ALL,
well_known_admins_sid);
if (!NT_SUCCESS (status))
- debug_printf ("RtlAddAccessAllowedAce(admin) %p", status);
+ debug_printf ("RtlAddAccessAllowedAce(admin) %y", status);
}
status = RtlAddAccessAllowedAce (acl, ACL_REVISION, GENERIC_ALL,
well_known_system_sid);
if (!NT_SUCCESS (status))
- debug_printf ("RtlAddAccessAllowedAce(system) %p", status);
+ debug_printf ("RtlAddAccessAllowedAce(system) %y", status);
status = RtlFirstFreeAce (acl, &pAce);
if (NT_SUCCESS (status) && pAce)
acl->AclSize = (char *) pAce - (char *) acl;
else
- debug_printf ("RtlFirstFreeAce: %p", status);
+ debug_printf ("RtlFirstFreeAce: %y", status);
return true;
}
-PSECURITY_ATTRIBUTES __stdcall
+PSECURITY_ATTRIBUTES __reg3
__sec_user (PVOID sa_buf, PSID sid1, PSID sid2, DWORD access2, BOOL inherit)
{
PSECURITY_ATTRIBUTES psa = (PSECURITY_ATTRIBUTES) sa_buf;
@@ -570,7 +541,7 @@ __sec_user (PVOID sa_buf, PSID sid1, PSID sid2, DWORD access2, BOOL inherit)
RtlCreateSecurityDescriptor (psd, SECURITY_DESCRIPTOR_REVISION);
status = RtlSetDaclSecurityDescriptor (psd, TRUE, acl, FALSE);
if (!NT_SUCCESS (status))
- debug_printf ("RtlSetDaclSecurityDescriptor %p", status);
+ debug_printf ("RtlSetDaclSecurityDescriptor %y", status);
psa->nLength = sizeof (SECURITY_ATTRIBUTES);
psa->lpSecurityDescriptor = psd;
@@ -621,7 +592,7 @@ _recycler_sd (void *buf, bool users, bool dir)
status = RtlFirstFreeAce (dacl, &ace);
if (!NT_SUCCESS (status))
{
- debug_printf ("RtlFirstFreeAce: %p", status);
+ debug_printf ("RtlFirstFreeAce: %y", status);
return NULL;
}
dacl->AclSize = (char *) ace - (char *) dacl;
@@ -655,14 +626,14 @@ _everyone_sd (void *buf, ACCESS_MASK access)
well_known_world_sid);
if (!NT_SUCCESS (status))
{
- debug_printf ("RtlAddAccessAllowedAce: %p", status);
+ debug_printf ("RtlAddAccessAllowedAce: %y", status);
return NULL;
}
LPVOID ace;
status = RtlFirstFreeAce (dacl, &ace);
if (!NT_SUCCESS (status))
{
- debug_printf ("RtlFirstFreeAce: %p", status);
+ debug_printf ("RtlFirstFreeAce: %y", status);
return NULL;
}
dacl->AclSize = (char *) ace - (char *) dacl;
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index fbc1d97a0..251e9609e 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -1,7 +1,7 @@
/* security.cc: NT file access control functions
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
Originaly written by Gunther Ebert, gunther.ebert@ixos-leipzig.de
Completely rewritten by Corinna Vinschen <corinna@vinschen.de>
@@ -31,10 +31,10 @@ details. */
| GROUP_SECURITY_INFORMATION \
| OWNER_SECURITY_INFORMATION)
-static NO_COPY GENERIC_MAPPING file_mapping = { FILE_GENERIC_READ,
- FILE_GENERIC_WRITE,
- FILE_GENERIC_EXECUTE,
- FILE_ALL_ACCESS };
+static GENERIC_MAPPING NO_COPY_RO file_mapping = { FILE_GENERIC_READ,
+ FILE_GENERIC_WRITE,
+ FILE_GENERIC_EXECUTE,
+ FILE_ALL_ACCESS };
LONG
get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd,
@@ -58,7 +58,7 @@ get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd,
sd, len, &rlen);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtQuerySecurityObject (%S), status %p",
+ debug_printf ("NtQuerySecurityObject (%S), status %y",
pc.get_nt_native_path (), status);
fh = NULL;
}
@@ -152,7 +152,7 @@ get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd,
| FILE_OPEN_REPARSE_POINT);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtOpenFile (%S), status %p", &dirname, status);
+ debug_printf ("NtOpenFile (%S), status %y", &dirname, status);
return 0;
}
/* ... fetch the parent's security descriptor ... */
@@ -162,7 +162,7 @@ get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd,
NtClose (fh);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtQuerySecurityObject (%S), status %p",
+ debug_printf ("NtQuerySecurityObject (%S), status %y",
&dirname, status);
return 0;
}
@@ -177,7 +177,7 @@ get_file_sd (HANDLE fh, path_conv &pc, security_descriptor &sd,
&file_mapping);
if (!NT_SUCCESS (status))
{
- debug_printf ("RtlConvertToAutoInheritSecurityObject (%S), status %p",
+ debug_printf ("RtlConvertToAutoInheritSecurityObject (%S), status %y",
&dirname, status);
return 0;
}
@@ -330,7 +330,7 @@ get_attribute_from_acl (mode_t *attribute, PACL acl, PSID owner_sid,
static void
get_info_from_sd (PSECURITY_DESCRIPTOR psd, mode_t *attribute,
- __uid32_t *uidret, __gid32_t *gidret)
+ uid_t *uidret, gid_t *gidret)
{
if (!psd)
{
@@ -352,13 +352,13 @@ get_info_from_sd (PSECURITY_DESCRIPTOR psd, mode_t *attribute,
status = RtlGetOwnerSecurityDescriptor (psd, (PSID *) &owner_sid, &dummy);
if (!NT_SUCCESS (status))
- debug_printf ("RtlGetOwnerSecurityDescriptor: %p", status);
+ debug_printf ("RtlGetOwnerSecurityDescriptor: %y", status);
status = RtlGetGroupSecurityDescriptor (psd, (PSID *) &group_sid, &dummy);
if (!NT_SUCCESS (status))
- debug_printf ("RtlGetGroupSecurityDescriptor: %p", status);
+ debug_printf ("RtlGetGroupSecurityDescriptor: %y", status);
- __uid32_t uid;
- __gid32_t gid;
+ uid_t uid;
+ gid_t gid;
bool grp_member = get_sids_info (owner_sid, group_sid, &uid, &gid);
if (uidret)
*uidret = uid;
@@ -367,7 +367,7 @@ get_info_from_sd (PSECURITY_DESCRIPTOR psd, mode_t *attribute,
if (!attribute)
{
- syscall_printf ("uid %d, gid %d", uid, gid);
+ syscall_printf ("uid %u, gid %u", uid, gid);
return;
}
@@ -385,7 +385,7 @@ get_info_from_sd (PSECURITY_DESCRIPTOR psd, mode_t *attribute,
else
get_attribute_from_acl (attribute, acl, owner_sid, group_sid, grp_member);
- syscall_printf ("%sACL %x, uid %d, gid %d",
+ syscall_printf ("%sACL %y, uid %u, gid %u",
(!acl_exists || !acl)?"NO ":"", *attribute, uid, gid);
}
@@ -414,8 +414,8 @@ get_reg_sd (HANDLE handle, security_descriptor &sd_ret)
}
int
-get_reg_attribute (HKEY hkey, mode_t *attribute, __uid32_t *uidret,
- __gid32_t *gidret)
+get_reg_attribute (HKEY hkey, mode_t *attribute, uid_t *uidret,
+ gid_t *gidret)
{
security_descriptor sd;
@@ -430,7 +430,7 @@ get_reg_attribute (HKEY hkey, mode_t *attribute, __uid32_t *uidret,
int
get_file_attribute (HANDLE handle, path_conv &pc,
- mode_t *attribute, __uid32_t *uidret, __gid32_t *gidret)
+ mode_t *attribute, uid_t *uidret, gid_t *gidret)
{
if (pc.has_acls ())
{
@@ -496,7 +496,7 @@ add_access_denied_ace (PACL acl, int offset, DWORD attributes,
}
static PSECURITY_DESCRIPTOR
-alloc_sd (path_conv &pc, __uid32_t uid, __gid32_t gid, int attribute,
+alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute,
security_descriptor &sd_ret)
{
NTSTATUS status;
@@ -506,17 +506,17 @@ alloc_sd (path_conv &pc, __uid32_t uid, __gid32_t gid, int attribute,
/* NOTE: If the high bit of attribute is set, we have just created
a file or directory. See below for an explanation. */
- debug_printf("uid %d, gid %d, attribute %x", uid, gid, attribute);
+ debug_printf("uid %u, gid %u, attribute %y", uid, gid, attribute);
/* Get owner and group from current security descriptor. */
PSID cur_owner_sid = NULL;
PSID cur_group_sid = NULL;
status = RtlGetOwnerSecurityDescriptor (sd_ret, &cur_owner_sid, &dummy);
if (!NT_SUCCESS (status))
- debug_printf ("RtlGetOwnerSecurityDescriptor: %p", status);
+ debug_printf ("RtlGetOwnerSecurityDescriptor: %y", status);
status = RtlGetGroupSecurityDescriptor (sd_ret, &cur_group_sid, &dummy);
if (!NT_SUCCESS (status))
- debug_printf ("RtlGetGroupSecurityDescriptor: %p", status);
+ debug_printf ("RtlGetGroupSecurityDescriptor: %y", status);
/* Get SID of owner. */
cygsid owner_sid;
@@ -899,7 +899,7 @@ get_object_sd (HANDLE handle, security_descriptor &sd)
}
int
-get_object_attribute (HANDLE handle, __uid32_t *uidret, __gid32_t *gidret,
+get_object_attribute (HANDLE handle, uid_t *uidret, gid_t *gidret,
mode_t *attribute)
{
security_descriptor sd;
@@ -911,7 +911,7 @@ get_object_attribute (HANDLE handle, __uid32_t *uidret, __gid32_t *gidret,
}
int
-create_object_sd_from_attribute (HANDLE handle, __uid32_t uid, __gid32_t gid,
+create_object_sd_from_attribute (HANDLE handle, uid_t uid, gid_t gid,
mode_t attribute, security_descriptor &sd)
{
path_conv pc;
@@ -936,7 +936,7 @@ set_object_sd (HANDLE handle, security_descriptor &sd, bool chown)
}
int
-set_object_attribute (HANDLE handle, __uid32_t uid, __gid32_t gid,
+set_object_attribute (HANDLE handle, uid_t uid, gid_t gid,
mode_t attribute)
{
security_descriptor sd;
@@ -949,7 +949,7 @@ set_object_attribute (HANDLE handle, __uid32_t uid, __gid32_t gid,
int
set_file_attribute (HANDLE handle, path_conv &pc,
- __uid32_t uid, __gid32_t gid, mode_t attribute)
+ uid_t uid, gid_t gid, mode_t attribute)
{
int ret = -1;
@@ -964,7 +964,7 @@ set_file_attribute (HANDLE handle, path_conv &pc,
}
else
ret = 0;
- syscall_printf ("%d = set_file_attribute(%S, %d, %d, %p)",
+ syscall_printf ("%d = set_file_attribute(%S, %d, %d, %y)",
ret, pc.get_nt_native_path (), uid, gid, attribute);
return ret;
}
@@ -1061,7 +1061,7 @@ check_file_access (path_conv &pc, int flags, bool effective)
desired |= FILE_EXECUTE;
if (!get_file_sd (pc.handle (), pc, sd, false))
ret = check_access (sd, file_mapping, desired, flags, effective);
- debug_printf ("flags %x, ret %d", flags, ret);
+ debug_printf ("flags %y, ret %d", flags, ret);
return ret;
}
@@ -1070,10 +1070,10 @@ check_registry_access (HANDLE hdl, int flags, bool effective)
{
security_descriptor sd;
int ret = -1;
- static GENERIC_MAPPING NO_COPY reg_mapping = { KEY_READ,
- KEY_WRITE,
- KEY_EXECUTE,
- KEY_ALL_ACCESS };
+ static GENERIC_MAPPING NO_COPY_RO reg_mapping = { KEY_READ,
+ KEY_WRITE,
+ KEY_EXECUTE,
+ KEY_ALL_ACCESS };
ACCESS_MASK desired = 0;
if (flags & R_OK)
desired |= KEY_ENUMERATE_SUB_KEYS;
@@ -1094,6 +1094,6 @@ check_registry_access (HANDLE hdl, int flags, bool effective)
set_errno (EROFS);
ret = -1;
}
- debug_printf ("flags %x, ret %d", flags, ret);
+ debug_printf ("flags %y, ret %d", flags, ret);
return ret;
}
diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h
index e478d91ac..ca0239b69 100644
--- a/winsup/cygwin/security.h
+++ b/winsup/cygwin/security.h
@@ -30,43 +30,41 @@ details. */
#define NO_SID ((PSID)NULL)
#ifndef SE_CREATE_TOKEN_PRIVILEGE
-#define SE_CREATE_TOKEN_PRIVILEGE 2UL
-#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3UL
-#define SE_LOCK_MEMORY_PRIVILEGE 4UL
-#define SE_INCREASE_QUOTA_PRIVILEGE 5UL
-#define SE_MACHINE_ACCOUNT_PRIVILEGE 6UL
-#define SE_TCB_PRIVILEGE 7UL
-#define SE_SECURITY_PRIVILEGE 8UL
-#define SE_TAKE_OWNERSHIP_PRIVILEGE 9UL
-#define SE_LOAD_DRIVER_PRIVILEGE 10UL
-#define SE_SYSTEM_PROFILE_PRIVILEGE 11UL
-#define SE_SYSTEMTIME_PRIVILEGE 12UL
-#define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13UL
-#define SE_INC_BASE_PRIORITY_PRIVILEGE 14UL
-#define SE_CREATE_PAGEFILE_PRIVILEGE 15UL
-#define SE_CREATE_PERMANENT_PRIVILEGE 16UL
-#define SE_BACKUP_PRIVILEGE 17UL
-#define SE_RESTORE_PRIVILEGE 18UL
-#define SE_SHUTDOWN_PRIVILEGE 19UL
-#define SE_DEBUG_PRIVILEGE 20UL
-#define SE_AUDIT_PRIVILEGE 21UL
-#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22UL
-#define SE_CHANGE_NOTIFY_PRIVILEGE 23UL
-#define SE_REMOTE_SHUTDOWN_PRIVILEGE 24UL
-/* Starting with Windows 2000 */
-#define SE_UNDOCK_PRIVILEGE 25UL
-#define SE_SYNC_AGENT_PRIVILEGE 26UL
-#define SE_ENABLE_DELEGATION_PRIVILEGE 27UL
-#define SE_MANAGE_VOLUME_PRIVILEGE 28UL
-/* Starting with Windows 2000 SP4, XP SP2, 2003 Server */
-#define SE_IMPERSONATE_PRIVILEGE 29UL
-#define SE_CREATE_GLOBAL_PRIVILEGE 30UL
+#define SE_CREATE_TOKEN_PRIVILEGE 2U
+#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3U
+#define SE_LOCK_MEMORY_PRIVILEGE 4U
+#define SE_INCREASE_QUOTA_PRIVILEGE 5U
+#define SE_MACHINE_ACCOUNT_PRIVILEGE 6U
+#define SE_TCB_PRIVILEGE 7U
+#define SE_SECURITY_PRIVILEGE 8U
+#define SE_TAKE_OWNERSHIP_PRIVILEGE 9U
+#define SE_LOAD_DRIVER_PRIVILEGE 10U
+#define SE_SYSTEM_PROFILE_PRIVILEGE 11U
+#define SE_SYSTEMTIME_PRIVILEGE 12U
+#define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13U
+#define SE_INC_BASE_PRIORITY_PRIVILEGE 14U
+#define SE_CREATE_PAGEFILE_PRIVILEGE 15U
+#define SE_CREATE_PERMANENT_PRIVILEGE 16U
+#define SE_BACKUP_PRIVILEGE 17U
+#define SE_RESTORE_PRIVILEGE 18U
+#define SE_SHUTDOWN_PRIVILEGE 19U
+#define SE_DEBUG_PRIVILEGE 20U
+#define SE_AUDIT_PRIVILEGE 21U
+#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22U
+#define SE_CHANGE_NOTIFY_PRIVILEGE 23U
+#define SE_REMOTE_SHUTDOWN_PRIVILEGE 24U
+#define SE_UNDOCK_PRIVILEGE 25U
+#define SE_SYNC_AGENT_PRIVILEGE 26U
+#define SE_ENABLE_DELEGATION_PRIVILEGE 27U
+#define SE_MANAGE_VOLUME_PRIVILEGE 28U
+#define SE_IMPERSONATE_PRIVILEGE 29U
+#define SE_CREATE_GLOBAL_PRIVILEGE 30U
/* Starting with Vista */
-#define SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE 31UL
-#define SE_RELABEL_PRIVILEGE 32UL
-#define SE_INCREASE_WORKING_SET_PRIVILEGE 33UL
-#define SE_TIME_ZONE_PRIVILEGE 34UL
-#define SE_CREATE_SYMBOLIC_LINK_PRIVILEGE 35UL
+#define SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE 31U
+#define SE_RELABEL_PRIVILEGE 32U
+#define SE_INCREASE_WORKING_SET_PRIVILEGE 33U
+#define SE_TIME_ZONE_PRIVILEGE 34U
+#define SE_CREATE_SYMBOLIC_LINK_PRIVILEGE 35U
#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_SYMBOLIC_LINK_PRIVILEGE
@@ -114,7 +112,7 @@ public:
cygpsid (PSID nsid) { psid = nsid; }
operator PSID () const { return psid; }
const PSID operator= (PSID nsid) { return psid = nsid;}
- __uid32_t get_id (BOOL search_grp, int *type = NULL);
+ uid_t get_id (BOOL search_grp, int *type = NULL);
int get_uid () { return get_id (FALSE); }
int get_gid () { return get_id (TRUE); }
@@ -187,7 +185,7 @@ public:
inline PSID set () { return psid = (PSID) sbuf; }
BOOL getfrompw (const struct passwd *pw);
- BOOL getfromgr (const struct __group32 *gr);
+ BOOL getfromgr (const struct group *gr);
void debug_print (const char *prefix = NULL) const
{
@@ -217,7 +215,7 @@ public:
}
~cygsidlist () { if (type == cygsidlist_auto) delete [] sids; }
- BOOL addfromgr (struct __group32 *gr) /* Only with alloc */
+ BOOL addfromgr (struct group *gr) /* Only with alloc */
{ return sids[cnt].getfromgr (gr) && ++cnt; }
/* += adds a "normal" SID, *= adds a well-known SID. See comment in class
@@ -346,7 +344,6 @@ extern cygpsid well_known_system_sid;
extern cygpsid well_known_builtin_sid;
extern cygpsid well_known_admins_sid;
extern cygpsid well_known_users_sid;
-extern cygpsid fake_logon_sid;
extern cygpsid mandatory_medium_integrity_sid;
extern cygpsid mandatory_high_integrity_sid;
extern cygpsid mandatory_system_integrity_sid;
@@ -370,17 +367,17 @@ legal_sid_type (SID_NAME_USE type)
class path_conv;
/* File manipulation */
int __reg3 get_file_attribute (HANDLE, path_conv &, mode_t *,
- __uid32_t *, __gid32_t *);
+ uid_t *, gid_t *);
int __reg3 set_file_attribute (HANDLE, path_conv &,
- __uid32_t, __gid32_t, mode_t);
+ uid_t, gid_t, mode_t);
int __reg2 get_object_sd (HANDLE, security_descriptor &);
-int __reg3 get_object_attribute (HANDLE, __uid32_t *, __gid32_t *, mode_t *);
-int __reg3 set_object_attribute (HANDLE, __uid32_t, __gid32_t, mode_t);
-int __reg3 create_object_sd_from_attribute (HANDLE, __uid32_t, __gid32_t,
+int __reg3 get_object_attribute (HANDLE, uid_t *, gid_t *, mode_t *);
+int __reg3 set_object_attribute (HANDLE, uid_t, gid_t, mode_t);
+int __reg3 create_object_sd_from_attribute (HANDLE, uid_t, gid_t,
mode_t, security_descriptor &);
int __reg3 set_object_sd (HANDLE, security_descriptor &, bool);
-int __reg3 get_reg_attribute (HKEY hkey, mode_t *, __uid32_t *, __gid32_t *);
+int __reg3 get_reg_attribute (HKEY hkey, mode_t *, uid_t *, gid_t *);
LONG __reg3 get_file_sd (HANDLE fh, path_conv &, security_descriptor &, bool);
LONG __reg3 set_file_sd (HANDLE fh, path_conv &, security_descriptor &, bool);
bool __reg3 add_access_allowed_ace (PACL, int, DWORD, PSID, size_t &, DWORD);
@@ -392,14 +389,14 @@ void set_security_attribute (path_conv &pc, int attribute,
PSECURITY_ATTRIBUTES psa,
security_descriptor &sd_buf);
-bool get_sids_info (cygpsid, cygpsid, __uid32_t * , __gid32_t *);
+bool get_sids_info (cygpsid, cygpsid, uid_t * , gid_t *);
/* sec_acl.cc */
-struct __acl32;
-extern "C" int aclsort32 (int, int, __acl32 *);
-extern "C" int acl32 (const char *, int, int, __acl32 *);
-int getacl (HANDLE, path_conv &, int, __acl32 *);
-int setacl (HANDLE, path_conv &, int, __acl32 *, bool &);
+struct acl;
+extern "C" int aclsort32 (int, int, struct acl *);
+extern "C" int acl32 (const char *, int, int, struct acl *);
+int getacl (HANDLE, path_conv &, int, struct acl *);
+int setacl (HANDLE, path_conv &, int, struct acl *, bool &);
/* Set impersonation or restricted token. */
void set_imp_token (HANDLE token, int type);
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 11964c9d6..ab6517cbf 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -53,7 +53,6 @@ details. */
* should be >= NOFILE (param.h).
*/
-typedef long fd_mask;
#define UNIX_NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
#ifndef unix_howmany
#define unix_howmany(x,y) (((x)+((y)-1))/(y))
@@ -63,7 +62,7 @@ typedef long fd_mask;
#define NULL_fd_set ((fd_set *) NULL)
#define sizeof_fd_set(n) \
- ((unsigned) (NULL_fd_set->fds_bits + unix_howmany ((n), UNIX_NFDBITS)))
+ ((size_t) (NULL_fd_set->fds_bits + unix_howmany ((n), UNIX_NFDBITS)))
#define UNIX_FD_SET(n, p) \
((p)->fds_bits[(n)/UNIX_NFDBITS] |= (1L << ((n) % UNIX_NFDBITS)))
#define UNIX_FD_CLR(n, p) \
@@ -114,7 +113,7 @@ cygwin_select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
ms = 1; /* At least 1 ms granularity */
if (to)
- select_printf ("to->tv_sec %d, to->tv_usec %d, ms %d", to->tv_sec, to->tv_usec, ms);
+ select_printf ("to->tv_sec %ld, to->tv_usec %ld, ms %d", to->tv_sec, to->tv_usec, ms);
else
select_printf ("to NULL, ms %x", ms);
@@ -295,7 +294,7 @@ select_record::dump_select_record ()
read_ready, write_ready, except_ready);
select_printf ("read_selected %d, write_selected %d, except_selected %d, except_on_write %d",
read_selected, write_selected, except_selected, except_on_write);
-
+
select_printf ("startup %p, peek %p, verify %p cleanup %p, next %p",
startup, peek, verify, cleanup, next);
}
@@ -539,7 +538,7 @@ no_verify (select_record *, fd_set *, fd_set *, fd_set *)
static int
pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing)
{
- IO_STATUS_BLOCK iosb = {0};
+ IO_STATUS_BLOCK iosb = {{0}, 0};
FILE_PIPE_LOCAL_INFORMATION fpli = {0};
bool res;
@@ -568,7 +567,7 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing)
that. This means that a pipe could still block since you could
be trying to write more to the pipe than is available in the
buffer but that is the hazard of select(). */
- paranoid_printf ("fd %d, %s, write: size %lu, avail %lu", fd,
+ paranoid_printf ("fd %d, %s, write: size %u, avail %u", fd,
fh->get_name (), fpli.OutboundQuota,
fpli.WriteQuotaAvailable);
else if ((res = (fpli.OutboundQuota < PIPE_BUF &&
@@ -576,7 +575,7 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing)
/* If we somehow inherit a tiny pipe (size < PIPE_BUF), then consider
the pipe writable only if it is completely empty, to minimize the
probability that a subsequent write will block. */
- select_printf ("fd, %s, write tiny pipe: size %lu, avail %lu",
+ select_printf ("fd, %s, write tiny pipe: size %u, avail %u",
fd, fh->get_name (), fpli.OutboundQuota,
fpli.WriteQuotaAvailable);
return res ?: -!!(fpli.NamedPipeState & FILE_PIPE_CLOSING_STATE);
diff --git a/winsup/cygwin/select.h b/winsup/cygwin/select.h
index 9231e2fdc..5ce092486 100644
--- a/winsup/cygwin/select.h
+++ b/winsup/cygwin/select.h
@@ -1,7 +1,7 @@
/* select.h
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
diff --git a/winsup/cygwin/sem.cc b/winsup/cygwin/sem.cc
index d90ba2add..2c172990a 100644
--- a/winsup/cygwin/sem.cc
+++ b/winsup/cygwin/sem.cc
@@ -1,6 +1,6 @@
/* sem.cc: XSI IPC interface for Cygwin.
- Copyright 2002, 2003, 2004, 2005, 2008, 2009 Red Hat, Inc.
+ Copyright 2002, 2003, 2004, 2005, 2008, 2009, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -83,8 +83,8 @@ semctl (int semid, int semnum, int cmd, ...)
arg = va_arg (ap, union semun);
va_end (ap);
}
- syscall_printf ("semctl (semid = %d, semnum = %d, cmd = %d, arg.val = 0x%x)",
- semid, semnum, cmd, arg.val);
+ syscall_printf ("semctl (semid = %d, semnum = %d, cmd = %d, arg = %p)",
+ semid, semnum, cmd, arg.buf);
myfault efault;
if (efault.faulted (EFAULT))
return -1;
@@ -103,7 +103,7 @@ semctl (int semid, int semnum, int cmd, ...)
extern "C" int
semget (key_t key, int nsems, int semflg)
{
- syscall_printf ("semget (key = %U, nsems = %d, semflg = 0x%x)",
+ syscall_printf ("semget (key = %U, nsems = %d, semflg = %y)",
key, nsems, semflg);
client_request_sem request (key, nsems, semflg);
if (request.make_request () == -1 || request.retval () == -1)
@@ -120,7 +120,7 @@ semget (key_t key, int nsems, int semflg)
extern "C" int
semop (int semid, struct sembuf *sops, size_t nsops)
{
- syscall_printf ("semop (semid = %d, sops = %p, nsops = %d)",
+ syscall_printf ("semop (semid = %d, sops = %p, nsops = %ld)",
semid, sops, nsops);
myfault efault;
if (efault.faulted (EFAULT))
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index 5ba69dc65..9cc84593c 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -1,7 +1,7 @@
/* shared.cc: shared data area support.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -59,7 +59,7 @@ get_shared_parent_dir ()
status = NtCreateDirectoryObject (&shared_parent_dir,
CYG_SHARED_DIR_ACCESS, &attr);
if (!NT_SUCCESS (status))
- api_fatal ("NtCreateDirectoryObject(%S): %p", &uname, status);
+ api_fatal ("NtCreateDirectoryObject(%S): %y", &uname, status);
}
return shared_parent_dir;
}
@@ -95,7 +95,7 @@ get_session_parent_dir ()
status = NtCreateDirectoryObject (&session_parent_dir,
CYG_SHARED_DIR_ACCESS, &attr);
if (!NT_SUCCESS (status))
- api_fatal ("NtCreateDirectoryObject(%S): %p", &uname, status);
+ api_fatal ("NtCreateDirectoryObject(%S): %y", &uname, status);
}
}
return session_parent_dir;
@@ -115,8 +115,8 @@ shared_name (WCHAR *ret_buf, const WCHAR *str, int num)
return ret_buf;
}
-#define page_const (65535)
-#define pround(n) (((size_t) (n) + page_const) & ~page_const)
+#define page_const ((ptrdiff_t) 65535)
+#define pround(n) ((ptrdiff_t)(((n) + page_const) & ~page_const))
/* The order in offsets is so that the constant blocks shared_info
and user_info are right below the cygwin DLL, then the pinfo block
@@ -290,40 +290,20 @@ shared_destroy ()
void
shared_info::init_obcaseinsensitive ()
{
- if (wincap.kernel_is_always_casesensitive ())
- {
- /* Only Windows 2000. Default to case insensitive unless the user
- sets the obcaseinsensitive registry value explicitely to 0. */
- DWORD def_obcaseinsensitive = 1;
-
- obcaseinsensitive = def_obcaseinsensitive;
- RTL_QUERY_REGISTRY_TABLE tab[2] = {
- { NULL, RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_NOSTRING,
- L"obcaseinsensitive", &obcaseinsensitive, REG_DWORD,
- &def_obcaseinsensitive, sizeof (DWORD) },
- { NULL, 0, NULL, NULL, 0, NULL, 0 }
- };
- RtlQueryRegistryValues (RTL_REGISTRY_CONTROL,
- L"Session Manager\\kernel",
- tab, NULL, NULL);
- }
- else
- {
- /* Instead of reading the obcaseinsensitive registry value, test the
- actual state of case sensitivity handling in the kernel. */
- UNICODE_STRING sysroot;
- OBJECT_ATTRIBUTES attr;
- HANDLE h;
-
- RtlInitUnicodeString (&sysroot, L"\\SYSTEMROOT");
- InitializeObjectAttributes (&attr, &sysroot, 0, NULL, NULL);
- /* NtOpenSymbolicLinkObject returns STATUS_ACCESS_DENIED when called
- with a 0 access mask. However, if the kernel is case sensitive,
- it returns STATUS_OBJECT_NAME_NOT_FOUND because we used the incorrect
- case for the filename (It's actually "\\SystemRoot"). */
- obcaseinsensitive = NtOpenSymbolicLinkObject (&h, 0, &attr)
- != STATUS_OBJECT_NAME_NOT_FOUND;
- }
+ /* Instead of reading the obcaseinsensitive registry value, test the
+ actual state of case sensitivity handling in the kernel. */
+ UNICODE_STRING sysroot;
+ OBJECT_ATTRIBUTES attr;
+ HANDLE h;
+
+ RtlInitUnicodeString (&sysroot, L"\\SYSTEMROOT");
+ InitializeObjectAttributes (&attr, &sysroot, 0, NULL, NULL);
+ /* NtOpenSymbolicLinkObject returns STATUS_ACCESS_DENIED when called
+ with a 0 access mask. However, if the kernel is case sensitive,
+ it returns STATUS_OBJECT_NAME_NOT_FOUND because we used the incorrect
+ case for the filename (It's actually "\\SystemRoot"). */
+ obcaseinsensitive = NtOpenSymbolicLinkObject (&h, 0, &attr)
+ != STATUS_OBJECT_NAME_NOT_FOUND;
}
void inline
@@ -355,11 +335,11 @@ shared_info::initialize ()
debug_printf ("Installation root: <%W> key: <%S>",
cygheap->installation_root, &cygheap->installation_key);
}
- else if (sversion != (LONG) CURR_SHARED_MAGIC)
+ else if (sversion != CURR_SHARED_MAGIC)
sversion.multiple_cygwin_problem ("system shared memory version",
sversion, CURR_SHARED_MAGIC);
else if (cb != sizeof (*this))
- system_printf ("size of shared memory region changed from %u to %u",
+ system_printf ("size of shared memory region changed from %lu to %u",
sizeof (*this), cb);
heap_init ();
}
diff --git a/winsup/cygwin/shared_info.h b/winsup/cygwin/shared_info.h
index f3605e402..6733b3636 100644
--- a/winsup/cygwin/shared_info.h
+++ b/winsup/cygwin/shared_info.h
@@ -15,7 +15,7 @@ details. */
#include "limits.h"
#include "mount.h"
-#define CURR_USER_MAGIC 0x6467403bU
+#define CURR_USER_MAGIC 0xab1fcce8U
class user_info
{
@@ -25,6 +25,7 @@ public:
DWORD cb;
bool warned_msdos;
bool warned_notty;
+ bool warned_nonativesyms;
mount_info mountinfo;
friend void dll_crt0_1 (void *);
static void create (bool);
diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc
index f97210949..226d2ee91 100644
--- a/winsup/cygwin/shm.cc
+++ b/winsup/cygwin/shm.cc
@@ -1,6 +1,7 @@
/* shm.cc: XSI IPC interface for Cygwin.
- Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 Red Hat, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2012, 2013
+ Red Hat, Inc.
This file is part of Cygwin.
@@ -135,12 +136,12 @@ fixup_shms_after_fork ()
{
NTSTATUS status;
vm_object_t ptr = sph_entry->ptr;
- ULONG viewsize = sph_entry->parent->size;
+ SIZE_T viewsize = sph_entry->parent->size;
status = NtMapViewOfSection (sph_entry->parent->hdl, NtCurrentProcess (),
&ptr, 0, sph_entry->parent->size, NULL,
&viewsize, ViewShare, 0, sph_entry->access);
if (!NT_SUCCESS (status) || ptr != sph_entry->ptr)
- api_fatal ("fixup_shms_after_fork: NtMapViewOfSection (%p), status %p. Terminating.",
+ api_fatal ("fixup_shms_after_fork: NtMapViewOfSection (%p), status %y. Terminating.",
sph_entry->ptr, status);
}
return 0;
@@ -153,7 +154,7 @@ fixup_shms_after_fork ()
extern "C" void *
shmat (int shmid, const void *shmaddr, int shmflg)
{
- syscall_printf ("shmat (shmid = %d, shmaddr = %p, shmflg = 0x%x)",
+ syscall_printf ("shmat (shmid = %d, shmaddr = %p, shmflg = %y)",
shmid, shmaddr, shmflg);
SLIST_LOCK ();
@@ -219,7 +220,7 @@ shmat (int shmid, const void *shmaddr, int shmflg)
}
NTSTATUS status;
vm_object_t ptr = NULL;
- ULONG viewsize = ssh_entry->size;
+ SIZE_T viewsize = ssh_entry->size;
ULONG access = (shmflg & SHM_RDONLY) ? PAGE_READONLY : PAGE_READWRITE;
status = NtMapViewOfSection (ssh_entry->hdl, NtCurrentProcess (), &ptr, 0,
ssh_entry->size, NULL, &viewsize, ViewShare,
@@ -257,7 +258,7 @@ shmat (int shmid, const void *shmaddr, int shmflg)
extern "C" int
shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
- syscall_printf ("shmctl (shmid = %d, cmd = %d, buf = 0x%x)",
+ syscall_printf ("shmctl (shmid = %d, cmd = %d, buf = %p)",
shmid, cmd, buf);
myfault efault;
if (efault.faulted (EFAULT))
@@ -339,7 +340,7 @@ shmdt (const void *shmaddr)
extern "C" int
shmget (key_t key, size_t size, int shmflg)
{
- syscall_printf ("shmget (key = %U, size = %d, shmflg = 0x%x)",
+ syscall_printf ("shmget (key = %U, size = %d, shmflg = %y)",
key, size, shmflg);
/* Try allocating memory before calling cygserver. */
shm_shmid_list *ssh_new_entry = new (shm_shmid_list);
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index c99220d35..2501c1922 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -187,7 +187,7 @@ sigprocmask (int how, const sigset_t *set, sigset_t *oldset)
return res;
}
-int __stdcall
+int __reg3
handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& opmask)
{
/* check that how is in right range */
@@ -227,7 +227,7 @@ handle_sigprocmask (int how, const sigset_t *set, sigset_t *oldset, sigset_t& op
return 0;
}
-int __stdcall
+int __reg2
_pinfo::kill (siginfo_t& si)
{
int res;
@@ -273,7 +273,7 @@ _pinfo::kill (siginfo_t& si)
res = -1;
}
- syscall_printf ("%d = _pinfo::kill (%d), pid %d, process_state %p", res,
+ syscall_printf ("%d = _pinfo::kill (%d), pid %d, process_state %y", res,
si.si_signo, this_pid, this_process_state);
return res;
}
@@ -516,7 +516,7 @@ extern "C" int
sigpause (int signal_mask)
{
int res = handle_sigsuspend ((sigset_t) signal_mask);
- syscall_printf ("%R = sigpause(%p)", res, signal_mask);
+ syscall_printf ("%R = sigpause(%y)", res, signal_mask);
return res;
}
@@ -544,7 +544,7 @@ siginterrupt (int sig, int flag)
act.sa_flags |= SA_RESTART;
}
int res = sigaction_worker (sig, &act, NULL, true);
- syscall_printf ("%R = siginterrupt(%d, %p)", sig, flag);
+ syscall_printf ("%R = siginterrupt(%d, %y)", sig, flag);
return res;
}
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index e585877b9..55c5bbac9 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -44,8 +44,6 @@ char NO_COPY myself_nowait_dummy[1] = {'0'};// Flag to sig_send that signal goes
#define Static static NO_COPY
-Static HANDLE sig_hold; // Used to stop signal processing
-Static bool sigheld; // True if holding signals
Static int nprocs; // Number of deceased children
Static char cprocs[(NPROCS + 1) * sizeof (pinfo)];// All my children info
@@ -171,7 +169,7 @@ mychild (int pid)
/* Handle all subprocess requests
*/
int __reg2
-proc_subproc (DWORD what, DWORD val)
+proc_subproc (DWORD what, uintptr_t val)
{
int rc = 1;
int potential_match;
@@ -449,7 +447,16 @@ exit_thread (DWORD res)
# undef ExitThread
sigfillset (&_my_tls.sigmask); /* No signals wanted */
lock_process for_now; /* May block indefinitely when exiting. */
- if (exit_state)
+ /* ES_EXIT_STARTING indicates that exit is in progress. After setting
+ exit_state to ES_EXIT_STARTING, the global dtors are running first,
+ then the exit state is set to the next level in do_exit. We must not
+ block the thread exit while the global dtors are running, because
+ one of them might have called pthread_join, which is perfectly valid
+ for a global C++ destructor.
+ FIXME: Do we need another state between ES_EXIT_STARTING and
+ ES_SIGNAL_EXIT to narrow the gap in which the thread exit
+ is still valid? */
+ if (exit_state > ES_EXIT_STARTING)
{
for_now.release ();
Sleep (INFINITE);
@@ -478,24 +485,6 @@ exit_thread (DWORD res)
int __reg3
sig_send (_pinfo *p, int sig, _cygtls *tid)
{
- if (sig == __SIGHOLD)
- sigheld = true;
- else if (!sigheld)
- /* nothing */;
- else if (sig == __SIGFLUSH || sig == __SIGFLUSHFAST)
- return 0;
- else if (sig == __SIGNOHOLD)
- {
- SetEvent (sig_hold);
- sigheld = false;
- }
- else if (&_my_tls == _main_tls)
- {
-#ifdef DEBUGGING
- system_printf ("signal %d sent to %p while signals are on hold", sig, p);
-#endif
- return -1;
- }
siginfo_t si = {};
si.si_signo = sig;
si.si_code = SI_KERNEL;
@@ -991,7 +980,7 @@ child_info::sync (pid_t pid, HANDLE& hProcess, DWORD howlong)
hProcess = NULL;
}
}
- sigproc_printf ("pid %u, WFMO returned %d, exit_code %p, res %d", pid, x,
+ sigproc_printf ("pid %u, WFMO returned %d, exit_code %y, res %d", pid, x,
exit_code, res);
}
return res;
@@ -1002,7 +991,7 @@ child_info::proc_retry (HANDLE h)
{
if (!exit_code)
return EXITCODE_OK;
- sigproc_printf ("exit_code %p", exit_code);
+ sigproc_printf ("exit_code %y", exit_code);
switch (exit_code)
{
case STILL_ACTIVE: /* shouldn't happen */
@@ -1226,7 +1215,7 @@ static void WINAPI
wait_sig (VOID *)
{
_sig_tls = &_my_tls;
- sig_hold = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL);
+ bool sig_held = false;
sigproc_printf ("entering ReadFile loop, my_readsig %p, my_sendsig %p",
my_readsig, my_sendsig);
@@ -1275,33 +1264,7 @@ wait_sig (VOID *)
*pack.mask |= bit;
break;
case __SIGHOLD:
- goto loop;
- break;
- default:
- if (pack.si.si_signo < 0)
- sig_clear (-pack.si.si_signo);
- else
- sigq.add (pack);
- case __SIGNOHOLD:
- case __SIGFLUSH:
- case __SIGFLUSHFAST:
- {
- sigpacket *qnext;
- /* Check the queue for signals. There will always be at least one
- thing on the queue if this was a valid signal. */
- while ((qnext = q->next))
- {
- if (qnext->si.si_signo && qnext->process () <= 0)
- q = q->next;
- else
- {
- q->next = qnext->next;
- qnext->si.si_signo = 0;
- }
- }
- if (pack.si.si_signo == SIGCHLD)
- clearwait = true;
- }
+ sig_held = true;
break;
case __SIGSETPGRP:
init_console_handler (true);
@@ -1328,16 +1291,41 @@ wait_sig (VOID *)
}
}
break;
+ default:
+ if (pack.si.si_signo < 0)
+ sig_clear (-pack.si.si_signo);
+ else
+ sigq.add (pack);
+ case __SIGNOHOLD:
+ sig_held = false;
+ case __SIGFLUSH:
+ case __SIGFLUSHFAST:
+ if (!sig_held)
+ {
+ sigpacket *qnext;
+ /* Check the queue for signals. There will always be at least one
+ thing on the queue if this was a valid signal. */
+ while ((qnext = q->next))
+ {
+ if (qnext->si.si_signo && qnext->process () <= 0)
+ q = q->next;
+ else
+ {
+ q->next = qnext->next;
+ qnext->si.si_signo = 0;
+ }
+ }
+ if (pack.si.si_signo == SIGCHLD)
+ clearwait = true;
+ }
+ break;
}
if (clearwait && !have_execed)
proc_subproc (PROC_CLEARWAIT, 0);
- loop:
if (pack.wakeup)
{
sigproc_printf ("signalling pack.wakeup %p", pack.wakeup);
SetEvent (pack.wakeup);
}
- if (pack.si.si_signo == __SIGHOLD)
- WaitForSingleObject (sig_hold, INFINITE);
}
}
diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h
index c4313f056..23647a458 100644
--- a/winsup/cygwin/sigproc.h
+++ b/winsup/cygwin/sigproc.h
@@ -68,7 +68,7 @@ void __reg1 sig_clear (int);
void __reg1 sig_set_pending (int);
int __stdcall handle_sigsuspend (sigset_t);
-int __reg2 proc_subproc (DWORD, DWORD);
+int __reg2 proc_subproc (DWORD, uintptr_t);
class _pinfo;
void __stdcall proc_terminate ();
diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc
index f0ce7e74b..e3e238fd9 100644
--- a/winsup/cygwin/smallprint.cc
+++ b/winsup/cygwin/smallprint.cc
@@ -1,7 +1,7 @@
/* smallprint.cc: small print routines for WIN32
Copyright 1996, 1998, 2000, 2001, 2002, 2003, 2005, 2006,
- 2007, 2008, 2009, 2012
+ 2007, 2008, 2009, 2012, 2013
Red Hat, Inc.
This file is part of Cygwin.
@@ -20,8 +20,8 @@ details. */
#define LLMASK (0xffffffffffffffffULL)
#define LMASK (0xffffffff)
-#define rnarg(dst, base, dosign, len, pad) __rn ((dst), (base), (dosign), va_arg (ap, long), len, pad, LMASK)
-#define rnargLL(dst, base, dosign, len, pad) __rn ((dst), (base), (dosign), va_arg (ap, unsigned long long), len, pad, LLMASK)
+#define rnarg(dst, base, dosign, len, pad) __rn ((dst), (base), (dosign), va_arg (ap, int32_t), len, pad, LMASK)
+#define rnargLL(dst, base, dosign, len, pad) __rn ((dst), (base), (dosign), va_arg (ap, uint64_t), len, pad, LLMASK)
static const char hex_str[] = "0123456789ABCDEF";
@@ -92,6 +92,40 @@ __rn (char *dst, int base, int dosign, long long val, int len, int pad, unsigned
return dst;
}
+/*
+ Meaning of format conversion specifiers. If 'l' isn't explicitely mentioned,
+ it's ignored!
+
+ c char
+ C WCHAR/wchar_t
+ d signed int, 4 byte
+ ld signed long, 4 byte on 32 bit, 8 byte on 64 bit
+ D signed long long, 8 byte
+ E GetLastError
+ o octal unsigned int, 4 byte
+ lo octal unsigned long, 4 byte on 32 bit, 8 byte on 64 bit
+ O octal unsigned long long, 8 byte
+ p address
+ P process name
+ R return value, 4 byte.
+ lR return value, 4 byte on 32 bit, 8 byte on 64 bit.
+ s char *
+ ls char * w/ non-ASCII tweaking
+ S PUNICODE_STRING
+ lS PUNICODE_STRING w/ non-ASCII tweaking
+ u unsigned int, 4 byte
+ lu unsigned long, 4 byte on 32 bit, 8 byte on 64 bit
+ U unsigned long long, 8 byte
+ W PWCHAR/wchar_t *
+ lW PWCHAR/wchar_t * w/ non-ASCII tweaking
+ x hex unsigned int, 4 byte
+ lx hex unsigned long, 4 byte on 32 bit, 8 byte on 64 bit
+ X hex unsigned long long, 8 byte
+ y 0x hex unsigned int, 4 byte
+ ly 0x hex unsigned long, 4 byte on 32 bit, 8 byte on 64 bit
+ Y 0x hex unsigned long long, 8 byte
+*/
+
int
__small_vsprintf (char *dst, const char *fmt, va_list ap)
{
@@ -100,10 +134,11 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
const char *s;
PWCHAR w;
UNICODE_STRING uw, *us;
+ int base = 0;
DWORD err = GetLastError ();
- long Rval = 0;
+ intptr_t Rval = 0;
while (*fmt)
{
int i, n = 0x7fff;
@@ -171,35 +206,82 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
dst = __rn (dst + sizeof ("Win32 error"), 10, 0, err, len, pad, LMASK);
break;
case 'R':
- case 'd':
{
- long val = va_arg (ap, long);
- dst = __rn (dst, 10, addsign, val, len, pad, LMASK);
- if (c == 'R')
- Rval = val;
+#ifdef __x86_64__
+ if (l_opt)
+ Rval = va_arg (ap, int64_t);
+ else
+#endif
+ Rval = va_arg (ap, int32_t);
+ dst = __rn (dst, 10, addsign, Rval, len, pad, LMASK);
}
break;
- case 'D':
- dst = rnargLL (dst, 10, addsign, len, pad);
- break;
+ case 'd':
+ base = 10;
+#ifdef __x86_64__
+ if (l_opt)
+ goto gen_decimalLL;
+#endif
+ goto gen_decimal;
case 'u':
- dst = rnarg (dst, 10, 0, len, pad);
- break;
- case 'U':
- dst = rnargLL (dst, 10, 0, len, pad);
- break;
+ base = 10;
+ addsign = 0;
+#ifdef __x86_64__
+ if (l_opt)
+ goto gen_decimalLL;
+#endif
+ goto gen_decimal;
case 'o':
- dst = rnarg (dst, 8, 0, len, pad);
- break;
- case 'p':
+ base = 8;
+ addsign = 0;
+#ifdef __x86_64__
+ if (l_opt)
+ goto gen_decimalLL;
+#endif
+ goto gen_decimal;
+ case 'y':
*dst++ = '0';
*dst++ = 'x';
- /* fall through */
+ /*FALLTHRU*/
case 'x':
- dst = rnarg (dst, 16, 0, len, pad);
+ base = 16;
+ addsign = 0;
+#ifdef __x86_64__
+ if (l_opt)
+ goto gen_decimalLL;
+#endif
+gen_decimal:
+ dst = rnarg (dst, base, addsign, len, pad);
break;
+ case 'D':
+ base = 10;
+ goto gen_decimalLL;
+ case 'U':
+ base = 10;
+ addsign = 0;
+ goto gen_decimalLL;
+ case 'O':
+ base = 8;
+ addsign = 0;
+ goto gen_decimalLL;
+ case 'Y':
+ *dst++ = '0';
+ *dst++ = 'x';
+ /*FALLTHRU*/
case 'X':
+ base = 16;
+ addsign = 0;
+gen_decimalLL:
+ dst = rnargLL (dst, base, addsign, len, pad);
+ break;
+ case 'p':
+ *dst++ = '0';
+ *dst++ = 'x';
+#ifdef __x86_64__
dst = rnargLL (dst, 16, 0, len, pad);
+#else
+ dst = rnarg (dst, 16, 0, len, pad);
+#endif
break;
case 'P':
if (!GetModuleFileName (NULL, tmp, NT_MAX_PATH))
@@ -273,8 +355,7 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
}
if (Rval < 0)
{
- strcpy (dst, ", errno ");
- dst += strlen (", errno ");
+ dst = stpcpy (dst, ", errno ");
dst = __rn (dst, 10, false, get_errno (), 0, 0, LMASK);
}
*dst = 0;
@@ -395,12 +476,17 @@ __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap)
const char *s;
PWCHAR w;
UNICODE_STRING uw, *us;
+ int base = 0;
DWORD err = GetLastError ();
+ intptr_t Rval = 0;
while (*fmt)
{
unsigned int n = 0x7fff;
+#ifdef __x86_64__
+ bool l_opt = false;
+#endif
if (*fmt != L'%')
*dst++ = *fmt++;
else
@@ -435,6 +521,9 @@ __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap)
len = len * 10 + (c - L'0');
continue;
case L'l':
+#ifdef __x86_64__
+ l_opt = true;
+#endif
continue;
case L'c':
case L'C':
@@ -444,30 +533,83 @@ __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap)
wcscpy (dst, L"Win32 error ");
dst = __wrn (dst + sizeof ("Win32 error"), 10, 0, err, len, pad, LMASK);
break;
- case L'd':
- dst = wrnarg (dst, 10, addsign, len, pad);
- break;
- case L'D':
- dst = wrnargLL (dst, 10, addsign, len, pad);
- break;
- case L'u':
- dst = wrnarg (dst, 10, 0, len, pad);
+ case 'R':
+ {
+#ifdef __x86_64__
+ if (l_opt)
+ Rval = va_arg (ap, int64_t);
+ else
+#endif
+ Rval = va_arg (ap, int32_t);
+ dst = __wrn (dst, 10, addsign, Rval, len, pad, LMASK);
+ }
break;
- case L'U':
- dst = wrnargLL (dst, 10, 0, len, pad);
+ case L'd':
+ base = 10;
+#ifdef __x86_64__
+ if (l_opt)
+ goto gen_decimalLL;
+#endif
+ goto gen_decimal;
+ case 'u':
+ base = 10;
+ addsign = 0;
+#ifdef __x86_64__
+ if (l_opt)
+ goto gen_decimalLL;
+#endif
+ goto gen_decimal;
+ case 'o':
+ base = 8;
+ addsign = 0;
+#ifdef __x86_64__
+ if (l_opt)
+ goto gen_decimalLL;
+#endif
+ goto gen_decimal;
+ case 'y':
+ *dst++ = '0';
+ *dst++ = 'x';
+ /*FALLTHRU*/
+ case 'x':
+ base = 16;
+ addsign = 0;
+#ifdef __x86_64__
+ if (l_opt)
+ goto gen_decimalLL;
+#endif
+gen_decimal:
+ dst = wrnarg (dst, base, addsign, len, pad);
break;
- case L'o':
- dst = wrnarg (dst, 8, 0, len, pad);
+ case 'D':
+ base = 10;
+ goto gen_decimalLL;
+ case 'U':
+ base = 10;
+ addsign = 0;
+ goto gen_decimalLL;
+ case 'O':
+ base = 8;
+ addsign = 0;
+ goto gen_decimalLL;
+ case 'Y':
+ *dst++ = '0';
+ *dst++ = 'x';
+ /*FALLTHRU*/
+ case 'X':
+ base = 16;
+ addsign = 0;
+gen_decimalLL:
+ dst = wrnargLL (dst, base, addsign, len, pad);
break;
case L'p':
*dst++ = L'0';
*dst++ = L'x';
- /* fall through */
- case L'x':
- dst = wrnarg (dst, 16, 0, len, pad);
- break;
- case L'X':
+#ifdef __x86_64__
dst = wrnargLL (dst, 16, 0, len, pad);
+#else
+ dst = wrnarg (dst, 16, 0, len, pad);
+#endif
break;
case L'P':
if (!GetModuleFileNameW (NULL, tmp, NT_MAX_PATH))
@@ -511,6 +653,11 @@ __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap)
}
}
}
+ if (Rval < 0)
+ {
+ dst = wcpcpy (dst, L", errno ");
+ dst = __wrn (dst, 10, false, get_errno (), 0, 0, LMASK);
+ }
*dst = L'\0';
SetLastError (err);
return dst - orig;
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 4ed3221dd..89d4ddcb9 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -34,7 +34,7 @@ details. */
#include "winf.h"
#include "ntdll.h"
-static suffix_info NO_COPY exe_suffixes[] =
+static const suffix_info exe_suffixes[] =
{
suffix_info ("", 1),
suffix_info (".exe", 1),
@@ -42,20 +42,6 @@ static suffix_info NO_COPY exe_suffixes[] =
suffix_info (NULL)
};
-#if 0
-/* CV, 2009-11-05: Used to be used when searching for DLLs in calls to
- dlopen(). However, dlopen() on other platforms never adds a suffix by
- its own. Therefore we use stat_suffixes now, which only adds a .exe
- suffix for symmetry. */
-static suffix_info dll_suffixes[] =
-{
- suffix_info (".dll"),
- suffix_info ("", 1),
- suffix_info (".exe", 1),
- suffix_info (NULL)
-};
-#endif
-
/* Add .exe to PROG if not already present and see if that exists.
If not, return PROG (converted from posix to win32 rules if necessary).
The result is always BUF.
@@ -99,7 +85,7 @@ perhaps_suffix (const char *prog, path_conv& buf, int& err, unsigned opt)
of name is placed in buf and returned. Otherwise the contents of buf
is undefined and NULL is returned. */
-const char * __stdcall
+const char * __reg3
find_exec (const char *name, path_conv& buf, const char *mywinenv,
unsigned opt, const char **known_suffix)
{
@@ -248,26 +234,50 @@ iscmd (const char *argv0, const char *what)
(n == 0 || isdirsep (argv0[n - 1]));
}
-struct pthread_cleanup
+#define ILLEGAL_SIG_FUNC_PTR ((_sig_func_ptr) (-2))
+struct system_call_handle
{
_sig_func_ptr oldint;
_sig_func_ptr oldquit;
sigset_t oldmask;
- pthread_cleanup (): oldint (NULL), oldquit (NULL), oldmask ((sigset_t) -1) {}
-};
-
-static void
-do_cleanup (void *args)
-{
-# define cleanup ((pthread_cleanup *) args)
- if (cleanup->oldmask != (sigset_t) -1)
- {
- signal (SIGINT, cleanup->oldint);
- signal (SIGQUIT, cleanup->oldquit);
- sigprocmask (SIG_SETMASK, &(cleanup->oldmask), NULL);
- }
+ bool is_system_call ()
+ {
+ return oldint != ILLEGAL_SIG_FUNC_PTR;
+ }
+ system_call_handle (bool issystem)
+ {
+ if (!issystem)
+ oldint = ILLEGAL_SIG_FUNC_PTR;
+ else
+ {
+ sig_send (NULL, __SIGHOLD);
+ oldint = NULL;
+ }
+ }
+ void arm()
+ {
+ if (is_system_call ())
+ {
+ sigset_t child_block;
+ oldint = signal (SIGINT, SIG_IGN);
+ oldquit = signal (SIGQUIT, SIG_IGN);
+ sigemptyset (&child_block);
+ sigaddset (&child_block, SIGCHLD);
+ sigprocmask (SIG_BLOCK, &child_block, &oldmask);
+ sig_send (NULL, __SIGNOHOLD);
+ }
+ }
+ ~system_call_handle ()
+ {
+ if (is_system_call ())
+ {
+ signal (SIGINT, oldint);
+ signal (SIGQUIT, oldquit);
+ sigprocmask (SIG_SETMASK, &oldmask, NULL);
+ }
+ }
# undef cleanup
-}
+};
child_info_spawn NO_COPY ch_spawn;
@@ -308,18 +318,6 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
return -1;
}
- /* FIXME: There is a small race here and FIXME: not thread safe! */
- pthread_cleanup cleanup;
- if (mode == _P_SYSTEM)
- {
- sigset_t child_block;
- cleanup.oldint = signal (SIGINT, SIG_IGN);
- cleanup.oldquit = signal (SIGQUIT, SIG_IGN);
- sigemptyset (&child_block);
- sigaddset (&child_block, SIGCHLD);
- sigprocmask (SIG_BLOCK, &child_block, &cleanup.oldmask);
- }
- pthread_cleanup_push (do_cleanup, (void *) &cleanup);
av newargv;
linebuf one_line;
PWCHAR envblock = NULL;
@@ -336,6 +334,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
int looped = 0;
myfault efault;
+ system_call_handle system_call (mode == _P_SYSTEM);
if (efault.faulted ())
{
if (get_errno () == ENOMEM)
@@ -465,28 +464,18 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
of a compatibility job, which allows child processes to break away
from the job. This helps to avoid this issue.
+ First we call IsProcessInJob. It fetches the information whether or
+ not we're part of a job 20 times faster than QueryInformationJobObject.
+
(*) Note that this is not mintty's fault. It has just been observed
with mintty in the first place. See the archives for more info:
http://cygwin.com/ml/cygwin-developers/2012-02/msg00018.html */
JOBOBJECT_BASIC_LIMIT_INFORMATION jobinfo;
+ BOOL is_in_job;
- /* Calling QueryInformationJobObject costs time. Starting with
- Windows XP there's a function IsProcessInJob, which fetches the
- information whether or not we're part of a job 20 times faster than
- the call to QueryInformationJobObject. But we're still
- supporting Windows 2000, so we can't just link to that function.
- On the other hand, loading the function pointer at runtime is a
- time comsuming operation, too. So, what we do here is to emulate
- the IsProcessInJob function when called for the own process and with
- a NULL job handle. In this case it just returns the value of the
- lowest bit from PEB->EnvironmentUpdateCount (observed with WinDbg).
- The name of this PEB member is the same in all (inofficial)
- documentations of the PEB. Apparently it's a bit misleading.
- As a result, we only call QueryInformationJobObject if we're on
- Vista or later *and* if the PEB indicates we're running in a job.
- Tested on Vista/32, Vista/64, W7/32, W7/64, W8/64. */
- if ((NtCurrentTeb ()->Peb->EnvironmentUpdateCount & 1) != 0
+ if (IsProcessInJob (GetCurrentProcess (), NULL, &is_in_job)
+ && is_in_job
&& QueryInformationJobObject (NULL, JobObjectBasicLimitInformation,
&jobinfo, sizeof jobinfo, NULL)
&& (jobinfo.LimitFlags & (JOB_OBJECT_LIMIT_BREAKAWAY_OK
@@ -624,12 +613,12 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
SetHandleInformation (my_wr_proc_pipe, HANDLE_FLAG_INHERIT, 0);
parent_winpid = GetCurrentProcessId ();
+loop:
/* When ruid != euid we create the new process under the current original
account and impersonate in child, this way maintaining the different
effective vs. real ids.
FIXME: If ruid != euid and ruid != saved_uid we currently give
up on ruid. The new process will have ruid == euid. */
-loop:
::cygheap->user.deimpersonate ();
if (!real_path.iscygexec () && mode == _P_OVERLAY)
@@ -784,7 +773,6 @@ loop:
/* Name the handle similarly to proc_subproc. */
ProtectHandle1 (pi.hProcess, childhProc);
- pid_t pid;
if (mode == _P_OVERLAY)
{
myself->dwProcessId = pi.dwProcessId;
@@ -792,7 +780,6 @@ loop:
myself.hProcess = hExeced = pi.hProcess;
real_path.get_wide_win32_path (myself->progname); // FIXME: race?
sigproc_printf ("new process name %W", myself->progname);
- pid = myself->pid;
if (!iscygwin ())
close_all_files ();
}
@@ -832,7 +819,6 @@ loop:
res = -1;
goto out;
}
- pid = child->pid;
}
/* Start the child running */
@@ -885,6 +871,7 @@ loop:
break;
case _P_WAIT:
case _P_SYSTEM:
+ system_call.arm ();
if (waitpid (cygpid, &res, 0) != cygpid)
res = -1;
break;
@@ -904,7 +891,6 @@ out:
this->cleanup ();
if (envblock)
free (envblock);
- pthread_cleanup_pop (1);
return (int) res;
}
@@ -935,7 +921,7 @@ spawnve (int mode, const char *path, const char *const *argv,
vf = NULL;
#endif
- syscall_printf ("spawnve (%s, %s, %x)", path, argv[0], envp);
+ syscall_printf ("spawnve (%s, %s, %p)", path, argv[0], envp);
if (!envp)
envp = empty_env;
@@ -1135,7 +1121,7 @@ av::fixup (const char *prog_arg, path_conv& real_path, const char *ext,
NtClose (h);
goto err;
}
- if (size.QuadPart > wincap.allocation_granularity ())
+ if (size.QuadPart > (LONGLONG) wincap.allocation_granularity ())
size.LowPart = wincap.allocation_granularity ();
HANDLE hm = CreateFileMapping (h, &sec_none_nih, PAGE_READONLY,
@@ -1176,8 +1162,8 @@ av::fixup (const char *prog_arg, path_conv& real_path, const char *ext,
unsigned off = (unsigned char) buf[0x18] | (((unsigned char) buf[0x19]) << 8);
win16_exe = off < sizeof (IMAGE_DOS_HEADER);
if (!win16_exe)
- real_path.set_cygexec (!!hook_or_detect_cygwin (buf, NULL,
- subsys, hm));
+ real_path.set_cygexec (hook_or_detect_cygwin (buf, NULL,
+ subsys, hm));
else
real_path.set_cygexec (false);
UnmapViewOfFile (buf);
diff --git a/winsup/cygwin/speclib b/winsup/cygwin/speclib
index 7bac7eac4..b90096040 100755
--- a/winsup/cygwin/speclib
+++ b/winsup/cygwin/speclib
@@ -11,16 +11,17 @@ my $static;
my $inverse;
my @exclude;
-my ($ar, $as, $nm, $objcopy);
+my ($cpu, $ar, $as, $nm, $objcopy);
GetOptions('exclude=s'=>\@exclude, 'static!'=>\$static, 'v!'=>\$inverse,
- 'ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy);
+ 'cpu=s'=>\$cpu, 'ar=s'=>\$ar, 'as=s'=>\$as,'nm=s'=>\$nm, 'objcopy=s'=>\$objcopy);
$_ = File::Spec->rel2abs($_) for @ARGV;
my $libdll = shift;
my $lib = pop;
+my $uscore = ($cpu eq 'x86_64' ? undef : '_');
(my $iname = basename $lib) =~ s/\.a$//o;
-$iname = '_' . $iname . '_dll_iname';
+$iname = $uscore . $iname . '_dll_iname';
open my $nm_fd, '-|', $nm, '-Apg', '--defined-only', @ARGV, $libdll or
die "$0: execution of $nm for object files failed - $!\n";
@@ -34,7 +35,7 @@ $exclude_regex = qr/$exclude_regex/;
my $dllname;
while (<$nm_fd>) {
study;
- if (/ I _(.*)_dll_iname/o) {
+ if (/ I _?(.*)_dll_iname/o) {
$dllname = $1;
} else {
my ($file, $member, $symbol) = m%^([^:]*):([^:]*(?=:))?.* T (.*)%o;
diff --git a/winsup/cygwin/spinlock.h b/winsup/cygwin/spinlock.h
index b55817245..e43d19c88 100644
--- a/winsup/cygwin/spinlock.h
+++ b/winsup/cygwin/spinlock.h
@@ -67,7 +67,7 @@ public:
}
}
~spinlock () {done (setto);}
- operator LONG () const {return val;}
+ operator ULONG () const {return (ULONG) val;}
/* FIXME: This should be handled in a more general fashion, probably by
establishing a linked list of spinlocks which are freed on process exit. */
void multiple_cygwin_problem (const char *w, unsigned m, unsigned v)
diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc
index 98d3c4cb1..c77882007 100644
--- a/winsup/cygwin/strace.cc
+++ b/winsup/cygwin/strace.cc
@@ -37,7 +37,7 @@ strace::activate (bool isfork)
if (!_active && being_debugged ())
{
char buf[30];
- __small_sprintf (buf, "cYg%8x %x %d", _STRACE_INTERFACE_ACTIVATE_ADDR, &_active, isfork);
+ __small_sprintf (buf, "cYg%8x %lx %d", _STRACE_INTERFACE_ACTIVATE_ADDR, &_active, isfork);
OutputDebugString (buf);
if (_active)
{
@@ -223,7 +223,7 @@ strace::write (unsigned category, const char *buf, int count)
}
void
-strace::write_childpid (DWORD pid)
+strace::write_childpid (pid_t pid)
{
char buf[30];
diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc
index d6f5d96ab..9e5aa0304 100644
--- a/winsup/cygwin/strfuncs.cc
+++ b/winsup/cygwin/strfuncs.cc
@@ -410,7 +410,7 @@ __big5_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n,
to buffer size, it's a bug in Cygwin and the buffer in the calling
function should be raised.
*/
-size_t __stdcall
+size_t __reg3
sys_cp_wcstombs (wctomb_p f_wctomb, const char *charset, char *dst, size_t len,
const wchar_t *src, size_t nwc)
{
@@ -496,7 +496,7 @@ sys_cp_wcstombs (wctomb_p f_wctomb, const char *charset, char *dst, size_t len,
return n;
}
-size_t __stdcall
+size_t __reg3
sys_wcstombs (char *dst, size_t len, const wchar_t * src, size_t nwc)
{
return sys_cp_wcstombs (cygheap->locale.wctomb, cygheap->locale.charset,
@@ -513,7 +513,7 @@ sys_wcstombs (char *dst, size_t len, const wchar_t * src, size_t nwc)
Note that this code is shared by cygserver (which requires it via
__small_vsprintf) and so when built there plain calloc is the
only choice. */
-size_t __stdcall
+size_t __reg3
sys_wcstombs_alloc (char **dst_p, int type, const wchar_t *src, size_t nwc)
{
size_t ret;
@@ -539,7 +539,7 @@ sys_wcstombs_alloc (char **dst_p, int type, const wchar_t *src, size_t nwc)
conversion. This is so that fhandler_console can switch to an alternate
charset, which is the charset returned by GetConsoleCP (). Most of the
time this is used for box and line drawing characters. */
-size_t __stdcall
+size_t __reg3
sys_cp_mbstowcs (mbtowc_p f_mbtowc, const char *charset, wchar_t *dst,
size_t dlen, const char *src, size_t nms)
{
@@ -648,7 +648,7 @@ sys_cp_mbstowcs (mbtowc_p f_mbtowc, const char *charset, wchar_t *dst,
return count;
}
-size_t __stdcall
+size_t __reg3
sys_mbstowcs (wchar_t * dst, size_t dlen, const char *src, size_t nms)
{
return sys_cp_mbstowcs (cygheap->locale.mbtowc, cygheap->locale.charset,
@@ -656,7 +656,7 @@ sys_mbstowcs (wchar_t * dst, size_t dlen, const char *src, size_t nms)
}
/* Same as sys_wcstombs_alloc, just backwards. */
-size_t __stdcall
+size_t __reg3
sys_mbstowcs_alloc (wchar_t **dst_p, int type, const char *src, size_t nms)
{
size_t ret;
diff --git a/winsup/cygwin/strsig.cc b/winsup/cygwin/strsig.cc
index 8afa8db7a..987e13549 100644
--- a/winsup/cygwin/strsig.cc
+++ b/winsup/cygwin/strsig.cc
@@ -1,6 +1,6 @@
/* strsig.cc
- Copyright 2004, 2007, 2008, 2010, 2011 Red Hat, Inc.
+ Copyright 2004, 2007, 2008, 2010, 2011, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -20,7 +20,7 @@ struct sigdesc
const char *str;
};
-#define __signals \
+#define __signals_common \
_s(SIGHUP, "Hangup"), /* 1 */ \
_s(SIGINT, "Interrupt"), /* 2 */ \
_s(SIGQUIT, "Quit"), /* 3 */ \
@@ -54,13 +54,54 @@ struct sigdesc
_s2(SIGPWR, "Power failure", /* 29 */ \
SIGLOST, "Resource lost"), \
_s(SIGUSR1, "User defined signal 1"), /* 30 */ \
- _s(SIGUSR2, "User defined signal 2"), /* 31 */ \
+ _s(SIGUSR2, "User defined signal 2"), /* 31 */
+
+#ifdef __x86_64__
+# define __signals \
+ __signals_common \
+ _s(SIGRTMIN, "Real-time signal 0"), /* 32 */ \
+ _s(SIGRTMIN + 1, "Real-time signal 1"), /* 33 */ \
+ _s(SIGRTMIN + 2, "Real-time signal 2"), /* 34 */ \
+ _s(SIGRTMIN + 3, "Real-time signal 3"), /* 35 */ \
+ _s(SIGRTMIN + 4, "Real-time signal 4"), /* 36 */ \
+ _s(SIGRTMIN + 5, "Real-time signal 5"), /* 37 */ \
+ _s(SIGRTMIN + 6, "Real-time signal 6"), /* 38 */ \
+ _s(SIGRTMIN + 7, "Real-time signal 7"), /* 39 */ \
+ _s(SIGRTMIN + 8, "Real-time signal 8"), /* 40 */ \
+ _s(SIGRTMIN + 9, "Real-time signal 9"), /* 41 */ \
+ _s(SIGRTMIN + 10, "Real-time signal 10"), /* 42 */ \
+ _s(SIGRTMIN + 11, "Real-time signal 11"), /* 43 */ \
+ _s(SIGRTMIN + 12, "Real-time signal 12"), /* 44 */ \
+ _s(SIGRTMIN + 13, "Real-time signal 13"), /* 45 */ \
+ _s(SIGRTMIN + 14, "Real-time signal 14"), /* 46 */ \
+ _s(SIGRTMIN + 15, "Real-time signal 15"), /* 47 */ \
+ _s(SIGRTMIN + 16, "Real-time signal 16"), /* 48 */ \
+ _s(SIGRTMIN + 17, "Real-time signal 17"), /* 49 */ \
+ _s(SIGRTMIN + 18, "Real-time signal 18"), /* 50 */ \
+ _s(SIGRTMIN + 19, "Real-time signal 19"), /* 51 */ \
+ _s(SIGRTMIN + 20, "Real-time signal 20"), /* 52 */ \
+ _s(SIGRTMIN + 21, "Real-time signal 21"), /* 53 */ \
+ _s(SIGRTMIN + 22, "Real-time signal 22"), /* 54 */ \
+ _s(SIGRTMIN + 23, "Real-time signal 23"), /* 55 */ \
+ _s(SIGRTMIN + 24, "Real-time signal 24"), /* 56 */ \
+ _s(SIGRTMIN + 25, "Real-time signal 25"), /* 57 */ \
+ _s(SIGRTMIN + 26, "Real-time signal 26"), /* 58 */ \
+ _s(SIGRTMIN + 27, "Real-time signal 27"), /* 59 */ \
+ _s(SIGRTMIN + 28, "Real-time signal 28"), /* 60 */ \
+ _s(SIGRTMIN + 29, "Real-time signal 29"), /* 61 */ \
+ _s(SIGRTMIN + 30, "Real-time signal 30"), /* 62 */ \
+ _s(SIGRTMIN + 31, "Real-time signal 31"), /* 63 */ \
+ _s(SIGRTMAX, "Real-time signal 32") /* 64 */
+#else
+# define __signals \
+ __signals_common \
_s2(SIGRTMIN, "Real-time signal 0", /* 32 */ \
SIGRTMAX, "Real-time signal 0")
+#endif
#define _s(n, s) #n
#define _s2(n, s, n1, s1) #n
-const char *sys_sigabbrev[] NO_COPY_INIT =
+const char *sys_sigabbrev[] =
{
NULL,
__signals
@@ -70,7 +111,7 @@ const char *sys_sigabbrev[] NO_COPY_INIT =
#undef _s2
#define _s(n, s) s
#define _s2(n, s, n1, s1) s
-const char *sys_siglist[] NO_COPY_INIT =
+const char *sys_siglist[] =
{
NULL,
__signals
@@ -128,7 +169,7 @@ psiginfo (const siginfo_t *info, const char *s)
fprintf (stderr, " (%d [%p])", info->si_code, info->si_addr);
break;
case SIGCHLD:
- fprintf (stderr, " (%d %d %d %ld)", info->si_code, info->si_pid,
+ fprintf (stderr, " (%d %d %d %u)", info->si_code, info->si_pid,
info->si_status, info->si_uid);
break;
/* FIXME: implement si_band
@@ -137,7 +178,7 @@ psiginfo (const siginfo_t *info, const char *s)
break;
*/
default:
- fprintf (stderr, " (%d %d %ld)", info->si_code, info->si_pid, info->si_uid);
+ fprintf (stderr, " (%d %d %u)", info->si_code, info->si_pid, info->si_uid);
}
}
diff --git a/winsup/cygwin/sync.cc b/winsup/cygwin/sync.cc
index d8b3d8f54..821c214f7 100644
--- a/winsup/cygwin/sync.cc
+++ b/winsup/cygwin/sync.cc
@@ -33,7 +33,8 @@ muto::grab ()
muto *
muto::init (const char *s)
{
- char *already_exists = (char *) InterlockedExchangePointer (&name, s);
+ char *already_exists = (char *) InterlockedExchangePointer ((PVOID *) &name,
+ (PVOID) s);
if (already_exists)
while (!bruteforce)
yield ();
diff --git a/winsup/cygwin/sync.h b/winsup/cygwin/sync.h
index 9d702b6af..ebfccab45 100644
--- a/winsup/cygwin/sync.h
+++ b/winsup/cygwin/sync.h
@@ -16,7 +16,7 @@ details. */
class muto
{
public:
- const char *name;
+ char *name;
private:
LONG sync; /* Used to serialize access to this class. */
LONG waiters; /* Number of threads waiting for lock. */
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index bc3ba0f89..e1886e617 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -11,7 +11,7 @@ details. */
#define fstat __FOOfstat__
#define lstat __FOOlstat__
-#define stat __FOOstat__
+//#define stat __FOOstat__
#define _close __FOO_close__
#define _lseek __FOO_lseek__
#define _open __FOO_open__
@@ -44,7 +44,7 @@ details. */
#undef fstat
#undef lstat
-#undef stat
+//#undef stat
#undef pread
#undef pwrite
@@ -177,7 +177,7 @@ dup3 (int oldfd, int newfd, int flags)
else
res = dup_finish (oldfd, newfd, flags);
- syscall_printf ("%R = dup3(%d, %d, %p)", res, oldfd, newfd, flags);
+ syscall_printf ("%R = dup3(%d, %d, %y)", res, oldfd, newfd, flags);
return res;
}
@@ -194,7 +194,7 @@ start_transaction (HANDLE &old_trans, HANDLE &trans)
}
else
{
- debug_printf ("NtCreateTransaction failed, %p", status);
+ debug_printf ("NtCreateTransaction failed, %y", status);
old_trans = trans = NULL;
}
}
@@ -258,7 +258,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
if (!NT_SUCCESS (status))
{
debug_printf ("NtQueryInformationFile (%S, FileNameInformation) "
- "failed, status = %p", pc.get_nt_native_path (), status);
+ "failed, status = %y", pc.get_nt_native_path (), status);
goto out;
}
/* The filename could change, the parent dir not. So we split both paths
@@ -302,7 +302,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtOpenFile (%S) failed, status = %p", &root, status);
+ debug_printf ("NtOpenFile (%S) failed, status = %y", &root, status);
goto out;
}
@@ -321,8 +321,6 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
/* Unhide trailing backslash. */
recycler.Length += sizeof (WCHAR);
RtlInitEmptyUnicodeString (&sid, sidbuf, sizeof sidbuf);
- /* In contrast to what MSDN claims, this function is already available
- since NT4. */
RtlConvertSidToUnicodeString (&sid, cygheap->user.sid (), FALSE);
RtlAppendUnicodeStringToString (&recycler, &sid);
recycler_user_len = recycler.Length;
@@ -349,7 +347,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
if (!NT_SUCCESS (status))
{
debug_printf ("NtQueryInformationFile (%S, FileInternalInformation) "
- "failed, status = %p", pc.get_nt_native_path (), status);
+ "failed, status = %y", pc.get_nt_native_path (), status);
goto out;
}
RtlInt64ToHexUnicodeString (pfii->FileId.QuadPart, &recycler, TRUE);
@@ -374,7 +372,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtOpenFile (%S) failed, status = %p",
+ debug_printf ("NtOpenFile (%S) failed, status = %y",
&recycler, status);
goto out;
}
@@ -399,7 +397,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
FILE_DIRECTORY_FILE, NULL, 0);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtCreateFile (%S) failed, status = %p",
+ debug_printf ("NtCreateFile (%S) failed, status = %y",
&recycler, status);
goto out;
}
@@ -419,7 +417,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
FILE_DIRECTORY_FILE, NULL, 0);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtCreateFile (%S) failed, status = %p",
+ debug_printf ("NtCreateFile (%S) failed, status = %y",
&recycler, status);
goto out;
}
@@ -438,14 +436,14 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
FILE_SYNCHRONOUS_IO_NONALERT
| FILE_NON_DIRECTORY_FILE, NULL, 0);
if (!NT_SUCCESS (status))
- debug_printf ("NtCreateFile (%S) failed, status = %p",
+ debug_printf ("NtCreateFile (%S) failed, status = %y",
&recycler, status);
else
{
status = NtWriteFile (tmp_fh, NULL, NULL, NULL, &io, desktop_ini,
sizeof desktop_ini - 1, NULL, NULL);
if (!NT_SUCCESS (status))
- debug_printf ("NtWriteFile (%S) failed, status = %p",
+ debug_printf ("NtWriteFile (%S) failed, status = %y",
&fname, status);
else if (wincap.has_recycle_dot_bin ())
{
@@ -453,7 +451,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
desktop_ini_ext,
sizeof desktop_ini_ext - 1, NULL, NULL);
if (!NT_SUCCESS (status))
- debug_printf ("NtWriteFile (%S) failed, status = %p",
+ debug_printf ("NtWriteFile (%S) failed, status = %y",
&fname, status);
}
NtClose (tmp_fh);
@@ -468,14 +466,14 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
FILE_SYNCHRONOUS_IO_NONALERT
| FILE_NON_DIRECTORY_FILE, NULL, 0);
if (!NT_SUCCESS (status))
- debug_printf ("NtCreateFile (%S) failed, status = %p",
+ debug_printf ("NtCreateFile (%S) failed, status = %y",
&recycler, status);
else
{
status = NtWriteFile (tmp_fh, NULL, NULL, NULL, &io, info2,
sizeof info2, NULL, NULL);
if (!NT_SUCCESS (status))
- debug_printf ("NtWriteFile (%S) failed, status = %p",
+ debug_printf ("NtWriteFile (%S) failed, status = %y",
&fname, status);
NtClose (tmp_fh);
}
@@ -488,7 +486,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
}
if (!NT_SUCCESS (status))
{
- debug_printf ("Move %S to %S failed, status = %p",
+ debug_printf ("Move %S to %S failed, status = %y",
pc.get_nt_native_path (), &recycler, status);
goto out;
}
@@ -546,7 +544,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
NULL, 0);
if (!NT_SUCCESS (status))
{
- debug_printf ("Creating file for overwriting failed, status = %p",
+ debug_printf ("Creating file for overwriting failed, status = %y",
status);
goto out;
}
@@ -554,12 +552,12 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access)
FileRenameInformation);
NtClose (tmp_fh);
if (!NT_SUCCESS (status))
- debug_printf ("Overwriting with another file failed, status = %p", status);
+ debug_printf ("Overwriting with another file failed, status = %y", status);
out:
if (rootdir)
NtClose (rootdir);
- debug_printf ("%S, return status %d", pc.get_nt_native_path (), bin_stat);
+ debug_printf ("%S, return bin_status %d", pc.get_nt_native_path (), bin_stat);
return bin_stat;
}
@@ -576,7 +574,7 @@ check_dir_not_empty (HANDLE dir, path_conv &pc)
FALSE, NULL, TRUE);
if (!NT_SUCCESS (status))
{
- debug_printf ("Checking if directory %S is empty failed, status = %p",
+ debug_printf ("Checking if directory %S is empty failed, status = %y",
pc.get_nt_native_path (), status);
return status;
}
@@ -621,7 +619,7 @@ check_dir_not_empty (HANDLE dir, path_conv &pc)
&& status != STATUS_OBJECT_PATH_NOT_FOUND)
{
debug_printf ("Directory %S not empty, found file <%S>, "
- "query status = %p",
+ "query status = %y",
pc.get_nt_native_path (), &fname, status);
return STATUS_DIRECTORY_NOT_EMPTY;
}
@@ -685,12 +683,12 @@ unlink_nt (path_conv &pc)
pc.file_attributes ()
& ~FILE_ATTRIBUTE_READONLY);
if (!NT_SUCCESS (status2))
- debug_printf ("Removing R/O on %S failed, status = %p",
+ debug_printf ("Removing R/O on %S failed, status = %y",
pc.get_nt_native_path (), status2);
pc.init_reopen_attr (&attr, fh_ro);
}
else
- debug_printf ("Opening %S for removing R/O failed, status = %p",
+ debug_printf ("Opening %S for removing R/O failed, status = %y",
pc.get_nt_native_path (), status);
if (pc.is_lnk_symlink ())
{
@@ -782,7 +780,7 @@ unlink_nt (path_conv &pc)
status = STATUS_SUCCESS;
goto out;
}
- debug_printf ("Opening %S for delete failed, status = %p",
+ debug_printf ("Opening %S for delete failed, status = %y",
pc.get_nt_native_path (), status);
goto out;
}
@@ -807,7 +805,7 @@ try_again:
FileDispositionInformation);
if (!NT_SUCCESS (status))
{
- debug_printf ("Setting delete disposition on %S failed, status = %p",
+ debug_printf ("Setting delete disposition on %S failed, status = %y",
pc.get_nt_native_path (), status);
if (status == STATUS_DIRECTORY_NOT_EMPTY)
{
@@ -879,7 +877,7 @@ try_again:
{
fh = NULL;
debug_printf ("Opening dir %S for check_dir_not_empty failed, "
- "status = %p", pc.get_nt_native_path (), status2);
+ "status = %y", pc.get_nt_native_path (), status2);
}
else /* Directory disappeared between NtClose and NtOpenFile. */
status = STATUS_SUCCESS;
@@ -912,7 +910,7 @@ try_again:
flags | FILE_DELETE_ON_CLOSE);
if (!NT_SUCCESS (status))
{
- debug_printf ("Setting delete-on-close on %S failed, status = %p",
+ debug_printf ("Setting delete-on-close on %S failed, status = %y",
pc.get_nt_native_path (), status);
/* This is really the last chance. If it hasn't been moved
to the bin already, try it now. If moving to the bin
@@ -961,7 +959,7 @@ out:
&& (pc.fs_flags () & FILE_SUPPORTS_TRANSACTIONS))
stop_transaction (status, old_trans, trans);
- syscall_printf ("%S, return status = %p", pc.get_nt_native_path (), status);
+ syscall_printf ("%S, return status = %y", pc.get_nt_native_path (), status);
return status;
}
@@ -969,7 +967,7 @@ extern "C" int
unlink (const char *ourname)
{
int res = -1;
- DWORD devn;
+ dev_t devn;
NTSTATUS status;
path_conv win32_name (ourname, PC_SYM_NOFOLLOW, stat_suffixes);
@@ -980,7 +978,7 @@ unlink (const char *ourname)
goto done;
}
- devn = win32_name.get_devn ();
+ devn = win32_name.get_device ();
if (isproc_dev (devn))
{
set_errno (EROFS);
@@ -1149,7 +1147,7 @@ read (int fd, void *ptr, size_t len)
cfd->read (ptr, res = len);
done:
- syscall_printf ("%R = read(%d, %p, %d)", res, fd, ptr, len);
+ syscall_printf ("%lR = read(%d, %p, %d)", res, fd, ptr, len);
MALLOC_CHECK;
return (ssize_t) res;
}
@@ -1191,13 +1189,13 @@ readv (int fd, const struct iovec *const iov, const int iovcnt)
res = cfd->readv (iov, iovcnt, tot);
done:
- syscall_printf ("%R = readv(%d, %p, %d)", res, fd, iov, iovcnt);
+ syscall_printf ("%lR = readv(%d, %p, %d)", res, fd, iov, iovcnt);
MALLOC_CHECK;
return res;
}
extern "C" ssize_t
-pread (int fd, void *ptr, size_t len, _off64_t off)
+pread (int fd, void *ptr, size_t len, off_t off)
{
pthread_testcancel ();
@@ -1208,7 +1206,7 @@ pread (int fd, void *ptr, size_t len, _off64_t off)
else
res = cfd->pread (ptr, len, off);
- syscall_printf ("%R = pread(%d, %p, %d, %d)", res, fd, ptr, len, off);
+ syscall_printf ("%lR = pread(%d, %p, %d, %d)", res, fd, ptr, len, off);
return res;
}
@@ -1221,7 +1219,7 @@ write (int fd, const void *ptr, size_t len)
if (efault.faulted (EFAULT))
return -1;
- int res = -1;
+ ssize_t res = -1;
cygheap_fdget cfd (fd);
if (cfd < 0)
@@ -1242,7 +1240,7 @@ write (int fd, const void *ptr, size_t len)
res = cfd->write (ptr, len);
done:
- syscall_printf ("%R = write(%d, %p, %d)", res, fd, ptr, len);
+ syscall_printf ("%lR = write(%d, %p, %d)", res, fd, ptr, len);
MALLOC_CHECK;
return res;
@@ -1259,7 +1257,7 @@ writev (const int fd, const struct iovec *const iov, const int iovcnt)
if (efault.faulted (EFAULT))
return -1;
- int res = -1;
+ ssize_t res = -1;
const ssize_t tot = check_iovec_for_write (iov, iovcnt);
cygheap_fdget cfd (fd);
@@ -1288,16 +1286,16 @@ writev (const int fd, const struct iovec *const iov, const int iovcnt)
done:
if (fd == 1 || fd == 2)
- paranoid_printf ("%R = writev(%d, %p, %d)", res, fd, iov, iovcnt);
+ paranoid_printf ("%lR = writev(%d, %p, %d)", res, fd, iov, iovcnt);
else
- syscall_printf ("%R = writev(%d, %p, %d)", res, fd, iov, iovcnt);
+ syscall_printf ("%lR = writev(%d, %p, %d)", res, fd, iov, iovcnt);
MALLOC_CHECK;
return res;
}
extern "C" ssize_t
-pwrite (int fd, void *ptr, size_t len, _off64_t off)
+pwrite (int fd, void *ptr, size_t len, off_t off)
{
pthread_testcancel ();
@@ -1308,7 +1306,7 @@ pwrite (int fd, void *ptr, size_t len, _off64_t off)
else
res = cfd->pwrite (ptr, len, off);
- syscall_printf ("%R = pwrite(%d, %p, %d, %d)", res, fd, ptr, len, off);
+ syscall_printf ("%lR = pwrite(%d, %p, %d, %d)", res, fd, ptr, len, off);
return res;
}
@@ -1322,7 +1320,7 @@ open (const char *unix_path, int flags, ...)
va_list ap;
mode_t mode = 0;
- syscall_printf ("open(%s, %p)", unix_path, flags);
+ syscall_printf ("open(%s, %y)", unix_path, flags);
pthread_testcancel ();
myfault efault;
if (efault.faulted (EFAULT))
@@ -1362,7 +1360,7 @@ open (const char *unix_path, int flags, ...)
res = -1;
set_errno (ELOOP);
}
- else if ((flags & O_DIRECTORY) && !fh->pc.isdir ())
+ else if ((flags & O_DIRECTORY) && fh->exists () && !fh->pc.isdir ())
{
delete fh;
res = -1;
@@ -1390,17 +1388,17 @@ open (const char *unix_path, int flags, ...)
}
}
- syscall_printf ("%R = open(%s, %p)", res, unix_path, flags);
+ syscall_printf ("%R = open(%s, %y)", res, unix_path, flags);
return res;
}
EXPORT_ALIAS (open, _open )
EXPORT_ALIAS (open, _open64 )
-extern "C" _off64_t
-lseek64 (int fd, _off64_t pos, int dir)
+extern "C" off_t
+lseek64 (int fd, off_t pos, int dir)
{
- _off64_t res;
+ off_t res;
if (dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END)
{
@@ -1415,7 +1413,7 @@ lseek64 (int fd, _off64_t pos, int dir)
else
res = -1;
}
- /* Can't use %R here since res is 8 bytes */
+ /* Can't use %R/%lR here since res is always 8 bytes */
syscall_printf (res == -1 ? "%D = lseek(%d, %D, %d), errno %d"
: "%D = lseek(%d, %D, %d)",
res, fd, pos, dir, get_errno ());
@@ -1425,13 +1423,18 @@ lseek64 (int fd, _off64_t pos, int dir)
EXPORT_ALIAS (lseek64, _lseek64)
+#ifdef __x86_64__
+EXPORT_ALIAS (lseek64, lseek)
+EXPORT_ALIAS (lseek64, _lseek)
+#else
extern "C" _off_t
lseek (int fd, _off_t pos, int dir)
{
- return lseek64 (fd, (_off64_t) pos, dir);
+ return lseek64 (fd, (off_t) pos, dir);
}
-
EXPORT_ALIAS (lseek, _lseek)
+#endif
+
extern "C" int
close (int fd)
@@ -1509,7 +1512,7 @@ link (const char *oldpath, const char *newpath)
* systems, it is only a stub that always returns zero.
*/
static int
-chown_worker (const char *name, unsigned fmode, __uid32_t uid, __gid32_t gid)
+chown_worker (const char *name, unsigned fmode, uid_t uid, gid_t gid)
{
int res = -1;
fhandler_base *fh;
@@ -1533,33 +1536,41 @@ chown_worker (const char *name, unsigned fmode, __uid32_t uid, __gid32_t gid)
}
extern "C" int
-chown32 (const char * name, __uid32_t uid, __gid32_t gid)
+chown32 (const char * name, uid_t uid, gid_t gid)
{
return chown_worker (name, PC_SYM_FOLLOW, uid, gid);
}
+#ifdef __x86_64__
+EXPORT_ALIAS (chown32, chown)
+#else
extern "C" int
chown (const char * name, __uid16_t uid, __gid16_t gid)
{
return chown_worker (name, PC_SYM_FOLLOW,
uid16touid32 (uid), gid16togid32 (gid));
}
+#endif
extern "C" int
-lchown32 (const char * name, __uid32_t uid, __gid32_t gid)
+lchown32 (const char * name, uid_t uid, gid_t gid)
{
return chown_worker (name, PC_SYM_NOFOLLOW, uid, gid);
}
+#ifdef __x86_64__
+EXPORT_ALIAS (lchown32, lchown)
+#else
extern "C" int
lchown (const char * name, __uid16_t uid, __gid16_t gid)
{
return chown_worker (name, PC_SYM_NOFOLLOW,
uid16touid32 (uid), gid16togid32 (gid));
}
+#endif
extern "C" int
-fchown32 (int fd, __uid32_t uid, __gid32_t gid)
+fchown32 (int fd, uid_t uid, gid_t gid)
{
cygheap_fdget cfd (fd);
if (cfd < 0)
@@ -1574,11 +1585,15 @@ fchown32 (int fd, __uid32_t uid, __gid32_t gid)
return res;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (fchown32, fchown)
+#else
extern "C" int
fchown (int fd, __uid16_t uid, __gid16_t gid)
{
return fchown32 (fd, uid16touid32 (uid), gid16togid32 (gid));
}
+#endif
/* umask: POSIX 5.3.3.1 */
extern "C" mode_t
@@ -1619,7 +1634,7 @@ chmod (const char *path, mode_t mode)
delete fh;
error:
- syscall_printf ("%R = chmod(%s, %p)", res, path, mode);
+ syscall_printf ("%R = chmod(%s, 0%o)", res, path, mode);
return res;
}
@@ -1638,8 +1653,9 @@ fchmod (int fd, mode_t mode)
return cfd->fchmod (FILTERED_MODE (mode));
}
+#ifndef __x86_64__
static void
-stat64_to_stat32 (struct __stat64 *src, struct __stat32 *dst)
+stat64_to_stat32 (struct stat *src, struct __stat32 *dst)
{
dst->st_dev = ((src->st_dev >> 8) & 0xff00) | (src->st_dev & 0xff);
dst->st_ino = ((unsigned) (src->st_ino >> 32)) | (unsigned) src->st_ino;
@@ -1655,12 +1671,13 @@ stat64_to_stat32 (struct __stat64 *src, struct __stat32 *dst)
dst->st_blksize = src->st_blksize;
dst->st_blocks = src->st_blocks;
}
+#endif
-static struct __stat64 dev_st;
+static struct stat dev_st;
static bool dev_st_inited;
void
-fhandler_base::stat_fixup (struct __stat64 *buf)
+fhandler_base::stat_fixup (struct stat *buf)
{
/* For devices, set inode number to device number. This gives us a valid,
unique inode number without having to call hash_path_name. */
@@ -1700,7 +1717,7 @@ fhandler_base::stat_fixup (struct __stat64 *buf)
}
extern "C" int
-fstat64 (int fd, struct __stat64 *buf)
+fstat64 (int fd, struct stat *buf)
{
int res;
@@ -1709,7 +1726,7 @@ fstat64 (int fd, struct __stat64 *buf)
res = -1;
else
{
- memset (buf, 0, sizeof (struct __stat64));
+ memset (buf, 0, sizeof (struct stat));
res = cfd->fstat (buf);
if (!res)
cfd->stat_fixup (buf);
@@ -1720,7 +1737,7 @@ fstat64 (int fd, struct __stat64 *buf)
}
extern "C" int
-_fstat64_r (struct _reent *ptr, int fd, struct __stat64 *buf)
+_fstat64_r (struct _reent *ptr, int fd, struct stat *buf)
{
int ret;
@@ -1729,18 +1746,22 @@ _fstat64_r (struct _reent *ptr, int fd, struct __stat64 *buf)
return ret;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (fstat64, fstat)
+EXPORT_ALIAS (_fstat64_r, _fstat_r)
+#else
extern "C" int
-fstat (int fd, struct __stat32 *buf)
+fstat (int fd, struct stat *buf)
{
- struct __stat64 buf64;
+ struct stat buf64;
int ret = fstat64 (fd, &buf64);
if (!ret)
- stat64_to_stat32 (&buf64, buf);
+ stat64_to_stat32 (&buf64, (struct __stat32 *) buf);
return ret;
}
extern "C" int
-_fstat_r (struct _reent *ptr, int fd, struct __stat32 *buf)
+_fstat_r (struct _reent *ptr, int fd, struct stat *buf)
{
int ret;
@@ -1748,6 +1769,7 @@ _fstat_r (struct _reent *ptr, int fd, struct __stat32 *buf)
ptr->_errno = get_errno ();
return ret;
}
+#endif
/* fsync: P96 6.6.1.1 */
extern "C" int
@@ -1778,12 +1800,12 @@ sync_worker (HANDLE dir, USHORT len, LPCWSTR vol)
status = NtOpenFile (&fh, GENERIC_WRITE, &attr, &io,
FILE_SHARE_VALID_FLAGS, 0);
if (!NT_SUCCESS (status))
- debug_printf ("NtOpenFile (%S), status %p", &uvol, status);
+ debug_printf ("NtOpenFile (%S), status %y", &uvol, status);
else
{
status = NtFlushBuffersFile (fh, &io);
if (!NT_SUCCESS (status))
- debug_printf ("NtFlushBuffersFile (%S), status %p", &uvol, status);
+ debug_printf ("NtFlushBuffersFile (%S), status %y", &uvol, status);
NtClose (fh);
}
}
@@ -1803,7 +1825,7 @@ sync ()
status = NtOpenDirectoryObject (&devhdl, DIRECTORY_QUERY, &attr);
if (!NT_SUCCESS (status))
{
- debug_printf ("NtOpenDirectoryObject, status %p", status);
+ debug_printf ("NtOpenDirectoryObject, status %y", status);
return;
}
/* Traverse \Device directory ... */
@@ -1825,8 +1847,8 @@ sync ()
}
/* Cygwin internal */
-int __stdcall
-stat_worker (path_conv &pc, struct __stat64 *buf)
+int __reg2
+stat_worker (path_conv &pc, struct stat *buf)
{
int res = -1;
@@ -1864,7 +1886,7 @@ stat_worker (path_conv &pc, struct __stat64 *buf)
}
extern "C" int
-stat64 (const char *name, struct __stat64 *buf)
+stat64 (const char *name, struct stat *buf)
{
syscall_printf ("entering");
path_conv pc (name, PC_SYM_FOLLOW | PC_POSIX | PC_KEEP_HANDLE,
@@ -1873,7 +1895,7 @@ stat64 (const char *name, struct __stat64 *buf)
}
extern "C" int
-_stat64_r (struct _reent *ptr, const char *name, struct __stat64 *buf)
+_stat64_r (struct _reent *ptr, const char *name, struct stat *buf)
{
int ret;
@@ -1882,18 +1904,22 @@ _stat64_r (struct _reent *ptr, const char *name, struct __stat64 *buf)
return ret;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (stat64, stat)
+EXPORT_ALIAS (_stat64_r, _stat_r)
+#else
extern "C" int
-stat (const char *name, struct __stat32 *buf)
+stat (const char *name, struct stat *buf)
{
- struct __stat64 buf64;
+ struct stat buf64;
int ret = stat64 (name, &buf64);
if (!ret)
- stat64_to_stat32 (&buf64, buf);
+ stat64_to_stat32 (&buf64, (struct __stat32 *) buf);
return ret;
}
extern "C" int
-_stat_r (struct _reent *ptr, const char *name, struct __stat32 *buf)
+_stat_r (struct _reent *ptr, const char *name, struct stat *buf)
{
int ret;
@@ -1901,10 +1927,11 @@ _stat_r (struct _reent *ptr, const char *name, struct __stat32 *buf)
ptr->_errno = get_errno ();
return ret;
}
+#endif
/* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */
extern "C" int
-lstat64 (const char *name, struct __stat64 *buf)
+lstat64 (const char *name, struct stat *buf)
{
syscall_printf ("entering");
path_conv pc (name, PC_SYM_NOFOLLOW | PC_POSIX | PC_KEEP_HANDLE,
@@ -1912,16 +1939,20 @@ lstat64 (const char *name, struct __stat64 *buf)
return stat_worker (pc, buf);
}
+#ifdef __x86_64__
+EXPORT_ALIAS (lstat64, lstat)
+#else
/* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */
extern "C" int
-lstat (const char *name, struct __stat32 *buf)
+lstat (const char *name, struct stat *buf)
{
- struct __stat64 buf64;
+ struct stat buf64;
int ret = lstat64 (name, &buf64);
if (!ret)
- stat64_to_stat32 (&buf64, buf);
+ stat64_to_stat32 (&buf64, (struct __stat32 *) buf);
return ret;
}
+#endif
extern "C" int
access (const char *fn, int flags)
@@ -2338,7 +2369,7 @@ retry:
}
if (!NT_SUCCESS (status))
{
- debug_printf ("status %p", status);
+ debug_printf ("status %y", status);
if (status == STATUS_SHARING_VIOLATION
&& cygwait (10L) != WAIT_SIGNALED)
{
@@ -2721,7 +2752,7 @@ getmode (int fd)
previous mode. */
extern "C" int
-setmode (int fd, int mode)
+_setmode (int fd, int mode)
{
cygheap_fdget cfd (fd);
if (cfd < 0)
@@ -2759,7 +2790,7 @@ setmode (int fd, int mode)
extern "C" int
cygwin_setmode (int fd, int mode)
{
- int res = setmode (fd, mode);
+ int res = _setmode (fd, mode);
if (res != -1)
{
_my_tls.locals.setmode_file = fd;
@@ -2773,7 +2804,7 @@ cygwin_setmode (int fd, int mode)
}
extern "C" int
-posix_fadvise (int fd, _off64_t offset, _off64_t len, int advice)
+posix_fadvise (int fd, off_t offset, off_t len, int advice)
{
int res = -1;
cygheap_fdget cfd (fd);
@@ -2787,7 +2818,7 @@ posix_fadvise (int fd, _off64_t offset, _off64_t len, int advice)
}
extern "C" int
-posix_fallocate (int fd, _off64_t offset, _off64_t len)
+posix_fallocate (int fd, off_t offset, off_t len)
{
int res = -1;
if (offset < 0 || len == 0)
@@ -2805,7 +2836,7 @@ posix_fallocate (int fd, _off64_t offset, _off64_t len)
}
extern "C" int
-ftruncate64 (int fd, _off64_t length)
+ftruncate64 (int fd, off_t length)
{
int res = -1;
cygheap_fdget cfd (fd);
@@ -2817,16 +2848,20 @@ ftruncate64 (int fd, _off64_t length)
return res;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (ftruncate64, ftruncate)
+#else
/* ftruncate: P96 5.6.7.1 */
extern "C" int
ftruncate (int fd, _off_t length)
{
- return ftruncate64 (fd, (_off64_t)length);
+ return ftruncate64 (fd, (off_t)length);
}
+#endif
/* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */
extern "C" int
-truncate64 (const char *pathname, _off64_t length)
+truncate64 (const char *pathname, off_t length)
{
int fd;
int res = -1;
@@ -2843,15 +2878,19 @@ truncate64 (const char *pathname, _off64_t length)
return res;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (truncate64, truncate)
+#else
/* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */
extern "C" int
truncate (const char *pathname, _off_t length)
{
- return truncate64 (pathname, (_off64_t)length);
+ return truncate64 (pathname, (off_t)length);
}
+#endif
extern "C" long
-get_osfhandle (int fd)
+_get_osfhandle (int fd)
{
long res;
@@ -2993,7 +3032,7 @@ getpgid (pid_t pid)
pid = getpid ();
pinfo p (pid);
- if (p == 0)
+ if (!p)
{
set_errno (ESRCH);
return -1;
@@ -3042,11 +3081,11 @@ mknod_worker (const char *path, mode_t type, mode_t mode, _major_t major,
char buf[sizeof (":\\00000000:00000000:00000000") + PATH_MAX];
sprintf (buf, ":\\%x:%x:%x", major, minor,
type | (mode & (S_IRWXU | S_IRWXG | S_IRWXO)));
- return symlink_worker (buf, path, true, true);
+ return symlink_worker (buf, path, true);
}
extern "C" int
-mknod32 (const char *path, mode_t mode, __dev32_t dev)
+mknod32 (const char *path, mode_t mode, dev_t dev)
{
myfault efault;
if (efault.faulted (EFAULT))
@@ -3102,7 +3141,7 @@ mknod32 (const char *path, mode_t mode, __dev32_t dev)
extern "C" int
mknod (const char *_path, mode_t mode, __dev16_t dev)
{
- return mknod32 (_path, mode, (__dev32_t) dev);
+ return mknod32 (_path, mode, (dev_t) dev);
}
extern "C" int
@@ -3113,7 +3152,7 @@ mkfifo (const char *path, mode_t mode)
/* seteuid: standards? */
extern "C" int
-seteuid32 (__uid32_t uid)
+seteuid32 (uid_t uid)
{
debug_printf ("uid: %u myself->uid: %u myself->gid: %u",
uid, myself->uid, myself->gid);
@@ -3213,7 +3252,7 @@ seteuid32 (__uid32_t uid)
&token_is_internal))
new_token = cygheap->user.internal_token;
- debug_printf ("Found token %d", new_token);
+ debug_printf ("Found token %p", new_token);
/* If no impersonation token is available, try to authenticate using
LSA private data stored password, LSA authentication using our own
@@ -3268,14 +3307,14 @@ seteuid32 (__uid32_t uid)
status = NtSetInformationToken (new_token, TokenOwner,
&usersid, sizeof usersid);
if (!NT_SUCCESS (status))
- debug_printf ("NtSetInformationToken (user.token, TokenOwner), %p",
+ debug_printf ("NtSetInformationToken (user.token, TokenOwner), %y",
status);
/* Try setting primary group in token to current group */
status = NtSetInformationToken (new_token, TokenPrimaryGroup,
&groups.pgsid, sizeof (cygsid));
if (!NT_SUCCESS (status))
debug_printf ("NtSetInformationToken (user.token, TokenPrimaryGroup),"
- "%p", status);
+ "%y", status);
/* Try setting default DACL */
PACL dacl_buf = (PACL) alloca (MAX_DACL_LEN (5));
if (sec_acl (dacl_buf, true, true, usersid))
@@ -3284,7 +3323,7 @@ seteuid32 (__uid32_t uid)
status = NtSetInformationToken (new_token, TokenDefaultDacl,
&tdacl, sizeof (tdacl));
if (!NT_SUCCESS (status))
- debug_printf ("NtSetInformationToken (TokenDefaultDacl), %p",
+ debug_printf ("NtSetInformationToken (TokenDefaultDacl), %y",
status);
}
}
@@ -3333,15 +3372,19 @@ seteuid32 (__uid32_t uid)
return 0;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (seteuid32, seteuid)
+#else
extern "C" int
seteuid (__uid16_t uid)
{
return seteuid32 (uid16touid32 (uid));
}
+#endif
/* setuid: POSIX 4.2.2.1 */
extern "C" int
-setuid32 (__uid32_t uid)
+setuid32 (uid_t uid)
{
int ret = seteuid32 (uid);
if (!ret)
@@ -3354,18 +3397,22 @@ setuid32 (__uid32_t uid)
return ret;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (setuid32, setuid)
+#else
extern "C" int
setuid (__uid16_t uid)
{
return setuid32 (uid16touid32 (uid));
}
+#endif
extern "C" int
-setreuid32 (__uid32_t ruid, __uid32_t euid)
+setreuid32 (uid_t ruid, uid_t euid)
{
int ret = 0;
bool tried = false;
- __uid32_t old_euid = myself->uid;
+ uid_t old_euid = myself->uid;
if (ruid != ILLEGAL_UID && cygheap->user.real_uid != ruid && euid != ruid)
tried = !(ret = seteuid32 (ruid));
@@ -3379,15 +3426,19 @@ setreuid32 (__uid32_t ruid, __uid32_t euid)
return ret;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (setreuid32, setreuid)
+#else
extern "C" int
setreuid (__uid16_t ruid, __uid16_t euid)
{
return setreuid32 (uid16touid32 (ruid), uid16touid32 (euid));
}
+#endif
/* setegid: from System V. */
extern "C" int
-setegid32 (__gid32_t gid)
+setegid32 (gid_t gid)
{
debug_printf ("new egid: %u current: %u", gid, myself->gid);
@@ -3400,7 +3451,7 @@ setegid32 (__gid32_t gid)
NTSTATUS status;
user_groups * groups = &cygheap->user.groups;
cygsid gsid;
- struct __group32 * gr = internal_getgrgid (gid);
+ struct group * gr = internal_getgrgid (gid);
if (!gsid.getfromgr (gr))
{
@@ -3417,33 +3468,37 @@ setegid32 (__gid32_t gid)
TokenPrimaryGroup, &gsid, sizeof gsid);
if (!NT_SUCCESS (status))
debug_printf ("NtSetInformationToken (primary_token, "
- "TokenPrimaryGroup), %p", status);
+ "TokenPrimaryGroup), %y", status);
status = NtSetInformationToken (cygheap->user.imp_token (),
TokenPrimaryGroup, &gsid, sizeof gsid);
if (!NT_SUCCESS (status))
- debug_printf ("NtSetInformationToken (token, TokenPrimaryGroup), %p",
+ debug_printf ("NtSetInformationToken (token, TokenPrimaryGroup), %y",
status);
}
cygheap->user.deimpersonate ();
status = NtSetInformationToken (hProcToken, TokenPrimaryGroup,
&gsid, sizeof gsid);
if (!NT_SUCCESS (status))
- debug_printf ("NtSetInformationToken (hProcToken, TokenPrimaryGroup), %p",
+ debug_printf ("NtSetInformationToken (hProcToken, TokenPrimaryGroup), %y",
status);
clear_procimptoken ();
cygheap->user.reimpersonate ();
return 0;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (setegid32, setegid)
+#else
extern "C" int
setegid (__gid16_t gid)
{
return setegid32 (gid16togid32 (gid));
}
+#endif
/* setgid: POSIX 4.2.2.1 */
extern "C" int
-setgid32 (__gid32_t gid)
+setgid32 (gid_t gid)
{
int ret = setegid32 (gid);
if (!ret)
@@ -3451,6 +3506,9 @@ setgid32 (__gid32_t gid)
return ret;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (setgid32, setgid)
+#else
extern "C" int
setgid (__gid16_t gid)
{
@@ -3459,13 +3517,14 @@ setgid (__gid16_t gid)
cygheap->user.real_gid = myself->gid;
return ret;
}
+#endif
extern "C" int
-setregid32 (__gid32_t rgid, __gid32_t egid)
+setregid32 (gid_t rgid, gid_t egid)
{
int ret = 0;
bool tried = false;
- __gid32_t old_egid = myself->gid;
+ gid_t old_egid = myself->gid;
if (rgid != ILLEGAL_GID && cygheap->user.real_gid != rgid && egid != rgid)
tried = !(ret = setegid32 (rgid));
@@ -3479,11 +3538,15 @@ setregid32 (__gid32_t rgid, __gid32_t egid)
return ret;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (setregid32, setregid)
+#else
extern "C" int
setregid (__gid16_t rgid, __gid16_t egid)
{
return setregid32 (gid16togid32 (rgid), gid16togid32 (egid));
}
+#endif
/* chroot: privileged Unix system call. */
/* FIXME: Not privileged here. How should this be done? */
@@ -3584,7 +3647,7 @@ setpriority (int which, id_t who, int value)
continue;
break;
case PRIO_USER:
- if ((__uid32_t) who != p->uid)
+ if ((uid_t) who != p->uid)
continue;
break;
}
@@ -3655,7 +3718,7 @@ getpriority (int which, id_t who)
nice = p->nice;
break;
case PRIO_USER:
- if ((__uid32_t) who == p->uid && p->nice < nice)
+ if ((uid_t) who == p->uid && p->nice < nice)
nice = p->nice;
break;
}
@@ -3705,14 +3768,14 @@ ffs (int i)
static void
locked_append (int fd, const void * buf, size_t size)
{
- struct __flock64 lock_buffer = {F_WRLCK, SEEK_SET, 0, 0, 0};
+ struct flock lock_buffer = {F_WRLCK, SEEK_SET, 0, 0, 0};
int count = 0;
do
- if ((lock_buffer.l_start = lseek64 (fd, 0, SEEK_END)) != (_off64_t) -1
+ if ((lock_buffer.l_start = lseek64 (fd, 0, SEEK_END)) != (off_t) -1
&& fcntl64 (fd, F_SETLKW, &lock_buffer) != -1)
{
- if (lseek64 (fd, 0, SEEK_END) != (_off64_t) -1)
+ if (lseek64 (fd, 0, SEEK_END) != (off_t) -1)
write (fd, buf, size);
lock_buffer.l_type = F_UNLCK;
fcntl64 (fd, F_SETLK, &lock_buffer);
@@ -4010,7 +4073,7 @@ gethostid (void)
/* SDBM hash */
for (PWCHAR wp = wguid; *wp; ++wp)
hostid = *wp + (hostid << 6) + (hostid << 16) - hostid;
- debug_printf ("hostid 0x%08x from MachineGuid %W", hostid, wguid);
+ debug_printf ("hostid %08y from MachineGuid %W", hostid, wguid);
return (int32_t) hostid; /* Avoid sign extension. */
}
@@ -4025,7 +4088,7 @@ getusershell ()
FIXME: SunOS has a far longer list, containing all shells which
might be shipped with the OS. Should we do the same for the Cygwin
distro, adding bash, tcsh, ksh, pdksh and zsh? */
- static NO_COPY const char *def_shells[] = {
+ static const char *def_shells[] = {
"/bin/sh",
"/bin/csh",
"/usr/bin/sh",
@@ -4375,8 +4438,7 @@ fchmodat (int dirfd, const char *pathname, mode_t mode, int flags)
}
extern "C" int
-fchownat (int dirfd, const char *pathname, __uid32_t uid, __gid32_t gid,
- int flags)
+fchownat (int dirfd, const char *pathname, uid_t uid, gid_t gid, int flags)
{
tmp_pathbuf tp;
myfault efault;
@@ -4395,7 +4457,7 @@ fchownat (int dirfd, const char *pathname, __uid32_t uid, __gid32_t gid,
}
extern "C" int
-fstatat (int dirfd, const char *pathname, struct __stat64 *st, int flags)
+fstatat (int dirfd, const char *pathname, struct stat *st, int flags)
{
tmp_pathbuf tp;
myfault efault;
@@ -4512,7 +4574,7 @@ mkfifoat (int dirfd, const char *pathname, mode_t mode)
}
extern "C" int
-mknodat (int dirfd, const char *pathname, mode_t mode, __dev32_t dev)
+mknodat (int dirfd, const char *pathname, mode_t mode, dev_t dev)
{
tmp_pathbuf tp;
myfault efault;
diff --git a/winsup/cygwin/sysconf.cc b/winsup/cygwin/sysconf.cc
index efff108ed..7d09f53d0 100644
--- a/winsup/cygwin/sysconf.cc
+++ b/winsup/cygwin/sysconf.cc
@@ -1,7 +1,7 @@
/* sysconf.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -47,7 +47,7 @@ get_nproc_values (int in)
if (!NT_SUCCESS (status))
{
__seterrno_from_nt_status (status);
- debug_printf ("NtQuerySystemInformation: status %p, %E", status);
+ debug_printf ("NtQuerySystemInformation: status %y, %E", status);
return -1;
}
switch (in)
@@ -81,7 +81,7 @@ get_avphys (int in)
if (!NT_SUCCESS (status))
{
__seterrno_from_nt_status (status);
- debug_printf ("NtQuerySystemInformation: status %d, %E", status);
+ debug_printf ("NtQuerySystemInformation: status %y, %E", status);
return -1;
}
return spi.AvailablePages
@@ -192,10 +192,10 @@ static struct
{nsup, {c:0}}, /* 89, _SC_TRACE_SYS_MAX */
{nsup, {c:0}}, /* 90, _SC_TRACE_USER_EVENT_MAX */
{cons, {c:-1L}}, /* 91, _SC_TYPED_MEMORY_OBJECTS */
- {cons, {c:-1L}}, /* 92, _SC_V6_ILP32_OFF32 */
+ {cons, {c:_POSIX_V6_ILP32_OFF32}}, /* 92, _SC_V6_ILP32_OFF32 */
{cons, {c:_POSIX_V6_ILP32_OFFBIG}}, /* 93, _SC_V6_ILP32_OFFBIG */
- {cons, {c:-1L}}, /* 94, _SC_V6_LP64_OFF64 */
- {cons, {c:-1L}}, /* 95, _SC_V6_LPBIG_OFFBIG */
+ {cons, {c:_POSIX_V6_LP64_OFF64}}, /* 94, _SC_V6_LP64_OFF64 */
+ {cons, {c:_POSIX_V6_LPBIG_OFFBIG}}, /* 95, _SC_V6_LPBIG_OFFBIG */
{cons, {c:_XOPEN_CRYPT}}, /* 96, _SC_XOPEN_CRYPT */
{cons, {c:_XOPEN_ENH_I18N}}, /* 97, _SC_XOPEN_ENH_I18N */
{cons, {c:-1L}}, /* 98, _SC_XOPEN_LEGACY */
@@ -266,6 +266,21 @@ static struct
{0, NULL}, /* _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
{0, NULL}, /* _CS_POSIX_V6_ILP32_OFF32_LIBS */
{0, NULL}, /* _CS_XBS5_ILP32_OFF32_LINTFLAGS */
+#ifdef __x86_64__
+ {0, NULL}, /* _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
+ {0, NULL}, /* _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
+ {0, NULL}, /* _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
+ {0, NULL}, /* _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
+ {ls ("")}, /* _CS_POSIX_V6_LP64_OFF64_CFLAGS */
+ {ls ("")}, /* _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
+ {ls ("")}, /* _CS_POSIX_V6_LP64_OFF64_LIBS */
+ {ls ("")}, /* _CS_XBS5_LP64_OFF64_LINTFLAGS */
+ {ls ("")}, /* _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
+ {ls ("")}, /* _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
+ {ls ("")}, /* _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
+ {ls ("")}, /* _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
+ {ls ("POSIX_V6_LP64_OFF64")}, /* _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS */
+#else
{ls ("")}, /* _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
{ls ("")}, /* _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
{ls ("")}, /* _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
@@ -279,6 +294,7 @@ static struct
{0, NULL}, /* _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
{0, NULL}, /* _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
{ls ("POSIX_V6_ILP32_OFFBIG")}, /* _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS */
+#endif
{ls ("")}, /* _CS_POSIX_V7_THREADS_CFLAGS */
{ls ("")}, /* _CS_POSIX_V7_THREADS_LDFLAGS */
{ls ("POSIXLY_CORRECT=1")}, /* _CS_V7_ENV */
@@ -336,8 +352,8 @@ sysinfo (struct sysinfo *info)
MEMORYSTATUSEX memory_status;
PSYSTEM_PAGEFILE_INFORMATION spi = NULL;
ULONG sizeof_spi = 512;
- PSYSTEM_TIME_OF_DAY_INFORMATION stodi = NULL;
- const ULONG sizeof_stodi = sizeof (SYSTEM_TIME_OF_DAY_INFORMATION);
+ PSYSTEM_TIMEOFDAY_INFORMATION stodi = NULL;
+ const ULONG sizeof_stodi = sizeof (SYSTEM_TIMEOFDAY_INFORMATION);
NTSTATUS status = STATUS_SUCCESS;
winpids pids ((DWORD) 0);
@@ -347,7 +363,7 @@ sysinfo (struct sysinfo *info)
return -1;
}
- stodi = (PSYSTEM_TIME_OF_DAY_INFORMATION) malloc (sizeof_stodi);
+ stodi = (PSYSTEM_TIMEOFDAY_INFORMATION) malloc (sizeof_stodi);
status = NtQuerySystemInformation (SystemTimeOfDayInformation, (PVOID) stodi,
sizeof_stodi, NULL);
if (NT_SUCCESS (status))
@@ -355,7 +371,7 @@ sysinfo (struct sysinfo *info)
/ 10000000ULL;
else
debug_printf ("NtQuerySystemInformation(SystemTimeOfDayInformation), "
- "status %p", status);
+ "status %y", status);
if (stodi)
free (stodi);
@@ -383,7 +399,7 @@ sysinfo (struct sysinfo *info)
if (!spi || !NT_SUCCESS (status))
{
debug_printf ("NtQuerySystemInformation(SystemPagefileInformation), "
- "status %p", status);
+ "status %y", status);
totalswap = (memory_status.ullTotalPageFile - memory_status.ullTotalPhys)
/ wincap.page_size ();
freeswap = (memory_status.ullAvailPageFile - memory_status.ullTotalPhys)
diff --git a/winsup/cygwin/syslog.cc b/winsup/cygwin/syslog.cc
index 98b15060d..7949b7001 100644
--- a/winsup/cygwin/syslog.cc
+++ b/winsup/cygwin/syslog.cc
@@ -45,7 +45,7 @@ openlog (const char *ident, int logopt, int facility)
wchar_t *new_ident = NULL;
debug_printf ("openlog called with (%s, %d, %d)",
- ident ? ident : "<NULL>", logopt, facility);
+ ident ? ident : "<NULL>", logopt, facility);
if (ident)
{
@@ -249,7 +249,7 @@ connect_syslogd ()
}
static int
-try_connect_syslogd (int priority, const char *msg, int len)
+try_connect_syslogd (int priority, const char *msg, size_t len)
{
ssize_t ret = -1;
@@ -296,11 +296,11 @@ try_connect_syslogd (int priority, const char *msg, int len)
extern "C" void
vsyslog (int priority, const char *message, va_list ap)
{
- debug_printf ("%x %s", priority, message);
+ debug_printf ("%y %s", priority, message);
/* If the priority fails the current mask, reject */
if ((LOG_MASK (LOG_PRI (priority)) & syslog_globals.process_logmask) == 0)
{
- debug_printf ("failing message %x due to priority mask %x",
+ debug_printf ("failing message %y due to priority mask %y",
priority, syslog_globals.process_logmask);
return;
}
@@ -402,7 +402,7 @@ vsyslog (int priority, const char *message, va_list ap)
}
char *total_msg = pass.get_message ();
- int len = strlen (total_msg);
+ size_t len = strlen (total_msg);
if (len != 0 && (total_msg[len - 1] == '\n'))
total_msg[--len] = '\0';
diff --git a/winsup/cygwin/termios.cc b/winsup/cygwin/termios.cc
index fef5e506c..2f6629842 100644
--- a/winsup/cygwin/termios.cc
+++ b/winsup/cygwin/termios.cc
@@ -159,10 +159,10 @@ tcsetattr (int fd, int a, const struct termios *t)
}
set_errno (e);
- termios_printf ("iflag %p, oflag %p, cflag %p, lflag %p, VMIN %d, VTIME %d",
+ termios_printf ("iflag %y, oflag %y, cflag %y, lflag %y, VMIN %d, VTIME %d",
t->c_iflag, t->c_oflag, t->c_cflag, t->c_lflag, t->c_cc[VMIN],
t->c_cc[VTIME]);
- termios_printf ("%R = tcsetattr(%d, %d, %x)", res, fd, a, t);
+ termios_printf ("%R = tcsetattr(%d, %d, %p)", res, fd, a, t);
return res;
}
@@ -184,7 +184,7 @@ tcgetattr (int fd, struct termios *in_t)
if (res)
termios_printf ("%R = tcgetattr(%d, %p)", res, fd, in_t);
else
- termios_printf ("iflag %x, oflag %x, cflag %x, lflag %x, VMIN %d, VTIME %d",
+ termios_printf ("iflag %y, oflag %y, cflag %y, lflag %y, VMIN %d, VTIME %d",
t->c_iflag, t->c_oflag, t->c_cflag, t->c_lflag, t->c_cc[VMIN],
t->c_cc[VTIME]);
diff --git a/winsup/cygwin/textmode.c b/winsup/cygwin/textmode.c
index 55c6fb975..320b75453 100644
--- a/winsup/cygwin/textmode.c
+++ b/winsup/cygwin/textmode.c
@@ -1,6 +1,6 @@
/* binmode.c
- Copyright 2000, 2001, 2010 Red Hat, Inc.
+ Copyright 2000, 2001, 2010, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,7 +14,9 @@ details. */
extern int _fmode;
void
-cygwin_premain0 (int argc, char **argv, struct per_process *myself)
+cygwin_premain0 (int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)),
+ struct per_process *myself __attribute__ ((unused)))
{
_fmode &= ~_O_BINARY;
_fmode |= _O_TEXT;
diff --git a/winsup/cygwin/textreadmode.c b/winsup/cygwin/textreadmode.c
index ab6d2cbb2..5425002f2 100644
--- a/winsup/cygwin/textreadmode.c
+++ b/winsup/cygwin/textreadmode.c
@@ -1,6 +1,6 @@
/* textreadmode.c
- Copyright 2004, 2010 Red Hat, Inc.
+ Copyright 2004, 2010, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,7 +14,9 @@ details. */
extern int _fmode;
void
-cygwin_premain0 (int argc, char **argv, struct per_process *myself)
+cygwin_premain0 (int argc __attribute__ ((unused)),
+ char **argv __attribute__ ((unused)),
+ struct per_process *myself __attribute__ ((unused)))
{
static struct __cygwin_perfile pf[] =
{
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 183b9b8d5..0d5ded675 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -38,7 +38,12 @@ extern "C" void __fp_lock_all ();
extern "C" void __fp_unlock_all ();
extern "C" int valid_sched_parameters(const struct sched_param *);
extern "C" int sched_set_thread_priority(HANDLE thread, int priority);
+#if __GNUC__ == 4 && __GNUC_MINOR__ >= 7
+/* FIXME: Temporarily workaround gcc 4.7+ bug. */
+static verifyable_object_state
+#else
static inline verifyable_object_state
+#endif
verifyable_object_isvalid (void const * objectptr, thread_magic_t magic,
void *static_ptr1 = NULL,
void *static_ptr2 = NULL,
@@ -117,7 +122,12 @@ __cygwin_lock_unlock (_LOCK_T *lock)
paranoid_printf ("threadcount %d. unlocked", MT_INTERFACE->threadcount);
}
+#if __GNUC__ == 4 && __GNUC_MINOR__ >= 7
+/* FIXME: Temporarily workaround gcc 4.7+ bug. */
+static verifyable_object_state
+#else
static inline verifyable_object_state
+#endif
verifyable_object_isvalid (void const *objectptr, thread_magic_t magic, void *static_ptr1,
void *static_ptr2, void *static_ptr3)
{
@@ -216,7 +226,7 @@ pthread_mutex::can_be_unlocked ()
* Also check for the ANONYMOUS owner to cover NORMAL mutexes as well. */
bool res = type == PTHREAD_MUTEX_NORMAL || no_owner ()
|| (recursion_counter == 1 && pthread::equal (owner, self));
- pthread_printf ("recursion_counter %d res %d", recursion_counter, res);
+ pthread_printf ("recursion_counter %u res %d", recursion_counter, res);
return res;
}
@@ -579,7 +589,11 @@ pthread::cancel ()
executing Windows code. Rely on deferred cancellation in this case. */
if (!cygtls->inside_kernel (&context))
{
+#ifdef __x86_64__
+ context.Rip = (ULONG_PTR) pthread::static_cancel_self;
+#else
context.Eip = (DWORD) pthread::static_cancel_self;
+#endif
SetThreadContext (win32_obj_id, &context);
}
}
@@ -1143,7 +1157,7 @@ pthread_cond::pthread_cond (pthread_condattr *attr) :
/* Change the mutex type to NORMAL to speed up mutex operations */
mtx_out.set_type (PTHREAD_MUTEX_NORMAL);
- sem_wait = ::CreateSemaphore (&sec_none_nih, 0, LONG_MAX, NULL);
+ sem_wait = ::CreateSemaphore (&sec_none_nih, 0, INT32_MAX, NULL);
if (!sem_wait)
{
pthread_printf ("CreateSemaphore failed. %E");
@@ -1165,7 +1179,7 @@ pthread_cond::~pthread_cond ()
void
pthread_cond::unblock (const bool all)
{
- unsigned long releaseable;
+ LONG releaseable;
/*
* Block outgoing threads (and avoid simultanous unblocks)
@@ -1175,7 +1189,7 @@ pthread_cond::unblock (const bool all)
releaseable = waiting - pending;
if (releaseable)
{
- unsigned long released;
+ LONG released;
if (!pending)
{
@@ -1212,11 +1226,11 @@ pthread_cond::wait (pthread_mutex_t mutex, PLARGE_INTEGER timeout)
DWORD rv;
mtx_in.lock ();
- if (InterlockedIncrement ((long *)&waiting) == 1)
+ if (InterlockedIncrement (&waiting) == 1)
mtx_cond = mutex;
else if (mtx_cond != mutex)
{
- InterlockedDecrement ((long *)&waiting);
+ InterlockedDecrement (&waiting);
mtx_in.unlock ();
return EINVAL;
}
@@ -1247,7 +1261,7 @@ pthread_cond::wait (pthread_mutex_t mutex, PLARGE_INTEGER timeout)
rv = WAIT_OBJECT_0;
}
- InterlockedDecrement ((long *)&waiting);
+ InterlockedDecrement (&waiting);
if (rv == WAIT_OBJECT_0 && --pending == 0)
/*
@@ -1286,7 +1300,7 @@ pthread_cond::_fixup_after_fork ()
mtx_in.unlock ();
mtx_out.unlock ();
- sem_wait = ::CreateSemaphore (&sec_none_nih, 0, LONG_MAX, NULL);
+ sem_wait = ::CreateSemaphore (&sec_none_nih, 0, INT32_MAX, NULL);
if (!sem_wait)
api_fatal ("pthread_cond::_fixup_after_fork () failed to recreate win32 semaphore");
}
@@ -1383,7 +1397,7 @@ pthread_rwlock::rdlock ()
reader = lookup_reader ();
if (reader)
{
- if (reader->n < ULONG_MAX)
+ if (reader->n < UINT32_MAX)
++reader->n;
else
errno = EAGAIN;
@@ -1429,7 +1443,7 @@ pthread_rwlock::tryrdlock ()
RWLOCK_READER *reader = lookup_reader ();
if (!reader)
reader = add_reader ();
- if (reader && reader->n < ULONG_MAX)
+ if (reader && reader->n < UINT32_MAX)
++reader->n;
else
result = EAGAIN;
@@ -1448,7 +1462,7 @@ pthread_rwlock::wrlock ()
mtx.lock ();
- if (writer == self || lookup_reader ())
+ if (writer == self || lookup_reader ())
{
result = EDEADLK;
goto DONE;
@@ -1730,7 +1744,7 @@ pthread_mutex::lock ()
pthread_t self = ::pthread_self ();
int result = 0;
- if (InterlockedIncrement ((long *) &lock_counter) == 1)
+ if (InterlockedIncrement (&lock_counter) == 1)
set_owner (self);
else if (type == PTHREAD_MUTEX_NORMAL /* potentially causes deadlock */
|| !pthread::equal (owner, self))
@@ -1741,14 +1755,14 @@ pthread_mutex::lock ()
}
else
{
- InterlockedDecrement ((long *) &lock_counter);
+ InterlockedDecrement (&lock_counter);
if (type == PTHREAD_MUTEX_RECURSIVE)
result = lock_recursive ();
else
result = EDEADLK;
}
- pthread_printf ("mutex %p, self %p, owner %p, lock_counter %d, recursion_counter %d",
+ pthread_printf ("mutex %p, self %p, owner %p, lock_counter %d, recursion_counter %u",
this, self, owner, lock_counter, recursion_counter);
return result;
}
@@ -1772,12 +1786,12 @@ pthread_mutex::unlock ()
#ifdef DEBUGGING
tid = 0; // thread-id
#endif
- if (InterlockedDecrement ((long *) &lock_counter))
+ if (InterlockedDecrement (&lock_counter))
::SetEvent (win32_obj_id); // Another thread is waiting
res = 0;
}
- pthread_printf ("mutex %p, owner %p, self %p, lock_counter %d, recursion_counter %d, type %d, res %d",
+ pthread_printf ("mutex %p, owner %p, self %p, lock_counter %d, recursion_counter %u, type %d, res %d",
this, owner, self, lock_counter, recursion_counter, type, res);
return res;
}
@@ -1788,7 +1802,7 @@ pthread_mutex::trylock ()
pthread_t self = ::pthread_self ();
int result = 0;
- if (InterlockedCompareExchange ((long *) &lock_counter, 1, 0) == 0)
+ if (InterlockedCompareExchange (&lock_counter, 1, 0) == 0)
set_owner (self);
else if (type == PTHREAD_MUTEX_RECURSIVE && pthread::equal (owner, self))
result = lock_recursive ();
@@ -1864,7 +1878,7 @@ pthread_spinlock::lock ()
do
{
- if (InterlockedExchange ((long *) &lock_counter, 1) == 0)
+ if (InterlockedExchange (&lock_counter, 1) == 0)
{
set_owner (self);
result = 0;
@@ -1899,7 +1913,7 @@ pthread_spinlock::unlock ()
#ifdef DEBUGGING
tid = 0; // thread-id
#endif
- InterlockedExchange ((long *) &lock_counter, 0);
+ InterlockedExchange (&lock_counter, 0);
::SetEvent (win32_obj_id);
result = 0;
}
@@ -2248,7 +2262,7 @@ pthread_attr_getstack (const pthread_attr_t *attr, void **addr, size_t *size)
if (!pthread_attr::is_good_object (attr))
return EINVAL;
/* uses lowest address of stack on all platforms */
- *addr = (void *)((int)(*attr)->stackaddr - (*attr)->stacksize);
+ *addr = (void *)((ptrdiff_t)(*attr)->stackaddr - (*attr)->stacksize);
*size = (*attr)->stacksize;
return 0;
}
@@ -2481,7 +2495,7 @@ pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
else
{
debug_printf ("NtQueryInformationThread(ThreadBasicInformation), "
- "status %p", status);
+ "status %y", status);
(*attr)->stackaddr = thread->attr.stackaddr;
(*attr)->stacksize = thread->attr.stacksize;
}
@@ -3030,7 +3044,8 @@ extern "C" int
pthread_sigmask (int operation, const sigset_t *set, sigset_t *old_set)
{
int res = handle_sigprocmask (operation, set, old_set, _my_tls.sigmask);
- syscall_printf ("%d = pthread_sigmask(%d, %p, %p)", operation, set, old_set);
+ syscall_printf ("%d = pthread_sigmask(%d, %p, %p)",
+ res, operation, set, old_set);
return res;
}
@@ -3368,7 +3383,7 @@ semaphore::semaphore (int pshared, unsigned int value)
{
SECURITY_ATTRIBUTES sa = (pshared != PTHREAD_PROCESS_PRIVATE)
? sec_all : sec_none_nih;
- this->win32_obj_id = ::CreateSemaphore (&sa, value, LONG_MAX, NULL);
+ this->win32_obj_id = ::CreateSemaphore (&sa, value, INT32_MAX, NULL);
if (!this->win32_obj_id)
magic = 0;
@@ -3389,7 +3404,7 @@ semaphore::semaphore (unsigned long long shash, LUID sluid, int sfd,
__small_sprintf (name, "semaphore/%016X%08x%08x",
hash, luid.HighPart, luid.LowPart);
- this->win32_obj_id = ::CreateSemaphore (&sec_all, value, LONG_MAX, name);
+ this->win32_obj_id = ::CreateSemaphore (&sec_all, value, INT32_MAX, name);
if (!this->win32_obj_id)
magic = 0;
if (GetLastError () == ERROR_ALREADY_EXISTS && (oflag & O_EXCL))
@@ -3420,7 +3435,7 @@ semaphore::_post ()
int
semaphore::_getvalue (int *sval)
{
- long val;
+ LONG val;
switch (WaitForSingleObject (win32_obj_id, 0))
{
@@ -3513,10 +3528,10 @@ semaphore::_fixup_after_fork ()
{
if (shared == PTHREAD_PROCESS_PRIVATE)
{
- pthread_printf ("sem %x", this);
+ pthread_printf ("sem %p", this);
/* FIXME: duplicate code here and in the constructor. */
this->win32_obj_id = ::CreateSemaphore (&sec_none_nih, currentvalue,
- LONG_MAX, NULL);
+ INT32_MAX, NULL);
if (!win32_obj_id)
api_fatal ("failed to create new win32 semaphore, %E");
}
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h
index 71f301258..c87c620eb 100644
--- a/winsup/cygwin/thread.h
+++ b/winsup/cygwin/thread.h
@@ -92,7 +92,7 @@ class pinfo;
#define MUTEX_OWNER_ANONYMOUS ((pthread_t) -1)
-typedef unsigned long thread_magic_t;
+typedef uint32_t thread_magic_t;
/* verifyable_object should not be defined here - it's a general purpose class */
@@ -496,8 +496,8 @@ public:
int shared;
clockid_t clock_id;
- unsigned long waiting;
- unsigned long pending;
+ LONG waiting;
+ LONG pending;
HANDLE sem_wait;
pthread_mutex mtx_in;
@@ -547,14 +547,14 @@ public:
int shared;
- unsigned long waiting_readers;
- unsigned long waiting_writers;
+ uint32_t waiting_readers;
+ uint32_t waiting_writers;
pthread_t writer;
struct RWLOCK_READER
{
struct RWLOCK_READER *next;
pthread_t thread;
- unsigned long n;
+ uint32_t n;
RWLOCK_READER (): next (NULL), thread (pthread::self ()), n (0) {}
} *readers;
fast_mutex readers_mx;
@@ -637,7 +637,7 @@ public:
HANDLE win32_obj_id;
int shared;
- long currentvalue;
+ LONG currentvalue;
int fd;
unsigned long long hash;
LUID luid;
diff --git a/winsup/cygwin/timer.cc b/winsup/cygwin/timer.cc
index 281d20cf3..93b9cb592 100644
--- a/winsup/cygwin/timer.cc
+++ b/winsup/cygwin/timer.cc
@@ -1,7 +1,6 @@
/* timer.cc
- Copyright 2004, 2005, 2006, 2008, 2010, 2011
- Red Hat, Inc.
+ Copyright 2004, 2005, 2006, 2008, 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -125,7 +124,7 @@ timer_thread (VOID *x)
while (1)
{
long long sleep_us;
- long sleep_ms;
+ LONG sleep_ms;
/* Account for delays in starting thread
and sending the signal */
now = gtod.usecs ();
@@ -449,7 +448,7 @@ alarm (unsigned int seconds)
newt.it_value.tv_sec = seconds;
timer_settime ((timer_t) &ttstart, 0, &newt, &oldt);
int ret = oldt.it_value.tv_sec + (oldt.it_value.tv_nsec > 0);
- syscall_printf ("%d = alarm(%d)", ret, seconds);
+ syscall_printf ("%d = alarm(%u)", ret, seconds);
return ret;
}
@@ -461,16 +460,16 @@ ualarm (useconds_t value, useconds_t interval)
Interpret negative arguments as zero */
if (value > 0)
{
- timer.it_value.tv_sec = (unsigned int) value / 1000000;
- timer.it_value.tv_nsec = ((unsigned int) value % 1000000) * 1000;
+ timer.it_value.tv_sec = value / 1000000;
+ timer.it_value.tv_nsec = (value % 1000000) * 1000;
}
if (interval > 0)
{
- timer.it_interval.tv_sec = (unsigned int) interval / 1000000;
- timer.it_interval.tv_nsec = ((unsigned int) interval % 1000000) * 1000;
+ timer.it_interval.tv_sec = interval / 1000000;
+ timer.it_interval.tv_nsec = (interval % 1000000) * 1000;
}
timer_settime ((timer_t) &ttstart, 0, &timer, &otimer);
useconds_t ret = otimer.it_value.tv_sec * 1000000 + (otimer.it_value.tv_nsec + 999) / 1000;
- syscall_printf ("%d = ualarm(%d , %d)", ret, value, interval);
+ syscall_printf ("%d = ualarm(%ld , %ld)", ret, value, interval);
return ret;
}
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 407f7c479..14d65354c 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -74,9 +74,11 @@ times (struct tms *buf)
GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time,
&kernel_time, &user_time);
- syscall_printf ("ticks %d, CLOCKS_PER_SEC %d", ticks, CLOCKS_PER_SEC);
- syscall_printf ("user_time %d, kernel_time %d, creation_time %d, exit_time %d",
- user_time, kernel_time, creation_time, exit_time);
+ syscall_printf ("ticks %D, CLOCKS_PER_SEC %d", ticks, CLOCKS_PER_SEC);
+ syscall_printf ("user_time %D, kernel_time %D, "
+ "creation_time %D, exit_time %D",
+ user_time, kernel_time,
+ creation_time, exit_time);
buf->tms_stime = __to_clock_t (&kernel_time, 0);
buf->tms_utime = __to_clock_t (&user_time, 0);
timeval_to_filetime (&myself->rusage_children.ru_stime, &kernel_time);
@@ -123,7 +125,7 @@ settimeofday (const struct timeval *tv, const struct timezone *tz)
if (res)
set_errno (EPERM);
- syscall_printf ("%R = settimeofday(%x, %x)", res, tv, tz);
+ syscall_printf ("%R = settimeofday(%p, %p)", res, tv, tz);
return res;
}
@@ -321,7 +323,7 @@ time (time_t * ptr)
if (ptr)
*ptr = res;
- syscall_printf ("%d = time(%x)", res, ptr);
+ syscall_printf ("%d = time(%p)", res, ptr);
return res;
}
@@ -425,7 +427,7 @@ utime (const char *path, const struct utimbuf *buf)
if (buf == 0)
return utimes (path, 0);
- debug_printf ("incoming utime act %x", buf->actime);
+ debug_printf ("incoming utime act %lx", buf->actime);
tmp[0] = time_t_to_timeval (buf->actime);
tmp[1] = time_t_to_timeval (buf->modtime);
@@ -496,7 +498,7 @@ hires_ns::nsecs (bool monotonic)
// FIXME: Use round() here?
now.QuadPart = (LONGLONG) (freq * (double)
- (now.QuadPart - (monotonic ? 0LL : primed_pc.QuadPart)));
+ (now.QuadPart - (monotonic ? 0LL : primed_pc.QuadPart)));
return now.QuadPart;
}
diff --git a/winsup/cygwin/tlsoffsets.h b/winsup/cygwin/tlsoffsets.h
index 2347e9291..37f30c070 100644
--- a/winsup/cygwin/tlsoffsets.h
+++ b/winsup/cygwin/tlsoffsets.h
@@ -3,115 +3,115 @@
//; $tls::start_offset = -12700;
//; $tls::locals = -12700;
//; $tls::plocals = 0;
-//; $tls::local_clib = -11236;
-//; $tls::plocal_clib = 1464;
-//; $tls::__dontuse = -11236;
-//; $tls::p__dontuse = 1464;
-//; $tls::func = -10148;
-//; $tls::pfunc = 2552;
-//; $tls::saved_errno = -10144;
-//; $tls::psaved_errno = 2556;
-//; $tls::sa_flags = -10140;
-//; $tls::psa_flags = 2560;
-//; $tls::oldmask = -10136;
-//; $tls::poldmask = 2564;
-//; $tls::deltamask = -10132;
-//; $tls::pdeltamask = 2568;
-//; $tls::errno_addr = -10128;
-//; $tls::perrno_addr = 2572;
-//; $tls::sigmask = -10124;
-//; $tls::psigmask = 2576;
-//; $tls::sigwait_mask = -10120;
-//; $tls::psigwait_mask = 2580;
-//; $tls::sigwait_info = -10116;
-//; $tls::psigwait_info = 2584;
-//; $tls::signal_arrived = -10112;
-//; $tls::psignal_arrived = 2588;
-//; $tls::will_wait_for_signal = -10108;
-//; $tls::pwill_wait_for_signal = 2592;
-//; $tls::thread_context = -10104;
-//; $tls::pthread_context = 2596;
-//; $tls::thread_id = -9892;
-//; $tls::pthread_id = 2808;
-//; $tls::infodata = -9888;
-//; $tls::pinfodata = 2812;
-//; $tls::tid = -9740;
-//; $tls::ptid = 2960;
-//; $tls::_ctinfo = -9736;
-//; $tls::p_ctinfo = 2964;
-//; $tls::andreas = -9732;
-//; $tls::pandreas = 2968;
-//; $tls::wq = -9728;
-//; $tls::pwq = 2972;
-//; $tls::sig = -9700;
-//; $tls::psig = 3000;
-//; $tls::incyg = -9696;
-//; $tls::pincyg = 3004;
-//; $tls::spinning = -9692;
-//; $tls::pspinning = 3008;
-//; $tls::stacklock = -9688;
-//; $tls::pstacklock = 3012;
-//; $tls::stackptr = -9684;
-//; $tls::pstackptr = 3016;
-//; $tls::stack = -9680;
-//; $tls::pstack = 3020;
-//; $tls::initialized = -8656;
-//; $tls::pinitialized = 4044;
+//; $tls::local_clib = -11260;
+//; $tls::plocal_clib = 1440;
+//; $tls::__dontuse = -11260;
+//; $tls::p__dontuse = 1440;
+//; $tls::func = -10172;
+//; $tls::pfunc = 2528;
+//; $tls::saved_errno = -10168;
+//; $tls::psaved_errno = 2532;
+//; $tls::sa_flags = -10164;
+//; $tls::psa_flags = 2536;
+//; $tls::oldmask = -10160;
+//; $tls::poldmask = 2540;
+//; $tls::deltamask = -10156;
+//; $tls::pdeltamask = 2544;
+//; $tls::errno_addr = -10152;
+//; $tls::perrno_addr = 2548;
+//; $tls::sigmask = -10148;
+//; $tls::psigmask = 2552;
+//; $tls::sigwait_mask = -10144;
+//; $tls::psigwait_mask = 2556;
+//; $tls::sigwait_info = -10140;
+//; $tls::psigwait_info = 2560;
+//; $tls::signal_arrived = -10136;
+//; $tls::psignal_arrived = 2564;
+//; $tls::will_wait_for_signal = -10132;
+//; $tls::pwill_wait_for_signal = 2568;
+//; $tls::thread_context = -10128;
+//; $tls::pthread_context = 2572;
+//; $tls::thread_id = -9916;
+//; $tls::pthread_id = 2784;
+//; $tls::infodata = -9912;
+//; $tls::pinfodata = 2788;
+//; $tls::tid = -9764;
+//; $tls::ptid = 2936;
+//; $tls::_ctinfo = -9760;
+//; $tls::p_ctinfo = 2940;
+//; $tls::andreas = -9756;
+//; $tls::pandreas = 2944;
+//; $tls::wq = -9752;
+//; $tls::pwq = 2948;
+//; $tls::sig = -9724;
+//; $tls::psig = 2976;
+//; $tls::incyg = -9720;
+//; $tls::pincyg = 2980;
+//; $tls::spinning = -9716;
+//; $tls::pspinning = 2984;
+//; $tls::stacklock = -9712;
+//; $tls::pstacklock = 2988;
+//; $tls::stackptr = -9708;
+//; $tls::pstackptr = 2992;
+//; $tls::stack = -9704;
+//; $tls::pstack = 2996;
+//; $tls::initialized = -8680;
+//; $tls::pinitialized = 4020;
//; __DATA__
#define tls_locals (-12700)
#define tls_plocals (0)
-#define tls_local_clib (-11236)
-#define tls_plocal_clib (1464)
-#define tls___dontuse (-11236)
-#define tls_p__dontuse (1464)
-#define tls_func (-10148)
-#define tls_pfunc (2552)
-#define tls_saved_errno (-10144)
-#define tls_psaved_errno (2556)
-#define tls_sa_flags (-10140)
-#define tls_psa_flags (2560)
-#define tls_oldmask (-10136)
-#define tls_poldmask (2564)
-#define tls_deltamask (-10132)
-#define tls_pdeltamask (2568)
-#define tls_errno_addr (-10128)
-#define tls_perrno_addr (2572)
-#define tls_sigmask (-10124)
-#define tls_psigmask (2576)
-#define tls_sigwait_mask (-10120)
-#define tls_psigwait_mask (2580)
-#define tls_sigwait_info (-10116)
-#define tls_psigwait_info (2584)
-#define tls_signal_arrived (-10112)
-#define tls_psignal_arrived (2588)
-#define tls_will_wait_for_signal (-10108)
-#define tls_pwill_wait_for_signal (2592)
-#define tls_thread_context (-10104)
-#define tls_pthread_context (2596)
-#define tls_thread_id (-9892)
-#define tls_pthread_id (2808)
-#define tls_infodata (-9888)
-#define tls_pinfodata (2812)
-#define tls_tid (-9740)
-#define tls_ptid (2960)
-#define tls__ctinfo (-9736)
-#define tls_p_ctinfo (2964)
-#define tls_andreas (-9732)
-#define tls_pandreas (2968)
-#define tls_wq (-9728)
-#define tls_pwq (2972)
-#define tls_sig (-9700)
-#define tls_psig (3000)
-#define tls_incyg (-9696)
-#define tls_pincyg (3004)
-#define tls_spinning (-9692)
-#define tls_pspinning (3008)
-#define tls_stacklock (-9688)
-#define tls_pstacklock (3012)
-#define tls_stackptr (-9684)
-#define tls_pstackptr (3016)
-#define tls_stack (-9680)
-#define tls_pstack (3020)
-#define tls_initialized (-8656)
-#define tls_pinitialized (4044)
+#define tls_local_clib (-11260)
+#define tls_plocal_clib (1440)
+#define tls___dontuse (-11260)
+#define tls_p__dontuse (1440)
+#define tls_func (-10172)
+#define tls_pfunc (2528)
+#define tls_saved_errno (-10168)
+#define tls_psaved_errno (2532)
+#define tls_sa_flags (-10164)
+#define tls_psa_flags (2536)
+#define tls_oldmask (-10160)
+#define tls_poldmask (2540)
+#define tls_deltamask (-10156)
+#define tls_pdeltamask (2544)
+#define tls_errno_addr (-10152)
+#define tls_perrno_addr (2548)
+#define tls_sigmask (-10148)
+#define tls_psigmask (2552)
+#define tls_sigwait_mask (-10144)
+#define tls_psigwait_mask (2556)
+#define tls_sigwait_info (-10140)
+#define tls_psigwait_info (2560)
+#define tls_signal_arrived (-10136)
+#define tls_psignal_arrived (2564)
+#define tls_will_wait_for_signal (-10132)
+#define tls_pwill_wait_for_signal (2568)
+#define tls_thread_context (-10128)
+#define tls_pthread_context (2572)
+#define tls_thread_id (-9916)
+#define tls_pthread_id (2784)
+#define tls_infodata (-9912)
+#define tls_pinfodata (2788)
+#define tls_tid (-9764)
+#define tls_ptid (2936)
+#define tls__ctinfo (-9760)
+#define tls_p_ctinfo (2940)
+#define tls_andreas (-9756)
+#define tls_pandreas (2944)
+#define tls_wq (-9752)
+#define tls_pwq (2948)
+#define tls_sig (-9724)
+#define tls_psig (2976)
+#define tls_incyg (-9720)
+#define tls_pincyg (2980)
+#define tls_spinning (-9716)
+#define tls_pspinning (2984)
+#define tls_stacklock (-9712)
+#define tls_pstacklock (2988)
+#define tls_stackptr (-9708)
+#define tls_pstackptr (2992)
+#define tls_stack (-9704)
+#define tls_pstack (2996)
+#define tls_initialized (-8680)
+#define tls_pinitialized (4020)
diff --git a/winsup/cygwin/tlsoffsets64.h b/winsup/cygwin/tlsoffsets64.h
new file mode 100644
index 000000000..f85dae242
--- /dev/null
+++ b/winsup/cygwin/tlsoffsets64.h
@@ -0,0 +1,117 @@
+//;# autogenerated: Do not edit.
+
+//; $tls::start_offset = -12800;
+//; $tls::locals = -12800;
+//; $tls::plocals = 0;
+//; $tls::local_clib = -11200;
+//; $tls::plocal_clib = 1600;
+//; $tls::__dontuse = -11200;
+//; $tls::p__dontuse = 1600;
+//; $tls::func = -9312;
+//; $tls::pfunc = 3488;
+//; $tls::saved_errno = -9304;
+//; $tls::psaved_errno = 3496;
+//; $tls::sa_flags = -9300;
+//; $tls::psa_flags = 3500;
+//; $tls::oldmask = -9296;
+//; $tls::poldmask = 3504;
+//; $tls::deltamask = -9288;
+//; $tls::pdeltamask = 3512;
+//; $tls::errno_addr = -9280;
+//; $tls::perrno_addr = 3520;
+//; $tls::sigmask = -9272;
+//; $tls::psigmask = 3528;
+//; $tls::sigwait_mask = -9264;
+//; $tls::psigwait_mask = 3536;
+//; $tls::sigwait_info = -9256;
+//; $tls::psigwait_info = 3544;
+//; $tls::signal_arrived = -9248;
+//; $tls::psignal_arrived = 3552;
+//; $tls::will_wait_for_signal = -9240;
+//; $tls::pwill_wait_for_signal = 3560;
+//; $tls::thread_context = -9232;
+//; $tls::pthread_context = 3568;
+//; $tls::thread_id = -8400;
+//; $tls::pthread_id = 4400;
+//; $tls::infodata = -8396;
+//; $tls::pinfodata = 4404;
+//; $tls::tid = -8248;
+//; $tls::ptid = 4552;
+//; $tls::_ctinfo = -8240;
+//; $tls::p_ctinfo = 4560;
+//; $tls::andreas = -8232;
+//; $tls::pandreas = 4568;
+//; $tls::wq = -8224;
+//; $tls::pwq = 4576;
+//; $tls::sig = -8176;
+//; $tls::psig = 4624;
+//; $tls::incyg = -8172;
+//; $tls::pincyg = 4628;
+//; $tls::spinning = -8168;
+//; $tls::pspinning = 4632;
+//; $tls::stacklock = -8164;
+//; $tls::pstacklock = 4636;
+//; $tls::stackptr = -8160;
+//; $tls::pstackptr = 4640;
+//; $tls::stack = -8152;
+//; $tls::pstack = 4648;
+//; $tls::initialized = -6104;
+//; $tls::pinitialized = 6696;
+//; __DATA__
+
+#define tls_locals (-12800)
+#define tls_plocals (0)
+#define tls_local_clib (-11200)
+#define tls_plocal_clib (1600)
+#define tls___dontuse (-11200)
+#define tls_p__dontuse (1600)
+#define tls_func (-9312)
+#define tls_pfunc (3488)
+#define tls_saved_errno (-9304)
+#define tls_psaved_errno (3496)
+#define tls_sa_flags (-9300)
+#define tls_psa_flags (3500)
+#define tls_oldmask (-9296)
+#define tls_poldmask (3504)
+#define tls_deltamask (-9288)
+#define tls_pdeltamask (3512)
+#define tls_errno_addr (-9280)
+#define tls_perrno_addr (3520)
+#define tls_sigmask (-9272)
+#define tls_psigmask (3528)
+#define tls_sigwait_mask (-9264)
+#define tls_psigwait_mask (3536)
+#define tls_sigwait_info (-9256)
+#define tls_psigwait_info (3544)
+#define tls_signal_arrived (-9248)
+#define tls_psignal_arrived (3552)
+#define tls_will_wait_for_signal (-9240)
+#define tls_pwill_wait_for_signal (3560)
+#define tls_thread_context (-9232)
+#define tls_pthread_context (3568)
+#define tls_thread_id (-8400)
+#define tls_pthread_id (4400)
+#define tls_infodata (-8396)
+#define tls_pinfodata (4404)
+#define tls_tid (-8248)
+#define tls_ptid (4552)
+#define tls__ctinfo (-8240)
+#define tls_p_ctinfo (4560)
+#define tls_andreas (-8232)
+#define tls_pandreas (4568)
+#define tls_wq (-8224)
+#define tls_pwq (4576)
+#define tls_sig (-8176)
+#define tls_psig (4624)
+#define tls_incyg (-8172)
+#define tls_pincyg (4628)
+#define tls_spinning (-8168)
+#define tls_pspinning (4632)
+#define tls_stacklock (-8164)
+#define tls_pstacklock (4636)
+#define tls_stackptr (-8160)
+#define tls_pstackptr (4640)
+#define tls_stack (-8152)
+#define tls_pstack (4648)
+#define tls_initialized (-6104)
+#define tls_pinitialized (6696)
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc
index 515e706a0..7388ac1a3 100644
--- a/winsup/cygwin/tty.cc
+++ b/winsup/cygwin/tty.cc
@@ -1,7 +1,7 @@
/* tty.cc
Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009,
- 2010, 2011 Red Hat, Inc.
+ 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -85,7 +85,7 @@ tty::init_session ()
cygheap->fdtab.get_debugger_info ();
}
-int __stdcall
+int __reg2
tty_list::attach (int n)
{
int res;
@@ -163,7 +163,7 @@ tty::not_allocated (HANDLE& r, HANDLE& w)
/* Attempt to open the from-master side of the tty. If it is accessible
then it exists although we may not have privileges to actually use it. */
char pipename[sizeof("ptyNNNN-from-master")];
- __small_sprintf (pipename, "pty%d-from-master", get_unit ());
+ __small_sprintf (pipename, "pty%d-from-master", get_minor ());
/* fhandler_pipe::create returns 0 when creation succeeds */
return fhandler_pipe::create (&sec_none, &r, &w,
fhandler_pty_common::pipesize, pipename,
@@ -202,7 +202,7 @@ HANDLE
tty::open_mutex (const char *mutex, ACCESS_MASK access)
{
char buf[MAX_PATH];
- shared_name (buf, mutex, get_unit ());
+ shared_name (buf, mutex, get_minor ());
return OpenMutex (access, TRUE, buf);
}
@@ -210,7 +210,7 @@ HANDLE
tty::open_inuse (ACCESS_MASK access)
{
char buf[MAX_PATH];
- shared_name (buf, TTY_SLAVE_ALIVE, get_unit ());
+ shared_name (buf, TTY_SLAVE_ALIVE, get_minor ());
return OpenEvent (access, FALSE, buf);
}
@@ -220,11 +220,11 @@ tty::create_inuse (PSECURITY_ATTRIBUTES sa)
HANDLE h;
char buf[MAX_PATH];
- shared_name (buf, TTY_SLAVE_ALIVE, get_unit ());
+ shared_name (buf, TTY_SLAVE_ALIVE, get_minor ());
h = CreateEvent (sa, TRUE, FALSE, buf);
termios_printf ("%s %p", buf, h);
if (!h)
- termios_printf ("couldn't open inuse event, %E", buf);
+ termios_printf ("couldn't open inuse event %s, %E", buf);
return h;
}
@@ -245,7 +245,7 @@ tty::get_event (const char *fmt, PSECURITY_ATTRIBUTES sa, BOOL manual_reset)
HANDLE hev;
char buf[MAX_PATH];
- shared_name (buf, fmt, get_unit ());
+ shared_name (buf, fmt, get_minor ());
if (!sa)
sa = &sec_all;
if (!(hev = CreateEvent (sa, manual_reset, FALSE, buf)))
diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h
index b05ed9780..f7a80e10f 100644
--- a/winsup/cygwin/tty.h
+++ b/winsup/cygwin/tty.h
@@ -69,9 +69,9 @@ public:
int ioctl_retval;
int write_error;
- void setntty (_major_t t, int n) {ntty = (fh_devices) FHDEV (t, n);}
- int getntty () const {return ntty;}
- int get_unit () const {return device::minor (ntty);}
+ void setntty (_major_t t, _minor_t n) {ntty = (fh_devices) FHDEV (t, n);}
+ dev_t getntty () const {return ntty;}
+ _minor_t get_minor () const {return device::minor (ntty);}
pid_t getpgid () const {return pgid;}
void setpgid (int pid) {pgid = pid;}
int getsid () const {return sid;}
@@ -90,7 +90,30 @@ class tty: public tty_min
public:
pid_t master_pid; /* PID of tty master process */
- HANDLE from_master, to_master;
+private:
+ /* Since tty is shared, the HANDLEs must be 32 and 64 bit clean. The below
+ code makes sure of that by setting the upper 4 byte of the union to 0
+ when writing the handle value from a 32 bit process. Fortunately the
+ actual values are 32 bit on both platforms, so the HANDLES can be
+ used on both platforms. */
+ union {
+ HANDLE _from_master;
+ LARGE_INTEGER _fm_dummy;
+ };
+ union {
+ HANDLE _to_master;
+ LARGE_INTEGER _tm_dummy;
+ };
+public:
+ HANDLE from_master() const { return _from_master; }
+ HANDLE to_master() const { return _to_master; }
+#ifdef __x86_64__
+ void set_from_master (HANDLE h) { _from_master = h; }
+ void set_to_master (HANDLE h) { _to_master = h; }
+#else
+ void set_from_master (HANDLE h) { _fm_dummy.HighPart = 0; _from_master = h; }
+ void set_to_master (HANDLE h) { _tm_dummy.HighPart = 0; _to_master = h; }
+#endif
int read_retval;
bool was_opened; /* True if opened at least once. */
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 6cd6c6436..4ca901f35 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -66,14 +66,14 @@ cygheap_user::init ()
status = NtQueryInformationToken (hProcToken, TokenPrimaryGroup,
&groups.pgsid, sizeof (cygsid), &size);
if (!NT_SUCCESS (status))
- system_printf ("NtQueryInformationToken (TokenPrimaryGroup), %p", status);
+ system_printf ("NtQueryInformationToken (TokenPrimaryGroup), %y", status);
/* Get the SID from current process and store it in effec_cygsid */
status = NtQueryInformationToken (hProcToken, TokenUser, &effec_cygsid,
sizeof (cygsid), &size);
if (!NT_SUCCESS (status))
{
- system_printf ("NtQueryInformationToken (TokenUser), %p", status);
+ system_printf ("NtQueryInformationToken (TokenUser), %y", status);
return;
}
@@ -81,7 +81,7 @@ cygheap_user::init ()
status = NtSetInformationToken (hProcToken, TokenOwner, &effec_cygsid,
sizeof (cygsid));
if (!NT_SUCCESS (status))
- debug_printf ("NtSetInformationToken(TokenOwner), %p", status);
+ debug_printf ("NtSetInformationToken(TokenOwner), %y", status);
/* Standard way to build a security descriptor with the usual DACL */
PSECURITY_ATTRIBUTES sa_buf = (PSECURITY_ATTRIBUTES) alloca (1024);
@@ -100,10 +100,10 @@ cygheap_user::init ()
status = NtSetInformationToken (hProcToken, TokenDefaultDacl, &dacl,
sizeof (dacl));
if (!NT_SUCCESS (status))
- system_printf ("NtSetInformationToken (TokenDefaultDacl), %p", status);
+ system_printf ("NtSetInformationToken (TokenDefaultDacl), %y", status);
if ((status = NtSetSecurityObject (NtCurrentProcess (),
DACL_SECURITY_INFORMATION, psd)))
- system_printf ("NtSetSecurityObject, %lx", status);
+ system_printf ("NtSetSecurityObject, %y", status);
}
else
system_printf("Cannot get dacl, %E");
@@ -136,7 +136,7 @@ internal_getlogin (cygheap_user &user)
TokenPrimaryGroup,
&gsid, sizeof gsid);
if (!NT_SUCCESS (status))
- debug_printf ("NtSetInformationToken (TokenPrimaryGroup), %p",
+ debug_printf ("NtSetInformationToken (TokenPrimaryGroup), %y",
status);
else
user.groups.pgsid = gsid;
@@ -211,53 +211,69 @@ getlogin (void)
return username;
}
-extern "C" __uid32_t
+extern "C" uid_t
getuid32 (void)
{
return cygheap->user.real_uid;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getuid32, getuid)
+#else
extern "C" __uid16_t
getuid (void)
{
return cygheap->user.real_uid;
}
+#endif
-extern "C" __gid32_t
+extern "C" gid_t
getgid32 (void)
{
return cygheap->user.real_gid;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getgid32, getgid)
+#else
extern "C" __gid16_t
getgid (void)
{
return cygheap->user.real_gid;
}
+#endif
-extern "C" __uid32_t
+extern "C" uid_t
geteuid32 (void)
{
return myself->uid;
}
-extern "C" __uid16_t
+#ifdef __x86_64__
+EXPORT_ALIAS (geteuid32, geteuid)
+#else
+extern "C" uid_t
geteuid (void)
{
return myself->uid;
}
+#endif
-extern "C" __gid32_t
+extern "C" gid_t
getegid32 (void)
{
return myself->gid;
}
+#ifdef __x86_64__
+EXPORT_ALIAS (getegid32, getegid)
+#else
extern "C" __gid16_t
getegid (void)
{
return myself->gid;
}
+#endif
/* Not quite right - cuserid can change, getlogin can't */
extern "C" char *
@@ -569,14 +585,14 @@ pwdgrp::load (const wchar_t *rel_path)
| FILE_OPEN_FOR_BACKUP_INTENT);
if (!NT_SUCCESS (status))
{
- paranoid_printf ("NtOpenFile(%S) failed, status %p", &upath, status);
+ paranoid_printf ("NtOpenFile(%S) failed, status %y", &upath, status);
goto out;
}
status = NtQueryInformationFile (fh, &io, &fsi, sizeof fsi,
FileStandardInformation);
if (!NT_SUCCESS (status))
{
- paranoid_printf ("NtQueryInformationFile(%S) failed, status %p",
+ paranoid_printf ("NtQueryInformationFile(%S) failed, status %y",
&upath, status);
goto out;
}
@@ -587,14 +603,14 @@ pwdgrp::load (const wchar_t *rel_path)
buf = (char *) malloc (fsi.EndOfFile.LowPart + 1);
if (!buf)
{
- paranoid_printf ("malloc (%d) failed", fsi.EndOfFile.LowPart);
+ paranoid_printf ("malloc (%u) failed", fsi.EndOfFile.LowPart);
goto out;
}
status = NtReadFile (fh, NULL, NULL, NULL, &io, buf, fsi.EndOfFile.LowPart,
NULL, NULL);
if (!NT_SUCCESS (status))
{
- paranoid_printf ("NtReadFile(%S) failed, status %p", &upath, status);
+ paranoid_printf ("NtReadFile(%S) failed, status %y", &upath, status);
free (buf);
goto out;
}
diff --git a/winsup/cygwin/wait.cc b/winsup/cygwin/wait.cc
index 8dd97277e..fca5a3c01 100644
--- a/winsup/cygwin/wait.cc
+++ b/winsup/cygwin/wait.cc
@@ -69,7 +69,7 @@ wait4 (int intpid, int *status, int options, struct rusage *r)
w->rusage = r;
sigproc_printf ("calling proc_subproc, pid %d, options %d",
w->pid, w->options);
- if (!proc_subproc (PROC_WAIT, (DWORD) w))
+ if (!proc_subproc (PROC_WAIT, (uintptr_t) w))
{
set_errno (ENOSYS);
paranoid_printf ("proc_subproc returned 0");
@@ -110,7 +110,7 @@ wait4 (int intpid, int *status, int options, struct rusage *r)
break;
}
- syscall_printf ("%R = wait4(%d, %p, %d, %p)", res, intpid, w->status, options, r);
+ syscall_printf ("%R = wait4(%d, %y, %d, %p)", res, intpid, w->status, options, r);
w->status = -1;
return res;
}
diff --git a/winsup/cygwin/winbase.h b/winsup/cygwin/winbase.h
index d9c53cfba..666f74a2d 100644
--- a/winsup/cygwin/winbase.h
+++ b/winsup/cygwin/winbase.h
@@ -11,7 +11,6 @@ details. */
#ifndef _WINBASE2_H
#define _WINBASE2_H
-#ifndef __x86_64__
extern __inline__ LONG
ilockcmpexch (volatile LONG *t, LONG v, LONG c)
{
@@ -29,7 +28,30 @@ ilockcmpexch (volatile LONG *t, LONG v, LONG c)
#undef InterlockedCompareExchange
#define InterlockedCompareExchange ilockcmpexch
#undef InterlockedCompareExchangePointer
+
+#ifdef __x86_64__
+extern __inline__ LONGLONG
+ilockcmpexch64 (volatile LONGLONG *t, LONGLONG v, LONGLONG c)
+{
+ return
+ ({
+ register LONGLONG ret __asm ("%rax");
+ __asm __volatile ("lock cmpxchgq %2, %1"
+ : "=a" (ret), "=m" (*t)
+ : "r" (v), "m" (*t), "0" (c)
+ : "memory");
+ ret;
+ });
+}
+
+#define InterlockedCompareExchange64 ilockcmpexch64
+#define InterlockedCompareExchangePointer(d,e,c) \
+ (PVOID)InterlockedCompareExchange64((LONGLONG volatile *)(d),(LONGLONG)(e),(LONGLONG)(c))
+
+#else
+
#define InterlockedCompareExchangePointer(d,e,c) \
(PVOID)InterlockedCompareExchange((LONG volatile *)(d),(LONG)(e),(LONG)(c))
+
#endif /* !__x86_64 */
#endif /*_WINBASE2_H*/
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index 30c4eb908..9964467e3 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -21,185 +21,32 @@ details. */
puzzled that this has never been noticed before... */
/* Minimal set of capabilities required to run Cygwin. */
-#define wincap_minimal wincap_2000
-
-wincaps wincap_2000 __attribute__((section (".cygwin_dll_common"), shared)) = {
- max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE,
- is_server:false,
- has_physical_mem_access:true,
- has_create_global_privilege:false,
- has_ioctl_storage_get_media_types_ex:false,
- has_disk_ex_ioctls:false,
- has_buggy_restart_scan:true,
- has_mandatory_integrity_control:false,
- needs_logon_sid_in_sid_list:true,
- needs_count_in_si_lpres2:false,
- has_recycle_dot_bin:false,
- has_gaa_prefixes:false,
- has_gaa_on_link_prefix:false,
- has_gaa_largeaddress_bug:false,
- supports_all_posix_ai_flags:false,
- has_restricted_stack_args:false,
- has_transactions:false,
- has_recvmsg:false,
- has_sendmsg:false,
- has_broken_udf:true,
- has_console_handle_problem:false,
- has_broken_alloc_console:false,
- has_always_all_codepages:false,
- has_localenames:false,
- has_fast_cwd:false,
- has_restricted_raw_disk_access:false,
- use_dont_resolve_hack:false,
- has_stack_size_param_is_a_reservation:false,
- has_console_logon_sid:false,
- wow64_has_secondary_stack:false,
- has_program_compatibility_assistant:false,
- kernel_is_always_casesensitive:true,
- terminate_thread_frees_stack:false,
-};
-
-wincaps wincap_2000sp4 __attribute__((section (".cygwin_dll_common"), shared)) = {
- max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE,
- is_server:false,
- has_physical_mem_access:true,
- has_create_global_privilege:true,
- has_ioctl_storage_get_media_types_ex:false,
- has_disk_ex_ioctls:false,
- has_buggy_restart_scan:true,
- has_mandatory_integrity_control:false,
- needs_logon_sid_in_sid_list:true,
- needs_count_in_si_lpres2:false,
- has_recycle_dot_bin:false,
- has_gaa_prefixes:false,
- has_gaa_on_link_prefix:false,
- has_gaa_largeaddress_bug:false,
- supports_all_posix_ai_flags:false,
- has_restricted_stack_args:false,
- has_transactions:false,
- has_recvmsg:false,
- has_sendmsg:false,
- has_broken_udf:true,
- has_console_handle_problem:false,
- has_broken_alloc_console:false,
- has_always_all_codepages:false,
- has_localenames:false,
- has_fast_cwd:false,
- has_restricted_raw_disk_access:false,
- use_dont_resolve_hack:false,
- has_stack_size_param_is_a_reservation:false,
- has_console_logon_sid:false,
- wow64_has_secondary_stack:false,
- has_program_compatibility_assistant:false,
- kernel_is_always_casesensitive:true,
- terminate_thread_frees_stack:false,
-};
-
-wincaps wincap_xp __attribute__((section (".cygwin_dll_common"), shared)) = {
- max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE,
- is_server:false,
- has_physical_mem_access:true,
- has_create_global_privilege:false,
- has_ioctl_storage_get_media_types_ex:true,
- has_disk_ex_ioctls:true,
- has_buggy_restart_scan:false,
- has_mandatory_integrity_control:false,
- needs_logon_sid_in_sid_list:false,
- needs_count_in_si_lpres2:false,
- has_recycle_dot_bin:false,
- has_gaa_prefixes:false,
- has_gaa_on_link_prefix:false,
- has_gaa_largeaddress_bug:false,
- supports_all_posix_ai_flags:false,
- has_restricted_stack_args:false,
- has_transactions:false,
- has_recvmsg:true,
- has_sendmsg:false,
- has_broken_udf:true,
- has_console_handle_problem:false,
- has_broken_alloc_console:false,
- has_always_all_codepages:false,
- has_localenames:false,
- has_fast_cwd:false,
- has_restricted_raw_disk_access:false,
- use_dont_resolve_hack:true,
- has_stack_size_param_is_a_reservation:true,
- has_console_logon_sid:false,
- wow64_has_secondary_stack:false,
- has_program_compatibility_assistant:false,
- kernel_is_always_casesensitive:false,
- terminate_thread_frees_stack:false,
-};
-
-wincaps wincap_xpsp1 __attribute__((section (".cygwin_dll_common"), shared)) = {
- max_sys_priv:SE_MANAGE_VOLUME_PRIVILEGE,
- is_server:false,
- has_physical_mem_access:true,
- has_create_global_privilege:false,
- has_ioctl_storage_get_media_types_ex:true,
- has_disk_ex_ioctls:true,
- has_buggy_restart_scan:false,
- has_mandatory_integrity_control:false,
- needs_logon_sid_in_sid_list:false,
- needs_count_in_si_lpres2:false,
- has_recycle_dot_bin:false,
- has_gaa_prefixes:true,
- has_gaa_on_link_prefix:false,
- has_gaa_largeaddress_bug:false,
- supports_all_posix_ai_flags:false,
- has_restricted_stack_args:false,
- has_transactions:false,
- has_recvmsg:true,
- has_sendmsg:false,
- has_broken_udf:true,
- has_console_handle_problem:false,
- has_broken_alloc_console:false,
- has_always_all_codepages:false,
- has_localenames:false,
- has_fast_cwd:false,
- has_restricted_raw_disk_access:false,
- use_dont_resolve_hack:true,
- has_stack_size_param_is_a_reservation:true,
- has_console_logon_sid:false,
- wow64_has_secondary_stack:false,
- has_program_compatibility_assistant:false,
- kernel_is_always_casesensitive:false,
- terminate_thread_frees_stack:false,
-};
+#define wincap_minimal wincap_xpsp2
wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE,
is_server:false,
has_physical_mem_access:true,
- has_create_global_privilege:true,
- has_ioctl_storage_get_media_types_ex:true,
- has_disk_ex_ioctls:true,
- has_buggy_restart_scan:false,
has_mandatory_integrity_control:false,
- needs_logon_sid_in_sid_list:false,
needs_count_in_si_lpres2:false,
has_recycle_dot_bin:false,
- has_gaa_prefixes:true,
has_gaa_on_link_prefix:false,
has_gaa_largeaddress_bug:false,
supports_all_posix_ai_flags:false,
has_restricted_stack_args:false,
has_transactions:false,
- has_recvmsg:true,
has_sendmsg:false,
has_broken_udf:true,
- has_console_handle_problem:false,
has_broken_alloc_console:false,
has_always_all_codepages:false,
has_localenames:false,
has_fast_cwd:false,
has_restricted_raw_disk_access:false,
use_dont_resolve_hack:true,
- has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:false,
wow64_has_secondary_stack:false,
has_program_compatibility_assistant:false,
- kernel_is_always_casesensitive:false,
+ has_pipe_reject_remote_clients:false,
terminate_thread_frees_stack:false,
};
@@ -207,35 +54,26 @@ wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE,
is_server:false,
has_physical_mem_access:false,
- has_create_global_privilege:true,
- has_ioctl_storage_get_media_types_ex:true,
- has_disk_ex_ioctls:true,
- has_buggy_restart_scan:false,
has_mandatory_integrity_control:false,
- needs_logon_sid_in_sid_list:false,
needs_count_in_si_lpres2:false,
has_recycle_dot_bin:false,
- has_gaa_prefixes:true,
has_gaa_on_link_prefix:false,
has_gaa_largeaddress_bug:false,
supports_all_posix_ai_flags:false,
has_restricted_stack_args:true,
has_transactions:false,
- has_recvmsg:true,
has_sendmsg:false,
has_broken_udf:true,
- has_console_handle_problem:false,
has_broken_alloc_console:false,
has_always_all_codepages:false,
has_localenames:false,
has_fast_cwd:false,
has_restricted_raw_disk_access:false,
use_dont_resolve_hack:true,
- has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:false,
wow64_has_secondary_stack:true,
has_program_compatibility_assistant:false,
- kernel_is_always_casesensitive:false,
+ has_pipe_reject_remote_clients:false,
terminate_thread_frees_stack:false,
};
@@ -243,35 +81,26 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE,
is_server:false,
has_physical_mem_access:false,
- has_create_global_privilege:true,
- has_ioctl_storage_get_media_types_ex:true,
- has_disk_ex_ioctls:true,
- has_buggy_restart_scan:false,
has_mandatory_integrity_control:true,
- needs_logon_sid_in_sid_list:false,
needs_count_in_si_lpres2:true,
has_recycle_dot_bin:true,
- has_gaa_prefixes:true,
has_gaa_on_link_prefix:true,
has_gaa_largeaddress_bug:true,
supports_all_posix_ai_flags:true,
has_restricted_stack_args:false,
has_transactions:true,
- has_recvmsg:true,
has_sendmsg:true,
has_broken_udf:false,
- has_console_handle_problem:false,
has_broken_alloc_console:false,
has_always_all_codepages:true,
has_localenames:true,
has_fast_cwd:true,
has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false,
- has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:false,
wow64_has_secondary_stack:false,
has_program_compatibility_assistant:true,
- kernel_is_always_casesensitive:false,
+ has_pipe_reject_remote_clients:true,
terminate_thread_frees_stack:true,
};
@@ -279,35 +108,26 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE,
is_server:false,
has_physical_mem_access:false,
- has_create_global_privilege:true,
- has_ioctl_storage_get_media_types_ex:true,
- has_disk_ex_ioctls:true,
- has_buggy_restart_scan:false,
has_mandatory_integrity_control:true,
- needs_logon_sid_in_sid_list:false,
needs_count_in_si_lpres2:false,
has_recycle_dot_bin:true,
- has_gaa_prefixes:true,
has_gaa_on_link_prefix:true,
has_gaa_largeaddress_bug:true,
supports_all_posix_ai_flags:true,
has_restricted_stack_args:false,
has_transactions:true,
- has_recvmsg:true,
has_sendmsg:true,
has_broken_udf:false,
- has_console_handle_problem:true,
has_broken_alloc_console:true,
has_always_all_codepages:true,
has_localenames:true,
has_fast_cwd:true,
has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false,
- has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:true,
wow64_has_secondary_stack:false,
has_program_compatibility_assistant:true,
- kernel_is_always_casesensitive:false,
+ has_pipe_reject_remote_clients:true,
terminate_thread_frees_stack:true,
};
@@ -315,35 +135,26 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE,
is_server:false,
has_physical_mem_access:false,
- has_create_global_privilege:true,
- has_ioctl_storage_get_media_types_ex:true,
- has_disk_ex_ioctls:true,
- has_buggy_restart_scan:false,
has_mandatory_integrity_control:true,
- needs_logon_sid_in_sid_list:false,
needs_count_in_si_lpres2:false,
has_recycle_dot_bin:true,
- has_gaa_prefixes:true,
has_gaa_on_link_prefix:true,
has_gaa_largeaddress_bug:false,
supports_all_posix_ai_flags:true,
has_restricted_stack_args:false,
has_transactions:true,
- has_recvmsg:true,
has_sendmsg:true,
has_broken_udf:false,
- has_console_handle_problem:true,
has_broken_alloc_console:true,
has_always_all_codepages:true,
has_localenames:true,
has_fast_cwd:true,
has_restricted_raw_disk_access:true,
use_dont_resolve_hack:false,
- has_stack_size_param_is_a_reservation:true,
has_console_logon_sid:true,
wow64_has_secondary_stack:false,
has_program_compatibility_assistant:true,
- kernel_is_always_casesensitive:false,
+ has_pipe_reject_remote_clients:true,
terminate_thread_frees_stack:true,
};
@@ -364,24 +175,8 @@ wincapc::init ()
case 5:
switch (version.dwMinorVersion)
{
- case 0:
- if (version.wServicePackMajor < 4)
- caps = &wincap_2000;
- else
- caps = &wincap_2000sp4;
- break;
-
case 1:
- caps = &wincap_xp;
- switch (version.wServicePackMajor)
- {
- case 0:
- caps = &wincap_xp;
- case 1:
- caps = &wincap_xpsp1;
- default:
- caps = &wincap_xpsp2;
- }
+ caps = &wincap_xpsp2;
break;
default:
@@ -408,10 +203,14 @@ wincapc::init ()
}
((wincaps *)caps)->is_server = (version.wProductType != VER_NT_WORKSTATION);
+#ifdef __x86_64__
+ wow64 = 0;
+#else
if (NT_SUCCESS (NtQueryInformationProcess (NtCurrentProcess (),
ProcessWow64Information,
&wow64, sizeof wow64, NULL))
&& !wow64)
+#endif
{
((wincaps *)caps)->needs_count_in_si_lpres2 = false;
((wincaps *)caps)->has_restricted_stack_args = false;
diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h
index d3823e0c3..1004a5e46 100644
--- a/winsup/cygwin/wincap.h
+++ b/winsup/cygwin/wincap.h
@@ -17,35 +17,26 @@ struct wincaps
DWORD max_sys_priv;
unsigned is_server : 1;
unsigned has_physical_mem_access : 1;
- unsigned has_create_global_privilege : 1;
- unsigned has_ioctl_storage_get_media_types_ex : 1;
- unsigned has_disk_ex_ioctls : 1;
- unsigned has_buggy_restart_scan : 1;
unsigned has_mandatory_integrity_control : 1;
- unsigned needs_logon_sid_in_sid_list : 1;
unsigned needs_count_in_si_lpres2 : 1;
unsigned has_recycle_dot_bin : 1;
- unsigned has_gaa_prefixes : 1;
unsigned has_gaa_on_link_prefix : 1;
unsigned has_gaa_largeaddress_bug : 1;
unsigned supports_all_posix_ai_flags : 1;
unsigned has_restricted_stack_args : 1;
unsigned has_transactions : 1;
- unsigned has_recvmsg : 1;
unsigned has_sendmsg : 1;
unsigned has_broken_udf : 1;
- unsigned has_console_handle_problem : 1;
unsigned has_broken_alloc_console : 1;
unsigned has_always_all_codepages : 1;
unsigned has_localenames : 1;
unsigned has_fast_cwd : 1;
unsigned has_restricted_raw_disk_access : 1;
unsigned use_dont_resolve_hack : 1;
- unsigned has_stack_size_param_is_a_reservation : 1;
unsigned has_console_logon_sid : 1;
unsigned wow64_has_secondary_stack : 1;
unsigned has_program_compatibility_assistant : 1;
- unsigned kernel_is_always_casesensitive : 1;
+ unsigned has_pipe_reject_remote_clients : 1;
unsigned terminate_thread_frees_stack : 1;
};
@@ -54,53 +45,47 @@ class wincapc
SYSTEM_INFO system_info;
OSVERSIONINFOEX version;
char osnam[40];
- ULONG wow64;
+ ULONG_PTR wow64;
void *caps;
public:
void init ();
const DWORD cpu_count () const { return system_info.dwNumberOfProcessors; }
- const DWORD page_size () const { return system_info.dwPageSize; }
- const DWORD allocation_granularity () const
- { return system_info.dwAllocationGranularity; }
+ /* The casts to size_t make sure that the returned value has the size of
+ a pointer on any system. This is important when using them for bit
+ mask operations, like in roundup2. */
+ const size_t page_size () const { return (size_t) system_info.dwPageSize; }
+ const size_t allocation_granularity () const
+ { return (size_t) system_info.dwAllocationGranularity; }
const char *osname () const { return osnam; }
- const bool is_wow64 () const { return wow64; }
+ const bool is_wow64 () const { return !!wow64; }
#define IMPLEMENT(cap) cap() const { return ((wincaps *) this->caps)->cap; }
DWORD IMPLEMENT (max_sys_priv)
bool IMPLEMENT (is_server)
bool IMPLEMENT (has_physical_mem_access)
- bool IMPLEMENT (has_create_global_privilege)
- bool IMPLEMENT (has_ioctl_storage_get_media_types_ex)
- bool IMPLEMENT (has_disk_ex_ioctls)
- bool IMPLEMENT (has_buggy_restart_scan)
bool IMPLEMENT (has_mandatory_integrity_control)
- bool IMPLEMENT (needs_logon_sid_in_sid_list)
bool IMPLEMENT (needs_count_in_si_lpres2)
bool IMPLEMENT (has_recycle_dot_bin)
- bool IMPLEMENT (has_gaa_prefixes)
bool IMPLEMENT (has_gaa_on_link_prefix)
bool IMPLEMENT (has_gaa_largeaddress_bug)
bool IMPLEMENT (supports_all_posix_ai_flags)
bool IMPLEMENT (has_restricted_stack_args)
bool IMPLEMENT (has_transactions)
- bool IMPLEMENT (has_recvmsg)
bool IMPLEMENT (has_sendmsg)
bool IMPLEMENT (has_broken_udf)
- bool IMPLEMENT (has_console_handle_problem)
bool IMPLEMENT (has_broken_alloc_console)
bool IMPLEMENT (has_always_all_codepages)
bool IMPLEMENT (has_localenames)
bool IMPLEMENT (has_fast_cwd)
bool IMPLEMENT (has_restricted_raw_disk_access)
bool IMPLEMENT (use_dont_resolve_hack)
- bool IMPLEMENT (has_stack_size_param_is_a_reservation)
bool IMPLEMENT (has_console_logon_sid)
bool IMPLEMENT (wow64_has_secondary_stack)
bool IMPLEMENT (has_program_compatibility_assistant)
- bool IMPLEMENT (kernel_is_always_casesensitive)
+ bool IMPLEMENT (has_pipe_reject_remote_clients)
bool IMPLEMENT (terminate_thread_frees_stack)
#undef IMPLEMENT
diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc
index 27d8b4a4f..ce9a7c708 100644
--- a/winsup/cygwin/window.cc
+++ b/winsup/cygwin/window.cc
@@ -26,7 +26,7 @@ wininfo NO_COPY winmsg;
muto NO_COPY wininfo::_lock;
-int __stdcall
+int __reg3
wininfo::process (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
#ifndef NOSTRACE
@@ -57,7 +57,7 @@ process_window_events (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
/* Handle windows events. Inherits ownership of the wininfo lock */
-DWORD WINAPI
+DWORD __reg1 WINAPI
wininfo::winthread ()
{
MSG msg;
diff --git a/winsup/cygwin/winlean.h b/winsup/cygwin/winlean.h
index 15e533037..8a4c2aeb2 100644
--- a/winsup/cygwin/winlean.h
+++ b/winsup/cygwin/winlean.h
@@ -12,13 +12,6 @@ details. */
#define _WINLEAN_H 1
#define WIN32_LEAN_AND_MEAN 1
-/* Mingw32 */
-#define _WINGDI_H
-#define _WINUSER_H
-#define _WINNLS_H
-#define _WINVER_H
-#define _WINNETWK_H
-#define _WINSVC_H
/* Mingw64 */
#define _WINNLS_
#define _WINNETWK_
@@ -34,8 +27,6 @@ details. */
#define _WINMM_
#define WINIMPM
#define WINSOCK_API_LINKAGE
-#define NTDDI_VERSION 0x6020000 /* Probably should just be derived from our
- _WIN32_WINNT setting in winsup.h */
/* Windows headers define a couple of annoyingly intrusive macros for the
sole purpose of inline documentation. Since they are defined without
@@ -63,6 +54,11 @@ details. */
#include <lmcons.h>
#include <ntdef.h>
+/* Temporary kludge for missing flag in Mingw64's w32api. */
+#ifndef PIPE_REJECT_REMOTE_CLIENTS
+#define PIPE_REJECT_REMOTE_CLIENTS 8
+#endif
+
#ifdef __undef_IN
#undef IN
#endif
@@ -79,13 +75,6 @@ details. */
#undef CRITICAL
#endif
-#undef _WINGDI_H
-#undef _WINUSER_H
-#undef _WINNLS_H
-#undef _WINVER_H
-#undef _WINNETWK_H
-#undef _WINSVC_H
-
#undef _WINNLS_
#undef _WINNETWK_
#undef _WINSVC_
diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h
index f955dd38e..f8142e9e6 100644
--- a/winsup/cygwin/winsup.h
+++ b/winsup/cygwin/winsup.h
@@ -13,9 +13,9 @@ details. */
#define __INSIDE_CYGWIN__
+#define NO_COPY_RO __attribute__((nocommon)) __attribute__((section(".rdata_cygwin_nocopy")))
#define NO_COPY __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy")))
#define NO_COPY_INIT __attribute__((section(".data_cygwin_nocopy")))
-#define _RDATA __attribute__ ((section(".rdata")))
#define EXPORT_ALIAS(sym,symalias) extern "C" __typeof (sym) symalias __attribute__ ((alias(#sym)));
@@ -33,11 +33,11 @@ details. */
#ifdef __cplusplus
extern "C" {
#endif
-__uid32_t getuid32 ();
-__uid32_t geteuid32 ();
-int seteuid32 (__uid32_t);
-__gid32_t getegid32 (void);
-struct passwd *getpwuid32 (__uid32_t);
+uid_t getuid32 ();
+uid_t geteuid32 ();
+int seteuid32 (uid_t);
+gid_t getegid32 (void);
+struct passwd *getpwuid32 (uid_t);
struct passwd *getpwnam (const char *);
struct __sFILE64 *fopen64 (const char *, const char *);
struct hostent *cygwin_gethostbyname (const char *name);
@@ -78,15 +78,12 @@ int fcntl64 (int fd, int cmd, ...);
#ifdef __cplusplus
#include "wincap.h"
+#include "regparm.h"
-#define __reg1 __stdcall __attribute__ ((regparm (1)))
-#define __reg2 __stdcall __attribute__ ((regparm (2)))
-#define __reg3 __stdcall __attribute__ ((regparm (3)))
-
-extern const char case_folded_lower[];
-#define cyg_tolower(c) (case_folded_lower[(unsigned char)(c)])
-extern const char case_folded_upper[];
-#define cyg_toupper(c) (case_folded_upper[(unsigned char)(c)])
+extern const unsigned char case_folded_lower[];
+#define cyg_tolower(c) ((char) case_folded_lower[(unsigned char)(c)])
+extern const unsigned char case_folded_upper[];
+#define cyg_toupper(c) ((char) case_folded_upper[(unsigned char)(c)])
#ifndef MALLOC_DEBUG
#define cfree newlib_cfree_dont_use
@@ -155,18 +152,21 @@ extern int cygserver_running;
class per_process;
/* cygwin .dll initialization */
-void dll_crt0 (per_process *) __asm__ ("_dll_crt0__FP11per_process");
+void dll_crt0 (per_process *) __asm__ (_SYMSTR (dll_crt0__FP11per_process));
extern "C" void __stdcall _dll_crt0 ();
void dll_crt0_1 (void *);
void dll_dllcrt0_1 (void *);
/* dynamically loaded dll initialization */
-extern "C" int dll_dllcrt0 (HMODULE, per_process *);
+extern "C" PVOID dll_dllcrt0 (HMODULE, per_process *);
extern "C" void _pei386_runtime_relocator (per_process *);
+#ifndef __x86_64__
/* dynamically loaded dll initialization for non-cygwin apps */
extern "C" int dll_noncygwin_dllcrt0 (HMODULE, per_process *);
+#endif /* !__x86_64__ */
+
void __reg1 do_exit (int) __attribute__ ((noreturn));
/* libstdc++ malloc operator wrapper support. */
@@ -175,14 +175,16 @@ extern struct per_process_cxx_malloc default_cygwin_cxx_malloc;
/* UID/GID */
void uinfo_init ();
+#define ILLEGAL_UID ((uid_t)-1)
+#define ILLEGAL_GID ((gid_t)-1)
+#define ILLEGAL_SEEK ((off_t)-1)
+
+#ifndef __x86_64__
#define ILLEGAL_UID16 ((__uid16_t)-1)
-#define ILLEGAL_UID ((__uid32_t)-1)
#define ILLEGAL_GID16 ((__gid16_t)-1)
-#define ILLEGAL_GID ((__gid32_t)-1)
-#define ILLEGAL_SEEK ((_off64_t)-1)
-
-#define uid16touid32(u16) ((u16)==ILLEGAL_UID16?ILLEGAL_UID:(__uid32_t)(u16))
-#define gid16togid32(g16) ((g16)==ILLEGAL_GID16?ILLEGAL_GID:(__gid32_t)(g16))
+#define uid16touid32(u16) ((u16)==ILLEGAL_UID16?ILLEGAL_UID:(uid_t)(u16))
+#define gid16togid32(g16) ((g16)==ILLEGAL_GID16?ILLEGAL_GID:(gid_t)(g16))
+#endif
/* Convert LARGE_INTEGER into long long */
#define get_ll(pl) (((long long) (pl).HighPart << 32) | (pl).LowPart)
@@ -199,16 +201,14 @@ extern "C" int try_to_debug (bool waitloop = 1);
void ld_preload ();
const char *find_first_notloaded_dll (class path_conv &);
-extern bool cygwin_finished_initializing;
-
/**************************** Miscellaneous ******************************/
void __stdcall set_std_handle (int);
-int __stdcall stat_dev (DWORD, int, unsigned long, struct __stat64 *);
+int __stdcall stat_dev (DWORD, int, unsigned long, struct stat *);
-__ino64_t __reg2 hash_path_name (__ino64_t hash, PUNICODE_STRING name);
-__ino64_t __reg2 hash_path_name (__ino64_t hash, PCWSTR name);
-__ino64_t __reg2 hash_path_name (__ino64_t hash, const char *name);
+ino_t __reg2 hash_path_name (ino_t hash, PUNICODE_STRING name);
+ino_t __reg2 hash_path_name (ino_t hash, PCWSTR name);
+ino_t __reg2 hash_path_name (ino_t hash, const char *name);
void __reg2 nofinalslash (const char *src, char *dst);
void __reg3 *hook_or_detect_cygwin (const char *, const void *, WORD&, HANDLE h = NULL);
@@ -225,8 +225,6 @@ void __stdcall timeval_to_filetime (const struct timeval *, FILETIME *);
void __stdcall set_console_title (char *);
void init_console_handler (bool);
-void init_global_security ();
-
void __reg2 __set_winsock_errno (const char *fn, int ln);
#define set_winsock_errno() __set_winsock_errno (__FUNCTION__, __LINE__)
@@ -239,19 +237,17 @@ int __small_sprintf (char *dst, const char *fmt, ...);
int __small_vsprintf (char *dst, const char *fmt, va_list ap);
int __small_swprintf (PWCHAR dst, const WCHAR *fmt, ...);
int __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap);
-void multiple_cygwin_problem (const char *, unsigned, unsigned);
+void multiple_cygwin_problem (const char *, uintptr_t, uintptr_t);
extern "C" void vklog (int priority, const char *message, va_list ap);
extern "C" void klog (int priority, const char *message, ...);
bool child_copy (HANDLE, bool, ...);
-int __reg3 symlink_worker (const char *, const char *, bool, bool);
-
class path_conv;
-int __reg2 stat_worker (path_conv &pc, struct __stat64 *buf);
+int __reg2 stat_worker (path_conv &pc, struct stat *buf);
-__ino64_t __reg2 readdir_get_ino (const char *path, bool dot_dot);
+ino_t __reg2 readdir_get_ino (const char *path, bool dot_dot);
/* mmap functions. */
enum mmap_region_status
@@ -293,13 +289,16 @@ int cygwin_gethostname (char *__name, size_t __len);
#define NO_X ~(S_IXUSR | S_IXGRP | S_IXOTH)
+#ifdef __x86_64__
+extern "C" char __data_start__, __data_end__, __bss_start__, __bss_end__;
+#else
extern "C" char _data_start__, _data_end__, _bss_start__, _bss_end__;
+#endif
extern "C" void (*__CTOR_LIST__) (void);
extern "C" void (*__DTOR_LIST__) (void);
-
-
#ifndef NO_GLOBALS_H
+#define _RDATA /* See globals.h */
#include "globals.h"
extern inline void clear_procimptoken ()
diff --git a/winsup/cygwin/wow64.cc b/winsup/cygwin/wow64.cc
index 35dd5cda9..070b9c2c4 100644
--- a/winsup/cygwin/wow64.cc
+++ b/winsup/cygwin/wow64.cc
@@ -1,6 +1,6 @@
/* wow64.cc
- Copyright 2011 Red Hat, Inc.
+ Copyright 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -8,6 +8,10 @@ This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
+#ifndef __x86_64__
+/* WOW64 only plays a role in the 32 bit version. Don't use any of this
+ in the 64 bit version. */
+
#include "winsup.h"
#include "cygtls.h"
#include "ntdll.h"
@@ -77,7 +81,7 @@ wow64_test_for_64bit_parent ()
HANDLE parent;
PVOID allocbase, stackbase;
- ULONG wow64 = TRUE; /* Opt on the safe side. */
+ ULONG_PTR wow64 = TRUE; /* Opt on the safe side. */
/* First check if the current stack is where it belongs. If so, we don't
have to do anything special. This is the case on Vista and later. */
@@ -94,7 +98,7 @@ wow64_test_for_64bit_parent ()
if (NT_SUCCESS (ret)
&& (parent = OpenProcess (PROCESS_QUERY_INFORMATION,
FALSE,
- pbi.InheritedFromUniqueProcessId)))
+ (DWORD) pbi.InheritedFromUniqueProcessId)))
{
NtQueryInformationProcess (parent, ProcessWow64Information,
&wow64, sizeof wow64, NULL);
@@ -203,9 +207,11 @@ wow64_respawn_process ()
path, GetCommandLineW ());
CloseHandle (pi.hThread);
if (WaitForSingleObject (pi.hProcess, INFINITE) == WAIT_FAILED)
- api_fatal ("Waiting for process %d failed, %E", pi.dwProcessId);
+ api_fatal ("Waiting for process %u failed, %E", pi.dwProcessId);
GetExitCodeProcess (pi.hProcess, &ret);
CloseHandle (pi.hProcess);
TerminateProcess (GetCurrentProcess (), ret);
ExitProcess (ret);
}
+
+#endif /* !__x86_64__ */
diff --git a/winsup/cygwin/wow64.h b/winsup/cygwin/wow64.h
index d82293e69..a0b5b318d 100644
--- a/winsup/cygwin/wow64.h
+++ b/winsup/cygwin/wow64.h
@@ -1,6 +1,6 @@
/* wow64.h
- Copyright 2011 Red Hat, Inc.
+ Copyright 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -8,8 +8,14 @@ This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
+#ifndef __x86_64__
+/* WOW64 only plays a role in the 32 bit version. Don't use any of this
+ in the 64 bit version. */
+
extern bool NO_COPY wow64_needs_stack_adjustment;
extern bool wow64_test_for_64bit_parent ();
extern PVOID wow64_revert_to_original_stack (PVOID &allocationbase);
extern void wow64_respawn_process () __attribute__ ((noreturn));
+
+#endif /* !__x86_64__ */
diff --git a/winsup/cygwin/x86_64.din b/winsup/cygwin/x86_64.din
new file mode 100644
index 000000000..24f2584c6
--- /dev/null
+++ b/winsup/cygwin/x86_64.din
@@ -0,0 +1,20 @@
+LIBRARY "cygwin1.dll" BASE=0x180040000
+
+EXPORTS
+#Exported variables
+environ = __cygwin_environ DATA
+
+#Exported functions
+__wrap__Znam NOSIGFE # void *operator new[](std::size_t sz) throw (std::bad_alloc)
+__wrap__ZnamRKSt9nothrow_t NOSIGFE # void *operator new[](std::size_t sz, const std::nothrow_t &nt) throw()
+__wrap__Znwm NOSIGFE # void *operator new(std::size_t sz) throw (std::bad_alloc)
+__wrap__ZnwmRKSt9nothrow_t NOSIGFE # void *operator new(std::size_t sz, const std::nothrow_t &nt) throw()
+_alloca = __alloca NOSIGFE
+_dll_crt0 NOSIGFE
+dll_entry NOSIGFE
+llrint NOSIGFE
+llrintf NOSIGFE
+lrint NOSIGFE
+lrintf NOSIGFE
+rint NOSIGFE
+rintf NOSIGFE
diff --git a/winsup/doc/.cvsignore b/winsup/doc/.cvsignore
new file mode 100644
index 000000000..288848833
--- /dev/null
+++ b/winsup/doc/.cvsignore
@@ -0,0 +1,14 @@
+Makefile
+Makefile.dep
+
+autom4te.cache
+config.log
+config.status
+
+cygwin-api
+cygwin-api.xml
+
+cygwin-ug-net
+cygwin-ug-net.html
+
+faq
diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog
index 223261304..024abbe00 100644
--- a/winsup/doc/ChangeLog
+++ b/winsup/doc/ChangeLog
@@ -1,3 +1,176 @@
+2013-06-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * faq-copyright.xml: Fix link to license.
+ * faq-using.xml: Ditto.
+ * faq-what.xml: Ditto.
+
+2013-06-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * faq-programming.xml: Convert url to refer to new flat faq.html file.
+ * faq-setup.xml: Ditto.
+ * faq-using.xml: Ditto.
+ * highlights.xml: Ditto.
+
+2013-06-05 Corinna Vinschen <corinna@vinschen.de>
+
+ * new-features.xml (ov-new1.7.19): Revert mandatory locking support to
+ "preliminary".
+
+2013-06-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in: Add rule to rebuild Makefile if Makefile.in changes.
+ Include Makefile.dep last.
+ (Makefile.dep): Run xidepend within source dir. Temporarily drop
+ faq.xml from dependencies.
+ * xidepend: Fix creating base filename to accommodate VPATH.
+
+2013-06-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * new-features.xml (ov-new1.7.19): Align mandatory locking text to
+ today's changes.
+
+2013-06-03 Corinna Vinschen <corinna@vinschen.de>
+
+ * new-features.xml (ov-new1.7.19): Add mandatory locking.
+
+2013-05-23 Warren Young <warren@etr-usa.com>
+
+ * xidepend: New script, generates Makefile.dep from top-level XML
+ * .cvsignore: Ignoring Makefile.dep output
+ * Makefile: Creating Makefile.dep if it doesn't exist, including it
+ if it does, and removing it on 'make clean'
+ * Wishlist: Knocked autodependency generation off the list
+
+2013-05-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwinenv.xml (cygwinenv-implemented-options): Explain new
+ winsymliks:nativestrict option. Strip out description of symlink types
+ and refer to new pathnames-symlinks section.
+ * highlights.xml (ov-hi-files): Rip out most of symlink description and
+ refer to new pathnames-symlinks section instead.
+ * new-features.xml (ov-new1.7.19): Add CYGWIN=winsymlinks:nativestrict.
+ * pathnames.xml (pathnames-symlinks): New section describing symbolic
+ link handling.
+
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * new-features.xml (ov-new1.7.19): Add arc4random,
+ arc4random_addrandom, arc4random_buf, arc4random_stir and
+ arc4random_uniform.
+
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * new-features.xml (ov-new1.7.19): Add __b64_ntop and __b64_pton.
+
+2013-05-13 Warren Young <warren@etr-usa.com>
+
+ * cygwin-ug.xml setup.xml: Removed; unused.
+ * Wishlist: Created, with initial content based on a -patches
+ mailing list post.
+
+2013-05-06 Warren Young <warren@etr-usa.com>
+
+ * cygwin-api.in.xml (bookinfo): Reverted XInclude for legal.xml
+ fragment to a DOCTOOL include.
+
+2013-05-03 Christopher Faylor <me.cygwin2013@cgf.cx>
+
+ * Makefile (FAQ_SOURCES): Use wildcard function to find sources in
+ srcdir.
+
+2013-05-01 Warren Young <warren@etr-usa.com>
+
+ * bodysnatcher.pl: Created
+ * Makefile.in (faq/faq.body): Added target to create this file from
+ faq/faq.html using new bodysnatcher.pl script.
+
+2013-05-01 Warren Young <warren@etr-usa.com>
+
+ * cygwin-ug.xml: Renamed from cygwin-ug.in.sgml
+ (bookinfo) Extracted <bookinfo> section into new ug-info.xml file
+ * ug-info.xml: Created
+ * cygwin-ug-net.xml: Renamed from cygwin-ug-net.in.sgml
+ (bookinfo) Replaced content with XInclude referencing ug-info.xml
+ * configure.ac: Replaced a *.sgml file reference with *.xml
+ * cygserver.xml cygwinenv.xml dll.xml effectively.xml filemodes.xml
+ gcc.xml gdb.xml legal.xml new-features.xml ntsec.xml overview.xml
+ pathnames.xml programming.xml setup.xml setup-net.xml textbinary.xml
+ using.xml windres.xml: Renamed from *.sgml.
+ Added <?xml> and <!DOCTYPE> tags to the top.
+ * cygserver.sgml cygwinenv.sgml dll.sgml effectively.sgml filemodes.sgml
+ gcc.sgml gdb.sgml legal.sgml new-features.sgml ntsec.sgml overview.sgml
+ pathnames.sgml programming.sgml setup.sgml setup-net.sgml textbinary.sgml
+ using.sgml windres.sgml: Renamed to *.xml
+ * faq.xml: Renamed from faq-sections.sgml. (Not faq.sgml!)
+ Replaced FAQ section ENTITY declarations with XIncludes.
+ Removed all other ENTITY declarations as they just name entities
+ already defined in the current DocBook stylesheets.
+ * faq.sgml: Removed without translating to DocBook XML. Obsolete.
+ * faq-*.xml: Added <?xml> and <!DOCTYPE> tags to the top.
+ Moved <qandadiv> tags from faq.xml and faq-sections.xml into
+ individual section files so they individually pass XML validation.
+ * pathnames.xml: Contained two top-level <sect1> elements, which is
+ malformed XML. Moved second to new specialnames.xml file.
+ * specialnames.xml: Created; extracted from pathnames.sgml
+ * overview2.xml: Broke it up into following three files, and
+ removed the original.
+ * ov-ex-win.xml (ov-ex-win): Created; contents extracted from
+ overview2.sgml
+ * ov-ex-unix.xml (ov-ex-unix): Ditto
+ * highlights.xml (highlights): Ditto
+ * setup2.xml: Broke it up into setup-*.xml.
+ * setup-env.xml setup-files.xml setup-locale.xml setup-maxmem.xml:
+ Created; contents extracted from setup2.sgml
+
+2013-04-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * faq-programming.xml (faq.programming.64bitporting): Fix typo.
+
+2013-04-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * faq-programming.xml (faq.programming.64bitporting): Extend entry.
+ (faq.programming.64bitporting-fail): New entry.
+ (faq.programming.64bitporting-cygwin64): New entry.
+
+2013-04-24 Corinna Vinschen <corinna@vinschen.de>
+ Christian Franke <Christian.Franke@t-online.de>
+
+ * faq-programming.xml (faq.programming.64bitporting): Mention the
+ -Wformat and -Wall gcc options.
+
+2013-04-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * faq-programming.xml (faq.programming.64bitporting): New FAQ entry.
+ (faq.programming.objective-c): Include gcc4.
+ (faq.programming.make-execvp): Drop text discouraging usage of -j.
+ (faq.programming.undeclared-functions): Drop entry.
+ (faq.programming.x86-assembly): Ditto.
+ (faq.programming.djgpp): Ditto.
+
+2013-04-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwinenv.sgml (cygwinenv-implemented-options): Change description
+ for winsymlink option to explain new implementation.
+ * new-features.sgml (ov-new1.7.19): Add support for native symlinks and
+ AFS.
+
+2013-04-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * Throughout, eliminate Windows 2000 from the documentation.
+ * overview.sgml (brief-history): Mention native AMD64 support.
+
+2013-04-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (SGMLDIRS): Accommodate dropping utils_source and
+ cygwin_source from ../Makefile.common.
+ * new-features.sgml (ov-new1.7.19): New section. Document dropped
+ support for pre-XP SP3 and added support for 64 bit Cygwin.
+
+2013-04-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * faq-what.xml (faq.what.supported): Change to accommodate existence
+ of 64 bit version.
+
2013-03-27 Corinna Vinschen <corinna@vinschen.de>
* faq-what.xml (faq.what.supported): Mention Windows 8 and Server 2012.
diff --git a/winsup/doc/Makefile.in b/winsup/doc/Makefile.in
index 5ea8fd529..48bf50472 100644
--- a/winsup/doc/Makefile.in
+++ b/winsup/doc/Makefile.in
@@ -1,5 +1,6 @@
# -*- Makefile -*- for winsup/doc
-# Copyright (c) 1998-2000,2001 Red Hat, Inc.
+# Copyright (c) 1998-2000, 2001, 2002, 2004, 2005, 2006, 2008, 2009, 2010,
+# 2013 Red Hat, Inc.
#
# This file is part of Cygwin.
#
@@ -11,7 +12,7 @@ SHELL = @SHELL@
srcdir = @srcdir@
VPATH = @srcdir@
-SGMLDIRS = -d $(srcdir) -d $(utils_source) -d $(cygwin_source)
+DBXDIRS = -d $(srcdir) -d $(srcdir)/../utils -d $(srcdir)/../cygwin
CC:=@CC@
CC_FOR_TARGET:=@CC@
@@ -21,73 +22,76 @@ XMLTO:=xmlto --skip-validation --with-dblatex
include $(srcdir)/../Makefile.common
-TOCLEAN:=faq.txt ./*.html readme.txt doctool.o doctool.exe *.junk \
- cygwin-ug.sgml cygwin-ug cygwin-ug-net.html.gz \
- cygwin-ug-net.sgml cygwin-ug-net cygwin-ug-net.html \
- cygwin-api.sgml cygwin-api cygwin-api-int.sgml cygwin-api-int \
- faq
+FAQ_SOURCES:= $(wildcard ${srcdir}/faq*.xml)
-FAQ_SOURCES:= faq-api.xml faq-programming.xml faq-resources.xml \
- faq-sections.xml faq-setup.xml faq-using.xml faq-what.xml faq.xml
+.SUFFIXES: .html .body
-.SUFFIXES:
+.html.body:
+ $(srcdir)/bodysnatcher.pl $<
-all : \
+all: Makefile Makefile.dep \
cygwin-ug-net/cygwin-ug-net.html \
cygwin-ug-net/cygwin-ug-net-nochunks.html.gz \
cygwin-api/cygwin-api.html \
- faq/faq.html faq/faq-nochunks.html \
+ faq/faq.body faq/faq.html \
cygwin-ug-net/cygwin-ug-net.pdf \
cygwin-api/cygwin-api.pdf
+Makefile: ${srcdir}/Makefile.in
+ /bin/sh ./config.status
+
clean:
- rm -Rf $(TOCLEAN)
+ rm -f Makefile.dep
+ rm -f doctool.exe doctool.o
+ rm -f cygwin-api.xml
+ rm -f *.html *.html.gz
+ rm -Rf cygwin-api cygwin-ug cygwin-ug-net faq
install: all
-cygwin-ug-net/cygwin-ug-net-nochunks.html.gz : cygwin-ug-net.sgml doctool
- -${XMLTO} html-nochunks -m $(srcdir)/cygwin.dsl $<
+cygwin-ug-net/cygwin-ug-net-nochunks.html.gz : cygwin-ug-net.xml
+ -${XMLTO} html-nochunks -m $(srcdir)/cygwin.xsl $<
-cp cygwin-ug-net.html cygwin-ug-net/cygwin-ug-net-nochunks.html
-rm -f cygwin-ug-net/cygwin-ug-net-nochunks.html.gz
-gzip cygwin-ug-net/cygwin-ug-net-nochunks.html
-cygwin-ug-net/cygwin-ug-net.html : cygwin-ug-net.sgml doctool
- -${XMLTO} html -o cygwin-ug-net/ -m $(srcdir)/cygwin.dsl $<
+cygwin-ug-net/cygwin-ug-net.html : cygwin-ug-net.xml
+ -${XMLTO} html -o cygwin-ug-net/ -m $(srcdir)/cygwin.xsl $<
# Some versions of jw hang with the -o option
-cygwin-ug-net/cygwin-ug-net.pdf : cygwin-ug-net.sgml
+cygwin-ug-net/cygwin-ug-net.pdf : cygwin-ug-net.xml
-${XMLTO} pdf -o cygwin-ug-net/ $<
-cygwin-ug-net.sgml : cygwin-ug-net.in.sgml ./doctool Makefile
- -./doctool -m $(SGMLDIRS) -s $(srcdir) -o $@ $<
-
-cygwin-api/cygwin-api.html : cygwin-api.sgml
- -${XMLTO} html -o cygwin-api/ -m $(srcdir)/cygwin.dsl $<
+cygwin-api/cygwin-api.html : cygwin-api.xml
+ -${XMLTO} html -o cygwin-api/ -m $(srcdir)/cygwin.xsl $<
-cygwin-api/cygwin-api.pdf : cygwin-api.sgml
+cygwin-api/cygwin-api.pdf : cygwin-api.xml
-${XMLTO} pdf -o cygwin-api/ $<
-cygwin-api.sgml : cygwin-api.in.sgml ./doctool Makefile
- -./doctool -m $(SGMLDIRS) -s $(srcdir) -o $@ $<
+cygwin-api.xml : cygwin-api.in.xml ./doctool Makefile
+ -./doctool -m $(DBXDIRS) -s $(srcdir) -o $@ $<
faq/faq.html : $(FAQ_SOURCES)
- -${XMLTO} html -o faq -m $(srcdir)/cygwin.dsl $(srcdir)/faq-sections.xml
- -sed -i 's;</a><a name="id[0-9]*"></a>;</a>;g' faq/faq.*.html
-
-faq/faq-nochunks.html : $(FAQ_SOURCES)
- -${XMLTO} html -o faq -m $(srcdir)/cygwin.dsl $(srcdir)/faq.xml
- -sed -i 's;</a><a name="id[0-9]*"></a>;</a>;g' faq/faq-nochunks.html
+ -${XMLTO} html -o faq -m $(srcdir)/cygwin.xsl $(srcdir)/faq.xml
+ -sed -i 's;</a><a name="id[0-9]*"></a>;</a>;g' faq/faq.html
./doctool : doctool.c
gcc -g $< -o $@
TBFILES = cygwin-ug-net.dvi cygwin-ug-net.rtf cygwin-ug-net.ps \
- cygwin-ug-net.pdf cygwin-ug-net.sgml \
+ cygwin-ug-net.pdf cygwin-ug-net.xml \
cygwin-api.dvi cygwin-api.rtf cygwin-api.ps \
- cygwin-api.pdf cygwin-api.sgml
+ cygwin-api.pdf cygwin-api.xml
TBDIRS = cygwin-ug-net cygwin-api
TBDEPS = cygwin-ug-net/cygwin-ug-net.html cygwin-api/cygwin-api.html
tarball : cygwin-docs.tar.bz2
cygwin-docs.tar.bz2 : $(TBFILES) $(TBDEPS)
find $(TBFILES) $(TBDIRS) \! -type d | sort | tar -T - -cf - | bzip2 > cygwin-docs.tar.bz2
+
+Makefile.dep: cygwin-ug-net.xml
+ builddir=`pwd` \
+ && cd $(srcdir) \
+ && $(srcdir)/xidepend $^ > "$${builddir}/$@"
+
+-include Makefile.dep
diff --git a/winsup/doc/Wishlist b/winsup/doc/Wishlist
new file mode 100644
index 000000000..9e7aa4ca1
--- /dev/null
+++ b/winsup/doc/Wishlist
@@ -0,0 +1,111 @@
+- Change the '-' prefixes on Makefile.in commands to '@'. We only want
+ to avoid echoing the commands, not keep on trucking past build
+ errors.
+
+- Cygwin API docs update:
+
+ - Either:
+
+ - Convert existing SGML code embedded in Cygwin source code
+ to Doxygen format, then set up HTML and PDF reference manual
+ generation in doc/Makefile.in. Then, remove vestiges of doctool.
+
+ The Cygwin User Manual reportedly references pieces of the
+ current SGML that makes up the API Manual, which if true means
+ we have a challenge to make the Doxygen process continue to feed
+ the user manual.
+
+ - Or, move all SGML from winsup/cygwin into winsup/doc/api.
+
+ - Current POSIX documentation is nonexistent. Either:
+
+ - Fork the current POSIX/Linux manpages. Downside of this is that
+ it's in nroff format and the license demands that nroff sources
+ continue to be made available. This is a challenge for PDF
+ manual integration.
+
+ - Switch to Doxygen, which lets us have skeletal POSIX docs almost
+ for free. Each can point to web docs for more complete info, such
+ that the Cygwin man pages only need to provide parameter lists and
+ document Cygwinisms in the implementation.
+
+ - Write our own man pages in DocBook <refentry> form. Such files
+ should be XInclude-able in regular API/user manuals, and only have
+ to have the same mininal info as in the Doxygen case above. It
+ just requires a more verbose markup format.
+
+- Remove autotools outputs from repo. (configure, Makefile, etc.)
+ Create a bootstrap script to generate them. Make sure top-level
+ "make" process knows how to call the bootstrap script at need.
+
+- There are absolute HTTP <ulinks> which should be transformed to
+ relative links so that they do the right thing when you move the docs
+ around. Maybe they'll never live somewhere else on cygwin.com, but if
+ nothing else, they currently do the wrong thing when you open one of the
+ generated .html files from the local filesystem: hyperlinks take you off
+ to cygwin.com instead of to the relevant local file.
+
+- Convert remaining code snippets from HTML entity form (&amp;,
+ &lt;...) to raw C/C++ code in CDATA sections. Easier to read and
+ edit in XML form.
+
+- Pretty code snippets. Search for a DocBook aware automatic code
+ formatter that will take raw example code in and mark it up, as exists
+ for HTML. If one can't be found or created -- e.g. by lashing an HTML
+ code formatter to a sed script then whipping them until they sing -- do
+ the markup by hand.
+
+- Move to DocBook 5.
+
+- Files are often named with less detail than the ID of the top-level
+ XML element it contains. For example, specialnames.xml contains
+ <sect1 id="using-specialnames">. The ID scheme seems hierarchical, so
+ maybe the files should go into subdirectories; e.g.
+ using/specialnames.xml. This would help with the proliferation of files
+ this "patch" created.
+
+- "Tidy" the XML files.
+
+- Remove --skip-validation from XMLTO flags variable in Makefile.in,
+ then fix any errors and warnings that result.
+
+- Replace the hard-coded dates in <bookinfo><date> tags with DocBook
+ time stamps. (http://www.sagehill.net/docbookxsl/Datetime.html)
+
+- cygwin-ug-net/cygwin-ug-net-nochunks.html.gz build rules can probably
+ be reduced to a one-liner by moving from xmlto wrapper to a raw
+ xsltproc call.
+
+- Is xmlto pulling its own weight for the HTML case? It *might* have
+ some value for the PDF-via-dblatex case, but an xsltproc call for HTML
+ is also a one-liner.
+
+- Switch from xmlto/dblatex to xsltproc/FOP for PDF? Might be a
+ prerequisite to the font changes below if dblatex doesn't allow
+ one to specify fonts through the xmlto layer.
+
+- Typography improvements: curl all the quotation marks, replace "--"
+ with em dashes, check proper names for missing accents, etc.
+
+- Adapt top-level cygwin.com CSS to DocBook HTML output so the user
+ guide blends with the rest of the site. (Something like this has
+ been done to cygwin.com/faq.html already.)
+
+- Improve PDF styling:
+
+ - Wider margins, section indenting, etc. (i.e. Fix the "wall of text"
+ problem.)
+
+ - Current fonts are Business Blah at best. Most severe to least:
+
+ - Courier for code is just plain ugly, and is apparently a bitmap
+ font in some people's PDF output besides. Switch to Deja Vu,
+ Inconsolata, or Adobe Source Code Pro.
+
+ - Times. Sigh. There must be something better in the free world,
+ something more in the Palatino or Garamond mold. Bitstream Vera
+ Serif? Linux Libertine?
+
+ - Arial/Helvetica/whatever. Not a serious issue, but we can do
+ better, even if it's just a minor shake-up, like switching to a
+ condensed face.
diff --git a/winsup/doc/bodysnatcher.pl b/winsup/doc/bodysnatcher.pl
new file mode 100755
index 000000000..1db30aad4
--- /dev/null
+++ b/winsup/doc/bodysnatcher.pl
@@ -0,0 +1,44 @@
+#!/usr/bin/perl -w
+# Copyright © 2013 by Red Hat, Inc.
+#
+# This file is part of Cygwin.
+#
+# This software is a copyrighted work licensed under the terms of the
+# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+# details.
+
+use strict;
+
+if (@ARGV) {
+ my $infile = $ARGV[0];
+ my $outfile = $infile;
+ $outfile =~ s/\.html$/.body/;
+ if ($infile ne $outfile) {
+ open my $input, '<', $infile or die "Failed to open $infile: $!\n";
+ my $html = do { local $/; <$input> }; # slurp!
+ my ($body) = $html =~ m|<body[^>]*>(.*)</body>|is;
+ if ($body) {
+ open my $output, '>', $outfile
+ or die "Failed to write $outfile: $!\n";
+ print $output $body;
+ }
+ else {
+ print STDERR "Could not find <body> element in $infile!\n\n";
+ exit 3;
+ }
+ }
+ else {
+ print STDERR "Input file name must end in .html!\n\n";
+ exit 2;
+ }
+}
+else {
+ print STDERR <<USAGE;
+usage: $0 <input.html>
+
+ Transforms input.html to input.body by extracting whatever is
+ between <body> and </body> in input.html.
+
+USAGE
+ exit 1;
+}
diff --git a/winsup/doc/configure b/winsup/doc/configure
index 352dfdca9..996722fc1 100755
--- a/winsup/doc/configure
+++ b/winsup/doc/configure
@@ -1,11 +1,9 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68.
+# Generated by GNU Autoconf 2.69.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -134,6 +132,31 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -211,21 +235,25 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
@@ -327,6 +355,14 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -448,6 +484,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
@@ -482,16 +522,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -503,28 +543,8 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -561,7 +581,7 @@ PACKAGE_STRING=
PACKAGE_BUGREPORT=
PACKAGE_URL=
-ac_unique_file="cygwin-api.in.sgml"
+ac_unique_file="cygwin-api.in.xml"
ac_no_link=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
@@ -1090,8 +1110,6 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1321,9 +1339,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1376,7 +1394,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -1883,7 +1901,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -1923,7 +1941,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -1981,7 +1999,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2021,7 +2039,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2074,7 +2092,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2115,7 +2133,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -2173,7 +2191,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2217,7 +2235,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2739,8 +2757,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3275,16 +3292,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -3344,28 +3361,16 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -3387,7 +3392,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -3440,10 +3445,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -3520,7 +3525,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
diff --git a/winsup/doc/configure.ac b/winsup/doc/configure.ac
index 0a2bb8562..ea5d61074 100644
--- a/winsup/doc/configure.ac
+++ b/winsup/doc/configure.ac
@@ -10,7 +10,7 @@ dnl details.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(cygwin-api.in.sgml)
+AC_INIT(cygwin-api.in.xml)
AC_CONFIG_AUX_DIR(../..)
AC_NO_EXECUTABLES
diff --git a/winsup/doc/cygserver.sgml b/winsup/doc/cygserver.xml
index cef73b201..6a4ec4ec5 100644
--- a/winsup/doc/cygserver.sgml
+++ b/winsup/doc/cygserver.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="using-cygserver"><title>Cygserver</title>
<sect2 id="what-is-cygserver"><title>What is Cygserver?</title>
diff --git a/winsup/doc/cygwin-api.in.sgml b/winsup/doc/cygwin-api.in.xml
index 15e663e97..3fee468dc 100644
--- a/winsup/doc/cygwin-api.in.sgml
+++ b/winsup/doc/cygwin-api.in.xml
@@ -1,15 +1,13 @@
-<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<book id="cygwin-api">
+<book id="cygwin-api" xmlns:xi="http://www.w3.org/2001/XInclude">
<bookinfo>
<date>1998-08-31</date>
<title>Cygwin API Reference</title>
-
- DOCTOOL-INSERT-legal
-
+DOCTOOL-INSERT-legal
</bookinfo>
<toc></toc>
diff --git a/winsup/doc/cygwin-ug-net.in.sgml b/winsup/doc/cygwin-ug-net.in.sgml
deleted file mode 100644
index 542457859..000000000
--- a/winsup/doc/cygwin-ug-net.in.sgml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-
-<book id="cygwin-ug-net">
-
- <bookinfo>
- <date>2009-03-18</date>
- <title>Cygwin User's Guide</title>
-
-DOCTOOL-INSERT-legal
-
- </bookinfo>
-
- <toc></toc>
-
-DOCTOOL-INSERT-overview
-
-DOCTOOL-INSERT-setup-net
-
-DOCTOOL-INSERT-using
-
-DOCTOOL-INSERT-programming
-
-</book>
diff --git a/winsup/doc/cygwin-ug-net.xml b/winsup/doc/cygwin-ug-net.xml
new file mode 100644
index 000000000..89526d721
--- /dev/null
+++ b/winsup/doc/cygwin-ug-net.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<book id="cygwin-ug-net" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <bookinfo>
+ <date>2009-03-18</date>
+ <title>Cygwin User's Guide</title>
+ <xi:include href="legal.xml"/>
+ </bookinfo>
+
+ <xi:include href="overview.xml"/>
+ <xi:include href="setup-net.xml"/>
+ <xi:include href="using.xml"/>
+ <xi:include href="programming.xml"/>
+</book>
diff --git a/winsup/doc/cygwin-ug.in.sgml b/winsup/doc/cygwin-ug.in.sgml
deleted file mode 100644
index 976f23f1c..000000000
--- a/winsup/doc/cygwin-ug.in.sgml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- <!ENTITY cygnus-copyright "<year>1999,2000,2001,2002,2003,2004,2005,2006,2007,2008</year>
- <holder>Red Hat, Inc.</holder>">
- <!ENTITY cygnus-code-copyright "
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-Copyright (C) 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007,
- 2008 Red Hat, Inc.
-
-This is copyrighted software that may only
-be reproduced, modified, or distributed
-under license from Red Hat, Inc.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-">
- ]>
-
-<book id="cygwin-ug">
-
- <bookinfo>
- <date>2001-22-03</date>
- <title>Cygwin User's Guide</title>
- <authorgroup>
- <author>
- <firstname>Joshua Daniel</firstname>
- <surname>Franklin</surname>
- </author>
- <author>
- <firstname>Corinna</firstname>
- <surname>Vinschen</surname>
- </author>
- <author>
- <firstname>Christopher</firstname>
- <surname>Faylor</surname>
- </author>
- <author>
- <firstname>DJ</firstname>
- <surname>Delorie</surname>
- </author>
- <author>
- <firstname>Pierre</firstname>
- <surname>Humblet</surname>
- </author>
- <author>
- <firstname>Geoffrey</firstname>
- <surname>Noer</surname>
- </author>
- </authorgroup>
-
-DOCTOOL-INSERT-legal
-
- </bookinfo>
-
- <toc></toc>
-
-DOCTOOL-INSERT-overview
-
-DOCTOOL-INSERT-setup
-
-DOCTOOL-INSERT-using
-
-DOCTOOL-INSERT-programming
-
-</book>
diff --git a/winsup/doc/cygwin.dsl b/winsup/doc/cygwin.xsl
index 23512934a..23512934a 100644
--- a/winsup/doc/cygwin.dsl
+++ b/winsup/doc/cygwin.xsl
diff --git a/winsup/doc/cygwinenv.sgml b/winsup/doc/cygwinenv.xml
index 3a05e9ba3..a6d0eaac9 100644
--- a/winsup/doc/cygwinenv.sgml
+++ b/winsup/doc/cygwinenv.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="using-cygwinenv"><title>The <envar>CYGWIN</envar> environment
variable</title>
@@ -78,16 +82,27 @@ time and when handles are inherited. Defaults to set.</para>
</listitem>
<listitem>
-<para><envar>(no)winsymlinks</envar> - if set, Cygwin creates
-symlinks as Windows shortcuts with a special header and the R/O attribute
-set. If not set, Cygwin creates symlinks as plain files with a magic number,
-a path and the system attribute set. Defaults to not set since plain
-file symlinks are faster to write and faster to read.</para>
-
-<para>Please note that symlinks created under Cygwin 1.7 or later are
-not readable by older Cygwin releases because the new symlinks use UTF-16
-to encode the target filename, while the old symlinks used the current
-ANSI or OEM charset.</para>
+<para><envar>winsymlinks:{lnk,native,nativestrict}</envar> - if set to just
+<literal>winsymlinks</literal> or <literal>winsymlinks:lnk</literal>,
+Cygwin creates symlinks as Windows shortcuts with a special header and
+the R/O attribute set.</para>
+
+<para>If set to <literal>winsymlinks:native</literal> or
+<literal>winsymlinks:nativestrict</literal>, Cygwin creates symlinks as
+native Windows symlinks on filesystems and OS versions supporting them.
+If the OS is known not to support native symlinks (Windows XP, Windows
+Server 2003), a warning message is produced once per session.</para>
+
+<para>The difference between <literal>winsymlinks:native</literal> and
+<literal>winsymlinks:nativestrict</literal> is this: If the filesystem
+supports native symlinks and Cygwin fails to create a native symlink for
+some reason, it will fall back to creating Cygwin default symlinks
+with <literal>winsymlinks:native</literal>, while with
+<literal>winsymlinks:nativestrict</literal> the <literal>symlink(2)</literal>
+system call will immediately fail.</para>
+
+<para>For more information on symbolic links, see
+<xref linkend="pathnames-symlinks"></xref>.</para>
</listitem>
</itemizedlist>
diff --git a/winsup/doc/dll.sgml b/winsup/doc/dll.xml
index 2575c6858..f0369760f 100644
--- a/winsup/doc/dll.sgml
+++ b/winsup/doc/dll.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="dll"><title>Building and Using DLLs</title>
<para>DLLs are Dynamic Link Libraries, which means that they're linked
diff --git a/winsup/doc/effectively.sgml b/winsup/doc/effectively.xml
index 41a97f8b5..cb25628fd 100644
--- a/winsup/doc/effectively.sgml
+++ b/winsup/doc/effectively.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="using-effectively">
<title>Using Cygwin effectively with Windows</title>
@@ -17,12 +21,9 @@ support the <literal>/?</literal> switch to display usage information.
<para>
Unfortunately, no standard set of tools included with all versions of
-Windows exists. If you are unfamiliar with the tools available
-on your system, here is a general guide. Windows 2000 has only a basic
-set of tools, which later versions of Windows expanded. Microsoft also
-provides free downloads for Windows 2000 (the Resource Kit Tools), and XP
-(the Windows Support Tools). Generally, the younger the Windows version,
-the more complete are the on-board tools. Additionally, many independent
+Windows exists. Generally, the younger the Windows version, the more
+complete are the on-board tools. Microsoft also provides free downloads
+for Windows XP (the Windows Support Tools). Additionally, many independent
sites such as
<ulink url="http://download.com">download.com</ulink>,
<ulink url="http://simtel.net">simtel.net</ulink>,
@@ -85,8 +86,8 @@ If your system does not have an always-on network connection, you
may be interested in <command>rasdial.exe</command> for automating dialup
connections.
Users who frequently change their network
-configuration can script these changes with <command>netsh.exe</command>
-(Windows 2000 and later). For proxy users, the open source
+configuration can script these changes with <command>netsh.exe</command>.
+For proxy users, the open source
<ulink url="http://apserver.sourceforge.net">
NTLM Authorization Proxy Server</ulink> or the no-charge
<ulink url="http://www.hummingbird.com/products/nc/socks/index.html">
diff --git a/winsup/doc/faq-api.xml b/winsup/doc/faq-api.xml
index a515d1cd9..de2d31cc6 100644
--- a/winsup/doc/faq-api.xml
+++ b/winsup/doc/faq-api.xml
@@ -1,3 +1,10 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<qandadiv id="faq.api">
+<title>Cygwin API Questions</title>
+
<!-- faq-api.xml -->
<qandaentry id="faq.api.everything">
<question><para>How does everything work?</para></question>
@@ -319,4 +326,4 @@ In a Windows console window you can enable and capture mouse events
using the xterm escape sequences for mouse events.
</para>
</answer></qandaentry>
-
+</qandadiv>
diff --git a/winsup/doc/faq-copyright.xml b/winsup/doc/faq-copyright.xml
new file mode 100644
index 000000000..95abaa2b4
--- /dev/null
+++ b/winsup/doc/faq-copyright.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- faq-copyright.xml -->
+
+<qandadiv id="faq.copyright">
+ <title>Copyright</title>
+
+ <qandaentry id="faq.what.copyright">
+ <question><para>What are the copyrights?</para></question>
+
+ <answer>
+ <para>Please see <ulink url="http://cygwin.com/licensing.html"/>
+ for more information about Cygwin copyright and licensing.</para>
+ </answer>
+ </qandaentry>
+</qandadiv>
diff --git a/winsup/doc/faq-programming.xml b/winsup/doc/faq-programming.xml
index bfc27fac7..c01a127e6 100644
--- a/winsup/doc/faq-programming.xml
+++ b/winsup/doc/faq-programming.xml
@@ -1,5 +1,11 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- faq-programming.xml -->
+<qandadiv id="faq.programming">
+<title>Programming Questions</title>
+
<qandaentry id="faq.programming.packages">
<question><para>How do I contribute a package?</para></question>
<answer>
@@ -48,6 +54,287 @@ package. Or compile with the <literal>-s</literal> option to gcc.
</para>
</answer></qandaentry>
+<qandaentry id="faq.programming.64bitporting">
+<question><para>What do I have to look out for when porting applications to 64 bit Cygwin?</para></question>
+<answer>
+
+<para>The Cygwin x86_64 toolchain is using the
+<ulink url="http://en.wikipedia.org/wiki/LLP64#64-bit_data_models">LP64</ulink>
+data model. That means, in contrast to Windows, which uses an
+<ulink url="http://en.wikipedia.org/wiki/LLP64#64-bit_data_models">LLP64</ulink>
+data model, sizeof(long) != sizeof(int), just as on Linux.</para>
+
+<para>For comparison:</para>
+
+<screen>
+ Cygwin Windows Cygwin
+ Linux x86_64 Linux
+ Windows x86_64
+ i686
+
+sizeof(int) 4 4 4
+sizeof(long) 4 4 8
+sizeof(size_t) 4 8 8
+sizeof(void*) 4 8 8
+</screen>
+
+<para>This difference can result in interesting problems, especially when
+using Win32 functions, especially when using pointers to Windows
+datatypes like LONG, ULONG, DWORD. Given that Windows is LLP64, all of
+the aforementioned types are 4 byte in size, on 32 as well as on 64 bit
+Windows, while `long' on 64 bit Cygwin is 8 bytes.</para>
+
+<para>Take the example ReadFile:</para>
+
+<screen>
+ ReadFile (HANDLE, LPVOID, DWORD, LPDWORD, LPOVERLAPPED);
+</screen>
+
+<para>In the 32 bit Cygwin and Mingw environments, as well as in the 64 bit
+Mingw environment, it is no problem to substitute DWORD with unsigned
+long:</para>
+
+<screen>
+ unsigned long number_of_bytes_read;
+ [...]
+ ReadFile (fhdl, buf, buflen, &amp;number_of_bytes_read, NULL);
+</screen>
+
+<para>However, in 64 bit Cygwin, using LP64, number_of_bytes_read is 8 bytes
+in size. But since ReadFile expects a pointer to a 4 byte type, the function
+will only change the lower 4 bytes of number_of_bytes_read on return, while
+the content of the upper 4 bytes stays undefined.</para>
+
+<para>Here are a few <emphasis>donts</emphasis> which should help porting
+applications from the known ILP32 data model of 32 bit Cygwin, to the LP64
+data model of 64 bit Cygwin. Note that these are not Cygwin-only problems.
+Many Linux applications suffered the same somewhat liberal handling of
+datatypes when the AMD64 CPU was new.</para>
+
+<itemizedlist mark="bullet">
+
+<listitem><para>
+<emphasis>Don't</emphasis> mix up int and long in printf/scanf. This:
+
+<screen>
+ int i; long l;
+ printf ("%d %ld\n", l, i);
+</screen>
+
+may not print what you think it should. Enable the gcc options -Wformat or
+-Wall, which warn about type mismatches in printf/scanf functions.
+
+<note>Using -Wall (optionally with -Werror to drive the point home) makes a
+lot of sense in general, not only when porting code to a new platform.</note>
+</para></listitem>
+
+<listitem><para>
+<emphasis>Don't</emphasis> mix int and long pointers.
+
+<screen>
+ long *long_ptr = (long *) &amp;my_int; /* Uh oh! */
+ *long_ptr = 42;
+</screen>
+
+The assignment will write 8 bytes to the address of my_int. Since my_int
+is only 4 bytes, <emphasis>something else</emphasis> gets randomly overwritten.
+Finding this kind of bug is very hard, because you will often see a problem
+which has no immediate connection to the actual bug.
+</para></listitem>
+
+<listitem><para>
+<emphasis>Don't</emphasis> mix int and pointers at all! This will
+<emphasis>not</emphasis> work as expected anymore:
+
+<screen>
+ void *ptr;
+ printf ("Pointer value is %x\n", ptr);
+</screen>
+
+%x denotes an int argument. The value printed by printf is a 4 byte value,
+so on x86_64 the printed pointer value is missing its upper 4 bytes; the output
+is very likely wrong. Use %p instead, which portable across architectures:
+
+<screen>
+ void *ptr;
+ printf ("Pointer value is %p\n", ptr);
+</screen>
+</para></listitem>
+
+<listitem><para>
+Along the same lines <emphasis>don't</emphasis> use the type int in
+pointer arithmetic. Don't cast pointers to int, don't cast pointer
+differences to int, and don't store pointer differences in an int type.
+Use the types <literal>intptr_t</literal>, <literal>uintptr_t</literal>
+and <literal>ptrdiff_t</literal> instead, they are designed for performing
+architecture-independent pointer arithmetic.
+</para></listitem>
+
+<listitem><para>
+<emphasis>Don't</emphasis> make blind assumptions about the size of a POSIX
+type. For instance, <literal>time_t</literal> is 8 bytes on 64 bit Cygwin,
+while it is (still, at the time of writing this) 4 bytes on 32 bit Cygwin,
+since time_t is based on the type long.
+</para></listitem>
+
+<listitem><para>
+<emphasis>Don't</emphasis> use functions returning pointers without declaration.
+For instance
+
+<screen>
+ printf ("Error message is: %s\n", strerror (errno));
+</screen>
+
+This code will <emphasis>crash</emphasis>, unless you included
+<filename>string.h</filename>. The implicit rule in C is that an undeclared
+function is of type int. But int is 4 byte and pointers are 8 byte, so the
+string pointer given to printf is missing the upper 4 bytes.
+</para></listitem>
+
+<listitem><para>
+<emphasis>Don't</emphasis> use C base types together with Win32 functions.
+Keep in mind that DWORD, LONG, ULONG are <emphasis>not</emphasis> the same
+as long and unsigned long. Try to use only Win32 datatypes in conjunction
+with Win32 API function calls to avoid type problems. See the above
+ReadFile example. Windows functions in printf calls should be treated
+carefully as well. This code is common for 32 bit code, but probably prints
+the wrong value on 64 bit:
+
+<screen>
+ printf ("Error message is: %lu\n", GetLastError ());
+</screen>
+
+Using gcc's -Wformat option would warn about this. Casting to the requested
+base type helps in this case:
+
+<screen>
+ printf ("Error message is: %lu\n", (unsigned long) GetLastError ());
+</screen>
+</para></listitem>
+
+<listitem><para>
+<emphasis>Don't</emphasis> mix Windows datatypes with POSIX type-specific
+MIN/MAX values.
+
+<screen>
+ unsigned long l_max = ULONG_MAX; /* That's right. */
+ ULONG w32_biggest = ULONG_MAX; /* Hey, wait! What? */
+ ULONG w32_biggest = UINT_MAX; /* Ok, but borderline. */
+</screen>
+
+Again, keep in mind that ULONG (or DWORD) is <emphasis>not</emphasis> unsigned
+long but rather unsigned int on 64 bit.
+</para></listitem>
+
+</itemizedlist>
+
+</answer></qandaentry>
+
+<qandaentry id="faq.programming.64bitporting-fail">
+<question><para>My project doesn't build at all on 64 bit Cygwin. What's up?</para></question>
+<answer>
+
+<para>Typically reasons for that are:</para>
+
+<itemizedlist mark="bullet">
+
+<listitem><para><literal>__CYGWIN32__</literal> is not defined in the
+64 bit toolchain. This may hit a few projects which are around since before
+Y2K. Check your project for occurences of <literal>__CYGWIN32__</literal>
+and change them to <literal>__CYGWIN__</literal>, which is defined in the
+Cygwin toolchain since 1998, to get the same Cygwin-specific code changes done.
+</para></listitem>
+
+<listitem><para>The project maintainers took it for granted that Cygwin is
+running only on i686 CPUs and the code is making this assumption blindly.
+You have to check the code for such assumptions and fix them.
+</para></listitem>
+
+<listitem><para>The project is using autotools, the
+<filename>config.sub</filename> and <filename>config.guess</filename> files
+are hopelessly outdated and don't recognize
+<literal>x86_64-{pc,unknown}-cygwin</literal> as valid target. Update the
+project configury (cygport will do this by default) and try again.
+</para></listitem>
+
+<listitem><para>The project uses Windows functions on Cygwin and it's suffering
+from the problems described in the preceeding FAQ entry.
+</para></listitem>
+
+</itemizedlist>
+
+<para>In all of this cases, please make sure to fix that upstream, or send
+your patches to the upstream maintainers, so the problems get fixed for the
+future.</para>
+
+</answer></qandaentry>
+
+<qandaentry id="faq.programming.64bitporting-cygwin64">
+<question><para>Why is __CYGWIN64__ not defined for 64 bit?</para></question>
+<answer>
+
+<para>There is no <literal>__CYGWIN64__</literal> because we would like to
+have a unified way to handle Cygwin code in portable projects. Using
+<literal>__CYGWIN32__</literal> and <literal>__CYGWIN64__</literal> only
+complicates the code for no good reason. Along the same lines you won't
+find predefined macros <literal>__linux32__</literal> and
+<literal>__linux64__</literal> on Linux.</para>
+
+<para>If you really have to differ between 32 and 64 bit in some way, you have
+three choices.</para>
+
+<itemizedlist mark="bullet">
+
+<listitem><para>If your code depends on the CPU architecture, use the
+predefined compiler definition for the architecture, like this:</para>
+
+<screen>
+#ifdef __CYGWIN__
+# ifdef __x86_64__ /* Alternatively __x86_64, __amd64__, __amd64 */
+ /* Code specific for AMD64 CPU */
+# elif __X86__
+ /* Code specific for ix86 CPUs */
+# else
+# error Unsupported Architecture
+# endif
+#endif
+</screen></listitem>
+
+<listitem><para>If your code depends on differences in the data model, you
+should consider to use the <literal>__LP64__</literal> definition
+instead:</para>
+
+<screen>
+#ifdef __CYGWIN__
+# ifdef __LP64__ /* Alternatively _LP64 */
+ /* Code specific for 64 bit CPUs */
+# else
+ /* Code specific for 32 bit CPUs */
+# endif
+#endif
+</screen></listitem>
+
+<listitem><para>If your code uses Windows functions, and some of the
+functionality is 64 bit Windows-specific, use <literal>_WIN64</literal>,
+which is defined on 64 bit Cygwin, as soon as you include
+<filename>windows.h</filename>. This should only be used in the most
+desperate of occasions, though, and <emphasis>only</emphasis> if it's
+really about a difference in Windows API functionality!</para>
+
+<screen>
+#ifdef __CYGWIN__
+# ifdef _WIN64
+ /* Code specific for 64 bit Windows */
+# else
+ /* Code specific for 32 bit Windows */
+# endif
+#endif
+</screen></listitem>
+
+</itemizedlist>
+
+</answer></qandaentry>
+
<qandaentry id="faq.programming.glibc">
<question><para>Where is glibc?</para></question>
<answer>
@@ -62,7 +349,7 @@ would be difficult.
<question><para>Where is Objective C?</para></question>
<answer>
-<para>Support for compiling Objective C is available in the <literal>gcc4-objc</literal>
+<para>Support for compiling Objective C is available in the <literal>gcc{4}-objc</literal>
package; resulting binaries will depend on the <literal>libobjc2</literal>
package at runtime.
</para>
@@ -72,10 +359,8 @@ package at runtime.
<question><para>Why does my make fail on Cygwin with an execvp error? </para></question>
<answer>
-<para>First of all, if you are using <literal>make -j[N]</literal>, then stop. It doesn't
-work well. Also beware of using non-portable shell features in your
-Makefiles (see tips at <ulink
-url="http://cygwin.com/faq/faq.using.html#faq.using.shell-scripts" />).
+<para>Beware of using non-portable shell features in your Makefiles (see tips
+at <ulink url="http://cygwin.com/faq/faq.html#faq.using.shell-scripts" />).
</para>
<para>Errors of <literal>make: execvp: /bin/sh: Illegal Argument</literal> or
<literal>make: execvp: /bin/sh: Argument list too long</literal> are often
@@ -461,7 +746,7 @@ recommend trying the latest snapshot from
<ulink url="http://cygwin.com/snapshots/" /> or building the DLL from CVS.
</para>
<para>To build a debugging version of the Cygwin DLL, you will need to follow
-the instructions at <ulink url="http://cygwin.com/faq/faq-nochunks.html#faq.programming.building-cygwin" />.
+the instructions at <ulink url="http://cygwin.com/faq/faq.html#faq.programming.building-cygwin" />.
You can also contact the mailing list for pointers (a simple test case that
demonstrates the bug is always welcome).
</para>
@@ -681,15 +966,6 @@ This is right <literal>gcc hello.cc -lstdc++</literal>.
use <literal>struct stat</literal>. It's 64 bit aware.</para>
</answer></qandaentry>
-<qandaentry id="faq.programming.undeclared-functions">
-<question><para>I use a function I know is in the API, but I still get a link error.</para></question>
-<answer>
-
-<para>The function probably isn't declared in the header files, or
-the UNICODE stuff for it isn't filled in.
-</para>
-</answer></qandaentry>
-
<qandaentry id="faq.programming.libc">
<question><para>Can you make DLLs that are linked against libc ?</para></question>
<answer>
@@ -758,17 +1034,6 @@ data types, line numbers, local variables etc.
</para>
</answer></qandaentry>
-<qandaentry id="faq.programming.x86-assembly">
-<question><para>Where can I find info on x86 assembly?</para></question>
-<answer>
-
-<para>CPU reference manuals for Intel's current chips are available in
-downloadable PDF form on Intel's web site:
-</para>
-<para><ulink url="http://developer.intel.com/">http://developer.intel.com/</ulink>
-</para>
-</answer></qandaentry>
-
<qandaentry id="faq.programming.make-scripts">
<question><para>Shell scripts aren't running properly from my makefiles?</para></question>
<answer>
@@ -849,18 +1114,4 @@ linker flag.</para></listitem>
</orderedlist></listitem></orderedlist>
</answer></qandaentry>
-<qandaentry id="faq.programming.djgpp">
-<question><para>Why not use DJGPP ?</para></question>
-<answer>
-
-<para>DJGPP is a similar idea, but for DOS instead of Win32. DJGPP uses a
-"DOS extender" to provide a more reasonable operating interface for its
-applications. The Cygwin toolset doesn't have to do this since all of
-the applications are native WIN32. Applications compiled with the
-Cygwin tools can access the Win32 API functions, so you can write
-programs which use the Windows GUI.
-</para>
-<para>You can get more info on DJGPP by following
-<ulink url="http://www.delorie.com/">http://www.delorie.com/</ulink>.
-</para></answer></qandaentry>
-
+</qandadiv>
diff --git a/winsup/doc/faq-resources.xml b/winsup/doc/faq-resources.xml
index 9bf42f722..128b713a3 100644
--- a/winsup/doc/faq-resources.xml
+++ b/winsup/doc/faq-resources.xml
@@ -1,3 +1,10 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<qandadiv id="faq.resources">
+<title>Further Resources</title>
+
<!-- faq-resources.xml -->
<qandaentry id="faq.resources.documentation">
<question><para>Where's the documentation?</para></question>
@@ -48,4 +55,4 @@ for a list of them.)
<para>Comprehensive information about reporting problems with Cygwin can be found at <ulink url="http://cygwin.com/problems.html" />.
</para>
</answer></qandaentry>
-
+</qandadiv>
diff --git a/winsup/doc/faq-sections.xml b/winsup/doc/faq-sections.xml
deleted file mode 100644
index 896a9661b..000000000
--- a/winsup/doc/faq-sections.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- <!-- see http://www.unicode.org/charts/PDF/U0080.pdf -->
- <!ENTITY pound "&#x00A3;">
- <!ENTITY brokenpipe "&#x00A6;">
-
- <!-- all the files -->
- <!ENTITY FAQ-WHAT SYSTEM "faq-what.xml">
- <!ENTITY FAQ-SETUP SYSTEM "faq-setup.xml">
- <!ENTITY FAQ-RESOURCES SYSTEM "faq-resources.xml">
- <!ENTITY FAQ-USING SYSTEM "faq-using.xml">
- <!ENTITY FAQ-API SYSTEM "faq-api.xml">
- <!ENTITY FAQ-PROGRAMMING SYSTEM "faq-programming.xml">
-]>
-
-<article id="faq" lang="en">
- <articleinfo>
- <title>Cygwin FAQ</title>
- </articleinfo>
-
-<sect1 id="faq.about">
-<title>About Cygwin</title>
-<qandaset><?dbhtml toc="1"?>
-&FAQ-WHAT;
-</qandaset></sect1>
-
-<sect1 id="faq.setup">
-<title>Setting up Cygwin</title>
-<qandaset><?dbhtml toc="1"?>
-&FAQ-SETUP;
-</qandaset></sect1>
-
-<sect1 id="faq.resources">
-<title>Further Resources</title>
-<qandaset><?dbhtml toc="1"?>
-&FAQ-RESOURCES;
-</qandaset></sect1>
-
-<sect1 id="faq.using">
-<title>Using Cygwin</title>
-<qandaset><?dbhtml toc="1"?>
-&FAQ-USING;
-</qandaset></sect1>
-
-<sect1 id="faq.api">
-<title>Cygwin API Questions</title>
-<qandaset><?dbhtml toc="1"?>
-&FAQ-API;
-</qandaset></sect1>
-
-<sect1 id="faq.programming">
-<title>Programming Questions</title>
-<qandaset><?dbhtml toc="1"?>
-&FAQ-PROGRAMMING;
-</qandaset></sect1>
-
-<sect1 id="faq.copyright">
-<title>Copyright</title>
-<qandaset><?dbhtml toc="1"?>
-
-
-<qandaentry id="faq.what.copyright">
-<question><para>What are the copyrights?</para></question>
-<answer>
-
-<para>Please see
-<ulink url="http://cygwin.com/license.html" /> for more information
-about Cygwin copyright and licensing.
-</para>
-
-</answer></qandaentry>
-</qandaset></sect1>
-
-</article>
diff --git a/winsup/doc/faq-setup.xml b/winsup/doc/faq-setup.xml
index 4daa39b37..8339b61f3 100644
--- a/winsup/doc/faq-setup.xml
+++ b/winsup/doc/faq-setup.xml
@@ -1,3 +1,10 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<qandadiv id="faq.setup">
+<title>Setting up Cygwin</title>
+
<!-- faq-setup.xml -->
<qandaentry id="faq.setup.setup">
<question><para>What is the recommended installation procedure?</para></question>
@@ -180,7 +187,7 @@ disk if you are paranoid.
<para>This should be safe, but only if Cygwin Setup is not substituted by
something malicious, and no mirror has been compromised.
</para>
-<para>See also <ulink url="http://cygwin.com/faq/faq.using.html#faq.using.bloda" />
+<para>See also <ulink url="http://cygwin.com/faq/faq.html#faq.using.bloda" />
for a list of applications that have been known, at one time or another, to
interfere with the normal functioning of Cygwin.
</para>
@@ -452,7 +459,7 @@ of Cygwin is as follows:
<orderedlist>
<listitem><para>If you have any Cygwin services running, remove by repeating
the instructions in <ulink
-url="http://cygwin.com/faq/faq.setup.html#faq.setup.uninstall-service" /> for
+url="http://cygwin.com/faq/faq.html#faq.setup.uninstall-service" /> for
all services that you installed. Common services that might have been
installed are <literal>sshd</literal>, <literal>cron</literal>,
<literal>cygserver</literal>, <literal>inetd</literal>, <literal>apache</literal>,
@@ -604,4 +611,5 @@ this up for Cygwin 1.7, we might add this information here.
except for the installation directory information stored there for the sake
of setup.exe. There's nothing left to manipulate anymore.
</para></answer></qandaentry>
+</qandadiv>
diff --git a/winsup/doc/faq-using.xml b/winsup/doc/faq-using.xml
index f478d84b6..1a0727ff6 100644
--- a/winsup/doc/faq-using.xml
+++ b/winsup/doc/faq-using.xml
@@ -1,3 +1,10 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<qandadiv id="faq.using">
+<title>Using Cygwin</title>
+
<!-- faq-problems.xml -->
<qandaentry id="faq.using.missing-dlls">
<question><para>Why can't my application locate cygncurses-8.dll? or cygintl-3.dll? or cygreadline6.dll? or ...?</para></question>
@@ -432,7 +439,7 @@ Can I bundle Cygwin with my product for free?
</para></question>
<answer><para>
Only if you comply with Cygwin's <ulink
-url="http://cygwin.com/license.html">license</ulink> very carefully. If you
+url="http://cygwin.com/licensing.html">license</ulink> very carefully. If you
choose to distribute cygwin1.dll, you must be willing to distribute the
exact source code used to build that copy of cygwin1.dll as per the
terms of the GPL. If you ship applications that link with cygwin1.dll,
@@ -621,7 +628,7 @@ of poorly written firewall-type software that causes things to break.
Note that with many of these products, simply disabling the firewall
does not remove these changes; it must be completely uninstalled.
</para>
-<para>See also <ulink url="http://cygwin.com/faq/faq.using.html#faq.using.bloda" />
+<para>See also <ulink url="http://cygwin.com/faq/faq.html#faq.using.bloda" />
for a list of applications that have been known, at one time or another, to
interfere with the normal functioning of Cygwin.
</para>
@@ -771,7 +778,7 @@ contents are exempt from scanning. In a default installation, this
would be <literal>C:\cygwin\bin</literal>. Obviously, this could be
exploited by a hostile non-Cygwin program, so do this at your own risk.
</para>
-<para>See also <ulink url="http://cygwin.com/faq/faq.using.html#faq.using.bloda" />
+<para>See also <ulink url="http://cygwin.com/faq/faq.html#faq.using.bloda" />
for a list of applications that have been known, at one time or another, to
interfere with the normal functioning of Cygwin.
</para>
@@ -1101,10 +1108,6 @@ IPv6-capable and that's why you see the "Address family not supported"
error message. Note, however, that the IPv6 stack on these systems
don't fully support all features of IPv6.</para>
-<para>There's also a very experimental IPv6 stack for Windows 2000, and
-Cygwin will try its best to support it, but it's not recommended to install
-it.</para>
-
<para>For more information about IPv6 on Windows and how to install the
IPv6 stack, see the <ulink url="http://www.microsoft.com/technet/network/ipv6/ipv6faq.mspx">Microsoft TechNet IPv6 FAQ article</ulink>
</para></answer></qandaentry>
@@ -1247,3 +1250,4 @@ such as virtual memory paging and file caching.</para>
difficult to make <literal>fork()</literal> work reliably.</para>
</answer>
</qandaentry>
+</qandadiv>
diff --git a/winsup/doc/faq-what.xml b/winsup/doc/faq-what.xml
index ff1134042..6960c687e 100644
--- a/winsup/doc/faq-what.xml
+++ b/winsup/doc/faq-what.xml
@@ -1,5 +1,12 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<qandadiv id="faq.about">
+<title>About Cygwin</title>
+
<!-- faq-what.xml -->
-<qandaentry id="faq.what">
+<qandaentry id="faq.what.what">
<question><para>What is it?</para></question>
<answer>
@@ -26,18 +33,17 @@ sad reason.
<question><para>What versions of Windows are supported?</para></question>
<answer>
-<para>Cygwin can be expected to run on all modern 32 bit versions of
-Windows This includes, as of the time of writing this, Windows 2000,
-Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008,
-Windows 7, Windows Server 2012, Windows 8, as well as the WOW64 32 bit
+<para>Cygwin can be expected to run on all modern versions of Windows.
+This includes, as of the time of writing this, Windows XP SP3, Windows
+Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows
+Server 2012, Windows 8. The 32 bit version also runs in the WOW64 32 bit
environment on released 64 bit versions of Windows
(XP/2003/Vista/2008/7/2008 R2/8/2012).
-A native 64 bit Cygwin version is in the works.
Since Cygwin is a community-supported free software project, patches to
provide support for other versions would be thoughtfully considered.
Paid support contracts or enhancements are available through Red Hat. For
information about getting a Red Hat support contract, see
-<ulink url="http://cygwin.com/license.html" />.
+<ulink url="http://cygwin.com/licensing.html" />.
</para>
<para>Keep in mind that Cygwin can only do as much as the underlying OS
supports. Because of this, Cygwin will behave differently, and
@@ -79,7 +85,7 @@ these tools.
<para>In particular, if you intend to port a proprietary (non-GPL'd)
application using Cygwin, you will need the proprietary-use license
for the Cygwin library. This is available for purchase from Red Hat;
-please visit <ulink url="http://cygwin.com/license.html" /> for more
+please visit <ulink url="http://cygwin.com/licensing.html" /> for more
information. All other questions should be sent to the public project
mailing list cygwin@cygwin.com.
</para>
@@ -153,4 +159,4 @@ function, so some email will have to go unanswered.
<para>Many thanks to everyone using the tools for their many contributions in
the form of advice, bug reports, and code fixes. Keep them coming!
</para></answer></qandaentry>
-
+</qandadiv>
diff --git a/winsup/doc/faq.xml b/winsup/doc/faq.xml
index a48783410..498558907 100644
--- a/winsup/doc/faq.xml
+++ b/winsup/doc/faq.xml
@@ -1,71 +1,21 @@
-<?xml version='1.0'?>
-<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- <!-- see http://www.unicode.org/charts/PDF/U0080.pdf -->
- <!ENTITY pound "&#x00A3;">
- <!ENTITY brokenpipe "&#x00A6;">
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
- <!-- all the files -->
- <!ENTITY FAQ-WHAT SYSTEM "faq-what.xml">
- <!ENTITY FAQ-SETUP SYSTEM "faq-setup.xml">
- <!ENTITY FAQ-RESOURCES SYSTEM "faq-resources.xml">
- <!ENTITY FAQ-USING SYSTEM "faq-using.xml">
- <!ENTITY FAQ-API SYSTEM "faq-api.xml">
- <!ENTITY FAQ-PROGRAMMING SYSTEM "faq-programming.xml">
-]>
-
-<article id="faq-nochunks" lang="en">
+<article id="faq" lang="en" xmlns:xi="http://www.w3.org/2001/XInclude">
<articleinfo>
<title>Cygwin FAQ</title>
</articleinfo>
-<qandaset>
-<?dbhtml toc="1"?>
-
-<qandadiv id="faq.about">
-<title>About Cygwin</title>
-&FAQ-WHAT;
-</qandadiv>
-
-<qandadiv id="faq.setup">
-<title>Setting up Cygwin</title>
-&FAQ-SETUP;
-</qandadiv>
-
-<qandadiv id="faq.resources">
-<title>Further Resources</title>
-&FAQ-RESOURCES;
-</qandadiv>
-
-<qandadiv id="faq.using">
-<title>Using Cygwin</title>
-&FAQ-USING;
-</qandadiv>
-
-<qandadiv id="faq.api">
-<title>Cygwin API Questions</title>
-&FAQ-API;
-</qandadiv>
-
-<qandadiv id="faq.programming">
-<title>Programming Questions</title>
-&FAQ-PROGRAMMING;
-</qandadiv>
-
-<qandadiv id="faq.copyright">
-<title>Copyright</title>
-
-<qandaentry id="faq.what.copyright">
-<question><para>What are the copyrights?</para></question>
-<answer>
-
-<para>Please see
-<ulink url="http://cygwin.com/license.html" /> for more information
-about Cygwin copyright and licensing.
-</para>
-
-</answer></qandaentry>
-</qandadiv>
-</qandaset>
-
+ <qandaset>
+ <?dbhtml toc="1"?>
+
+ <xi:include href="faq-what.xml"/>
+ <xi:include href="faq-setup.xml"/>
+ <xi:include href="faq-resources.xml"/>
+ <xi:include href="faq-using.xml"/>
+ <xi:include href="faq-api.xml"/>
+ <xi:include href="faq-programming.xml"/>
+ <xi:include href="faq-copyright.xml"/>
+ </qandaset>
</article>
diff --git a/winsup/doc/filemodes.sgml b/winsup/doc/filemodes.xml
index 2a644db51..e4cbd448f 100644
--- a/winsup/doc/filemodes.sgml
+++ b/winsup/doc/filemodes.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="using-filemodes"><title>File permissions</title>
<para>On FAT or FAT32 filesystems, files are always readable, and Cygwin
diff --git a/winsup/doc/gcc.sgml b/winsup/doc/gcc.xml
index 6a9d1055b..b9039db96 100644
--- a/winsup/doc/gcc.sgml
+++ b/winsup/doc/gcc.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="gcc"><title>Using GCC with Cygwin</title>
<sect2 id="gcc-cons"><title>Console Mode Applications</title>
diff --git a/winsup/doc/gdb.sgml b/winsup/doc/gdb.xml
index 42d31284c..af0c0dd8a 100644
--- a/winsup/doc/gdb.sgml
+++ b/winsup/doc/gdb.xml
@@ -1,3 +1,6 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<sect1 id="gdb"><title>Debugging Cygwin Programs</title>
diff --git a/winsup/doc/overview2.sgml b/winsup/doc/highlights.xml
index 81e55c47e..5de789a8c 100644
--- a/winsup/doc/overview2.sgml
+++ b/winsup/doc/highlights.xml
@@ -1,97 +1,6 @@
-<sect1 id="ov-ex-win">
-<title>Quick Start Guide for those more experienced with Windows</title>
-<para>
-If you are new to the world of UNIX, you may find it difficult to
-understand at first. This guide is not meant to be comprehensive,
-so we recommend that you use the many available Internet resources
-to become acquainted with UNIX basics (search for "UNIX basics" or
-"UNIX tutorial").
-</para>
-<para>
-To install a basic Cygwin environment, run the
-<command>setup.exe</command> program and click <literal>Next</literal>
-at each page. The default settings are correct for most users. If you
-want to know more about what each option means, see
-<xref linkend="internet-setup"></xref>. Use <command>setup.exe</command>
-any time you want to update or install a Cygwin package. If you are
-installing Cygwin for a specific purpose, use it to install the tools
-that you need. For example, if you want to compile C++ programs, you
-need the <systemitem>gcc-g++</systemitem> package and probably a text
-editor like <systemitem>nano</systemitem>. When running
-<command>setup.exe</command>, clicking on categories and packages in the
-package installation screen will provide you with the ability to control
-what is installed or updated.
-</para>
-<para>
-Another option is to install everything by clicking on the
-<literal>Default</literal> field next to the <literal>All</literal>
-category. However, be advised that this will download and install
-several hundreds of megabytes of software to your computer. The best
-plan is probably to click on individual categories and install either
-entire categories or packages from the categories themselves.
-After installation, you can find Cygwin-specific documentation in
-the <literal>/usr/share/doc/Cygwin/</literal> directory.
-</para>
-<para>
-Developers coming from a Windows background will be able to write
-console or GUI executables that rely on the Microsoft Win32 API instead
-of Cygwin using the mingw32 or mingw64 cross-compiler toolchains. The
-<command>-shared</command> option to GCC allows to write Windows Dynamically
-Linked Libraries (DLLs). The resource compiler <command>windres</command>
-is also provided.
-</para>
-</sect1>
-
-<sect1 id="ov-ex-unix">
-<title>Quick Start Guide for those more experienced with UNIX</title>
-<para>
-If you are an experienced UNIX user who misses a powerful command-line
-environment, you will enjoy Cygwin.
-Developers coming from a UNIX background will find a set of utilities
-they are already comfortable using, including a working UNIX shell. The
-compiler tools are the standard GNU compilers most people will have previously
-used under UNIX, only ported to the Windows host. Programmers wishing to port
-UNIX software to Windows NT will find that the Cygwin library provides
-an easy way to port many UNIX packages, with only minimal source code
-changes.
-</para>
-<para>
-Note that there are some workarounds that cause Cygwin to behave differently
-than most UNIX-like operating systems; these are described in more detail in
-<xref linkend="using-effectively"></xref>.
-</para>
-<para>
-Use the graphical command <command>setup.exe</command> any time you want
-to update or install a Cygwin package. This program must be run
-manually every time you want to check for updated packages since Cygwin
-does not currently include a mechanism for automatically detecting
-package updates.
-</para>
-<para>
-By default, <command>setup.exe</command> only installs a minimal subset of
-packages. Add any other packages by clicking on the <literal>+</literal>
-next to the Category name and selecting the package from the displayed
-list. You may search for specfic tools by using the
-<ulink url="http://cygwin.com/packages/">Setup Package Search</ulink>
-at the Cygwin web site.
-</para>
-<para>
-Another option is to install everything by clicking on the
-<literal>Default</literal> field next to the <literal>All</literal>
-category. However, be advised that this will download and install
-several hundreds of megabytes of software to your computer. The best
-plan is probably to click on individual categories and install either
-entire categories or packages from the categories themselves.
-After installation, you can find Cygwin-specific documentation in
-the <literal>/usr/share/doc/Cygwin/</literal> directory.
-</para>
-<para>
-For more information about what each option in
-<command>setup.exe</command> means, see <xref
-linkend="internet-setup"></xref>.
-</para>
-
-</sect1>
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<sect1 id="highlights"><title>Highlights of Cygwin Functionality</title>
@@ -204,30 +113,9 @@ supporting that. Since Windows XP, the OS only supports case
sensitivity when a specific registry value is changed. Therefore, case
sensitivity is not usually the default.</para>
-<para>Symbolic links are not present and supported on Windows up to and
-including Windows Server 2003 R2. Native symlinks are available starting
-with Windows Vista. Due to their strange implementation, however,
-they are not useful in a POSIX emulation layer. Cygwin recognizes
-native symlinks, but does not create them.</para>
-
-<para>Symbolic links are potentially created in two different ways.
-The file style symlinks are files containing a magic cookie followed by
-the path to which the link points. They are marked with the System DOS
-attribute so that only files with that attribute have to be read to
-determine whether or not the file is a symbolic link. The shortcut style
-symlinks are Windows shortcut files with a special header and the
-Readonly DOS attribute set. The advantage of file symlinks is speed,
-the advantage of shortcut symlinks is the fact that they can be utilized
-by non-Cygwin Win32 tools as well.</para>
-
-<para>Starting with Cygwin 1.7, symbolic links are using UTF-16 to encode
-the filename of the target file, to better support internationalization.
-Symlinks created by older Cygwin releases can be read just fine. However,
-you could run into problems with them if you're now using another character
-set than the one you used when creating these symlinks
-(see <xref linkend="setup-locale-problems"></xref>. Please note that this
-new UTF-16 style of symlinks is not compatible with older Cygwin release,
-which can't read the target filename correctly.</para>
+<para>Cygwin supports creating and reading symbolic links, even on Windows
+filesystems and OS versions which don't support them.
+See <xref linkend="pathnames-symlinks"></xref> for details.</para>
<para>Hard links are fully supported on NTFS and NFS file systems. On FAT
and other file systems which don't support hardlinks, the call returns with
@@ -383,7 +271,7 @@ location, Cygwin can do nothing to compensate (though it will
retry a few times automatically).</listitem>
<listitem>DLL injection by
-<ulink url="http://cygwin.com/faq/faq.using.html#faq.using.bloda">
+<ulink url="http://cygwin.com/faq/faq.html#faq.using.bloda">
BLODA</ulink>. Badly-behaved applications which
inject dlls into other processes often manage to clobber important
sections of the child's address space, leading to base address
diff --git a/winsup/doc/legal.sgml b/winsup/doc/legal.xml
index e3722af6a..f909f4915 100644
--- a/winsup/doc/legal.sgml
+++ b/winsup/doc/legal.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<legalnotice id="legal">
<para>Copyright &copy; 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.</para>
diff --git a/winsup/doc/new-features.sgml b/winsup/doc/new-features.xml
index ab0e452d1..8ae6858bf 100644
--- a/winsup/doc/new-features.sgml
+++ b/winsup/doc/new-features.xml
@@ -1,5 +1,45 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="ov-new1.7"><title>What's new and what changed in Cygwin 1.7</title>
+<sect2 id="ov-new1.7.19"><title>What's new and what changed from 1.7.18 to 1.7.19</title>
+
+<itemizedlist mark="bullet">
+
+<listitem><para>
+Drop support for Windows 2000 and Windows XP pre-SP3.
+</para></listitem>
+
+<listitem><para>
+Add support for building a 64 bit version of Cygwin on x86_64 natively.
+</para></listitem>
+
+<listitem><para>
+Add support for creating native NTFS symlinks starting with Windows Vista
+by setting the CYGWIN=winsymlinks:native or CYGWIN=winsymlinks:nativestrict
+option.
+</para></listitem>
+
+<listitem><para>
+Add support for AFS filesystem.
+</para></listitem>
+
+<listitem><para>
+Preliminary support for mandatory locking via fcntl/flock/lockf, using Windows
+locking semantics. New F_LCK_MANDATORY fcntl command.
+</para></listitem>
+
+<listitem><para>
+New APIs: __b64_ntop, __b64_pton, arc4random, arc4random_addrandom,
+arc4random_buf, arc4random_stir, arc4random_uniform.
+</para></listitem>
+
+</itemizedlist>
+
+</sect2>
+
<sect2 id="ov-new1.7.18"><title>What's new and what changed from 1.7.17 to 1.7.18</title>
<itemizedlist mark="bullet">
diff --git a/winsup/doc/ntsec.sgml b/winsup/doc/ntsec.xml
index 8804cceac..72cf7bb89 100644
--- a/winsup/doc/ntsec.sgml
+++ b/winsup/doc/ntsec.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="ntsec"><title>Using Windows security in Cygwin</title>
<para>This section discusses how the Windows security model is
@@ -497,7 +501,7 @@ OthersAllow: 110
</screen>
<para>Again: This works on all existing versions of Windows NT, at the
-time of writing from at least Windows 2000 up to Server 2008 R2. Only
+time of writing from at least Windows XP up to Server 2012. Only
the GUIs aren't able (or willing) to deal with that order.</para>
</sect2>
@@ -507,9 +511,9 @@ the GUIs aren't able (or willing) to deal with that order.</para>
<para>Since Windows XP, Windows users have been accustomed to the
"Switch User" feature, which switches the entire desktop to another user
while leaving the original user's desktop "suspended". Another Windows
-feature (since Windows 2000) is the "Run as..." context menu entry,
-which allows you to start an application using another user account when
-right-clicking on applications and shortcuts.</para>
+feature is the "Run as..." context menu entry, which allows you to start
+an application using another user account when right-clicking on applications
+and shortcuts.</para>
<para>On POSIX systems, this operation can be performed by processes
running under the privileged user accounts (usually the "root" user
diff --git a/winsup/doc/ov-ex-unix.xml b/winsup/doc/ov-ex-unix.xml
new file mode 100644
index 000000000..e1debabdd
--- /dev/null
+++ b/winsup/doc/ov-ex-unix.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<sect1 id="ov-ex-unix">
+<title>Quick Start Guide for those more experienced with UNIX</title>
+<para>
+If you are an experienced UNIX user who misses a powerful command-line
+environment, you will enjoy Cygwin.
+Developers coming from a UNIX background will find a set of utilities
+they are already comfortable using, including a working UNIX shell. The
+compiler tools are the standard GNU compilers most people will have previously
+used under UNIX, only ported to the Windows host. Programmers wishing to port
+UNIX software to Windows NT will find that the Cygwin library provides
+an easy way to port many UNIX packages, with only minimal source code
+changes.
+</para>
+<para>
+Note that there are some workarounds that cause Cygwin to behave differently
+than most UNIX-like operating systems; these are described in more detail in
+<xref linkend="using-effectively"></xref>.
+</para>
+<para>
+Use the graphical command <command>setup.exe</command> any time you want
+to update or install a Cygwin package. This program must be run
+manually every time you want to check for updated packages since Cygwin
+does not currently include a mechanism for automatically detecting
+package updates.
+</para>
+<para>
+By default, <command>setup.exe</command> only installs a minimal subset of
+packages. Add any other packages by clicking on the <literal>+</literal>
+next to the Category name and selecting the package from the displayed
+list. You may search for specfic tools by using the
+<ulink url="http://cygwin.com/packages/">Setup Package Search</ulink>
+at the Cygwin web site.
+</para>
+<para>
+Another option is to install everything by clicking on the
+<literal>Default</literal> field next to the <literal>All</literal>
+category. However, be advised that this will download and install
+several hundreds of megabytes of software to your computer. The best
+plan is probably to click on individual categories and install either
+entire categories or packages from the categories themselves.
+After installation, you can find Cygwin-specific documentation in
+the <literal>/usr/share/doc/Cygwin/</literal> directory.
+</para>
+<para>
+For more information about what each option in
+<command>setup.exe</command> means, see <xref
+linkend="internet-setup"></xref>.
+</para>
+
+</sect1>
diff --git a/winsup/doc/ov-ex-win.xml b/winsup/doc/ov-ex-win.xml
new file mode 100644
index 000000000..c9371a971
--- /dev/null
+++ b/winsup/doc/ov-ex-win.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<sect1 id="ov-ex-win">
+<title>Quick Start Guide for those more experienced with Windows</title>
+<para>
+If you are new to the world of UNIX, you may find it difficult to
+understand at first. This guide is not meant to be comprehensive,
+so we recommend that you use the many available Internet resources
+to become acquainted with UNIX basics (search for "UNIX basics" or
+"UNIX tutorial").
+</para>
+<para>
+To install a basic Cygwin environment, run the
+<command>setup.exe</command> program and click <literal>Next</literal>
+at each page. The default settings are correct for most users. If you
+want to know more about what each option means, see
+<xref linkend="internet-setup"></xref>. Use <command>setup.exe</command>
+any time you want to update or install a Cygwin package. If you are
+installing Cygwin for a specific purpose, use it to install the tools
+that you need. For example, if you want to compile C++ programs, you
+need the <systemitem>gcc-g++</systemitem> package and probably a text
+editor like <systemitem>nano</systemitem>. When running
+<command>setup.exe</command>, clicking on categories and packages in the
+package installation screen will provide you with the ability to control
+what is installed or updated.
+</para>
+<para>
+Another option is to install everything by clicking on the
+<literal>Default</literal> field next to the <literal>All</literal>
+category. However, be advised that this will download and install
+several hundreds of megabytes of software to your computer. The best
+plan is probably to click on individual categories and install either
+entire categories or packages from the categories themselves.
+After installation, you can find Cygwin-specific documentation in
+the <literal>/usr/share/doc/Cygwin/</literal> directory.
+</para>
+<para>
+Developers coming from a Windows background will be able to write
+console or GUI executables that rely on the Microsoft Win32 API instead
+of Cygwin using the mingw32 or mingw64 cross-compiler toolchains. The
+<command>-shared</command> option to GCC allows to write Windows Dynamically
+Linked Libraries (DLLs). The resource compiler <command>windres</command>
+is also provided.
+</para>
+</sect1>
diff --git a/winsup/doc/overview.sgml b/winsup/doc/overview.xml
index 3dce16707..f43a69719 100644
--- a/winsup/doc/overview.sgml
+++ b/winsup/doc/overview.xml
@@ -1,4 +1,9 @@
-<chapter id="overview"><title>Cygwin Overview</title>
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<chapter id="overview" xmlns:xi="http://www.w3.org/2001/XInclude">
+<title>Cygwin Overview</title>
<sect1 id="what-is-it"><title>What is it?</title>
@@ -8,7 +13,7 @@ Cygwin is a Linux-like environment for Windows. It consists of a DLL
providing substantial <ulink url="http://www.pasc.org/#POSIX">POSIX</ulink>
(Portable Operating System Interface) system call functionality, and a
collection of tools, which provide a Linux look and feel. The Cygwin DLL
-works with all x86 and AMD64 versions of Windows NT since Windows 2000.
+works with all x86 and AMD64 versions of Windows NT since Windows XP SP3.
The API follows the
<ulink url="http://www.opengroup.org/onlinepubs/009695399/nfindex.html">Single
Unix Specification</ulink> as much as possible, and then Linux practice.
@@ -29,8 +34,8 @@ distribution).
</para>
</sect1>
-DOCTOOL-INSERT-ov-ex-win
-DOCTOOL-INSERT-ov-ex-unix
+<xi:include href="ov-ex-win.xml"/>
+<xi:include href="ov-ex-unix.xml"/>
<sect1 id="are-free"><title>Are the Cygwin tools free software?</title>
@@ -108,15 +113,19 @@ have seen continuous development.
</para>
<para>
-The latest major improvement in this development is the 1.7 release in
+The biggest major improvement in this development is the 1.7 release in
2009, which dropped Windows 95/98/Me support in favor of using Windows
NT features more extensively. It adds a lot of new features like
case-sensitive filenames, NFS interoperability, IPv6 support and much
more.</para>
+<para>The latest big improvement is the 64 bit Cygwin DLL which
+allows to run natively on AMD64 Windows machines. The first release
+available in a 64 bit version is 1.7.19.</para>
+
</sect1>
-DOCTOOL-INSERT-highlights
-DOCTOOL-INSERT-ov-new1.7
+<xi:include href="highlights.xml"/>
+<xi:include href="new-features.xml"/>
</chapter>
diff --git a/winsup/doc/pathnames.sgml b/winsup/doc/pathnames.xml
index 96b0077af..3647253e2 100644
--- a/winsup/doc/pathnames.sgml
+++ b/winsup/doc/pathnames.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="using-pathnames"><title>Mapping path names</title>
<sect2 id="pathnames-intro"><title>Introduction</title>
@@ -351,6 +355,81 @@ the cygdrive prefix, use a distinct path prefix:</para>
</sect2>
+<sect2 id="pathnames-symlinks"><title>Symbolic links</title>
+
+<para>Symbolic links are not present and supported on Windows until Windows
+Vista/Server 2008, and then only on some filesystems. Since POSIX applications
+are rightfully expecting to use symlinks and the
+<literal>symlink(2)</literal> system call, Cygwin had to find a
+workaround for this Windows flaw.</para>
+
+<para>Cygwin creates symbolic links potentially in multiple different
+ways:</para>
+
+<itemizedlist mark="bullet">
+
+<listitem>
+<para>The default symlinks are plain files containing a magic cookie
+followed by the path to which the link points. They are marked with the
+DOS SYSTEM attribute so that only files with that attribute have to be
+read to determine whether or not the file is a symbolic link.</para>
+
+<note><para>Starting with Cygwin 1.7, symbolic links are using UTF-16 to encode
+the filename of the target file, to better support internationalization.
+Symlinks created by older Cygwin releases can be read just fine. However,
+you could run into problems with them if you're now using another character
+set than the one you used when creating these symlinks
+(see <xref linkend="setup-locale-problems"></xref>). Please note that this
+new UTF-16 style of symlinks is not compatible with older Cygwin release,
+which can't read the target filename correctly.</para></note>
+</listitem>
+
+<listitem>
+<para>The shortcut style symlinks are Windows <literal>.lnk</literal>
+shortcut files with a special header and the DOS READONLY attribute set.
+This symlink type is created if the environment variable
+<literal>CYGWIN</literal> (see <xref linkend="using-cygwinenv"></xref>)
+is set to contain the string <literal>winsymlinks</literal> or
+<literal>winsymlinks:lnk</literal>. On the MVFS filesystem, which does
+not support the DOS SYSTEM attribute, this is the one and only supported
+symlink type, independently from the <literal>winsymlinks</literal>
+setting.</para>
+</listitem>
+
+<listitem>
+<para>Native Windows symlinks are only created on Windows Vista/2008 and later,
+and only on filesystems supporting reparse points. Due to to their weird
+restrictions and behaviour, they are only created if the user
+explicitely requests creating them. This is done by setting the
+environment variable <literal>CYGWIN</literal> to contain the string
+<literal>winsymlinks:native</literal> or
+<literal>winsymlinks:nativestrict</literal>. For the difference between
+these two settings, see <xref linkend="using-cygwinenv"></xref>.
+On AFS, native symlinks are the only supported type of symlink due to
+AFS lacking support for DOS attributes. This is independent from the
+<literal>winsymlinks</literal> setting.</para>
+</listitem>
+
+<listitem>
+<para>On the NFS filesystem, Cygwin always creates real NFS symlinks.</para>
+</listitem>
+
+</itemizedlist>
+
+<para>All of the above four symlink types are recognized and used as symlinks
+under all circumstances. However, if the default plain file symlink type
+is lacking its DOS SYSTEM bit, or if the shortcut file is lacking the DOS
+READONLY attribute, they are not recognized as symlink.</para>
+
+<para>Apart from these four types, there's also a fifth type, which is
+recognized as symlink but never generated by Cygwin, directory
+junctions. This is an older reparse point type, supported by Windows
+since Windows 2000. Filesystem junctions on the other hand are not
+handled as symlinks, since otherwise they would not be recognized as
+filesystem borders by commands like <command>find -xdev</command>.</para>
+
+</sect2>
+
<sect2 id="pathnames-win32"><title>Using native Win32 paths</title>
<para>Using native Win32 paths in Cygwin, while possible, is generally
@@ -489,522 +568,3 @@ not by default, for example).</para>
</sect2>
</sect1>
-
-<sect1 id="using-specialnames"><title>Special filenames</title>
-
-<sect2 id="pathnames-etc"><title>Special files in /etc</title>
-
-<para>Certain files in Cygwin's <filename>/etc</filename> directory are
-read by Cygwin before the mount table has been established. The list
-of files is</para>
-
-<screen>
- /etc/fstab
- /etc/fstab.d/$USER
- /etc/passwd
- /etc/group
-</screen>
-
-<para>These file are read using native Windows NT functions which have
-no notion of Cygwin symlinks or POSIX paths. For that reason
-there are a few requirements as far as <filename>/etc</filename> is
-concerned.</para>
-
-<para>To access these files, the Cygwin DLL evaluates it's own full
-Windows path, strips off the innermost directory component and adds
-"\etc". Let's assume the Cygwin DLL is installed as
-<filename>C:\cygwin\bin\cygwin1.dll</filename>. First the DLL name as
-well as the innermost directory (<filename>bin</filename>) is stripped
-off: <filename>C:\cygwin\</filename>. Then "etc" and the filename to
-look for is attached: <filename>C:\cygwin\etc\fstab</filename>. So the
-/etc directory must be parallel to the directory in which the cygwin1.dll
-exists and <filename>/etc</filename> must not be a Cygwin symlink
-pointing to another directory. Consequentially none of the files from
-the above list, including the directory <filename>/etc/fstab.d</filename>
-is allowed to be a Cygwin symlink either.</para>
-
-<para>However, native NTFS symlinks and reparse points are transparent
-when accessing the above files so all these files as well as
-<filename>/etc</filename> itself may be NTFS symlinks or reparse
-points.</para>
-
-<para>Last but not least, make sure that these files are world-readable.
-Every process of any user account has to read these files potentially,
-so world-readability is essential. The only exception are the user
-specific files <filename>/etc/fstab.d/$USER</filename>, which only have
-to be readable by the $USER user account itself.</para>
-
-</sect2>
-
-<sect2 id="pathnames-dosdevices"><title>Invalid filenames</title>
-
-<para>Filenames invalid under Win32 are not necessarily invalid
-under Cygwin since release 1.7.0. There are a few rules which
-apply to Windows filenames. Most notably, DOS device names like
-<filename>AUX</filename>, <filename>COM1</filename>,
-<filename>LPT1</filename> or <filename>PRN</filename> (to name a few)
-cannot be used as filename or extension in a native Win32 application.
-So filenames like <filename>prn.txt</filename> or <filename>foo.aux</filename>
-are invalid filenames for native Win32 applications.</para>
-
-<para>This restriction doesn't apply to Cygwin applications. Cygwin
-can create and access files with such names just fine. Just don't try
-to use these files with native Win32 applications.</para>
-
-</sect2>
-
-<sect2 id="pathnames-specialchars">
-<title>Forbidden characters in filenames</title>
-
-<para>Some characters are disallowed in filenames on Windows filesystems.
-These forbidden characters are the ASCII control characters from ASCII
-value 1 to 31, plus the following characters which have a special meaning
-in the Win32 API:</para>
-
-<screen>
- " * : &lt; &gt; ? | \
-</screen>
-
-<para>Cygwin can't fix this, but it has a method to workaround this
-restriction. All of the above characters, except for the backslash,
-are converted to special UNICODE characters in the range 0xf000 to 0xf0ff
-(the "Private use area") when creating or accessing files.</para>
-
-<para>The backslash has to be exempt from this conversion, because Cygwin
-accepts Win32 filenames including backslashes as path separators on input.
-Converting backslashes using the above method would make this impossible.</para>
-
-<para>Additionally Win32 filenames can't contain trailing dots and spaces
-for DOS backward compatibility. When trying to create files with trailing
-dots or spaces, all of them are removed before the file is created. This
-restriction only affects native Win32 applications. Cygwin applications
-can create and access files with trailing dots and spaces without problems.
-</para>
-
-<para>An exception from this rule are some network filesystems (NetApp,
-NWFS) which choke on these filenames. They return with an error like
-"No such file or directory" when trying to create such files. Starting
-with Cygwin 1.7.6, Cygwin recognizes these filesystems and works around
-this problem by applying the same rule as for the other forbidden characters.
-Leading spaces and trailing dots and spaces will be converted to UNICODE
-characters in the private use area. This behaviour can be switched on
-explicitely for a filesystem or a directory tree by using the mount option
-<literal>dos</literal>.</para>
-
-</sect2>
-
-<sect2 id="pathnames-unusual">
-<title>Filenames with unusual (foreign) characters</title>
-
-<para> Windows filesystems use Unicode encoded as UTF-16
-to store filename information. If you don't use the UTF-8
-character set (see <xref linkend="setup-locale"></xref>) then there's a
-chance that a filename is using one or more characters which have no
-representation in the character set you're using.</para>
-
-<note><para>In the default "C" locale, Cygwin creates filenames using
-the UTF-8 charset. This will always result in some valid filename by
-default, but again might impose problems when switching to a non-"C"
-or non-"UTF-8" charset.</para></note>
-
-<note><para>To avoid this scenario altogether, always use UTF-8 as the
-character set.</para></note>
-
-<para>If you don't want or can't use UTF-8 as character set for whatever
-reason, you will nevertheless be able to access the file. How does that
-work? When Cygwin converts the filename from UTF-16 to your character
-set, it recognizes characters which can't be converted. If that occurs,
-Cygwin replaces the non-convertible character with a special character
-sequence. The sequence starts with an ASCII CAN character (hex code
-0x18, equivalent Control-X), followed by the UTF-8 representation of the
-character. The result is a filename containing some ugly looking
-characters. While it doesn't <emphasis role='bold'>look</emphasis> nice, it
-<emphasis role='bold'>is</emphasis> nice, because Cygwin knows how to convert
-this filename back to UTF-16. The filename will be converted using your
-usual character set. However, when Cygwin recognizes an ASCII CAN
-character, it skips over the ASCII CAN and handles the following bytes as
-a UTF-8 character. Thus, the filename is symmetrically converted back to
-UTF-16 and you can access the file.</para>
-
-<note><para>Please be aware that this method is not entirely foolproof.
-In some character set combinations it might not work for certain native
-characters.</para>
-
-<para>Only by using the UTF-8 charset you can avoid this problem safely.
-</para></note>
-
-</sect2>
-
-<sect2 id="pathnames-casesensitive">
-<title>Case sensitive filenames</title>
-
-<para>In the Win32 subsystem filenames are only case-preserved, but not
-case-sensitive. You can't access two files in the same directory which
-only differ by case, like <filename>Abc</filename> and
-<filename>aBc</filename>. While NTFS (and some remote filesystems)
-support case-sensitivity, the NT kernel starting with Windows XP does
-not support it by default. Rather, you have to tweak a registry setting
-and reboot. For that reason, case-sensitivity can not be supported by Cygwin,
-unless you change that registry value.</para>
-
-<para>If you really want case-sensitivity in Cygwin, you can switch it
-on by setting the registry value</para>
-
-<screen>
-HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive
-</screen>
-
-<para>to 0 and reboot the machine. For least surprise, Cygwin expects
-this registry value also on Windows 2000, which usually doesn't know this
-registry key. If you want case-sensitivity on Windows 2000, just create
-that registry value and set it to 0. <emphasis role='bold'>Only</emphasis>
-on Windows 2000 you don't have to reboot to bring it into effect, rather
-stopping all Cygwin processes and then restarting them is sufficient.</para>
-
-<note>
-<para>
-When installing Microsoft's Services For Unix (SFU), you're asked if
-you want to use case-sensitive filenames. If you answer "yes" at this point,
-the installer will change the aforementioned registry value to 0, too. So, if
-you have SFU installed, there's some chance that the registry value is already
-set to case sensitivity.
-</para>
-</note>
-
-<para>After you set this registry value to 0, Cygwin will be case-sensitive
-by default on NTFS and NFS filesystems. However, there are limitations:
-while two <emphasis role='bold'>programs</emphasis> <filename>Abc.exe</filename>
-and <filename>aBc.exe</filename> can be created and accessed like other files,
-starting applications is still case-insensitive due to Windows limitations
-and so the program you try to launch may not be the one actually started. Also,
-be aware that using two filenames which only differ by case might
-result in some weird interoperability issues with native Win32 applications.
-You're using case-sensitivity at your own risk. You have been warned! </para>
-
-<para>Even if you use case-sensitivity, it might be feasible to switch to
-case-insensitivity for certain paths for better interoperability with
-native Win32 applications (even if it's just Windows Explorer). You can do
-this on a per-mount point base, by using the "posix=0" mount option in
-<filename>/etc/fstab</filename>, or your <filename>/etc/fstab.d/$USER</filename>
-file.</para>
-
-<para><filename>/cygdrive</filename> paths are case-insensitive by default.
-The reason is that the native Windows %PATH% environment variable is not
-always using the correct case for all paths in it. As a result, if you use
-case-sensitivity on the <filename>/cygdrive</filename> prefix, your shell
-might claim that it can't find Windows commands like <command>attrib</command>
-or <command>net</command>. To ease the pain, the <filename>/cygdrive</filename>
-path is case-insensitive by default and you have to use the "posix=1" setting
-explicitly in <filename>/etc/fstab</filename> or
-<filename>/etc/fstab.d/$USER</filename> to switch it to case-sensitivity,
-or you have to make sure that the native Win32 %PATH% environment variable
-is using the correct case for all paths throughout.</para>
-
-<para>Note that mount points as well as device names and virtual
-paths like /proc are always case-sensitive! The only exception are
-the subdirectories and filenames under /proc/registry, /proc/registry32
-and /proc/registry64. Registry access is always case-insensitive.
-Read on for more information.</para>
-
-</sect2>
-
-<sect2 id="pathnames-posixdevices"> <title>POSIX devices</title>
-<para>While there is no need to create a POSIX <filename>/dev</filename>
-directory, the directory is automatically created as part of a Cygwin
-installation. It's existence is often a prerequisit to run certain
-applications which create symbolic links, fifos, or UNIX sockets in
-<filename>/dev</filename>. Also, the directories <filename>/dev/shm</filename>
-and <filename>/dev/mqueue</filename> are required to exist to use named POSIX
-semaphores, shared memory, and message queues, so a system without a real
-<filename>/dev</filename> directory is functionally crippled.
-</para>
-
-<para>Apart from that, Cygwin automatically simulates POSIX devices
-internally. Up to Cygwin 1.7.11, these devices couldn't be seen with the
-command <command>ls /dev/</command> although commands such as
-<command>ls /dev/tty</command> worked fine. Starting with Cygwin 1.7.12,
-the <filename>/dev</filename> directory is automagically populated with
-existing POSIX devices by Cygwin in a way comparable with a
-<ulink url="http://en.wikipedia.org/wiki/Udev">udev</ulink> based virtual
-<filename>/dev</filename> directory under Linux.</para>
-
-<para>
-Cygwin supports the following character devices commonly found on POSIX systems:
-</para>
-
-<screen>
-/dev/null
-/dev/zero
-/dev/full
-
-/dev/console Pseudo device name for the current console window of a session.
- Up to Cygwin 1.7.9, this was the only name for a console.
- Different consoles were indistinguishable.
- Cygwin's /dev/console is not quite comparable with the console
- device on UNIX machines.
-
-/dev/cons0 Starting with Cygwin 1.7.10, Console sessions are numbered from
-/dev/cons1 /dev/cons0 upwards. Console device names are pseudo device
-... names, only accessible from processes within this very console
- session. This is due to a restriction in Windows.
-
-/dev/tty The current controlling tty of a session.
-
-/dev/ptmx Pseudo tty master device.
-
-/dev/pty0 Pseudo ttys are numbered from /dev/pty0 upwards as they are
-/dev/pty1 requested.
-...
-
-/dev/ttyS0 Serial communication devices. ttyS0 == Win32 COM1,
-/dev/ttyS1 ttyS1 == COM2, etc.
-...
-
-/dev/pipe
-/dev/fifo
-
-/dev/mem The physical memory of the machine. Note that access to the
-/dev/port physical memory has been restricted with Windows Server 2003.
-/dev/kmem Since this OS, you can't access physical memory from user space.
-
-/dev/kmsg Kernel message pipe, for usage with sys logger services.
-
-/dev/random Random number generator.
-/dev/urandom
-
-/dev/dsp Default sound device of the system.
-</screen>
-
-<para>
-Cygwin also has several Windows-specific devices:
-</para>
-
-<screen>
-/dev/com1 The serial ports, starting with COM1 which is the same as ttyS0.
-/dev/com2 Please use /dev/ttySx instead.
-...
-
-/dev/conin Same as Windows CONIN$.
-/dev/conout Same as Windows CONOUT$.
-/dev/clipboard The Windows clipboard, text only
-/dev/windows The Windows message queue.
-</screen>
-
-<para>
-Block devices are accessible by Cygwin processes using fixed POSIX device
-names. These POSIX device names are generated using a direct conversion
-from the POSIX namespace to the internal NT namespace.
-E.g. the first harddisk is the NT internal device \device\harddisk0\partition0
-or the first partition on the third harddisk is \device\harddisk2\partition1.
-The first floppy in the system is \device\floppy0, the first CD-ROM is
-\device\cdrom0 and the first tape drive is \device\tape0.</para>
-
-<para>The mapping from physical device to the name of the device in the
-internal NT namespace can be found in various places. For hard disks and
-CD/DVD drives, the Windows "Disk Management" utility (part of the
-"Computer Management" console) shows that the mapping of "Disk 0" is
-\device\harddisk0. "CD-ROM 2" is \device\cdrom2. Another place to find
-this mapping is the "Device Management" console. Disks have a
-"Location" number, tapes have a "Tape Symbolic Name", etc.
-Unfortunately, the places where this information is found is not very
-well-defined.</para>
-
-<para>
-For external disks (USB-drives, CF-cards in a cardreader, etc) you can use
-Cygwin to show the mapping. <filename>/proc/partitions</filename>
-contains a list of raw drives known to Cygwin. The <command>df</command>
-command shows a list of drives and their respective sizes. If you match
-the information between <filename>/proc/partitions</filename> and the
-<command>df</command> output, you should be able to figure out which
-external drive corresponds to which raw disk device name.</para>
-
-<note><para>Apart from tape devices which are not block devices and are
-by default accessed directly, accessing mass storage devices raw
-is something you should only do if you know what you're doing and know how to
-handle the information. <emphasis role='bold'>Writing</emphasis> to a raw
-mass storage device you should only do if you
-<emphasis role='bold'>really</emphasis> know what you're doing and are aware
-of the fact that any mistake can destroy important information, for the
-device, and for you. So, please, handle this ability with care.
-<emphasis role='bold'>You have been warned.</emphasis></para></note>
-
-<para>
-Last but not least, the mapping from POSIX /dev namespace to internal
-NT namespace is as follows:
-</para>
-
-<screen>
-POSIX device name Internal NT device name
-
-/dev/st0 \device\tape0, rewind
-/dev/nst0 \device\tape0, no-rewind
-/dev/st1 \device\tape1
-/dev/nst1 \device\tape1
-...
-/dev/st15
-/dev/nst15
-
-/dev/fd0 \device\floppy0
-/dev/fd1 \device\floppy1
-...
-/dev/fd15
-
-/dev/sr0 \device\cdrom0
-/dev/sr1 \device\cdrom1
-...
-/dev/sr15
-
-/dev/scd0 \device\cdrom0
-/dev/scd1 \device\cdrom1
-...
-/dev/scd15
-
-/dev/sda \device\harddisk0\partition0 (whole disk)
-/dev/sda1 \device\harddisk0\partition1 (first partition)
-...
-/dev/sda15 \device\harddisk0\partition15 (fifteenth partition)
-
-/dev/sdb \device\harddisk1\partition0
-/dev/sdb1 \device\harddisk1\partition1
-
-[up to]
-
-/dev/sddx \device\harddisk127\partition0
-/dev/sddx1 \device\harddisk127\partition1
-...
-/dev/sddx15 \device\harddisk127\partition15
-</screen>
-
-<para>
-if you don't like these device names, feel free to create symbolic
-links as they are created on Linux systems for convenience:
-</para>
-
-<screen>
-ln -s /dev/sr0 /dev/cdrom
-ln -s /dev/nst0 /dev/tape
-...
-</screen>
-
-</sect2>
-
-<sect2 id="pathnames-exe"><title>The .exe extension</title>
-
-<para>Win32 executable filenames end with <filename>.exe</filename>
-but the <filename>.exe</filename> need not be included in the command,
-so that traditional UNIX names can be used. However, for programs that
-end in <filename>.bat</filename> and <filename>.com</filename>, you
-cannot omit the extension. </para>
-
-<para>As a side effect, the <command> ls filename</command> gives
-information about <filename>filename.exe</filename> if
-<filename>filename.exe</filename> exists and <filename>filename</filename>
-does not. In the same situation the function call
-<function>stat("filename",..)</function> gives information about
-<filename>filename.exe</filename>. The two files can be distinguished
-by examining their inodes, as demonstrated below.
-<screen>
-<prompt>bash$</prompt> <userinput>ls * </userinput>
-a a.exe b.exe
-<prompt>bash$</prompt> <userinput>ls -i a a.exe</userinput>
-445885548 a 435996602 a.exe
-<prompt>bash$</prompt> <userinput>ls -i b b.exe</userinput>
-432961010 b 432961010 b.exe
-</screen>
-If a shell script <filename>myprog</filename> and a program
-<filename>myprog.exe</filename> coexist in a directory, the shell
-script has precedence and is selected for execution of
-<command>myprog</command>. Note that this was quite the reverse up to
-Cygwin 1.5.19. It has been changed for consistency with the rest of Cygwin.
-</para>
-
-<para>The <command>gcc</command> compiler produces an executable named
-<filename>filename.exe</filename> when asked to produce
-<filename>filename</filename>. This allows many makefiles written
-for UNIX systems to work well under Cygwin.</para>
-
-</sect2>
-
-<sect2 id="pathnames-proc"><title>The /proc filesystem</title>
-<para>
-Cygwin, like Linux and other similar operating systems, supports the
-<filename>/proc</filename> virtual filesystem. The files in this
-directory are representations of various aspects of your system,
-for example the command <userinput>cat /proc/cpuinfo</userinput>
-displays information such as what model and speed processor you have.
-</para>
-<para>
-One unique aspect of the Cygwin <filename>/proc</filename> filesystem
-is <filename>/proc/registry</filename>, see next section.
-</para>
-<para>
-The Cygwin <filename>/proc</filename> is not as complete as the
-one in Linux, but it provides significant capabilities. The
-<systemitem>procps</systemitem> package contains several utilities
-that use it.
-</para>
-</sect2>
-
-<sect2 id="pathnames-proc-registry"><title>The /proc/registry filesystem</title>
-<para>
-The <filename>/proc/registry</filename> filesystem provides read-only
-access to the Windows registry. It displays each <literal>KEY</literal>
-as a directory and each <literal>VALUE</literal> as a file. As anytime
-you deal with the Windows registry, use caution since changes may result
-in an unstable or broken system. There are additionally subdirectories called
-<filename>/proc/registry32</filename> and <filename>/proc/registry64</filename>.
-They are identical to <filename>/proc/registry</filename> on 32 bit
-host OSes. On 64 bit host OSes, <filename>/proc/registry32</filename>
-opens the 32 bit processes view on the registry, while
-<filename>/proc/registry64</filename> opens the 64 bit processes view.
-</para>
-<para>
-Reserved characters ('/', '\', ':', and '%') or reserved names
-(<filename>.</filename> and <filename>..</filename>) are converted by
-percent-encoding:
-<screen>
-<prompt>bash$</prompt> <userinput>regtool list -v '\HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices'</userinput>
-...
-\DosDevices\C: (REG_BINARY) = cf a8 97 e8 00 08 fe f7
-...
-<prompt>bash$</prompt> <userinput>cd /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM</userinput>
-<prompt>bash$</prompt> <userinput>ls -l MountedDevices</userinput>
-...
--r--r----- 1 Admin SYSTEM 12 Dec 10 11:20 %5CDosDevices%5CC%3A
-...
-<prompt>bash$</prompt> <userinput>od -t x1 MountedDevices/%5CDosDevices%5CC%3A</userinput>
-0000000 cf a8 97 e8 00 08 fe f7 01 00 00 00
-</screen>
-The unnamed (default) value of a key can be accessed using the filename
-<filename>@</filename>.
-</para>
-<para>
-If a registry key contains a subkey and a value with the same name
-<filename>foo</filename>, Cygwin displays the subkey as
-<filename>foo</filename> and the value as <filename>foo%val</filename>.
-</para>
-</sect2>
-
-<sect2 id="pathnames-at"><title>The @pathnames</title>
-<para>To circumvent the limitations on shell line length in the native
-Windows command shells, Cygwin programs, when invoked by non-Cygwin processes, expand their arguments
-starting with "@" in a special way. If a file
-<filename>pathname</filename> exists, the argument
-<filename>@pathname</filename> expands recursively to the content of
-<filename>pathname</filename>. Double quotes can be used inside the
-file to delimit strings containing blank space.
-In the following example compare the behaviors
-<command>/bin/echo</command> when run from bash and from the Windows command prompt.</para>
-
-<example id="pathnames-at-ex"><title> Using @pathname</title>
-<screen>
-<prompt>bash$</prompt> <userinput>/bin/echo 'This is "a long" line' > mylist</userinput>
-<prompt>bash$</prompt> <userinput>/bin/echo @mylist</userinput>
-@mylist
-<prompt>bash$</prompt> <userinput>cmd</userinput>
-<prompt>c:\&gt;</prompt> <userinput>c:\cygwin\bin\echo @mylist</userinput>
-This is a long line
-</screen>
-</example>
-</sect2>
-</sect1>
diff --git a/winsup/doc/programming.sgml b/winsup/doc/programming.sgml
deleted file mode 100644
index 45f26f4fa..000000000
--- a/winsup/doc/programming.sgml
+++ /dev/null
@@ -1,11 +0,0 @@
-<chapter id="programming"><title>Programming with Cygwin</title>
-
-DOCTOOL-INSERT-gcc
-
-DOCTOOL-INSERT-gdb
-
-DOCTOOL-INSERT-dll
-
-DOCTOOL-INSERT-windres
-
-</chapter>
diff --git a/winsup/doc/programming.xml b/winsup/doc/programming.xml
new file mode 100644
index 000000000..4b65c4090
--- /dev/null
+++ b/winsup/doc/programming.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<chapter id="programming" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Programming with Cygwin</title>
+
+ <xi:include href="gcc.xml"/>
+ <xi:include href="gdb.xml"/>
+ <xi:include href="dll.xml"/>
+ <xi:include href="windres.xml"/>
+</chapter>
diff --git a/winsup/doc/setup-env.xml b/winsup/doc/setup-env.xml
new file mode 100644
index 000000000..ab3d50bdc
--- /dev/null
+++ b/winsup/doc/setup-env.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<sect1 id="setup-env"><title>Environment Variables</title>
+
+<sect2 id="setup-env-ov"><title>Overview</title>
+
+<para>
+All Windows environment variables are imported when Cygwin starts.
+Apart from that, you may wish to specify settings of several important
+environment variables that affect Cygwin's operation.</para>
+
+<para>
+The <envar>CYGWIN</envar> variable is used to configure a few global
+settings for the Cygwin runtime system. Typically you can leave
+<envar>CYGWIN</envar> unset, but if you want to set one ore more
+options, you can set it using a syntax like this, depending on the shell
+in which you're setting it. Here is an example in CMD syntax:</para>
+
+<screen>
+<prompt>C:\&gt;</prompt> <userinput>set CYGWIN=error_start:C:\cygwin\bin\gdb.exe glob</userinput>
+</screen>
+
+<para>
+This is, of course, just an example. For the recognized settings of the
+<envar>CYGWIN</envar> environment variable, see
+<xref linkend="using-cygwinenv"></xref>.
+</para>
+
+<para>
+Locale support is controlled by the <envar>LANG</envar> and
+<envar>LC_xxx</envar> environment variables. Since Cygwin 1.7.2, all of
+them are honored and have a meaning. For a more detailed description see
+<xref linkend="setup-locale"></xref>.
+</para>
+
+<para>
+The <envar>PATH</envar> environment variable is used by Cygwin
+applications as a list of directories to search for executable files
+to run. This environment variable is converted from Windows format
+(e.g. <filename>C:\Windows\system32;C:\Windows</filename>) to UNIX format
+(e.g., <filename>/cygdrive/c/Windows/system32:/cygdrive/c/Windows</filename>)
+when a Cygwin process first starts.
+Set it so that it contains at least the <filename>x:\cygwin\bin</filename>
+directory where "<filename>x:\cygwin</filename> is the "root" of your
+cygwin installation if you wish to use cygwin tools outside of bash.
+This is usually done by the batch file you're starting your shell with.
+</para>
+
+<para>
+The <envar>HOME</envar> environment variable is used by many programs to
+determine the location of your home directory and we recommend that it be
+defined. This environment variable is also converted from Windows format
+when a Cygwin process first starts. It's usually set in the shell
+profile scripts in the /etc directory.
+</para>
+
+<para>
+The <envar>TERM</envar> environment variable specifies your terminal
+type. It is automatically set to <literal>cygwin</literal> if you have
+not set it to something else.
+</para>
+
+<para>The <envar>LD_LIBRARY_PATH</envar> environment variable is used by
+the Cygwin function <function>dlopen ()</function> as a list of
+directories to search for .dll files to load. This environment variable
+is converted from Windows format to UNIX format when a Cygwin process
+first starts. Most Cygwin applications do not make use of the
+<function>dlopen ()</function> call and do not need this variable.
+</para>
+
+<para>
+In addition to <envar>PATH</envar>, <envar>HOME</envar>,
+and <envar>LD_LIBRARY_PATH</envar>, there are three other environment
+variables which, if they exist in the Windows environment, are
+converted to UNIX format: <envar>TMPDIR</envar>, <envar>TMP</envar>,
+and <envar>TEMP</envar>. The first is not set by default in the
+Windows environment but the other two are, and they point to the
+default Windows temporary directory. If set, these variables will be
+used by some Cygwin applications, possibly with unexpected results.
+You may therefore want to unset them by adding the following two lines
+to your <filename>~/.bashrc</filename> file:
+
+<screen>
+unset TMP
+unset TEMP
+</screen>
+
+This is done in the default <filename>~/.bashrc</filename> file.
+Alternatively, you could set <envar>TMP</envar>
+and <envar>TEMP</envar> to point to <filename>/tmp</filename> or to
+any other temporary directory of your choice. For example:
+
+<screen>
+export TMP=/tmp
+export TEMP=/tmp
+</screen>
+</para>
+
+</sect2>
+
+<sect2 id="setup-env-win32"><title>Restricted Win32 environment</title>
+
+<para>There is a restriction when calling Win32 API functions which
+require a fully set up application environment. Cygwin maintains its own
+environment in POSIX style. The Win32 environment is usually stripped
+to a bare minimum and not at all kept in sync with the Cygwin POSIX
+environment.</para>
+
+<para>If you need the full Win32 environment set up in a Cygwin process,
+you have to call</para>
+
+<screen>
+#include &lt;sys/cygwin.h&gt;
+
+cygwin_internal (CW_SYNC_WINENV);
+</screen>
+
+<para>to synchronize the Win32 environment with the Cygwin environment.
+Note that this only synchronizes the Win32 environment once with the
+Cygwin environment. Later changes using the <function>setenv</function>
+or <function>putenv</function> calls are not reflected in the Win32
+environment. In these cases, you have to call the aforementioned
+<function>cygwin_internal</function> call again.</para>
+
+</sect2>
+
+</sect1>
diff --git a/winsup/doc/setup-files.xml b/winsup/doc/setup-files.xml
new file mode 100644
index 000000000..3fc4d0ccb
--- /dev/null
+++ b/winsup/doc/setup-files.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<sect1 id="setup-files"><title>Customizing bash</title>
+
+<para>
+To set up bash so that cut and paste work properly, click on the
+"Properties" button of the window, then on the "Misc" tab. Make sure
+that "QuickEdit mode" and "Insert mode" are checked. These settings
+will be remembered next time you run bash from that shortcut. Similarly
+you can set the working directory inside the "Program" tab. The entry
+"%HOME%" is valid, but requires that you set <envar>HOME</envar> in
+the Windows environment.
+</para>
+
+<para>
+Your home directory should contain three initialization files
+that control the behavior of bash. They are
+<filename>.profile</filename>, <filename>.bashrc</filename> and
+<filename>.inputrc</filename>. The Cygwin base installation creates
+stub files when you start bash for the first time.</para>
+
+<para>
+<filename>.profile</filename> (other names are also valid, see the bash man
+page) contains bash commands. It is executed when bash is started as login
+shell, e.g. from the command <command>bash --login</command>.
+This is a useful place to define and
+export environment variables and bash functions that will be used by bash
+and the programs invoked by bash. It is a good place to redefine
+<envar>PATH</envar> if needed. We recommend adding a ":." to the end of
+<envar>PATH</envar> to also search the current working directory (contrary
+to DOS, the local directory is not searched by default). Also to avoid
+delays you should either <command>unset</command> <envar>MAILCHECK</envar>
+or define <envar>MAILPATH</envar> to point to your existing mail inbox.
+</para>
+
+<para>
+<filename>.bashrc</filename> is similar to
+<filename>.profile</filename> but is executed each time an interactive
+bash shell is launched. It serves to define elements that are not
+inherited through the environment, such as aliases. If you do not use
+login shells, you may want to put the contents of
+<filename>.profile</filename> as discussed above in this file
+instead.
+</para>
+
+<para>
+<screen>
+shopt -s nocaseglob
+</screen>
+will allow bash to glob filenames in a case-insensitive manner.
+Note that <filename>.bashrc</filename> is not called automatically for login
+shells. You can source it from <filename>.profile</filename>.
+</para>
+
+<para>
+<filename>.inputrc</filename> controls how programs using the readline
+library (including <command>bash</command>) behave. It is loaded
+automatically. For full details see the <literal>Function and Variable
+Index</literal> section of the GNU <systemitem>readline</systemitem> manual.
+Consider the following settings:
+<screen>
+# Ignore case while completing
+set completion-ignore-case on
+# Make Bash 8bit clean
+set meta-flag on
+set convert-meta off
+set output-meta on
+</screen>
+The first command makes filename completion case insensitive, which can
+be convenient in a Windows environment. The next three commands allow
+<command>bash</command> to display 8-bit characters, useful for
+languages with accented characters. Note that tools that do not use
+<systemitem>readline</systemitem> for display, such as
+<command>less</command> and <command>ls</command>, require additional
+settings, which could be put in your <filename>.bashrc</filename>:
+<screen>
+alias less='/bin/less -r'
+alias ls='/bin/ls -F --color=tty --show-control-chars'
+</screen>
+</para>
+
+</sect1>
+
diff --git a/winsup/doc/setup2.sgml b/winsup/doc/setup-locale.xml
index bafecef89..de0532f62 100644
--- a/winsup/doc/setup2.sgml
+++ b/winsup/doc/setup-locale.xml
@@ -1,191 +1,6 @@
-<sect1 id="setup-env"><title>Environment Variables</title>
-
-<sect2 id="setup-env-ov"><title>Overview</title>
-
-<para>
-All Windows environment variables are imported when Cygwin starts.
-Apart from that, you may wish to specify settings of several important
-environment variables that affect Cygwin's operation.</para>
-
-<para>
-The <envar>CYGWIN</envar> variable is used to configure a few global
-settings for the Cygwin runtime system. Typically you can leave
-<envar>CYGWIN</envar> unset, but if you want to set one ore more
-options, you can set it using a syntax like this, depending on the shell
-in which you're setting it. Here is an example in CMD syntax:</para>
-
-<screen>
-<prompt>C:\&gt;</prompt> <userinput>set CYGWIN=error_start:C:\cygwin\bin\gdb.exe glob</userinput>
-</screen>
-
-<para>
-This is, of course, just an example. For the recognized settings of the
-<envar>CYGWIN</envar> environment variable, see
-<xref linkend="using-cygwinenv"></xref>.
-</para>
-
-<para>
-Locale support is controlled by the <envar>LANG</envar> and
-<envar>LC_xxx</envar> environment variables. Since Cygwin 1.7.2, all of
-them are honored and have a meaning. For a more detailed description see
-<xref linkend="setup-locale"></xref>.
-</para>
-
-<para>
-The <envar>PATH</envar> environment variable is used by Cygwin
-applications as a list of directories to search for executable files
-to run. This environment variable is converted from Windows format
-(e.g. <filename>C:\Windows\system32;C:\Windows</filename>) to UNIX format
-(e.g., <filename>/cygdrive/c/Windows/system32:/cygdrive/c/Windows</filename>)
-when a Cygwin process first starts.
-Set it so that it contains at least the <filename>x:\cygwin\bin</filename>
-directory where "<filename>x:\cygwin</filename> is the "root" of your
-cygwin installation if you wish to use cygwin tools outside of bash.
-This is usually done by the batch file you're starting your shell with.
-</para>
-
-<para>
-The <envar>HOME</envar> environment variable is used by many programs to
-determine the location of your home directory and we recommend that it be
-defined. This environment variable is also converted from Windows format
-when a Cygwin process first starts. It's usually set in the shell
-profile scripts in the /etc directory.
-</para>
-
-<para>
-The <envar>TERM</envar> environment variable specifies your terminal
-type. It is automatically set to <literal>cygwin</literal> if you have
-not set it to something else.
-</para>
-
-<para>The <envar>LD_LIBRARY_PATH</envar> environment variable is used by
-the Cygwin function <function>dlopen ()</function> as a list of
-directories to search for .dll files to load. This environment variable
-is converted from Windows format to UNIX format when a Cygwin process
-first starts. Most Cygwin applications do not make use of the
-<function>dlopen ()</function> call and do not need this variable.
-</para>
-
-<para>
-In addition to <envar>PATH</envar>, <envar>HOME</envar>,
-and <envar>LD_LIBRARY_PATH</envar>, there are three other environment
-variables which, if they exist in the Windows environment, are
-converted to UNIX format: <envar>TMPDIR</envar>, <envar>TMP</envar>,
-and <envar>TEMP</envar>. The first is not set by default in the
-Windows environment but the other two are, and they point to the
-default Windows temporary directory. If set, these variables will be
-used by some Cygwin applications, possibly with unexpected results.
-You may therefore want to unset them by adding the following two lines
-to your <filename>~/.bashrc</filename> file:
-
-<screen>
-unset TMP
-unset TEMP
-</screen>
-
-This is done in the default <filename>~/.bashrc</filename> file.
-Alternatively, you could set <envar>TMP</envar>
-and <envar>TEMP</envar> to point to <filename>/tmp</filename> or to
-any other temporary directory of your choice. For example:
-
-<screen>
-export TMP=/tmp
-export TEMP=/tmp
-</screen>
-</para>
-
-</sect2>
-
-<sect2 id="setup-env-win32"><title>Restricted Win32 environment</title>
-
-<para>There is a restriction when calling Win32 API functions which
-require a fully set up application environment. Cygwin maintains its own
-environment in POSIX style. The Win32 environment is usually stripped
-to a bare minimum and not at all kept in sync with the Cygwin POSIX
-environment.</para>
-
-<para>If you need the full Win32 environment set up in a Cygwin process,
-you have to call</para>
-
-<screen>
-#include &lt;sys/cygwin.h&gt;
-
-cygwin_internal (CW_SYNC_WINENV);
-</screen>
-
-<para>to synchronize the Win32 environment with the Cygwin environment.
-Note that this only synchronizes the Win32 environment once with the
-Cygwin environment. Later changes using the <function>setenv</function>
-or <function>putenv</function> calls are not reflected in the Win32
-environment. In these cases, you have to call the aforementioned
-<function>cygwin_internal</function> call again.</para>
-
-</sect2>
-
-</sect1>
-
-<sect1 id="setup-maxmem"><title>Changing Cygwin's Maximum Memory</title>
-
-<para>
-Cygwin's heap is extensible. However, it does start out at a fixed size
-and attempts to extend it may run into memory which has been previously
-allocated by Windows. In some cases, this problem can be solved by
-changing a field in the file header which is utilized by Cygwin since
-version 1.7.10 to keep the initial size of the application heap. If the
-field contains 0, which is the default, the application heap defaults to
-a size of 384 Megabyte. If the field is set to any other value between 4 and
-2048, Cygwin tries to reserve as much Megabytes for the application heap.
-The field used for this is the "LoaderFlags" field in the NT-specific
-PE header structure (<literal>(IMAGE_NT_HEADER)->OptionalHeader.LoaderFlags</literal>).</para>
-
-<para>
-This value can be changed for any executable by using a more recent version
-of the <command>peflags</command> tool from the <literal>rebase</literal>
-Cygwin package. Example:
-
-<screen>
-$ peflags --cygwin-heap foo.exe
-foo.exe: initial Cygwin heap size: 0 (0x0) MB
-$ peflags --cygwin-heap=500 foo.exe
-foo.exe: initial Cygwin heap size: 500 (0x1f4) MB
-</screen>
-</para>
-
-<para>
-Heap memory can be allocated up to the size of the biggest available free
-block in the processes virtual memory (VM). By default, the VM per process
-is 2 GB for 32 processes. To get more VM for a process, the executable
-must have the "large address aware" flag set in the file header. You can
-use the aforementioned <command>peflags</command> tool to set this flag.
-On 64 bit systems this results in a 4 GB VM for a process started from that
-executable. On 32 bit systems you also have to prepare the system to allow
-up to 3 GB per process. See the Microsoft article
-<ulink url="http://msdn.microsoft.com/en-us/library/bb613473%28VS.85%29.aspx">4-Gigabyte Tuning</ulink>
-for more information.
-</para>
-
-<note>
-<para>
-Older Cygwin releases only supported a global registry setting to
-change the initial heap size for all Cygwin processes. This setting is
-not used anymore. However, if you're running an older Cygwin release
-than 1.7.10, you can add the <literal>DWORD</literal> value
-<literal>heap_chunk_in_mb</literal> and set it to the desired memory limit
-in decimal MB. You have to stop all Cygwin processes for this setting to
-have any effect. It is preferred to do this in Cygwin using the
-<command>regtool</command> program included in the Cygwin package.
-(see <xref linkend="regtool"></xref>) This example sets the memory limit
-to 1024 MB for all Cygwin processes (use HKCU instead of HKLM if you
-want to set this only for the current user):
-
-<screen>
-$ regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 1024
-$ regtool -v list /HKLM/Software/Cygwin
-</screen>
-</para>
-</note>
-
-</sect1>
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<sect1 id="setup-locale"><title>Internationalization</title>
@@ -615,85 +430,3 @@ of the "CPxxx" style charsets, always use them with the trailing "CP".</para>
</sect2>
</sect1>
-
-<sect1 id="setup-files"><title>Customizing bash</title>
-
-<para>
-To set up bash so that cut and paste work properly, click on the
-"Properties" button of the window, then on the "Misc" tab. Make sure
-that "QuickEdit mode" and "Insert mode" are checked. These settings
-will be remembered next time you run bash from that shortcut. Similarly
-you can set the working directory inside the "Program" tab. The entry
-"%HOME%" is valid, but requires that you set <envar>HOME</envar> in
-the Windows environment.
-</para>
-
-<para>
-Your home directory should contain three initialization files
-that control the behavior of bash. They are
-<filename>.profile</filename>, <filename>.bashrc</filename> and
-<filename>.inputrc</filename>. The Cygwin base installation creates
-stub files when you start bash for the first time.</para>
-
-<para>
-<filename>.profile</filename> (other names are also valid, see the bash man
-page) contains bash commands. It is executed when bash is started as login
-shell, e.g. from the command <command>bash --login</command>.
-This is a useful place to define and
-export environment variables and bash functions that will be used by bash
-and the programs invoked by bash. It is a good place to redefine
-<envar>PATH</envar> if needed. We recommend adding a ":." to the end of
-<envar>PATH</envar> to also search the current working directory (contrary
-to DOS, the local directory is not searched by default). Also to avoid
-delays you should either <command>unset</command> <envar>MAILCHECK</envar>
-or define <envar>MAILPATH</envar> to point to your existing mail inbox.
-</para>
-
-<para>
-<filename>.bashrc</filename> is similar to
-<filename>.profile</filename> but is executed each time an interactive
-bash shell is launched. It serves to define elements that are not
-inherited through the environment, such as aliases. If you do not use
-login shells, you may want to put the contents of
-<filename>.profile</filename> as discussed above in this file
-instead.
-</para>
-
-<para>
-<screen>
-shopt -s nocaseglob
-</screen>
-will allow bash to glob filenames in a case-insensitive manner.
-Note that <filename>.bashrc</filename> is not called automatically for login
-shells. You can source it from <filename>.profile</filename>.
-</para>
-
-<para>
-<filename>.inputrc</filename> controls how programs using the readline
-library (including <command>bash</command>) behave. It is loaded
-automatically. For full details see the <literal>Function and Variable
-Index</literal> section of the GNU <systemitem>readline</systemitem> manual.
-Consider the following settings:
-<screen>
-# Ignore case while completing
-set completion-ignore-case on
-# Make Bash 8bit clean
-set meta-flag on
-set convert-meta off
-set output-meta on
-</screen>
-The first command makes filename completion case insensitive, which can
-be convenient in a Windows environment. The next three commands allow
-<command>bash</command> to display 8-bit characters, useful for
-languages with accented characters. Note that tools that do not use
-<systemitem>readline</systemitem> for display, such as
-<command>less</command> and <command>ls</command>, require additional
-settings, which could be put in your <filename>.bashrc</filename>:
-<screen>
-alias less='/bin/less -r'
-alias ls='/bin/ls -F --color=tty --show-control-chars'
-</screen>
-</para>
-
-</sect1>
-
diff --git a/winsup/doc/setup-maxmem.xml b/winsup/doc/setup-maxmem.xml
new file mode 100644
index 000000000..1f5ee31a6
--- /dev/null
+++ b/winsup/doc/setup-maxmem.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<sect1 id="setup-maxmem"><title>Changing Cygwin's Maximum Memory</title>
+
+<para>
+Cygwin's heap is extensible. However, it does start out at a fixed size
+and attempts to extend it may run into memory which has been previously
+allocated by Windows. In some cases, this problem can be solved by
+changing a field in the file header which is utilized by Cygwin since
+version 1.7.10 to keep the initial size of the application heap. If the
+field contains 0, which is the default, the application heap defaults to
+a size of 384 Megabyte. If the field is set to any other value between 4 and
+2048, Cygwin tries to reserve as much Megabytes for the application heap.
+The field used for this is the "LoaderFlags" field in the NT-specific
+PE header structure (<literal>(IMAGE_NT_HEADER)->OptionalHeader.LoaderFlags</literal>).</para>
+
+<para>
+This value can be changed for any executable by using a more recent version
+of the <command>peflags</command> tool from the <literal>rebase</literal>
+Cygwin package. Example:
+
+<screen>
+$ peflags --cygwin-heap foo.exe
+foo.exe: initial Cygwin heap size: 0 (0x0) MB
+$ peflags --cygwin-heap=500 foo.exe
+foo.exe: initial Cygwin heap size: 500 (0x1f4) MB
+</screen>
+</para>
+
+<para>
+Heap memory can be allocated up to the size of the biggest available free
+block in the processes virtual memory (VM). By default, the VM per process
+is 2 GB for 32 processes. To get more VM for a process, the executable
+must have the "large address aware" flag set in the file header. You can
+use the aforementioned <command>peflags</command> tool to set this flag.
+On 64 bit systems this results in a 4 GB VM for a process started from that
+executable. On 32 bit systems you also have to prepare the system to allow
+up to 3 GB per process. See the Microsoft article
+<ulink url="http://msdn.microsoft.com/en-us/library/bb613473%28VS.85%29.aspx">4-Gigabyte Tuning</ulink>
+for more information.
+</para>
+
+<note>
+<para>
+Older Cygwin releases only supported a global registry setting to
+change the initial heap size for all Cygwin processes. This setting is
+not used anymore. However, if you're running an older Cygwin release
+than 1.7.10, you can add the <literal>DWORD</literal> value
+<literal>heap_chunk_in_mb</literal> and set it to the desired memory limit
+in decimal MB. You have to stop all Cygwin processes for this setting to
+have any effect. It is preferred to do this in Cygwin using the
+<command>regtool</command> program included in the Cygwin package.
+(see <xref linkend="regtool"></xref>) This example sets the memory limit
+to 1024 MB for all Cygwin processes (use HKCU instead of HKLM if you
+want to set this only for the current user):
+
+<screen>
+$ regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 1024
+$ regtool -v list /HKLM/Software/Cygwin
+</screen>
+</para>
+</note>
+
+</sect1>
diff --git a/winsup/doc/setup-net.sgml b/winsup/doc/setup-net.xml
index 4694eb330..877489b9c 100644
--- a/winsup/doc/setup-net.sgml
+++ b/winsup/doc/setup-net.xml
@@ -1,4 +1,9 @@
-<chapter id="setup-net"><title>Setting Up Cygwin</title>
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<chapter id="setup-net" xmlns:xi="http://www.w3.org/2001/XInclude">
+<title>Setting Up Cygwin</title>
<sect1 id="internet-setup">
<title>Internet Setup</title>
@@ -257,8 +262,8 @@ Problems with Cygwin</ulink>.
</sect1>
-DOCTOOL-INSERT-setup-env
-DOCTOOL-INSERT-setup-maxmem
-DOCTOOL-INSERT-setup-locale
-DOCTOOL-INSERT-setup-files
+<xi:include href="setup-env.xml"/>
+<xi:include href="setup-maxmem.xml"/>
+<xi:include href="setup-locale.xml"/>
+<xi:include href="setup-files.xml"/>
</chapter>
diff --git a/winsup/doc/setup.sgml b/winsup/doc/setup.sgml
deleted file mode 100644
index 1ba28abb5..000000000
--- a/winsup/doc/setup.sgml
+++ /dev/null
@@ -1,47 +0,0 @@
-<chapter id="setup"><title>Setting Up Cygwin</title>
-
-<sect1><title>Cygwin Contents</title>
-
-<para>The following packages are included in the native Win32
-release of GNUPro:</para>
-
-<para>GNUPro development tools: binutils, bison, byacc, dejagnu,
-diff, expect, flex, gas, gcc, gdb, itcl, ld, libstdc++, make, patch,
-tcl, tix, tk</para>
-
-<para>GNUPro unsupported tools: ash, bash, bzip2, diff, fileutils,
-findutils, gawk, grep, gzip, m4, sed, shellutils, tar, textutils,
-time</para>
-
-</sect1>
-
-<sect1 id="installing-binaries"><title>Installing the binary release</title>
-
-<para>Load the GNUPro CD-ROM and run the installer. It will
-take you through the installation process, starting with asking for
-your install location. Once the installation is complete, there will
-be a new Program Files folder that you can use to obtain a shell
-from which you can run the tools.</para>
-
-<para>There are two remaining thing you should do from this
-prompt. First, you need to type <command>mkdir -p /tmp</command> to
-ensure that a temp directory exists for programs that expect to find
-one there.</para>
-
-<para>Second, depending on how you intend to use the tools, various
-programs may need to be able to find `/bin/sh'. You should `mkdir -p
-/bin' and put a copy of `sh.exe' there, removing the older version, if
-present. Note that you can use the `mount' utility to select which
-drive letter is mounted as `/'.</para>
-
-<para>If you should ever want to uninstall the tools, you may do so
-via the "Add/Remove Programs" control panel.</para>
-
-</sect1>
-
-DOCTOOL-INSERT-setup-dir
-DOCTOOL-INSERT-setup-env
-DOCTOOL-INSERT-ntsec
-DOCTOOL-INSERT-setup-reg
-DOCTOOL-INSERT-setup-mount
-</chapter>
diff --git a/winsup/doc/specialnames.xml b/winsup/doc/specialnames.xml
new file mode 100644
index 000000000..71491deac
--- /dev/null
+++ b/winsup/doc/specialnames.xml
@@ -0,0 +1,517 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<sect1 id="using-specialnames"><title>Special filenames</title>
+
+<sect2 id="pathnames-etc"><title>Special files in /etc</title>
+
+<para>Certain files in Cygwin's <filename>/etc</filename> directory are
+read by Cygwin before the mount table has been established. The list
+of files is</para>
+
+<screen>
+ /etc/fstab
+ /etc/fstab.d/$USER
+ /etc/passwd
+ /etc/group
+</screen>
+
+<para>These file are read using native Windows NT functions which have
+no notion of Cygwin symlinks or POSIX paths. For that reason
+there are a few requirements as far as <filename>/etc</filename> is
+concerned.</para>
+
+<para>To access these files, the Cygwin DLL evaluates it's own full
+Windows path, strips off the innermost directory component and adds
+"\etc". Let's assume the Cygwin DLL is installed as
+<filename>C:\cygwin\bin\cygwin1.dll</filename>. First the DLL name as
+well as the innermost directory (<filename>bin</filename>) is stripped
+off: <filename>C:\cygwin\</filename>. Then "etc" and the filename to
+look for is attached: <filename>C:\cygwin\etc\fstab</filename>. So the
+/etc directory must be parallel to the directory in which the cygwin1.dll
+exists and <filename>/etc</filename> must not be a Cygwin symlink
+pointing to another directory. Consequentially none of the files from
+the above list, including the directory <filename>/etc/fstab.d</filename>
+is allowed to be a Cygwin symlink either.</para>
+
+<para>However, native NTFS symlinks and reparse points are transparent
+when accessing the above files so all these files as well as
+<filename>/etc</filename> itself may be NTFS symlinks or reparse
+points.</para>
+
+<para>Last but not least, make sure that these files are world-readable.
+Every process of any user account has to read these files potentially,
+so world-readability is essential. The only exception are the user
+specific files <filename>/etc/fstab.d/$USER</filename>, which only have
+to be readable by the $USER user account itself.</para>
+
+</sect2>
+
+<sect2 id="pathnames-dosdevices"><title>Invalid filenames</title>
+
+<para>Filenames invalid under Win32 are not necessarily invalid
+under Cygwin since release 1.7.0. There are a few rules which
+apply to Windows filenames. Most notably, DOS device names like
+<filename>AUX</filename>, <filename>COM1</filename>,
+<filename>LPT1</filename> or <filename>PRN</filename> (to name a few)
+cannot be used as filename or extension in a native Win32 application.
+So filenames like <filename>prn.txt</filename> or <filename>foo.aux</filename>
+are invalid filenames for native Win32 applications.</para>
+
+<para>This restriction doesn't apply to Cygwin applications. Cygwin
+can create and access files with such names just fine. Just don't try
+to use these files with native Win32 applications.</para>
+
+</sect2>
+
+<sect2 id="pathnames-specialchars">
+<title>Forbidden characters in filenames</title>
+
+<para>Some characters are disallowed in filenames on Windows filesystems.
+These forbidden characters are the ASCII control characters from ASCII
+value 1 to 31, plus the following characters which have a special meaning
+in the Win32 API:</para>
+
+<screen>
+ " * : &lt; &gt; ? | \
+</screen>
+
+<para>Cygwin can't fix this, but it has a method to workaround this
+restriction. All of the above characters, except for the backslash,
+are converted to special UNICODE characters in the range 0xf000 to 0xf0ff
+(the "Private use area") when creating or accessing files.</para>
+
+<para>The backslash has to be exempt from this conversion, because Cygwin
+accepts Win32 filenames including backslashes as path separators on input.
+Converting backslashes using the above method would make this impossible.</para>
+
+<para>Additionally Win32 filenames can't contain trailing dots and spaces
+for DOS backward compatibility. When trying to create files with trailing
+dots or spaces, all of them are removed before the file is created. This
+restriction only affects native Win32 applications. Cygwin applications
+can create and access files with trailing dots and spaces without problems.
+</para>
+
+<para>An exception from this rule are some network filesystems (NetApp,
+NWFS) which choke on these filenames. They return with an error like
+"No such file or directory" when trying to create such files. Starting
+with Cygwin 1.7.6, Cygwin recognizes these filesystems and works around
+this problem by applying the same rule as for the other forbidden characters.
+Leading spaces and trailing dots and spaces will be converted to UNICODE
+characters in the private use area. This behaviour can be switched on
+explicitely for a filesystem or a directory tree by using the mount option
+<literal>dos</literal>.</para>
+
+</sect2>
+
+<sect2 id="pathnames-unusual">
+<title>Filenames with unusual (foreign) characters</title>
+
+<para> Windows filesystems use Unicode encoded as UTF-16
+to store filename information. If you don't use the UTF-8
+character set (see <xref linkend="setup-locale"></xref>) then there's a
+chance that a filename is using one or more characters which have no
+representation in the character set you're using.</para>
+
+<note><para>In the default "C" locale, Cygwin creates filenames using
+the UTF-8 charset. This will always result in some valid filename by
+default, but again might impose problems when switching to a non-"C"
+or non-"UTF-8" charset.</para></note>
+
+<note><para>To avoid this scenario altogether, always use UTF-8 as the
+character set.</para></note>
+
+<para>If you don't want or can't use UTF-8 as character set for whatever
+reason, you will nevertheless be able to access the file. How does that
+work? When Cygwin converts the filename from UTF-16 to your character
+set, it recognizes characters which can't be converted. If that occurs,
+Cygwin replaces the non-convertible character with a special character
+sequence. The sequence starts with an ASCII CAN character (hex code
+0x18, equivalent Control-X), followed by the UTF-8 representation of the
+character. The result is a filename containing some ugly looking
+characters. While it doesn't <emphasis role='bold'>look</emphasis> nice, it
+<emphasis role='bold'>is</emphasis> nice, because Cygwin knows how to convert
+this filename back to UTF-16. The filename will be converted using your
+usual character set. However, when Cygwin recognizes an ASCII CAN
+character, it skips over the ASCII CAN and handles the following bytes as
+a UTF-8 character. Thus, the filename is symmetrically converted back to
+UTF-16 and you can access the file.</para>
+
+<note><para>Please be aware that this method is not entirely foolproof.
+In some character set combinations it might not work for certain native
+characters.</para>
+
+<para>Only by using the UTF-8 charset you can avoid this problem safely.
+</para></note>
+
+</sect2>
+
+<sect2 id="pathnames-casesensitive">
+<title>Case sensitive filenames</title>
+
+<para>In the Win32 subsystem filenames are only case-preserved, but not
+case-sensitive. You can't access two files in the same directory which
+only differ by case, like <filename>Abc</filename> and
+<filename>aBc</filename>. While NTFS (and some remote filesystems)
+support case-sensitivity, the NT kernel starting with Windows XP does
+not support it by default. Rather, you have to tweak a registry setting
+and reboot. For that reason, case-sensitivity can not be supported by Cygwin,
+unless you change that registry value.</para>
+
+<para>If you really want case-sensitivity in Cygwin, you can switch it
+on by setting the registry value</para>
+
+<screen>
+HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive
+</screen>
+
+<para>to 0 and reboot the machine.</para>
+
+<note>
+<para>
+When installing Microsoft's Services For Unix (SFU), you're asked if
+you want to use case-sensitive filenames. If you answer "yes" at this point,
+the installer will change the aforementioned registry value to 0, too. So, if
+you have SFU installed, there's some chance that the registry value is already
+set to case sensitivity.
+</para>
+</note>
+
+<para>After you set this registry value to 0, Cygwin will be case-sensitive
+by default on NTFS and NFS filesystems. However, there are limitations:
+while two <emphasis role='bold'>programs</emphasis> <filename>Abc.exe</filename>
+and <filename>aBc.exe</filename> can be created and accessed like other files,
+starting applications is still case-insensitive due to Windows limitations
+and so the program you try to launch may not be the one actually started. Also,
+be aware that using two filenames which only differ by case might
+result in some weird interoperability issues with native Win32 applications.
+You're using case-sensitivity at your own risk. You have been warned! </para>
+
+<para>Even if you use case-sensitivity, it might be feasible to switch to
+case-insensitivity for certain paths for better interoperability with
+native Win32 applications (even if it's just Windows Explorer). You can do
+this on a per-mount point base, by using the "posix=0" mount option in
+<filename>/etc/fstab</filename>, or your <filename>/etc/fstab.d/$USER</filename>
+file.</para>
+
+<para><filename>/cygdrive</filename> paths are case-insensitive by default.
+The reason is that the native Windows %PATH% environment variable is not
+always using the correct case for all paths in it. As a result, if you use
+case-sensitivity on the <filename>/cygdrive</filename> prefix, your shell
+might claim that it can't find Windows commands like <command>attrib</command>
+or <command>net</command>. To ease the pain, the <filename>/cygdrive</filename>
+path is case-insensitive by default and you have to use the "posix=1" setting
+explicitly in <filename>/etc/fstab</filename> or
+<filename>/etc/fstab.d/$USER</filename> to switch it to case-sensitivity,
+or you have to make sure that the native Win32 %PATH% environment variable
+is using the correct case for all paths throughout.</para>
+
+<para>Note that mount points as well as device names and virtual
+paths like /proc are always case-sensitive! The only exception are
+the subdirectories and filenames under /proc/registry, /proc/registry32
+and /proc/registry64. Registry access is always case-insensitive.
+Read on for more information.</para>
+
+</sect2>
+
+<sect2 id="pathnames-posixdevices"> <title>POSIX devices</title>
+<para>While there is no need to create a POSIX <filename>/dev</filename>
+directory, the directory is automatically created as part of a Cygwin
+installation. It's existence is often a prerequisit to run certain
+applications which create symbolic links, fifos, or UNIX sockets in
+<filename>/dev</filename>. Also, the directories <filename>/dev/shm</filename>
+and <filename>/dev/mqueue</filename> are required to exist to use named POSIX
+semaphores, shared memory, and message queues, so a system without a real
+<filename>/dev</filename> directory is functionally crippled.
+</para>
+
+<para>Apart from that, Cygwin automatically simulates POSIX devices
+internally. Up to Cygwin 1.7.11, these devices couldn't be seen with the
+command <command>ls /dev/</command> although commands such as
+<command>ls /dev/tty</command> worked fine. Starting with Cygwin 1.7.12,
+the <filename>/dev</filename> directory is automagically populated with
+existing POSIX devices by Cygwin in a way comparable with a
+<ulink url="http://en.wikipedia.org/wiki/Udev">udev</ulink> based virtual
+<filename>/dev</filename> directory under Linux.</para>
+
+<para>
+Cygwin supports the following character devices commonly found on POSIX systems:
+</para>
+
+<screen>
+/dev/null
+/dev/zero
+/dev/full
+
+/dev/console Pseudo device name for the current console window of a session.
+ Up to Cygwin 1.7.9, this was the only name for a console.
+ Different consoles were indistinguishable.
+ Cygwin's /dev/console is not quite comparable with the console
+ device on UNIX machines.
+
+/dev/cons0 Starting with Cygwin 1.7.10, Console sessions are numbered from
+/dev/cons1 /dev/cons0 upwards. Console device names are pseudo device
+... names, only accessible from processes within this very console
+ session. This is due to a restriction in Windows.
+
+/dev/tty The current controlling tty of a session.
+
+/dev/ptmx Pseudo tty master device.
+
+/dev/pty0 Pseudo ttys are numbered from /dev/pty0 upwards as they are
+/dev/pty1 requested.
+...
+
+/dev/ttyS0 Serial communication devices. ttyS0 == Win32 COM1,
+/dev/ttyS1 ttyS1 == COM2, etc.
+...
+
+/dev/pipe
+/dev/fifo
+
+/dev/mem The physical memory of the machine. Note that access to the
+/dev/port physical memory has been restricted with Windows Server 2003.
+/dev/kmem Since this OS, you can't access physical memory from user space.
+
+/dev/kmsg Kernel message pipe, for usage with sys logger services.
+
+/dev/random Random number generator.
+/dev/urandom
+
+/dev/dsp Default sound device of the system.
+</screen>
+
+<para>
+Cygwin also has several Windows-specific devices:
+</para>
+
+<screen>
+/dev/com1 The serial ports, starting with COM1 which is the same as ttyS0.
+/dev/com2 Please use /dev/ttySx instead.
+...
+
+/dev/conin Same as Windows CONIN$.
+/dev/conout Same as Windows CONOUT$.
+/dev/clipboard The Windows clipboard, text only
+/dev/windows The Windows message queue.
+</screen>
+
+<para>
+Block devices are accessible by Cygwin processes using fixed POSIX device
+names. These POSIX device names are generated using a direct conversion
+from the POSIX namespace to the internal NT namespace.
+E.g. the first harddisk is the NT internal device \device\harddisk0\partition0
+or the first partition on the third harddisk is \device\harddisk2\partition1.
+The first floppy in the system is \device\floppy0, the first CD-ROM is
+\device\cdrom0 and the first tape drive is \device\tape0.</para>
+
+<para>The mapping from physical device to the name of the device in the
+internal NT namespace can be found in various places. For hard disks and
+CD/DVD drives, the Windows "Disk Management" utility (part of the
+"Computer Management" console) shows that the mapping of "Disk 0" is
+\device\harddisk0. "CD-ROM 2" is \device\cdrom2. Another place to find
+this mapping is the "Device Management" console. Disks have a
+"Location" number, tapes have a "Tape Symbolic Name", etc.
+Unfortunately, the places where this information is found is not very
+well-defined.</para>
+
+<para>
+For external disks (USB-drives, CF-cards in a cardreader, etc) you can use
+Cygwin to show the mapping. <filename>/proc/partitions</filename>
+contains a list of raw drives known to Cygwin. The <command>df</command>
+command shows a list of drives and their respective sizes. If you match
+the information between <filename>/proc/partitions</filename> and the
+<command>df</command> output, you should be able to figure out which
+external drive corresponds to which raw disk device name.</para>
+
+<note><para>Apart from tape devices which are not block devices and are
+by default accessed directly, accessing mass storage devices raw
+is something you should only do if you know what you're doing and know how to
+handle the information. <emphasis role='bold'>Writing</emphasis> to a raw
+mass storage device you should only do if you
+<emphasis role='bold'>really</emphasis> know what you're doing and are aware
+of the fact that any mistake can destroy important information, for the
+device, and for you. So, please, handle this ability with care.
+<emphasis role='bold'>You have been warned.</emphasis></para></note>
+
+<para>
+Last but not least, the mapping from POSIX /dev namespace to internal
+NT namespace is as follows:
+</para>
+
+<screen>
+POSIX device name Internal NT device name
+
+/dev/st0 \device\tape0, rewind
+/dev/nst0 \device\tape0, no-rewind
+/dev/st1 \device\tape1
+/dev/nst1 \device\tape1
+...
+/dev/st15
+/dev/nst15
+
+/dev/fd0 \device\floppy0
+/dev/fd1 \device\floppy1
+...
+/dev/fd15
+
+/dev/sr0 \device\cdrom0
+/dev/sr1 \device\cdrom1
+...
+/dev/sr15
+
+/dev/scd0 \device\cdrom0
+/dev/scd1 \device\cdrom1
+...
+/dev/scd15
+
+/dev/sda \device\harddisk0\partition0 (whole disk)
+/dev/sda1 \device\harddisk0\partition1 (first partition)
+...
+/dev/sda15 \device\harddisk0\partition15 (fifteenth partition)
+
+/dev/sdb \device\harddisk1\partition0
+/dev/sdb1 \device\harddisk1\partition1
+
+[up to]
+
+/dev/sddx \device\harddisk127\partition0
+/dev/sddx1 \device\harddisk127\partition1
+...
+/dev/sddx15 \device\harddisk127\partition15
+</screen>
+
+<para>
+if you don't like these device names, feel free to create symbolic
+links as they are created on Linux systems for convenience:
+</para>
+
+<screen>
+ln -s /dev/sr0 /dev/cdrom
+ln -s /dev/nst0 /dev/tape
+...
+</screen>
+
+</sect2>
+
+<sect2 id="pathnames-exe"><title>The .exe extension</title>
+
+<para>Win32 executable filenames end with <filename>.exe</filename>
+but the <filename>.exe</filename> need not be included in the command,
+so that traditional UNIX names can be used. However, for programs that
+end in <filename>.bat</filename> and <filename>.com</filename>, you
+cannot omit the extension. </para>
+
+<para>As a side effect, the <command> ls filename</command> gives
+information about <filename>filename.exe</filename> if
+<filename>filename.exe</filename> exists and <filename>filename</filename>
+does not. In the same situation the function call
+<function>stat("filename",..)</function> gives information about
+<filename>filename.exe</filename>. The two files can be distinguished
+by examining their inodes, as demonstrated below.
+<screen>
+<prompt>bash$</prompt> <userinput>ls * </userinput>
+a a.exe b.exe
+<prompt>bash$</prompt> <userinput>ls -i a a.exe</userinput>
+445885548 a 435996602 a.exe
+<prompt>bash$</prompt> <userinput>ls -i b b.exe</userinput>
+432961010 b 432961010 b.exe
+</screen>
+If a shell script <filename>myprog</filename> and a program
+<filename>myprog.exe</filename> coexist in a directory, the shell
+script has precedence and is selected for execution of
+<command>myprog</command>. Note that this was quite the reverse up to
+Cygwin 1.5.19. It has been changed for consistency with the rest of Cygwin.
+</para>
+
+<para>The <command>gcc</command> compiler produces an executable named
+<filename>filename.exe</filename> when asked to produce
+<filename>filename</filename>. This allows many makefiles written
+for UNIX systems to work well under Cygwin.</para>
+
+</sect2>
+
+<sect2 id="pathnames-proc"><title>The /proc filesystem</title>
+<para>
+Cygwin, like Linux and other similar operating systems, supports the
+<filename>/proc</filename> virtual filesystem. The files in this
+directory are representations of various aspects of your system,
+for example the command <userinput>cat /proc/cpuinfo</userinput>
+displays information such as what model and speed processor you have.
+</para>
+<para>
+One unique aspect of the Cygwin <filename>/proc</filename> filesystem
+is <filename>/proc/registry</filename>, see next section.
+</para>
+<para>
+The Cygwin <filename>/proc</filename> is not as complete as the
+one in Linux, but it provides significant capabilities. The
+<systemitem>procps</systemitem> package contains several utilities
+that use it.
+</para>
+</sect2>
+
+<sect2 id="pathnames-proc-registry"><title>The /proc/registry filesystem</title>
+<para>
+The <filename>/proc/registry</filename> filesystem provides read-only
+access to the Windows registry. It displays each <literal>KEY</literal>
+as a directory and each <literal>VALUE</literal> as a file. As anytime
+you deal with the Windows registry, use caution since changes may result
+in an unstable or broken system. There are additionally subdirectories called
+<filename>/proc/registry32</filename> and <filename>/proc/registry64</filename>.
+They are identical to <filename>/proc/registry</filename> on 32 bit
+host OSes. On 64 bit host OSes, <filename>/proc/registry32</filename>
+opens the 32 bit processes view on the registry, while
+<filename>/proc/registry64</filename> opens the 64 bit processes view.
+</para>
+<para>
+Reserved characters ('/', '\', ':', and '%') or reserved names
+(<filename>.</filename> and <filename>..</filename>) are converted by
+percent-encoding:
+<screen>
+<prompt>bash$</prompt> <userinput>regtool list -v '\HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices'</userinput>
+...
+\DosDevices\C: (REG_BINARY) = cf a8 97 e8 00 08 fe f7
+...
+<prompt>bash$</prompt> <userinput>cd /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM</userinput>
+<prompt>bash$</prompt> <userinput>ls -l MountedDevices</userinput>
+...
+-r--r----- 1 Admin SYSTEM 12 Dec 10 11:20 %5CDosDevices%5CC%3A
+...
+<prompt>bash$</prompt> <userinput>od -t x1 MountedDevices/%5CDosDevices%5CC%3A</userinput>
+0000000 cf a8 97 e8 00 08 fe f7 01 00 00 00
+</screen>
+The unnamed (default) value of a key can be accessed using the filename
+<filename>@</filename>.
+</para>
+<para>
+If a registry key contains a subkey and a value with the same name
+<filename>foo</filename>, Cygwin displays the subkey as
+<filename>foo</filename> and the value as <filename>foo%val</filename>.
+</para>
+</sect2>
+
+<sect2 id="pathnames-at"><title>The @pathnames</title>
+<para>To circumvent the limitations on shell line length in the native
+Windows command shells, Cygwin programs, when invoked by non-Cygwin processes, expand their arguments
+starting with "@" in a special way. If a file
+<filename>pathname</filename> exists, the argument
+<filename>@pathname</filename> expands recursively to the content of
+<filename>pathname</filename>. Double quotes can be used inside the
+file to delimit strings containing blank space.
+In the following example compare the behaviors
+<command>/bin/echo</command> when run from bash and from the Windows command prompt.</para>
+
+<example id="pathnames-at-ex"><title> Using @pathname</title>
+<screen>
+<prompt>bash$</prompt> <userinput>/bin/echo 'This is "a long" line' > mylist</userinput>
+<prompt>bash$</prompt> <userinput>/bin/echo @mylist</userinput>
+@mylist
+<prompt>bash$</prompt> <userinput>cmd</userinput>
+<prompt>c:\&gt;</prompt> <userinput>c:\cygwin\bin\echo @mylist</userinput>
+This is a long line
+</screen>
+</example>
+</sect2>
+</sect1>
diff --git a/winsup/doc/textbinary.sgml b/winsup/doc/textbinary.xml
index 6e6e83025..112042f82 100644
--- a/winsup/doc/textbinary.sgml
+++ b/winsup/doc/textbinary.xml
@@ -1,3 +1,7 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<sect1 id="using-textbinary"><title>Text and Binary modes</title>
<sect2 id="textbin-issue"> <title>The Issue</title>
diff --git a/winsup/doc/ug-info.xml b/winsup/doc/ug-info.xml
new file mode 100644
index 000000000..c5b4a67c8
--- /dev/null
+++ b/winsup/doc/ug-info.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<bookinfo xmlns:xi="http://www.w3.org/2001/XInclude">
+ <date>2001-22-03</date>
+ <title>Cygwin User's Guide</title>
+ <authorgroup>
+ <author>
+ <firstname>Joshua Daniel</firstname>
+ <surname>Franklin</surname>
+ </author>
+ <author>
+ <firstname>Corinna</firstname>
+ <surname>Vinschen</surname>
+ </author>
+ <author>
+ <firstname>Christopher</firstname>
+ <surname>Faylor</surname>
+ </author>
+ <author>
+ <firstname>DJ</firstname>
+ <surname>Delorie</surname>
+ </author>
+ <author>
+ <firstname>Pierre</firstname>
+ <surname>Humblet</surname>
+ </author>
+ <author>
+ <firstname>Geoffrey</firstname>
+ <surname>Noer</surname>
+ </author>
+ </authorgroup>
+
+ <xi:include href="legal.xml"/>
+</bookinfo>
diff --git a/winsup/doc/using.sgml b/winsup/doc/using.sgml
deleted file mode 100644
index 4a802e6c8..000000000
--- a/winsup/doc/using.sgml
+++ /dev/null
@@ -1,25 +0,0 @@
-<chapter id="using"><title>Using Cygwin</title>
-
-<para>This chapter explains some key differences between the Cygwin
-environment and traditional UNIX systems. It assumes a working
-knowledge of standard UNIX commands.</para>
-
-DOCTOOL-INSERT-using-pathnames
-
-DOCTOOL-INSERT-using-textbinary
-
-DOCTOOL-INSERT-using-filemodes
-
-DOCTOOL-INSERT-using-specialnames
-
-DOCTOOL-INSERT-using-cygwinenv
-
-DOCTOOL-INSERT-ntsec
-
-DOCTOOL-INSERT-using-cygserver
-
-DOCTOOL-INSERT-using-utils
-
-DOCTOOL-INSERT-using-effectively
-
-</chapter>
diff --git a/winsup/doc/using.xml b/winsup/doc/using.xml
new file mode 100644
index 000000000..1795acccd
--- /dev/null
+++ b/winsup/doc/using.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<chapter id="using" xmlns:xi="http://www.w3.org/2001/XInclude">
+<title>Using Cygwin</title>
+
+<para>This chapter explains some key differences between the Cygwin
+environment and traditional UNIX systems. It assumes a working
+knowledge of standard UNIX commands.</para>
+
+ <xi:include href="pathnames.xml"/>
+ <xi:include href="textbinary.xml"/>
+ <xi:include href="filemodes.xml"/>
+ <xi:include href="specialnames.xml"/>
+ <xi:include href="cygwinenv.xml"/>
+ <xi:include href="ntsec.xml"/>
+ <xi:include href="cygserver.xml"/>
+ <xi:include href="../utils/utils.xml"/>
+ <xi:include href="effectively.xml"/>
+</chapter>
diff --git a/winsup/doc/windres.sgml b/winsup/doc/windres.xml
index 82c537dff..4b2a13ef7 100644
--- a/winsup/doc/windres.sgml
+++ b/winsup/doc/windres.xml
@@ -1,3 +1,6 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<sect1 id="windres"><title>Defining Windows Resources</title>
diff --git a/winsup/doc/xidepend b/winsup/doc/xidepend
new file mode 100755
index 000000000..2a1fc831d
--- /dev/null
+++ b/winsup/doc/xidepend
@@ -0,0 +1,34 @@
+#!/bin/sh
+if [ "$1" = "-r" ]
+then
+ # We're being called recursively by another xidepend instance, so
+ # suppress outputs that only happen at the top level.
+ shift
+ subproc=1
+else
+ subproc=0
+fi
+
+for f in "$@"
+do
+ if fgrep -q 'xi:include' "$f"
+ then
+ # This file uses XIncludes. Let's chase its deps recursively.
+ base=`basename "$f" .xml`
+ if [ $subproc -eq 0 ] ; then echo -n "$base/$base.html:" ; fi
+
+ deps=`grep 'xi:include.*href' "$f" | cut -f2 -d\" | tr '\n' ' '`
+ echo -n " $deps"
+ for d in $deps
+ do
+ # Call ourselves recursively to continue to collect deps.
+ # The -r flag tells our subprocess that it is merely
+ # contributing to a dependency line in progress.
+ $0 -r $d
+ done
+
+ # If we're at the top recursion level, we have nothing else to
+ # add to this dependency line other than the newline.
+ if [ $subproc -eq 0 ] ; then echo ; fi
+ fi
+done
diff --git a/winsup/lsaauth/ChangeLog b/winsup/lsaauth/ChangeLog
index 0632a8a17..bd0ecbd1c 100644
--- a/winsup/lsaauth/ChangeLog
+++ b/winsup/lsaauth/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details.
+
2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx>
* configure.ac: Rename from configure.in.
diff --git a/winsup/lsaauth/ChangeLog.64bit b/winsup/lsaauth/ChangeLog.64bit
new file mode 100644
index 000000000..32ef85710
--- /dev/null
+++ b/winsup/lsaauth/ChangeLog.64bit
@@ -0,0 +1,13 @@
+2013-02-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ * configure.ac: Skip check for i686-w64-mingw32-g++ on x86_64.
+ * configure: Regenerate.
+
+2013-02-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (target_cpu): Define. Check for target_cpu rather than
+ target_alias for conditional compilation issues.
+
+2013-02-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ * Makefile.in: Do not build or install 32bit DLL for 64bit target.
diff --git a/winsup/lsaauth/Makefile.in b/winsup/lsaauth/Makefile.in
index 8fbb2a45a..162e5aa0c 100644
--- a/winsup/lsaauth/Makefile.in
+++ b/winsup/lsaauth/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2008, 2009, 2011, 2012 Red Hat, Inc.
+# Copyright (c) 2006, 2008, 2009, 2011, 2012, 2013 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@ CFLAGS := @CFLAGS@
include $(srcdir)/../Makefile.common
+target_cpu:=@target_cpu@
+
WIN32_INCLUDES := -I. -I$(srcdir)
WIN32_CFLAGS := $(CFLAGS) $(WIN32_INCLUDES)
WIN32_LDFLAGS := $(CFLAGS) -nostdlib -Wl,-shared
@@ -46,9 +48,11 @@ WIN32_LDFLAGS := $(CFLAGS) -nostdlib -Wl,-shared
# not recognized by LSA.
LIBS := -ladvapi32 -lkernel32 -lntdll
+ifneq ($(target_cpu),x86_64)
DLL32 := cyglsa.dll
DEF32 := cyglsa.def
OBJ32 := cyglsa.o
+endif
DLL64 := cyglsa64.dll
DEF64 := cyglsa64.def
@@ -84,6 +88,8 @@ clean:
install: all
/bin/mkdir -p $(DESTDIR)$(bindir)
+ifneq ($(target_cpu),x86_64)
$(INSTALL_PROGRAM) $(DLL32) $(DESTDIR)$(bindir)/$(DLL32)
+endif
$(INSTALL_PROGRAM) $(DLL64) $(DESTDIR)$(bindir)/$(DLL64)
$(INSTALL_PROGRAM) $(srcdir)/cyglsa-config $(DESTDIR)$(bindir)/cyglsa-config
diff --git a/winsup/lsaauth/configure b/winsup/lsaauth/configure
index 240d14448..51e28587b 100755
--- a/winsup/lsaauth/configure
+++ b/winsup/lsaauth/configure
@@ -2838,7 +2838,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5
-for ac_prog in i686-w64-mingw32-gcc
+case "$target_cpu" in
+i?86)
+ for ac_prog in i686-w64-mingw32-gcc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -2880,6 +2882,10 @@ fi
test -n "$MINGW32_CC" && break
done
+ test -z "$MINGW32_CC" && as_fn_error $? "no acceptable mingw32 cc found in \$PATH" "$LINENO" 5
+ ;;
+esac
+
for ac_prog in x86_64-w64-mingw32-gcc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -2922,8 +2928,6 @@ fi
test -n "$MINGW64_CC" && break
done
-
-test -z "$MINGW32_CC" && as_fn_error $? "no acceptable mingw32 cc found in \$PATH" "$LINENO" 5
test -z "$MINGW64_CC" && as_fn_error $? "no acceptable mingw64 cc found in \$PATH" "$LINENO" 5
test "$program_prefix" != NONE &&
diff --git a/winsup/lsaauth/configure.ac b/winsup/lsaauth/configure.ac
index edc81e809..fe2e30bf0 100644
--- a/winsup/lsaauth/configure.ac
+++ b/winsup/lsaauth/configure.ac
@@ -25,10 +25,14 @@ AC_CANONICAL_SYSTEM
LIB_AC_PROG_CC
-AC_CHECK_PROGS(MINGW32_CC, i686-w64-mingw32-gcc)
-AC_CHECK_PROGS(MINGW64_CC, x86_64-w64-mingw32-gcc)
+case "$target_cpu" in
+i?86)
+ AC_CHECK_PROGS(MINGW32_CC, i686-w64-mingw32-gcc)
+ test -z "$MINGW32_CC" && AC_MSG_ERROR([no acceptable mingw32 cc found in \$PATH])
+ ;;
+esac
-test -z "$MINGW32_CC" && AC_MSG_ERROR([no acceptable mingw32 cc found in \$PATH])
+AC_CHECK_PROGS(MINGW64_CC, x86_64-w64-mingw32-gcc)
test -z "$MINGW64_CC" && AC_MSG_ERROR([no acceptable mingw64 cc found in \$PATH])
AC_ARG_PROGRAM
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 9eaa7dc0b..e67bb102a 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,21 @@
+2013-05-21 Corinna Vinschen <corinna@vinschen.de>
+
+ Reinstantiate accidentally removed patch from 2009-05-16:
+ * Makefile.in (cygpath.exe): Link against cygwin.a before linking
+ against ntdll.dll to avoid linking symbols defined in both DLLs
+ from ntdll.
+ (ps.exe): Ditto.
+
+2013-05-10 Warren Young <warren@etr-usa.com>
+
+ * utils.sgml utils.xml: Renamed utils.sgml to utils.xml, added
+ <?xml> and <!DOCTYPE> tags to the top, and formatted it. No
+ content change.
+
+2013-04-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details.
+
2013-02-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* Makefile.in (CYGWIN_LDFLAGS): Replace -static-lib* with -static.
diff --git a/winsup/utils/ChangeLog.64bit b/winsup/utils/ChangeLog.64bit
new file mode 100644
index 000000000..69c235672
--- /dev/null
+++ b/winsup/utils/ChangeLog.64bit
@@ -0,0 +1,85 @@
+2013-03-28 Peter Rosin <peda@lysator.liu.se>
+ Corinna Vinschen <corinna@vinschen.de>
+
+ * cygcheck.cc (dll_info): Fix crash due to sizeof(time_t) being not
+ equal to sizeof(int). Output timestamp RFC 3339 compatible.
+
+2013-03-26 Corinna Vinschen <corinna@vinschen.de>
+
+ * tzset.c (main): Don't try to overwrite space with NUL. Explain why.
+ Rather, just print the string with computed precision value.
+
+2013-03-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * kill.cc (main): Chack pid against INT_MIN and (U)INT_MAX since pid_t
+ is 4 byte on all platforms.
+ * mkgroup.c (main): Check domlist[i].id_offset against UINT_MAX since
+ DWORD is 4 byte on all platforms.
+ * mkpasswd.c (main): Ditto.
+
+2013-02-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygcheck.cc (dll_info): Handle x86_64 binaries. Make sure to print
+ only architecture matching cygcheck build, otherwise suffer path
+ evaluation problems.
+
+2013-02-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ Fix 64-bit type problems in dumper.exe
+ * dumper.cc: Througout, cast pid to unsigned int, change addresses
+ and sizes from DWORD to SIZE_T, and use %p for pointer addresses.
+ (dumper::add_mem_region): Change size type to SIZE_T.
+ (dumper::split_add_mem_region): Ditto.
+ * dumper.h (struct process_mem_region): Change size type to SIZE_T.
+ (class exclusion): Change last, size, and step types to size_t.
+ (exclusion::exclusion): Change argument type to size_t.
+ (exclusion::add): Change mem_size type to SIZE_T.
+ (dumper::add_mem_region): Change size type to SIZE_T.
+ (dumper::split_add_mem_region): Ditto.
+ (psapi_get_module_name): Change BaseAddress type to LPVOID.
+ * module_info.cc (psapi_get_module_name): Ditto.
+ * parse_pe.cc: Througout, change addresses and sizes from DWORD to
+ SIZE_T, and use %p for pointer addresses.
+ (exclusion::add): Change mem_size type to SIZE_T.
+
+2013-02-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * kill.cc (forcekill): Use unsigned int printf format specifier and
+ cast to avoid compiler warnings where DWORD value is used.
+ * regtool.cc: Ditto, throughout.
+
+2013-02-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * ldd.cc: Drop including inttypes.h. Use %u rather than PRIu32.
+ * mount.cc: Fix type problem with %* expression.
+ * cygcheck.cc: Ditto.
+
+2013-02-06 Corinna Vinschen <corinna@vinschen.de>
+
+ Throughout, fix type problems on 32 and 64 bit. Except:
+ * ssp.c: Disable entire functionality on x86_64 for now.
+
+2012-11-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * dump_setup.cc: Drop temporary workaround to handle older Mingw header
+ files on Fedora 17.
+ * strace.cc: Ditto.
+
+2012-08-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * ps.cc (main): Define uid correctly as uid_t.
+
+2012-08-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygcheck.cc: Change include path to not depend on installed
+ cygwin/version.h.
+ (_NOMNTENT_MACROS): Define before including mntent.h.
+ * path.cc (_NOMNTENT_MACROS): Ditto.
+ * dump_setup.cc: Add temporary workaround to handle older Mingw header
+ files on Fedora 17.
+ * strace.cc: Ditto.
+
+2012-08-13 Corinna Vinschen <corinna@vinschen.de>
+
+ * ps.cc (main): Drop unneeded cast.
+
diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in
index 93894e821..e42d748ce 100644
--- a/winsup/utils/Makefile.in
+++ b/winsup/utils/Makefile.in
@@ -90,8 +90,8 @@ cygcheck.exe: MINGW_LDFLAGS += ${ZLIB} -lpsapi -lntdll
cygcheck.exe: ${CYGCHECK_OBJS}
cygpath.o: CXXFLAGS += -fno-threadsafe-statics
-cygpath.exe: CYGWIN_LDFLAGS += -luserenv -lntdll
-ps.exe: CYGWIN_LDFLAGS += -lpsapi -lntdll
+cygpath.exe: CYGWIN_LDFLAGS += -lcygwin -luserenv -lntdll
+ps.exe: CYGWIN_LDFLAGS += -lcygwin -lpsapi -lntdll
strace.exe: MINGW_LDFLAGS += -lntdll
ldd.exe:CYGWIN_LDFLAGS += -lpsapi
diff --git a/winsup/utils/aclocal.m4 b/winsup/utils/aclocal.m4
index 5985aa9a1..b08bdfec5 100644
--- a/winsup/utils/aclocal.m4
+++ b/winsup/utils/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.12.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/winsup/utils/configure b/winsup/utils/configure
index 36248c9c0..76432e743 100755
--- a/winsup/utils/configure
+++ b/winsup/utils/configure
@@ -1,11 +1,9 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68.
+# Generated by GNU Autoconf 2.69.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -134,6 +132,31 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -211,21 +235,25 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
@@ -327,6 +355,14 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -448,6 +484,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
@@ -482,16 +522,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -503,28 +543,8 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -1108,8 +1128,6 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1353,9 +1371,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1446,7 +1464,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -1989,7 +2007,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2029,7 +2047,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2082,7 +2100,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2123,7 +2141,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -2181,7 +2199,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2225,7 +2243,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2747,8 +2765,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -2861,7 +2878,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2905,7 +2922,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3178,7 +3195,7 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -3253,7 +3270,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_MINGW_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3736,16 +3753,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -3805,28 +3822,16 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -3848,7 +3853,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -3901,10 +3906,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -3982,7 +3987,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index 2560b07f1..8c7af0e1c 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -1,7 +1,7 @@
/* cygcheck.cc
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -24,6 +24,7 @@
#include <getopt.h>
#include "../cygwin/include/cygwin/version.h"
#include "../cygwin/include/sys/cygwin.h"
+#define _NOMNTENT_MACROS
#include "../cygwin/include/mntent.h"
#include "../cygwin/cygprops.h"
#undef cygwin_internal
@@ -597,6 +598,28 @@ dll_info (const char *path, HANDLE fh, int lvl, int recurse)
int pe_header_offset = get_dword (fh, 0x3c);
if (GetLastError () != NO_ERROR)
display_error ("get_dword");
+ WORD arch = get_word (fh, pe_header_offset + 4);
+ if (GetLastError () != NO_ERROR)
+ display_error ("get_word");
+#ifdef __x86_64__
+ if (arch != IMAGE_FILE_MACHINE_AMD64)
+ {
+ fputc ('\n', stderr);
+ display_error ("Wrong architecture. Only x86_64 executables supported.",
+ false, false);
+ return;
+ }
+ int base_off = 108;
+#else
+ if (arch != IMAGE_FILE_MACHINE_I386)
+ {
+ fputc ('\n', stderr);
+ display_error ("Wrong architecture. Only ix86 executables supported.",
+ false, false);
+ return;
+ }
+ int base_off = 92;
+#endif
int opthdr_ofs = pe_header_offset + 4 + 20;
unsigned short v[6];
@@ -619,19 +642,19 @@ dll_info (const char *path, HANDLE fh, int lvl, int recurse)
else
printf ("\n");
- int num_entries = get_dword (fh, opthdr_ofs + 92);
+ int num_entries = get_dword (fh, opthdr_ofs + base_off + 0);
if (GetLastError () != NO_ERROR)
display_error ("get_dword");
- int export_rva = get_dword (fh, opthdr_ofs + 96);
+ int export_rva = get_dword (fh, opthdr_ofs + base_off + 4);
if (GetLastError () != NO_ERROR)
display_error ("get_dword");
- int export_size = get_dword (fh, opthdr_ofs + 100);
+ int export_size = get_dword (fh, opthdr_ofs + base_off + 8);
if (GetLastError () != NO_ERROR)
display_error ("get_dword");
- int import_rva = get_dword (fh, opthdr_ofs + 104);
+ int import_rva = get_dword (fh, opthdr_ofs + base_off + 12);
if (GetLastError () != NO_ERROR)
display_error ("get_dword");
- int import_size = get_dword (fh, opthdr_ofs + 108);
+ int import_size = get_dword (fh, opthdr_ofs + base_off + 16);
if (GetLastError () != NO_ERROR)
display_error ("get_dword");
@@ -667,17 +690,20 @@ dll_info (const char *path, HANDLE fh, int lvl, int recurse)
ExpDirectory *ed = (ExpDirectory *) exp;
int ofs = ed->name_rva - export_rva;
- struct tm *tm = localtime ((const time_t *) &(ed->timestamp));
- if (tm->tm_year < 60)
+ time_t ts = ed->timestamp; /* timestamp is only 4 bytes! */
+ struct tm *tm = localtime (&ts);
+ if (tm && tm->tm_year < 60)
tm->tm_year += 2000;
- if (tm->tm_year < 200)
+ if (tm && tm->tm_year < 200)
tm->tm_year += 1900;
printf ("%*c", lvl + 2, ' ');
- printf ("\"%s\" v%d.%d ts=", exp + ofs,
+ printf ("\"%s\" v%d.%d", exp + ofs,
ed->major_ver, ed->minor_ver);
- printf ("%d/%d/%d %d:%02d\n",
- tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
- tm->tm_hour, tm->tm_min);
+ if (tm)
+ printf (" ts=%04d-%02d-%02d %02d:%02d",
+ tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min);
+ putchar ('\n');
}
}
@@ -1115,7 +1141,7 @@ pretty_id ()
sz = -sz;
for (char **g = groups; g <= ng; g++)
if ((g != ng) && (++i < n))
- printf ("%*s", sz, *g);
+ printf ("%*s", (int) sz, *g);
else
{
puts (*g);
@@ -1691,7 +1717,7 @@ dump_sysinfo ()
{
for (e = s; *e && *e != sep; e++);
if (e-s)
- printf ("\t%.*s\n", e - s, s);
+ printf ("\t%.*s\n", (int) (e - s), s);
else
puts ("\t.");
count_path_items++;
@@ -2307,7 +2333,7 @@ nuke (char *ev)
}
extern "C" {
-unsigned long (*cygwin_internal) (int, ...);
+uintptr_t (*cygwin_internal) (int, ...);
WCHAR cygwin_dll_path[32768];
};
@@ -2319,10 +2345,11 @@ load_cygwin (int& argc, char **&argv)
if (!(h = LoadLibrary ("cygwin1.dll")))
return;
GetModuleFileNameW (h, cygwin_dll_path, 32768);
- if ((cygwin_internal = (DWORD (*) (int, ...)) GetProcAddress (h, "cygwin_internal")))
+ if ((cygwin_internal = (uintptr_t (*) (int, ...))
+ GetProcAddress (h, "cygwin_internal")))
{
char **av = (char **) cygwin_internal (CW_ARGV);
- if (av && ((DWORD) av != (DWORD) -1))
+ if (av && ((uintptr_t) av != (uintptr_t) -1))
{
/* Copy cygwin's idea of the argument list into this Window application. */
for (argc = 0; av[argc]; argc++)
@@ -2334,7 +2361,7 @@ load_cygwin (int& argc, char **&argv)
char **envp = (char **) cygwin_internal (CW_ENVP);
- if (envp && ((DWORD) envp != (DWORD) -1))
+ if (envp && ((uintptr_t) envp != (uintptr_t) -1))
{
/* Store path and revert to this value, otherwise path gets overwritten
by the POSIXy Cygwin variation, which breaks cygcheck.
diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc
index 8199aa4eb..50df44569 100644
--- a/winsup/utils/dumper.cc
+++ b/winsup/utils/dumper.cc
@@ -1,6 +1,6 @@
/* dumper.cc
- Copyright 1999, 2001, 2002, 2004, 2006, 2007, 2011 Red Hat Inc.
+ Copyright 1999, 2001, 2002, 2004, 2006, 2007, 2011, 2013 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@@ -84,7 +84,8 @@ dumper::dumper (DWORD pid, DWORD tid, const char *file_name)
pid);
if (!hProcess)
{
- fprintf (stderr, "Failed to open process #%lu, error %ld\n", pid, GetLastError ());
+ fprintf (stderr, "Failed to open process #%u, error %ld\n",
+ (unsigned int) pid, (long) GetLastError ());
return;
}
@@ -192,7 +193,7 @@ dumper::add_thread (DWORD tid, HANDLE hThread)
}
int
-dumper::add_mem_region (LPBYTE base, DWORD size)
+dumper::add_mem_region (LPBYTE base, SIZE_T size)
{
if (!sane ())
return 0;
@@ -209,14 +210,14 @@ dumper::add_mem_region (LPBYTE base, DWORD size)
new_entity->u.memory.base = base;
new_entity->u.memory.size = size;
- deb_printf ("added memory region %08x-%08x\n", (DWORD) base, (DWORD) base + size);
+ deb_printf ("added memory region %p-%p\n", base, base + size);
return 1;
}
/* split_add_mem_region scans list of regions to be excluded from dumping process
(excl_list) and removes all "excluded" parts from given region. */
int
-dumper::split_add_mem_region (LPBYTE base, DWORD size)
+dumper::split_add_mem_region (LPBYTE base, SIZE_T size)
{
if (!sane ())
return 0;
@@ -255,7 +256,7 @@ dumper::add_module (LPVOID base_address)
if (!sane ())
return 0;
- char *module_name = psapi_get_module_name (hProcess, (DWORD) base_address);
+ char *module_name = psapi_get_module_name (hProcess, base_address);
if (module_name == NULL)
return 1;
@@ -270,7 +271,7 @@ dumper::add_module (LPVOID base_address)
parse_pe (module_name, excl_list);
- deb_printf ("added module %08x %s\n", base_address, module_name);
+ deb_printf ("added module %p %s\n", base_address, module_name);
return 1;
}
@@ -284,8 +285,8 @@ dumper::collect_memory_sections ()
LPBYTE current_page_address;
LPBYTE last_base = (LPBYTE) 0xFFFFFFFF;
- DWORD last_size = 0;
- DWORD done;
+ SIZE_T last_size = (SIZE_T) 0;
+ SIZE_T done;
char mem_buf[PAGE_BUFFER_SIZE];
@@ -329,9 +330,9 @@ dumper::collect_memory_sections ()
for (int i = 0; i < 10; i++)
strcat (buf, pt[i]);
- deb_printf ("warning: failed to read memory at %08x-%08x (protect = %s), error %ld.\n",
- (DWORD) current_page_address,
- (DWORD) current_page_address + mbi.RegionSize,
+ deb_printf ("warning: failed to read memory at %p-%p (protect = %s), error %ld.\n",
+ current_page_address,
+ current_page_address + mbi.RegionSize,
buf, err);
skip_region_p = 1;
}
@@ -369,9 +370,9 @@ dumper::dump_memory_region (asection * to, process_mem_region * memory)
if (!sane ())
return 0;
- DWORD size = memory->size;
- DWORD todo;
- DWORD done;
+ SIZE_T size = memory->size;
+ SIZE_T todo;
+ SIZE_T done;
LPBYTE pos = memory->base;
DWORD sect_pos = 0;
@@ -516,12 +517,13 @@ dumper::collect_process_information ()
if (!DebugActiveProcess (pid))
{
- fprintf (stderr, "Cannot attach to process #%lu, error %ld", pid, GetLastError ());
+ fprintf (stderr, "Cannot attach to process #%u, error %ld",
+ (unsigned int) pid, (long) GetLastError ());
return 0;
}
char event_name[sizeof ("cygwin_error_start_event") + 20];
- sprintf (event_name, "cygwin_error_start_event%16lx", pid);
+ sprintf (event_name, "cygwin_error_start_event%16x", (unsigned int) pid);
HANDLE sync_with_debugee = OpenEvent (EVENT_MODIFY_STATE, FALSE, event_name);
DEBUG_EVENT current_event;
@@ -660,7 +662,7 @@ dumper::prepare_core_dump ()
char sect_name[50];
flagword sect_flags;
- DWORD sect_size;
+ SIZE_T sect_size;
bfd_vma sect_vma;
asection *new_section;
@@ -812,7 +814,7 @@ dumper::write_core_dump ()
if (p->section == NULL)
continue;
- deb_printf ("writing section type=%u base=%08x size=%08x flags=%08x\n",
+ deb_printf ("writing section type=%u base=%p size=%p flags=%08x\n",
p->type,
p->section->vma,
bfd_get_section_size (p->section),
@@ -936,7 +938,7 @@ main (int argc, char **argv)
DWORD tid = 0;
if (verbose)
- printf ("dumping process #%lu to %s\n", pid, core_file);
+ printf ("dumping process #%u to %s\n", (unsigned int) pid, core_file);
dumper d (pid, tid, core_file);
if (!d.sane ())
diff --git a/winsup/utils/dumper.h b/winsup/utils/dumper.h
index 4b8d2bdf7..b6c70308c 100644
--- a/winsup/utils/dumper.h
+++ b/winsup/utils/dumper.h
@@ -1,6 +1,6 @@
/* dumper.h
- Copyright 1999,2001 Red Hat Inc.
+ Copyright 1999, 2001, 2013 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@@ -28,7 +28,7 @@
typedef struct
{
LPBYTE base;
- DWORD size;
+ SIZE_T size;
} process_mem_region;
typedef struct
@@ -67,16 +67,16 @@ typedef struct _process_entity
class exclusion
{
public:
- int last;
- int size;
- int step;
+ size_t last;
+ size_t size;
+ size_t step;
process_mem_region* region;
- exclusion ( int step ) { last = size = 0;
- this->step = step;
- region = NULL; }
+ exclusion ( size_t step ) { last = size = 0;
+ this->step = step;
+ region = NULL; }
~exclusion () { free ( region ); }
- int add ( LPBYTE mem_base, DWORD mem_size );
+ int add ( LPBYTE mem_base, SIZE_T mem_size );
int sort_and_check ();
};
@@ -105,10 +105,10 @@ class dumper
process_entity* add_process_entity_to_list ( process_entity_type type );
int add_thread ( DWORD tid, HANDLE hThread );
- int add_mem_region ( LPBYTE base, DWORD size );
+ int add_mem_region ( LPBYTE base, SIZE_T size );
/* break mem_region by excl_list and add add all subregions */
- int split_add_mem_region ( LPBYTE base, DWORD size );
+ int split_add_mem_region ( LPBYTE base, SIZE_T size );
int add_module ( LPVOID base_address );
@@ -133,7 +133,7 @@ public:
extern int deb_printf ( const char* format, ... );
-extern char* psapi_get_module_name ( HANDLE hProcess, DWORD BaseAddress );
+extern char* psapi_get_module_name ( HANDLE hProcess, LPVOID BaseAddress );
extern int parse_pe ( const char* file_name, exclusion* excl_list );
diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc
index 486d273f9..edabff321 100644
--- a/winsup/utils/kill.cc
+++ b/winsup/utils/kill.cc
@@ -176,8 +176,8 @@ forcekill (int pid, int sig, int wait)
if (!wait || WaitForSingleObject (h, 200) != WAIT_OBJECT_0)
if (sig && !TerminateProcess (h, sig << 8)
&& WaitForSingleObject (h, 200) != WAIT_OBJECT_0)
- fprintf (stderr, "%s: couldn't kill pid %u, %lu\n",
- prog_name, (unsigned) dwpid, GetLastError ());
+ fprintf (stderr, "%s: couldn't kill pid %u, %u\n",
+ prog_name, (unsigned) dwpid, (unsigned int) GetLastError ());
CloseHandle (h);
}
@@ -260,13 +260,13 @@ out:
if (!pid)
pid = strtoll (*argv, &p, 10);
if (*p != '\0'
- || (!force && (pid < LONG_MIN || pid > LONG_MAX))
- || (force && (pid <= 0 || pid > ULONG_MAX)))
+ || (!force && (pid < INT_MIN || pid > INT_MAX))
+ || (force && (pid <= 0 || pid > UINT_MAX)))
{
fprintf (stderr, "%s: illegal pid: %s\n", prog_name, *argv);
ret = 1;
}
- else if (pid <= LONG_MAX && kill ((pid_t) pid, sig) == 0)
+ else if (pid <= INT_MAX && kill ((pid_t) pid, sig) == 0)
{
if (force)
forcekill ((pid_t) pid, sig, 1);
diff --git a/winsup/utils/ldd.cc b/winsup/utils/ldd.cc
index fa771b288..de98658bc 100644
--- a/winsup/utils/ldd.cc
+++ b/winsup/utils/ldd.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011 Chris Faylor
+/* Copyright (c) 2009, 2010, 2011, 2013 Chris Faylor
All rights reserved.
@@ -162,7 +162,8 @@ load_dll (const wchar_t *fn)
wchar_t *buf = get_module_filename (GetCurrentProcess (), NULL);
if (!buf)
{
- printf ("ldd: GetModuleFileName returned an error %lu\n", GetLastError ());
+ printf ("ldd: GetModuleFileName returned an error %u\n",
+ (unsigned int) GetLastError ());
exit (1); /* FIXME */
}
@@ -219,8 +220,9 @@ static int
set_entry_point_break ()
{
HMODULE hm;
- DWORD cb;
- if (!EnumProcessModules (hProcess, &hm, sizeof (hm), &cb) || !cb)
+ DWORD cbe;
+ SIZE_T cbw;
+ if (!EnumProcessModules (hProcess, &hm, sizeof (hm), &cbe) || !cbe)
set_errno_and_return (1);
MODULEINFO mi = {};
@@ -228,7 +230,7 @@ set_entry_point_break ()
set_errno_and_return (1);
static const unsigned char int3 = 0xcc;
- if (!WriteProcessMemory (hProcess, mi.EntryPoint, &int3, 1, &cb) || cb != 1)
+ if (!WriteProcessMemory (hProcess, mi.EntryPoint, &int3, 1, &cbw) || cbw != 1)
set_errno_and_return (1);
return 0;
}
@@ -485,13 +487,15 @@ map_file (const wchar_t *filename)
}
if (!(hMapping = CreateFileMapping (hFile, 0, PAGE_READONLY | SEC_COMMIT, 0, 0, 0)))
{
- fprintf (stderr, "CreateFileMapping failed with windows error %lu\n", GetLastError ());
+ fprintf (stderr, "CreateFileMapping failed with windows error %u\n",
+ (unsigned int) GetLastError ());
CloseHandle (hFile);
return 0;
}
if (!(basepointer = MapViewOfFile (hMapping, FILE_MAP_READ, 0, 0, 0)))
{
- fprintf (stderr, "MapViewOfFile failed with windows error %lu\n", GetLastError ());
+ fprintf (stderr, "MapViewOfFile failed with windows error %u\n",
+ (unsigned int) GetLastError ());
CloseHandle (hMapping);
CloseHandle (hFile);
return 0;
diff --git a/winsup/utils/locale.cc b/winsup/utils/locale.cc
index be57cf161..fadf3f3da 100644
--- a/winsup/utils/locale.cc
+++ b/winsup/utils/locale.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011 Corinna Vinschen
+ * Copyright (c) 2010, 2011, 2012, 2013 Corinna Vinschen
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -520,7 +520,7 @@ print_lc_sepstrings (int key, const char *name, const char *value)
}
else
{
- printf ("%.*s", c - value, value);
+ printf ("%.*s", (int) (c - value), value);
value = c + 1;
}
if (key)
diff --git a/winsup/utils/mkgroup.c b/winsup/utils/mkgroup.c
index b15c14844..05f5910b0 100644
--- a/winsup/utils/mkgroup.c
+++ b/winsup/utils/mkgroup.c
@@ -1,7 +1,7 @@
/* mkgroup.c:
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -18,6 +18,7 @@
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
+#include <inttypes.h>
#include <getopt.h>
#include <io.h>
#include <sys/fcntl.h>
@@ -62,9 +63,11 @@ _print_win_error (DWORD code, int line)
code,
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) buf, sizeof (buf), NULL))
- fprintf (stderr, "mkgroup (%d): [%lu] %s", line, code, buf);
+ fprintf (stderr, "mkgroup (%d): [%" PRIu32 "] %s",
+ line, (unsigned int) code, buf);
else
- fprintf (stderr, "mkgroup (%d): error %lu", line, code);
+ fprintf (stderr, "mkgroup (%d): error %" PRIu32 ,
+ line, (unsigned int) code);
}
static PWCHAR
@@ -104,7 +107,7 @@ put_sid (PSID psid)
strcat (s, t);
for (i = 0; i < *GetSidSubAuthorityCount (psid); ++i)
{
- sprintf(t, "-%lu", *GetSidSubAuthority (psid, i));
+ sprintf(t, "-%" PRIu32 , (unsigned int) *GetSidSubAuthority (psid, i));
strcat (s, t);
}
return s;
@@ -164,12 +167,12 @@ current_group (const char *sep, DWORD id_offset)
}
gid = *GetSidSubAuthority (curr_pgrp.psid,
*GetSidSubAuthorityCount(curr_pgrp.psid) - 1);
- printf ("%ls%s%ls:%s:%lu:\n",
+ printf ("%ls%s%ls:%s:%" PRIu32 ":\n",
sep ? dom : L"",
sep ?: "",
grp,
put_sid (curr_pgrp.psid),
- id_offset + gid);
+ (unsigned int) (id_offset + gid));
}
static void
@@ -225,14 +228,14 @@ enum_unix_groups (domlist_t *dom_or_machine, const char *sep, DWORD id_offset,
dom,
(dlen = MAX_DOMAIN_NAME_LEN + 1, &dlen),
&acc_type))
- printf ("%s%s%ls:%s:%lu:\n",
+ printf ("%s%s%ls:%s:%" PRIu32 ":\n",
with_dom ? "Unix Group" : "",
with_dom ? sep : "",
p,
put_sid (psid),
- id_offset +
+ (unsigned int) (id_offset +
*GetSidSubAuthority (psid,
- *GetSidSubAuthorityCount(psid) - 1));
+ *GetSidSubAuthorityCount(psid) - 1)));
}
else
{
@@ -262,12 +265,12 @@ enum_unix_groups (domlist_t *dom_or_machine, const char *sep, DWORD id_offset,
(dlen = MAX_DOMAIN_NAME_LEN + 1, &dlen),
&acc_type)
&& !iswdigit (grp[0]))
- printf ("%s%s%ls:%s:%lu:\n",
+ printf ("%s%s%ls:%s:%" PRIu32 ":\n",
with_dom ? "Unix Group" : "",
with_dom ? sep : "",
grp,
put_sid (psid),
- id_offset + start);
+ (unsigned int) (id_offset + start));
}
}
}
@@ -288,7 +291,7 @@ enum_local_groups (BOOL domain, domlist_t *dom_or_machine, const char *sep,
LOCALGROUP_INFO_0 *buffer;
DWORD entriesread = 0;
DWORD totalentries = 0;
- DWORD resume_handle = 0;
+ DWORD_PTR resume_handle = 0;
WCHAR gname[GNLEN + 1];
DWORD rc;
@@ -411,12 +414,12 @@ enum_local_groups (BOOL domain, domlist_t *dom_or_machine, const char *sep,
got_curr_pgrp = TRUE;
gid = *GetSidSubAuthority (psid, *GetSidSubAuthorityCount(psid) - 1);
- printf ("%ls%s%ls:%s:%ld:\n",
+ printf ("%ls%s%ls:%s:%" PRIu32 ":\n",
with_dom && !is_builtin ? domain_name : L"",
with_dom && !is_builtin ? sep : "",
buffer[i].lgrpi0_name,
put_sid (psid),
- gid + (is_builtin ? 0 : id_offset));
+ (unsigned int) (gid + (is_builtin ? 0 : id_offset)));
skip_group:
;
}
@@ -443,7 +446,7 @@ enum_groups (BOOL domain, domlist_t *dom_or_machine, const char *sep,
GROUP_INFO_2 *buffer;
DWORD entriesread = 0;
DWORD totalentries = 0;
- DWORD resume_handle = 0;
+ DWORD_PTR resume_handle = 0;
WCHAR gname[GNLEN + 1];
DWORD rc;
@@ -543,12 +546,12 @@ enum_groups (BOOL domain, domlist_t *dom_or_machine, const char *sep,
else if (EqualSid (curr_pgrp.psid, psid))
got_curr_pgrp = TRUE;
- printf ("%ls%s%ls:%s:%lu:\n",
+ printf ("%ls%s%ls:%s:%" PRIu32 ":\n",
with_dom ? domain_name : L"",
with_dom ? sep : "",
buffer[i].grpi2_name,
put_sid (psid),
- id_offset + gid);
+ (unsigned int) (id_offset + gid));
}
NetApiBufferFree (buffer);
@@ -591,7 +594,8 @@ print_special_by_sid (PSID_IDENTIFIER_AUTHORITY auth, BYTE cnt,
rid = sub2;
else
rid = sub1;
- printf ("%ls:%s:%lu:\n", grp, put_sid (psid), rid);
+ printf ("%ls:%s:%" PRIu32 ":\n", grp, put_sid (psid),
+ (unsigned int) rid);
}
FreeSid (psid);
}
@@ -797,7 +801,7 @@ main (int argc, char **argv)
}
if (!(domlist[print_domlist].str = opt))
print_system = 1;
- domlist[print_domlist].id_offset = ULONG_MAX;
+ domlist[print_domlist].id_offset = UINT32_MAX;
if (opt && (p = strchr (opt, ',')))
{
if (p == opt
@@ -884,7 +888,7 @@ skip:
for (i = 0; i < print_domlist; ++i)
{
DWORD my_off = (domlist[i].domain || domlist[i].str)
- ? domlist[i].id_offset != ULONG_MAX
+ ? domlist[i].id_offset != UINT_MAX
? domlist[i].id_offset : off : 0;
if (!enum_local_groups (domlist[i].domain, domlist + i, sep_char,
my_off, disp_groupname, print_builtin, print_current))
diff --git a/winsup/utils/mkpasswd.c b/winsup/utils/mkpasswd.c
index c16c86892..d080dbd70 100644
--- a/winsup/utils/mkpasswd.c
+++ b/winsup/utils/mkpasswd.c
@@ -1,7 +1,7 @@
/* mkpasswd.c:
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2009,
- 2010, 2011, 2012 Red Hat, Inc.
+ 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -18,6 +18,7 @@
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
+#include <inttypes.h>
#include <getopt.h>
#include <io.h>
#include <sys/fcntl.h>
@@ -62,9 +63,11 @@ _print_win_error(DWORD code, int line)
code,
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) buf, sizeof (buf), NULL))
- fprintf (stderr, "mkpasswd (%d): [%lu] %s", line, code, buf);
+ fprintf (stderr, "mkpasswd (%d): [%" PRIu32 "] %s",
+ line, (unsigned int) code, buf);
else
- fprintf (stderr, "mkpasswd (%d): error %lu", line, code);
+ fprintf (stderr, "mkpasswd (%d): error %" PRIu32,
+ line, (unsigned int) code);
}
static PWCHAR
@@ -104,7 +107,7 @@ put_sid (PSID sid)
strcat (s, t);
for (i = 0; i < *GetSidSubAuthorityCount (sid); ++i)
{
- sprintf(t, "-%lu", *GetSidSubAuthority (sid, i));
+ sprintf(t, "-%" PRIu32, (unsigned int) *GetSidSubAuthority (sid, i));
strcat (s, t);
}
return s;
@@ -192,12 +195,13 @@ current_user (const char *sep, const char *passed_home_path, DWORD id_offset,
homedir_psx[PATH_MAX - 1] = '\0';
}
- printf ("%ls%s%ls:unused:%lu:%lu:U-%ls\\%ls,%s:%s:/bin/bash\n",
+ printf ("%ls%s%ls:unused:%" PRIu32 ":%" PRIu32
+ ":U-%ls\\%ls,%s:%s:/bin/bash\n",
sep ? dom : L"",
sep ?: "",
user,
- id_offset + uid,
- id_offset + gid,
+ (unsigned int) (id_offset + uid),
+ (unsigned int) (id_offset + gid),
dom,
user,
put_sid (curr_user.psid),
@@ -257,13 +261,13 @@ enum_unix_users (domlist_t *dom_or_machine, const char *sep, DWORD id_offset,
dom,
(dlen = MAX_DOMAIN_NAME_LEN + 1, &dlen),
&acc_type))
- printf ("%s%s%ls:unused:%lu:99999:,%s::\n",
+ printf ("%s%s%ls:unused:%" PRIu32 ":99999:,%s::\n",
with_dom ? "Unix User" : "",
with_dom ? sep : "",
user + 10,
- id_offset +
+ (unsigned int) (id_offset +
*GetSidSubAuthority (psid,
- *GetSidSubAuthorityCount(psid) - 1),
+ *GetSidSubAuthorityCount(psid) - 1)),
put_sid (psid));
}
else
@@ -294,11 +298,11 @@ enum_unix_users (domlist_t *dom_or_machine, const char *sep, DWORD id_offset,
(dlen = MAX_DOMAIN_NAME_LEN + 1, &dlen),
&acc_type)
&& !iswdigit (user[0]))
- printf ("%s%s%ls:unused:%lu:99999:,%s::\n",
+ printf ("%s%s%ls:unused:%" PRIu32 ":99999:,%s::\n",
with_dom ? "Unix User" : "",
with_dom ? sep : "",
user,
- id_offset + start,
+ (unsigned int) (id_offset + start),
put_sid (psid));
}
}
@@ -435,12 +439,13 @@ enum_users (BOOL domain, domlist_t *dom_or_machine, const char *sep,
else if (EqualSid (curr_user.psid, psid))
got_curr_user = TRUE;
- printf ("%ls%s%ls:unused:%lu:%lu:%ls%sU-%ls\\%ls,%s:%s:/bin/bash\n",
+ printf ("%ls%s%ls:unused:%" PRIu32 ":%" PRIu32
+ ":%ls%sU-%ls\\%ls,%s:%s:/bin/bash\n",
with_dom ? domain_name : L"",
with_dom ? sep : "",
buffer[i].usri3_name,
- id_offset + uid,
- id_offset + gid,
+ (unsigned int) (id_offset + uid),
+ (unsigned int) (id_offset + gid),
buffer[i].usri3_full_name ?: L"",
buffer[i].usri3_full_name
&& buffer[i].usri3_full_name[0] ? "," : "",
@@ -473,7 +478,7 @@ print_special_by_sid (PSID_IDENTIFIER_AUTHORITY auth, BYTE cnt,
{
if (LookupAccountSidW (NULL, sid,
user, (len = UNLEN + 1, &len),
- dom, (len2 = MAX_DOMAIN_NAME_LEN + 1, &len),
+ dom, (len2 = MAX_DOMAIN_NAME_LEN + 1, &len2),
&acc_type))
{
if (sub8)
@@ -492,8 +497,9 @@ print_special_by_sid (PSID_IDENTIFIER_AUTHORITY auth, BYTE cnt,
rid = sub2;
else
rid = sub1;
- printf ("%ls:*:%lu:%lu:,%s::\n",
- user, rid, rid == 18 ? 544 : rid, /* SYSTEM hack */
+ printf ("%ls:*:%" PRIu32 ":%" PRIu32 ":,%s::\n",
+ user, (unsigned int) rid,
+ (unsigned int) (rid == 18 ? 544 : rid), /* SYSTEM hack */
put_sid (sid));
}
FreeSid (sid);
@@ -718,7 +724,7 @@ main (int argc, char **argv)
goto skip;
}
domlist[print_domlist].str = opt;
- domlist[print_domlist].id_offset = ULONG_MAX;
+ domlist[print_domlist].id_offset = UINT32_MAX;
if (opt && (p = strchr (opt, ',')))
{
if (p == opt
@@ -812,7 +818,7 @@ skip:
for (i = 0; i < print_domlist; ++i)
{
DWORD my_off = (domlist[i].domain || domlist[i].str)
- ? domlist[i].id_offset != ULONG_MAX
+ ? domlist[i].id_offset != UINT_MAX
? domlist[i].id_offset : off : 0;
if (!domlist[i].domain && domlist[i].str && print_unix)
enum_unix_users (domlist + i, sep_char, my_off, print_unix);
diff --git a/winsup/utils/module_info.cc b/winsup/utils/module_info.cc
index 8137991ca..12e74de39 100644
--- a/winsup/utils/module_info.cc
+++ b/winsup/utils/module_info.cc
@@ -1,6 +1,6 @@
/* module_info.cc
- Copyright 1999, 2000, 2001, 2010 Red Hat, Inc.
+ Copyright 1999, 2000, 2001, 2010, 2013 Red Hat, Inc.
Written by Egor Duda <deo@logos-m.ru>
@@ -33,7 +33,7 @@ static tf_GetModuleFileNameExA *psapi_GetModuleFileNameExA = NULL;
Uses psapi.dll. */
char *
-psapi_get_module_name (HANDLE hProcess, DWORD BaseAddress)
+psapi_get_module_name (HANDLE hProcess, LPVOID BaseAddress)
{
DWORD len;
MODULEINFO mi;
@@ -103,7 +103,7 @@ psapi_get_module_name (HANDLE hProcess, DWORD BaseAddress)
goto failed;
}
- if ((DWORD) (mi.lpBaseOfDll) == BaseAddress)
+ if (mi.lpBaseOfDll == BaseAddress)
{
free (DllHandle);
return strdup (name_buf);
diff --git a/winsup/utils/mount.cc b/winsup/utils/mount.cc
index 1a3add147..650266d3f 100644
--- a/winsup/utils/mount.cc
+++ b/winsup/utils/mount.cc
@@ -1,7 +1,7 @@
/* mount.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -22,9 +22,6 @@ details. */
#include <dirent.h>
#include "path.h"
-#ifdef errno
-#undef errno
-#endif
#include <errno.h>
#define NT_MAX_PATH 32768
@@ -104,7 +101,7 @@ do_mount (const char *dev, const char *where, int flags)
fprintf (stderr,
"%s: defaulting to 'notexec' mount option for speed since native path\n"
"%*creferences a remote share. Use '-f' option to override.\n",
- progname, strlen(progname) + 2, ' ');
+ progname, (int) strlen(progname) + 2, ' ');
flags |= MOUNT_NOTEXEC;
}
}
diff --git a/winsup/utils/parse_pe.cc b/winsup/utils/parse_pe.cc
index 30043f6a6..c3ae7bb11 100644
--- a/winsup/utils/parse_pe.cc
+++ b/winsup/utils/parse_pe.cc
@@ -1,6 +1,6 @@
/* parse_pe.cc
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2012 Red Hat, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2012, 2013 Red Hat, Inc.
Written by Egor Duda <deo@logos-m.ru>
@@ -28,7 +28,7 @@
#include "dumper.h"
int
-exclusion::add (LPBYTE mem_base, DWORD mem_size)
+exclusion::add (LPBYTE mem_base, SIZE_T mem_size)
{
while (last >= size)
size += step;
@@ -62,7 +62,7 @@ exclusion::sort_and_check ()
continue;
if (p->base + size > q->base)
{
- fprintf (stderr, "region error @ (%8p + %d) > %8p\n", p->base, size, q->base);
+ fprintf (stderr, "region error @ (%p + %zd) > %p\n", p->base, size, q->base);
return 0;
}
}
@@ -77,7 +77,7 @@ select_data_section (bfd * abfd, asection * sect, PTR obj)
if ((sect->flags & (SEC_CODE | SEC_DEBUGGING)) &&
sect->vma && bfd_get_section_size (sect))
{
- excl_list->add ((LPBYTE) sect->vma, (DWORD) bfd_get_section_size (sect));
+ excl_list->add ((LPBYTE) sect->vma, (SIZE_T) bfd_get_section_size (sect));
deb_printf ("excluding section: %20s %08lx\n", sect->name,
bfd_get_section_size (sect));
}
diff --git a/winsup/utils/passwd.c b/winsup/utils/passwd.c
index 59a2d73ff..ea3e2d159 100644
--- a/winsup/utils/passwd.c
+++ b/winsup/utils/passwd.c
@@ -1,7 +1,7 @@
/* passwd.c: Changing passwords and managing account information
- Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2008, 2009, 2011, 2012 Red
- Hat, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2008, 2009, 2011, 2012,
+ 2013 Red Hat, Inc.
Written by Corinna Vinschen <corinna.vinschen@cityweb.de>
@@ -22,6 +22,7 @@ details. */
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <inttypes.h>
#include <getopt.h>
#include <pwd.h>
#include <sys/cygwin.h>
@@ -203,14 +204,14 @@ PrintPW (PUSER_INFO_3 ui, LPCWSTR server)
if (ui->usri3_priv == USER_PRIV_ADMIN)
mi->usrmod0_min_passwd_len = 0;
printf ("\nSystem password settings:\n");
- printf ("Max. password age %ld days\n",
- mi->usrmod0_max_passwd_age / ONE_DAY);
- printf ("Min. password age %ld days\n",
- mi->usrmod0_min_passwd_age / ONE_DAY);
- printf ("Force logout after %ld days\n",
- mi->usrmod0_force_logoff / ONE_DAY);
- printf ("Min. password length: %ld\n",
- mi->usrmod0_min_passwd_len);
+ printf ("Max. password age %" PRIu32 " days\n",
+ (unsigned int) (mi->usrmod0_max_passwd_age / ONE_DAY));
+ printf ("Min. password age %" PRIu32 " days\n",
+ (unsigned int) (mi->usrmod0_min_passwd_age / ONE_DAY));
+ printf ("Force logout after %" PRIu32 " days\n",
+ (unsigned int) (mi->usrmod0_force_logoff / ONE_DAY));
+ printf ("Min. password length: %" PRIu32 "\n",
+ (unsigned int) mi->usrmod0_min_passwd_len);
}
}
diff --git a/winsup/utils/path.cc b/winsup/utils/path.cc
index 8c17dce14..a66dcdc14 100644
--- a/winsup/utils/path.cc
+++ b/winsup/utils/path.cc
@@ -1,7 +1,7 @@
/* path.cc
- Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Red Hat, Inc.
+ Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
+ 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -25,6 +25,7 @@ details. */
#include "path.h"
#include "../cygwin/include/cygwin/version.h"
#include "../cygwin/include/sys/mount.h"
+#define _NOMNTENT_MACROS
#include "../cygwin/include/mntent.h"
#include "testsuite.h"
#ifdef FSTAB_ONLY
@@ -841,7 +842,7 @@ vcygpath (const char *cwd, const char *s, va_list v)
if (n < max_len || !path_prefix_p (m->posix, path, n))
continue;
if ((m->flags & MOUNT_CYGDRIVE)
- && (strlen (path) < n + 2
+ && ((int) strlen (path) < n + 2
|| path[n] != '/'
|| !isalpha (path[n + 1])
|| path[n + 2] != '/'))
@@ -917,7 +918,8 @@ getmntent (FILE *)
if (!mnt.mnt_opts)
mnt.mnt_opts = (char *) malloc (64);
- strcpy (mnt.mnt_type, (char *) (m->flags & MOUNT_SYSTEM) ? "system" : "user");
+ strcpy (mnt.mnt_type,
+ (char *) ((m->flags & MOUNT_SYSTEM) ? "system" : "user"));
if (!(m->flags & MOUNT_BINARY))
strcpy (mnt.mnt_opts, (char *) "text");
diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc
index ca874a191..952b63ee3 100644
--- a/winsup/utils/ps.cc
+++ b/winsup/utils/ps.cc
@@ -149,7 +149,8 @@ int
main (int argc, char *argv[])
{
external_pinfo *p;
- int aflag, lflag, fflag, sflag, uid, proc_id;
+ int aflag, lflag, fflag, sflag, proc_id;
+ uid_t uid;
bool found_proc_id = true;
DWORD proc_access = PROCESS_QUERY_LIMITED_INFORMATION;
cygwin_getinfo_types query = CW_GETPINFO;
@@ -294,7 +295,7 @@ main (int argc, char *argv[])
/* nothing to do */;
else if (p->version >= EXTERNAL_PINFO_VERSION_32_BIT)
{
- if (p->uid32 != (__uid32_t) uid)
+ if (p->uid32 != uid)
continue;
}
else if (p->uid != uid)
diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc
index 5a4244e3e..86f2bb61f 100644
--- a/winsup/utils/regtool.cc
+++ b/winsup/utils/regtool.cc
@@ -190,7 +190,7 @@ print_version ()
}
void
-Fail (DWORD rv)
+Fail (unsigned int rv)
{
char *buf;
if (!quiet)
@@ -198,7 +198,7 @@ Fail (DWORD rv)
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM,
0, rv, 0, (CHAR *) & buf, 0, 0);
- fprintf (stderr, "Error (%ld): %s\n", rv, buf);
+ fprintf (stderr, "Error (%d): %s\n", rv, buf);
LocalFree (buf);
}
exit (1);
@@ -512,8 +512,8 @@ cmd_list ()
printf ("\n");
break;
case REG_DWORD:
- printf ("0x%08lx (%lu)\n", *(DWORD *) value_data,
- *(DWORD *) value_data);
+ printf ("0x%08x (%u)\n", *(unsigned int *) value_data,
+ *(unsigned int *) value_data);
break;
case REG_DWORD_BIG_ENDIAN:
v = ((value_data[0] << 24)
@@ -773,14 +773,14 @@ cmd_get ()
fwrite (data, dsize, 1, stdout);
break;
case REG_DWORD:
- printf (hex ? "0x%08lx\n" : "%lu\n", *(DWORD *) data);
+ printf (hex ? "0x%08x\n" : "%u\n", *(unsigned int *) data);
break;
case REG_DWORD_BIG_ENDIAN:
rv = ((data[0] << 24)
| (data[1] << 16)
| (data[2] << 8)
| (data[3]));
- printf (hex ? "0x%08lx\n" : "%lu\n", rv);
+ printf (hex ? "0x%08x\n" : "%u\n", (unsigned int) rv);
break;
case REG_QWORD:
printf (hex ? "0x%016llx\n" : "%llu\n", *(unsigned long long *) data);
diff --git a/winsup/utils/ssp.c b/winsup/utils/ssp.c
index 63aa9197e..3136a9f66 100644
--- a/winsup/utils/ssp.c
+++ b/winsup/utils/ssp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2009, 2011 Red Hat, Inc.
+ * Copyright (c) 2000, 2001, 2002, 2009, 2011, 2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,6 +13,20 @@
*
*/
+#ifdef __x86_64__
+
+#include <stdio.h>
+
+int
+main (int argc, char **argv)
+{
+ fprintf (stderr, "%s: This application is unsuported on x86_64 so far.\n",
+ argv[0]);
+ return 1;
+}
+
+#else
+
#include <errno.h>
#include <stdio.h>
#include <string.h>
@@ -939,3 +953,4 @@ main (int argc, char **argv)
exit (0);
}
+#endif /* !__x86_64 */
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index 62d408601..73096ab3b 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -1,7 +1,7 @@
/* strace.cc
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011 Red Hat Inc.
+ 2009, 2010, 2011, 2012, 2013 Red Hat Inc.
Written by Chris Faylor <cgf@redhat.com>
@@ -265,7 +265,7 @@ ctrl_c (DWORD)
}
extern "C" {
-unsigned long (*cygwin_internal) (int, ...);
+uintptr_t (*cygwin_internal) (int, ...);
WCHAR cygwin_dll_path[32768];
};
@@ -286,7 +286,7 @@ load_cygwin ()
return 0;
}
GetModuleFileNameW (h, cygwin_dll_path, 32768);
- if (!(cygwin_internal = (DWORD (*) (int, ...)) GetProcAddress (h, "cygwin_internal")))
+ if (!(cygwin_internal = (uintptr_t (*) (int, ...)) GetProcAddress (h, "cygwin_internal")))
{
errno = ENOSYS;
return 0;
@@ -437,7 +437,7 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile)
int len;
int special;
char alen[3 + 8 + 1];
- DWORD nbytes;
+ SIZE_T nbytes;
child_list *child = get_child (id);
if (!child)
error (0, "no process id %d found", id);
@@ -482,7 +482,11 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile)
buf[len] = '\0';
char *s = strtok (buf, " ");
+#ifdef __x86_64__
+ unsigned long long n = strtoull (s, NULL, 16);
+#else
unsigned long n = strtoul (s, NULL, 16);
+#endif
s = strchr (s, '\0') + 1;
@@ -619,7 +623,11 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile)
if (include_hex)
{
s -= 8;
- sprintf (s, "%p", (void *) n);
+#ifdef __x86_64__
+ sprintf (s, "%012I64x", n);
+#else
+ sprintf (s, "%08lx", n);
+#endif
strchr (s, '\0')[0] = ' ';
}
child->last_usecs = usecs;
@@ -691,8 +699,9 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid)
{
status = DBG_EXCEPTION_NOT_HANDLED;
if (ev.u.Exception.dwFirstChance)
- fprintf (ofile, "--- Process %lu, exception %p at %p\n", ev.dwProcessId,
- (void *) ev.u.Exception.ExceptionRecord.ExceptionCode,
+ fprintf (ofile, "--- Process %lu, exception %08lx at %p\n",
+ ev.dwProcessId,
+ ev.u.Exception.ExceptionRecord.ExceptionCode,
ev.u.Exception.ExceptionRecord.ExceptionAddress);
}
break;
@@ -966,7 +975,7 @@ main (int argc, char **argv)
if (load_cygwin ())
{
char **av = (char **) cygwin_internal (CW_ARGV);
- if (av && (DWORD) av != (DWORD) -1)
+ if (av && (uintptr_t) av != (uintptr_t) -1)
for (argc = 0, argv = av; *av; av++)
argc++;
}
diff --git a/winsup/utils/tzset.c b/winsup/utils/tzset.c
index a3abe315e..45f3f1655 100644
--- a/winsup/utils/tzset.c
+++ b/winsup/utils/tzset.c
@@ -1,6 +1,6 @@
/* tzset.c: Convert current Windows timezone to POSIX timezone information.
- Copyright 2012 Red Hat, Inc.
+ Copyright 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -10,6 +10,7 @@ details. */
#include <errno.h>
#include <stdio.h>
+#include <inttypes.h>
#include <wchar.h>
#include <locale.h>
#include <getopt.h>
@@ -518,8 +519,8 @@ reg_open (HKEY pkey, PCWSTR path, const char *msg)
if (ret == ERROR_SUCCESS)
return hkey;
if (msg)
- fprintf (stderr, "%s: cannot open registry %s, error code %ld\n",
- program_invocation_short_name, msg, ret);
+ fprintf (stderr, "%s: cannot open registry %s, error code %" PRIu32 "\n",
+ program_invocation_short_name, msg, (unsigned int) ret);
return NULL;
}
@@ -536,8 +537,8 @@ reg_query (HKEY hkey, PCWSTR value, PWCHAR buf, DWORD size, const char *msg)
if (ret == ERROR_SUCCESS)
return TRUE;
if (msg)
- fprintf (stderr, "%s: cannot query registry %s, error code %ld\n",
- program_invocation_short_name, msg, ret);
+ fprintf (stderr, "%s: cannot query registry %s, error code %" PRIu32 "\n",
+ program_invocation_short_name, msg, (unsigned int) ret);
return FALSE;
}
@@ -709,10 +710,12 @@ main (int argc, char **argv)
}
idx = gotit;
}
- /* Got one. Print it. */
- spc = wcschr (tzmap[idx].posix_tzid, ' ');
- if (spc)
- *spc = L'\0';
- printf ("%ls\n", tzmap[idx].posix_tzid);
+ /* Got one. Print it.
+ Note: The tzmap array is in the R/O data section on x86_64. Don't
+ try to overwrite the space, as the code did originally. */
+ spc = wcschr (tzmap[idx].posix_tzid, L' ');
+ if (!spc)
+ spc = wcschr (tzmap[idx].posix_tzid, L'\0');
+ printf ("%.*ls\n", (int) (spc - tzmap[idx].posix_tzid), tzmap[idx].posix_tzid);
return 0;
}
diff --git a/winsup/utils/utils.sgml b/winsup/utils/utils.sgml
deleted file mode 100644
index 8c0b838c6..000000000
--- a/winsup/utils/utils.sgml
+++ /dev/null
@@ -1,2190 +0,0 @@
-<sect1 id="using-utils"><title>Cygwin Utilities</title>
-
-<para>Cygwin comes with a number of command-line utilities that are
-used to manage the UNIX emulation portion of the Cygwin environment.
-While many of these reflect their UNIX counterparts, each was written
-specifically for Cygwin. You may use the long or short option names
-interchangeably; for example, <literal>--help</literal> and
-<literal>-h</literal> function identically. All of the Cygwin
-command-line utilities support the <literal>--help</literal> and
-<literal>--version</literal> options.
-</para>
-
-<sect2 id="cygcheck"><title>cygcheck</title>
-
-<screen>
-Usage: cygcheck [-v] [-h] PROGRAM
- cygcheck -c [-d] [PACKAGE]
- cygcheck -s [-r] [-v] [-h]
- cygcheck -k
- cygcheck -f FILE [FILE]...
- cygcheck -l [PACKAGE]...
- cygcheck -p REGEXP
- cygcheck --delete-orphaned-installation-keys
- cygcheck --enable-unique-object-names Cygwin-DLL
- cygcheck --disable-unique-object-names Cygwin-DLL
- cygcheck --show-unique-object-names Cygwin-DLL
- cygcheck -h
-
-List system information, check installed packages, or query package database.
-
-At least one command option or a PROGRAM is required, as shown above.
-
- PROGRAM list library (DLL) dependencies of PROGRAM
- -c, --check-setup show installed version of PACKAGE and verify integrity
- (or for all installed packages if none specified)
- -d, --dump-only just list packages, do not verify (with -c)
- -s, --sysinfo produce diagnostic system information (implies -c -d)
- -r, --registry also scan registry for Cygwin settings (with -s)
- -k, --keycheck perform a keyboard check session (must be run from a
- plain console only, not from a pty/rxvt/xterm)
- -f, --find-package find the package to which FILE belongs
- -l, --list-package list contents of PACKAGE (or all packages if none given)
- -p, --package-query search for REGEXP in the entire cygwin.com package
- repository (requires internet connectivity)
- --delete-orphaned-installation-keys
- Delete installation keys of old, now unused
- installations from the registry. Requires the right
- to change the registry.
- --enable-unique-object-names Cygwin-DLL
- --disable-unique-object-names Cygwin-DLL
- --show-unique-object-names Cygwin-DLL
- Enable, disable, or show the setting of the
- \"unique object names\" setting in the Cygwin DLL
- given as argument to this option. The DLL path must
- be given as valid Windows(!) path.
- See the users guide for more information.
- If you don't know what this means, don't change it.
- -v, --verbose produce more verbose output
- -h, --help annotate output with explanatory comments when given
- with another command, otherwise print this help
- -V, --version print the version of cygcheck and exit
-
-Note: -c, -f, and -l only report on packages that are currently installed. To
- search all official Cygwin packages use -p instead. The -p REGEXP matches
- package names, descriptions, and names of files/paths within all packages.
-</screen>
-
-<para>
-The <command>cygcheck</command> program is a diagnostic utility for
-dealing with Cygwin programs. If you are familiar with
-<command>dpkg</command> or <command>rpm</command>,
-<command>cygcheck</command> is similar in many ways. (The major difference
-is that <command>setup.exe</command> handles installing and uninstalling
-packages; see <xref linkend="internet-setup"></xref> for more information.)
-</para>
-<para>
-The <literal>-c</literal> option checks the version and status of
-installed Cygwin packages. If you specify one or more package names,
-<command>cygcheck</command> will limit its output to those packages,
-or with no arguments it lists all packages. A package will be marked
-<literal>Incomplete</literal> if files originally installed are no longer
-present. The best thing to do in that situation is reinstall the package
-with <command>setup.exe</command>. To see which files are missing, use the
-<literal>-v</literal> option. If you do not need to know the status
-of each package and want <command>cygcheck</command> to run faster, add the
-<literal>-d</literal> option and <command>cygcheck</command> will only
-output the name and version for each package.
-</para>
-<para>
-If you list one or more programs on the command line,
-<command>cygcheck</command> will diagnose the runtime environment of that
-program or programs, providing the names of DLL files on which the program
-depends. If you specify the <literal>-s</literal> option,
-<command>cygcheck</command> will give general system information. If you
-list one or more programs on the command line and specify
-<literal>-s</literal>, <command>cygcheck</command> will report on
-both.</para>
-<para>
-The <literal>-f</literal> option helps you to track down which package a
-file came from, and <literal>-l</literal> lists all files in a package.
-For example, to find out about <filename>/usr/bin/less</filename> and its
-package:
-<example id="utils-cygcheck-ex"><title>Example <command>cygcheck</command> usage</title>
-<screen>
-$ cygcheck -f /usr/bin/less
-less-381-1
-
-$ cygcheck -l less
-/usr/bin/less.exe
-/usr/bin/lessecho.exe
-/usr/bin/lesskey.exe
-/usr/man/man1/less.1
-/usr/man/man1/lesskey.1
-</screen>
-</example>
-</para>
-
-<para>The <literal>-h</literal> option prints additional helpful
-messages in the report, at the beginning of each section. It also
-adds table column headings. While this is useful information, it also
-adds some to the size of the report, so if you want a compact report
-or if you know what everything is already, just leave this out.</para>
-
-<para>The <literal>-v</literal> option causes the output to be more
-verbose. What this means is that additional information will be
-reported which is usually not interesting, such as the internal
-version numbers of DLLs, additional information about recursive DLL
-usage, and if a file in one directory in the PATH also occurs in other
-directories on the PATH. </para>
-
-<para>The <literal>-r</literal> option causes
-<command>cygcheck</command> to search your registry for information
-that is relevant to Cygwin programs. These registry entries are the
-ones that have "Cygwin" in the name. If you are paranoid about
-privacy, you may remove information from this report, but please keep
-in mind that doing so makes it harder to diagnose your problems.</para>
-
-<para>In contrast to the other options that search the packages that are
-installed on your local system, the <literal>-p</literal> option can be used
-to search the entire official Cygwin package repository. It takes as argument
-a Perl-compatible regular expression which is used to match package names,
-package descriptions, and path/filenames of the contents of packages. This
-feature requires an active internet connection, since it must query the
-<literal>cygwin.com</literal> web site. In fact, it is equivalent to the
-search that is available on the <ulink url="http://cygwin.com/packages/">Cygwin
-package listing</ulink> page.</para>
-
-<para>For example, perhaps you are getting an error because you are missing a
-certain DLL and you want to know which package includes that file:
-<example id="utils-search-ex"><title>Searching all packages for a file</title>
-<screen>
-$ cygcheck -p 'cygintl-2\.dll'
-Found 1 matches for 'cygintl-2\.dll'.
-
-libintl2-0.12.1-3 GNU Internationalization runtime library
-
-$ cygcheck -p 'libexpat.*\.a'
-Found 2 matches for 'libexpat.*\.a'.
-
-expat-1.95.7-1 XML parser library written in C
-expat-1.95.8-1 XML parser library written in C
-
-$ cygcheck -p '/ls\.exe'
-Found 2 matches for '/ls\.exe'.
-
-coreutils-5.2.1-5 GNU core utilities (includes fileutils, sh-utils and textutils)
-coreutils-5.3.0-6 GNU core utilities (includes fileutils, sh-utils and textutils)
-</screen>
-</example>
-</para>
-
-<para>Note that this option takes a regular expression, not a glob or wildcard.
-This means that you need to use <literal>.*</literal> if you want something
-similar to the wildcard <literal>*</literal> commonly used in filename globbing.
-Similarly, to match the period character you should use <literal>\.</literal>
-since the <literal>.</literal> character in a regexp is a metacharacter that
-will match any character. Also be aware that the characters such as
-<literal>\</literal> and <literal>*</literal> are shell metacharacters, so
-they must be either escaped or quoted, as in the example above.</para>
-
-<para>The third example above illustrates that if you want to match a whole
-filename, you should include the <literal>/</literal> path seperator. In the
-given example this ensures that filenames that happen to end in
-<literal>ls.exe</literal> such as <literal>ncftpls.exe</literal> are not shown.
-Note that this use does not mean "look for packages with <literal>ls</literal>
-in the root directory," since the <literal>/</literal> can match anywhere in the
-path. It's just there to anchor the match so that it matches a full
-filename.</para>
-
-<para>By default the matching is case-sensitive. To get a case insensitive
-match, begin your regexp with <literal>(?i)</literal> which is a PCRE-specific
-feature. For complete documentation on Perl-compatible regular expression
-syntax and options, read the <command>perlre</command> manpage, or one of many
-websites such as <literal>perldoc.com</literal> that document the Perl
-language.</para>
-
-<para>The <command>cygcheck</command> program should be used to send
-information about your system for troubleshooting when requested.
-When asked to run this command save the output so that you can email it,
-for example:</para>
-
-<screen>
-<prompt>$</prompt> <userinput>cygcheck -s -v -r -h &gt; cygcheck_output.txt</userinput>
-</screen>
-
-<para>
-Each Cygwin DLL stores its path and installation key in the registry.
-This allows troubleshooting of problems which could be a result of having
-multiple concurrent Cygwin installations. However, if you're experimenting
-a lot with different Cygwin installation paths, your registry could
-accumulate a lot of old Cygwin installation entries for which the
-installation doesn't exist anymore. To get rid of these orphaned registry
-entries, use the <command>cygcheck --delete-orphaned-installation-keys</command>
-command.</para>
-
-<para>
-Each Cygwin DLL generates a key value from its installation path. This
-value is not only stored in the registry, it's also used to generate
-global object names used for interprocess communication. This keeps
-different Cygwin installations separate. Processes running under a
-Cygwin DLL installed in C:\cygwin don't see processes running under a
-Cygwin DLL installed in C:\Program Files\cygwin. This allows
-running multiple versions of Cygwin DLLs without these versions to
-interfere with each other, or to run small third-party installations
-for a specific purpose independently from a Cygwin net distribution.
-</para>
-
-<para>
-For debugging purposes it could be desired that the various Cygwin DLLs
-use the same key, independently from their installation paths. If the
-DLLs have different versions, trying to run processes under these DLLs
-concurrently will result in error messages like this one:</para>
-
-<screen>
-*** shared version mismatch detected - 0x8A88009C/0x75BE0074.
-This problem is probably due to using incompatible versions of the Cygwin DLL.
-Search for cygwin1.dll using the Windows Start->Find/Search facility
-and delete all but the most recent version. The most recent version *should*
-reside in x:\\cygwin\\bin, where 'x' is the drive on which you have
-installed the cygwin distribution. Rebooting is also suggested if you
-are unable to find another Cygwin DLL.
-</screen>
-
-<para>
-To disable the usage of a unique key value of a certain Cygwin DLL, use
-the <command>cygcheck --disable-unique-object-names Cygwin-DLL</command>
-command. <literal>Cygwin-DLL</literal> is the Windows path (*not* a
-Cygwin POSIX path) to the DLL for which you want to disable this feature.
-Note that you have to stop all Cygwin processes running under this DLL,
-before you're allowed to change this setting. For instance, run
-<command>cygcheck</command> from a DOS command line for this purpose.</para>
-
-<para>To re-enable the usage of a unique key, use the
-<command>cygcheck --enable-unique-object-names Cygwin-DLL</command> command.
-This option has the same characteristics as the
-<literal>--disable-unique-object-names</literal> option</para>
-
-<para>Finally, you can use
-<command>cygcheck --show-unique-object-names Cygwin-DLL</command> to find out
-if the given Cygwin DLL use unique object names or not. In contrast to the
-<literal>--disable-...</literal> and <literal>--enable-...</literal> options,
-the <literal>--show-unique-object-names</literal> option also works for
-Cygwin DLLs which are currently in use.</para>
-
-</sect2>
-
-<sect2 id="cygpath"><title>cygpath</title>
-
-<screen>
-Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
- cygpath [-c HANDLE]
- cygpath [-ADHOPSW]
- cygpath [-F ID]
-
-Convert Unix and Windows format paths, or output system path information
-
-Output type options:
-
- -d, --dos print DOS (short) form of NAMEs (C:\PROGRA~1\)
- -m, --mixed like --windows, but with regular slashes (C:/WINNT)
- -M, --mode report on mode of file (currently binmode or textmode)
- -u, --unix (default) print Unix form of NAMEs (/cygdrive/c/winnt)
- -w, --windows print Windows form of NAMEs (C:\WINNT)
- -t, --type TYPE print TYPE form: 'dos', 'mixed', 'unix', or 'windows'
-
-Path conversion options:
-
- -a, --absolute output absolute path
- -l, --long-name print Windows long form of NAMEs (with -w, -m only)
- -p, --path NAME is a PATH list (i.e., '/bin:/usr/bin')
- -s, --short-name print DOS (short) form of NAMEs (with -w, -m only)
- -C, --codepage CP print DOS, Windows, or mixed pathname in Windows
- codepage CP. CP can be a numeric codepage identifier,
- or one of the reserved words ANSI, OEM, or UTF8.
- If this option is missing, cygpath defaults to the
- character set defined by the current locale.
-
-System information:
-
- -A, --allusers use `All Users' instead of current user for -D, -P
- -D, --desktop output `Desktop' directory and exit
- -H, --homeroot output `Profiles' directory (home root) and exit
- -O, --mydocs output `My Documents' directory and exit
- -P, --smprograms output Start Menu `Programs' directory and exit
- -S, --sysdir output system directory and exit
- -W, --windir output `Windows' directory and exit
- -F, --folder ID output special folder with numeric ID and exit
-
-Other options:
-
- -f, --file FILE read FILE for input; use - to read from STDIN
- -o, --option read options from FILE as well (for use with --file)
- -c, --close HANDLE close HANDLE (for use in captured process)
- -i, --ignore ignore missing argument
- -h, --help output usage information and exit
- -V, --version output version information and exit
-</screen>
-
-<para>The <command>cygpath</command> program is a utility that
-converts Windows native filenames to Cygwin POSIX-style pathnames and
-vice versa. It can be used when a Cygwin program needs to pass a file
-name to a native Windows program, or expects to get a file name from a
-native Windows program. Alternatively, <command>cygpath</command> can
-output information about the location of important system directories
-in either format.
-</para>
-
-<para>The <literal>-u</literal> and <literal>-w</literal> options
-indicate whether you want a conversion to UNIX (POSIX) format
-(<literal>-u</literal>) or to Windows format (<literal>-w</literal>).
-Use the <literal>-d</literal> to get DOS-style (8.3) file and path names.
-The <literal>-m</literal> option will output Windows-style format
-but with forward slashes instead of backslashes. This option is
-especially useful in shell scripts, which use backslashes as an escape
-character.</para>
-
-<para> In combination with the <literal>-w</literal> option, you can use
-the <literal>-l</literal> and <literal>-s</literal> options to use normal
-(long) or DOS-style (short) form. The <literal>-d</literal> option is
-identical to <literal>-w</literal> and <literal>-s</literal> together.
-</para>
-
-<para>The <literal>-C</literal> option allows to specify a Windows codepage
-to print DOS and Windows paths created with one of the <literal>-d</literal>,
-<literal>-m</literal>, or <literal>-w</literal> options. The default is to
-use the character set of the current locale defined by one of the
-internationalization environment variables <envar>LC_ALL</envar>,
-<envar>LC_CTYPE</envar>, or <envar>LANG</envar>, see
-<xref linkend="setup-locale"></xref>. This is sometimes not sufficient for
-interaction with native Windows tools, which might expect native, non-ASCII
-characters in a specific Windows codepage. Console tools, for instance, might
-expect pathnames in the current OEM codepage, while graphical tools like
-Windows Explorer might expect pathnames in the current ANSI codepage.</para>
-
-<para>The <literal>-C</literal> option takes a single parameter:</para>
-<itemizedlist spacing="compact">
-<listitem><para><literal>ANSI</literal>, to specify the current ANSI codepage</para></listitem>
-<listitem><para><literal>OEM</literal>, to specify the current OEM (console) codepage</para></listitem>
-<listitem><para><literal>UTF8</literal>, to specify UTF-8.</para></listitem>
-<listitem><para>A numerical, decimal codepage number, for instance 936 for GBK,
-28593 for ISO-8859-3, etc. A full list of supported codepages is listed on the
-Microsoft MSDN page
-<ulink url="http://msdn.microsoft.com/en-us/library/dd317756(VS.85).aspx">Code Page Identifiers</ulink>. A codepage of 0 is the same as if the
-<literal>-C</literal> hasn't been specified at all.</para></listitem>
-</itemizedlist>
-
-<para>The <literal>-p</literal> option means that you want to convert
-a path-style string rather than a single filename. For example, the
-PATH environment variable is semicolon-delimited in Windows, but
-colon-delimited in UNIX. By giving <literal>-p</literal> you are
-instructing <command>cygpath</command> to convert between these
-formats.</para>
-
-<para>The <literal>-i</literal> option supresses the print out of the
-usage message if no filename argument was given. It can be used in
-make file rules converting variables that may be omitted
-to a proper format. Note that <command>cygpath</command> output may
-contain spaces (C:\Program Files) so should be enclosed in quotes.
-</para>
-
-
-<example id="utils-cygpath-ex"><title>Example <command>cygpath</command> usage</title>
-<screen>
-<![CDATA[
-#!/bin/sh
-if [ "${1}" = "" ];
- then
- XPATH=".";
- else
- XPATH="$(cygpath -C ANSI -w "${1}")";
-fi
-explorer $XPATH &
-]]>
-</screen>
-</example>
-
-<para>The capital options
-<literal>-D</literal>, <literal>-H</literal>, <literal>-P</literal>,
-<literal>-S</literal>, and <literal>-W</literal> output directories used
-by Windows that are not the same on all systems, for example
-<literal>-S</literal> might output C:\WINNT\system32 or C:\Windows\System32.
-The <literal>-H</literal> shows the Windows profiles directory that can
-be used as root of home. The <literal>-A</literal> option forces use of
-the "All Users" directories instead of the current user for the
-<literal>-D</literal>, <literal>-O</literal> and <literal>-P</literal>
-options.
-The <literal>-F</literal> outputs other special folders specified by
-their internal numeric code (decimal or 0x-prefixed hex). For valid codes and
-symbolic names, see the CSIDL_* definitions in the include file
-/usr/include/w32api/shlobj.h from package w32api. The current valid
-range of codes for folders is 0 (Desktop) to 59 (CDBurn area).
-By default the output is in UNIX (POSIX) format;
-use the <literal>-w</literal> or <literal>-d</literal> options to get
-other formats.</para>
-
-</sect2>
-
-<sect2 id="dumper"><title>dumper</title>
-
-<screen>
-Usage: dumper [OPTION] FILENAME WIN32PID
-
-Dump core from WIN32PID to FILENAME.core
-
--d, --verbose be verbose while dumping
--h, --help output help information and exit
--q, --quiet be quiet while dumping (default)
--V, --version output version information and exit
-</screen>
-
-<para>The <command>dumper</command> utility can be used to create a
-core dump of running Windows process. This core dump can be later loaded
-to <command>gdb</command> and analyzed. One common way to use
-<command>dumper</command> is to plug it into cygwin's Just-In-Time
-debugging facility by adding
-
-<screen>
-error_start=x:\path\to\dumper.exe
-</screen>
-
-to the <emphasis>CYGWIN</emphasis> environment variable. Please note that
-<literal>x:\path\to\dumper.exe</literal> is Windows-style and not cygwin
-path. If <literal>error_start</literal> is set this way, then dumper will
-be started whenever some program encounters a fatal error.
-</para>
-
-<para>
-<command>dumper</command> can be also be started from the command line to
-create a core dump of any running process. Unfortunately, because of a Windows
-API limitation, when a core dump is created and <command>dumper</command>
-exits, the target process is terminated too.
-</para>
-
-<para>
-To save space in the core dump, <command>dumper</command> doesn't write those
-portions of target process' memory space that are loaded from executable and
-dll files and are unchangeable, such as program code and debug info. Instead,
-<command>dumper</command> saves paths to files which contain that data. When a
-core dump is loaded into gdb, it uses these paths to load appropriate files.
-That means that if you create a core dump on one machine and try to debug it on
-another, you'll need to place identical copies of the executable and dlls in
-the same directories as on the machine where the core dump was created.
-</para>
-
-</sect2>
-
-<sect2 id="getconf"><title>getconf</title>
-
-<screen>
-Usage: getconf [-v specification] variable_name [pathname]
- getconf -a [pathname]
-
-Get configuration values
-
- -v specification Indicate specific version for which configuration
- values shall be fetched.
- -a, --all Print all known configuration values
-
-Other options:
-
- -h, --help This text
- -V, --version Print program version and exit
-</screen>
-
-<para>The <command>getconf</command> utility prints the value of the
-configuration variable specified by <literal>variable_name</literal>.
-If no <literal>pathname</literal> is given, <command>getconf</command>
-serves as a wrapper for the <literal>confstr</literal> and
-<literal>sysconf</literal> functions, supporting the symbolic constants
-defined in the <literal>limits.h</literal> and <literal>unistd.h</literal>
-headers, without their respective <literal>_CS_</literal> or
-<literal>_SC_</literal> prefixes.
-</para>
-
-<para>If <literal>pathname</literal> is given, <command>getconf</command>
-prints the value of the configuration variable for the specified pathname.
-In this form, <command>getconf</command> serves as a wrapper for the
-<literal>pathconf</literal> function, supporting the symbolic constants defined
-in the <literal>unistd.h</literal> header, without the <literal>_PC_</literal>
-prefix. </para>
-
-<para>If you specify the <literal>-v</literal> option, the parameter
-denotes a specification for which the value of the configuration variable
-should be printed. Note that the only specifications supported by Cygwin
-are <literal>POSIX_V7_ILP32_OFFBIG</literal> and the legacy
-<literal>POSIX_V6_ILP32_OFFBIG</literal> and
-<literal>XBS5_ILP32_OFFBIG</literal> equivalents.</para>
-
-<para>Use the <literal>-a</literal> option to print a list of all available
-configuration variables for the system, or given <literal>pathname</literal>,
-and their values.</para>
-
-</sect2>
-
-<sect2 id="getfacl"><title>getfacl</title>
-
-<screen>
-Usage: getfacl [-adn] FILE [FILE2...]
-
-Display file and directory access control lists (ACLs).
-
- -a, --all display the filename, the owner, the group, and
- the ACL of the file
- -d, --dir display the filename, the owner, the group, and
- the default ACL of the directory, if it exists
- -h, --help output usage information and exit
- -n, --noname display user and group IDs instead of names
- -V, --version output version information and exit
-
-When multiple files are specified on the command line, a blank
-line separates the ACLs for each file.
-</screen>
-
-<para>
-For each argument that is a regular file, special file or
-directory, <command>getfacl</command> displays the owner, the group, and the
-ACL. For directories <command>getfacl</command> displays additionally the
-default ACL. With no options specified, <command>getfacl</command> displays
-the filename, the owner, the group, and both the ACL and the default ACL, if
-it exists. For more information on Cygwin and Windows ACLs, see
-<xref linkend="ntsec"></xref> in the Cygwin User's Guide.
-The format for ACL output is as follows:
-<screen>
- # file: filename
- # owner: name or uid
- # group: name or uid
- user::perm
- user:name or uid:perm
- group::perm
- group:name or gid:perm
- mask:perm
- other:perm
- default:user::perm
- default:user:name or uid:perm
- default:group::perm
- default:group:name or gid:perm
- default:mask:perm
- default:other:perm
-</screen>
-</para>
-</sect2>
-
-<sect2 id="kill"><title>kill</title>
-
-<screen>
-Usage: kill [-f] [-signal] [-s signal] pid1 [pid2 ...]
- kill -l [signal]
-
-Send signals to processes
-
- -f, --force force, using win32 interface if necessary
- -l, --list print a list of signal names
- -s, --signal send signal (use kill --list for a list)
- -h, --help output usage information and exit
- -V, --version output version information and exit
-</screen>
-
-<para>The <command>kill</command> program allows you to send arbitrary
-signals to other Cygwin programs. The usual purpose is to end a
-running program from some other window when ^C won't work, but you can
-also send program-specified signals such as SIGUSR1 to trigger actions
-within the program, like enabling debugging or re-opening log files.
-Each program defines the signals they understand.</para>
-
-<para>You may need to specify the full path to use <command>kill</command>
-from within some shells, including <command>bash</command>, the default Cygwin
-shell. This is because <command>bash</command> defines a
-<command>kill</command> builtin function; see the <command>bash</command>
-man page under <emphasis>BUILTIN COMMANDS</emphasis> for more information.
-To make sure you are using the Cygwin version, try
-
-<screen>
-$ /bin/kill --version
-</screen>
-
-which should give the Cygwin <command>kill</command> version number and
-copyright information.
-</para>
-
-<para>Unless you specific the <literal>-f</literal> option, the "pid" values
-used by <command>kill</command> are the Cygwin pids, not the Windows pids.
-To get a list of running programs and their Cygwin pids, use the Cygwin
-<command>ps</command> program. <command>ps -W</command> will display
-<emphasis>all</emphasis> windows pids.</para>
-
-<para>The <command>kill -l</command> option prints the name of the
-given signal, or a list of all signal names if no signal is given.</para>
-
-<para>To send a specific signal, use the <literal>-signN</literal>
-option, either with a signal number or a signal name (minus the "SIG"
-part), as shown in these examples:</para>
-
-<example id="utils-kill-ex"><title>Using the kill command</title>
-<screen>
-<prompt>$</prompt> <userinput>kill 123</userinput>
-<prompt>$</prompt> <userinput>kill -1 123</userinput>
-<prompt>$</prompt> <userinput>kill -HUP 123</userinput>
-<prompt>$</prompt> <userinput>kill -f 123</userinput>
-</screen>
-</example>
-
-<para>Here is a list of available signals, their numbers, and some
-commentary on them, from the file
-<literal>&lt;sys/signal.h&gt;</literal>, which should be considered
-the official source of this information.</para>
-
-<screen>
-SIGHUP 1 hangup
-SIGINT 2 interrupt
-SIGQUIT 3 quit
-SIGILL 4 illegal instruction (not reset when caught)
-SIGTRAP 5 trace trap (not reset when caught)
-SIGABRT 6 used by abort
-SIGEMT 7 EMT instruction
-SIGFPE 8 floating point exception
-SIGKILL 9 kill (cannot be caught or ignored)
-SIGBUS 10 bus error
-SIGSEGV 11 segmentation violation
-SIGSYS 12 bad argument to system call
-SIGPIPE 13 write on a pipe with no one to read it
-SIGALRM 14 alarm clock
-SIGTERM 15 software termination signal from kill
-SIGURG 16 urgent condition on IO channel
-SIGSTOP 17 sendable stop signal not from tty
-SIGTSTP 18 stop signal from tty
-SIGCONT 19 continue a stopped process
-SIGCHLD 20 to parent on child stop or exit
-SIGCLD 20 System V name for SIGCHLD
-SIGTTIN 21 to readers pgrp upon background tty read
-SIGTTOU 22 like TTIN for output if (tp-&gt;t_local&amp;LTOSTOP)
-SIGIO 23 input/output possible
-SIGPOLL 23 System V name for SIGIO
-SIGXCPU 24 exceeded CPU time limit
-SIGXFSZ 25 exceeded file size limit
-SIGVTALRM 26 virtual time alarm
-SIGPROF 27 profiling time alarm
-SIGWINCH 28 window changed
-SIGLOST 29 resource lost (eg, record-lock lost)
-SIGPWR 29 power failure
-SIGUSR1 30 user defined signal 1
-SIGUSR2 31 user defined signal 2
-</screen>
-
-</sect2>
-
-<sect2 id="ldd"><title>ldd</title>
-
-<screen>
-Usage: ldd [OPTION]... FILE...
-
-Print shared library dependencies
-
- -h, --help print this help and exit
- -V, --version print version information and exit
- -r, --function-relocs process data and function relocations
- (currently unimplemented)
- -u, --unused print unused direct dependencies
- (currently unimplemented)
- -v, --verbose print all information
- (currently unimplemented)
-</screen>
-
-<para><command>ldd</command> prints the shared libraries (DLLs) an executable
-or DLL is linked against. No modifying option is implemented yet.</para>
-
-</sect2>
-
-<sect2 id="locale"><title>locale</title>
-
-<screen>
-Usage: locale [-amvhV]
- or: locale [-ck] NAME
- or: locale [-usfnU]
-
-Get locale-specific information.
-
-System information:
-
- -a, --all-locales List all available supported locales
- -m, --charmaps List all available character maps
- -v, --verbose More verbose output
-
-Modify output format:
-
- -c, --category-name List information about given category NAME
- -k, --keyword-name Print information about given keyword NAME
-
-Default locale information:
-
- -u, --user Print locale of user's default UI language
- -s, --system Print locale of system default UI language
- -f, --format Print locale of user's regional format settings
- (time, numeric &amp; monetary)
- -n, --no-unicode Print system default locale for non-Unicode programs
- -U, --utf Attach \".UTF-8\" to the result
-
-Other options:
-
- -h, --help This text
- -V, --version Print program version and exit
-</screen>
-
-<para><command>locale</command> without parameters prints information about
-the current locale environment settings.</para>
-
-<para>The <literal>-u</literal>, <literal>-s</literal>, <literal>-f</literal>,
-and <literal>-n</literal> options can be used to request the various Windows
-locale settings. The purpose is to use this command in scripts to set the
-POSIX locale variables.</para>
-
-<para>The <literal>-u</literal> option prints the current user's Windows
-UI locale to stdout. In Windows Vista and Windows 7 this setting is called
-the "Display Language"; there was no corresponding user setting in Windows XP.
-The <literal>-s</literal> option prints the systems default instead.
-The <literal>-f</literal> option prints the user's setting for time, date,
-number and currency. That's equivalent to the setting in the "Formats" or
-"Regional Options" tab in the "Region and Language" or "Regional and Language
-Options" dialog. With the <literal>-U</literal> option
-<command>locale</command> appends a ".UTF-8".</para>
-
-<para>Usage example:</para>
-
-<screen>
-bash$ export LANG=$(locale -uU)
-bash$ echo $LANG
-en_US.UTF-8
-bash$ export LC_TIME=$(locale -fU)
-bash$ echo $LC_TIME
-de_DE.UTF-8
-</screen>
-
-<para>The <literal>-a</literal> option is helpful to learn which locales
-are supported by your Windows machine. It prints all available locales
-and the allowed modifiers. Example:</para>
-
-<screen>
-bash$ locale -a
-C
-C.utf8
-POSIX
-af_ZA
-af_ZA.utf8
-am_ET
-am_ET.utf8
-...
-be_BY
-be_BY.utf8
-be_BY@latin
-...
-ca_ES
-ca_ES.utf8
-ca_ES@euro
-catalan
-...
-</screen>
-
-<para>The <literal>-v</literal> option prints more detailed information about
-each available locale. Example:</para>
-
-<screen>
-bash$ locale -av
-locale: af_ZA archive: /cygdrive/c/Windows/system32/kernel32.dll
--------------------------------------------------------------------------------
- language | Afrikaans
-territory | South Africa
- codeset | ISO-8859-1
-
-locale: af_ZA.utf8 archive: /cygdrive/c/Windows/system32/kernel32.dll
--------------------------------------------------------------------------------
- language | Afrikaans
-territory | South Africa
- codeset | UTF-8
-
-...
-
-locale: ca_ES@euro archive: /cygdrive/c/Windows/system32/kernel32.dll
--------------------------------------------------------------------------------
- language | Catalan
-territory | Spain
- codeset | ISO-8859-15
-
-locale: catalan archive: /usr/share/locale/locale.alias
--------------------------------------------------------------------------------
- language | Catalan
-territory | Spain
- codeset | ISO-8859-1
-
-...
-</screen>
-
-<para>The <literal>-m</literal> option prints the names of the available
-charmaps supported by Cygwin to stdout.</para>
-
-<para>Otherwise, if arguments are given, <command>locale</command> prints
-the values assigned to these arguments. Arguments can be names of locale
-categories (for instance: LC_CTYPE, LC_MONETARY), or names of keywords
-supported in the locale categories (for instance: thousands_sep, charmap).
-The <literal>-c</literal> option prints additionally the name of the category.
-The <literal>-k</literal> option prints additionally the name of the keyword.
-Example:</para>
-
-<screen>
-bash$ locale -ck LC_MESSAGES
-LC_MESSAGES
-yesexpr="^[yY]"
-noexpr="^[nN]"
-yesstr="yes"
-nostr="no"
-messages-codeset="UTF-8"
-bash$ locale noexpr
-^[nN]
-</screen>
-
-</sect2>
-
-<sect2 id="mkgroup"><title>mkgroup</title>
-
-<screen>
-Usage: mkgroup [OPTION]...
-
-Print /etc/group file to stdout
-
-Options:
-
- -l,--local [machine[,offset]]
- print local groups with gid offset offset
- (from local machine if no machine specified)
- -L,--Local [machine[,offset]]
- ditto, but generate groupname with machine prefix
- -d,--domain [domain[,offset]]
- print domain groups with gid offset offset
- (from current domain if no domain specified)
- -D,--Domain [domain[,offset]]
- ditto, but generate groupname with machine prefix
- -c,--current print current group
- -C,--Current ditto, but generate groupname with machine or
- domain prefix
- -S,--separator char for -L, -D, -C use character char as domain\group
- separator in groupname instead of the default '\'
- -o,--id-offset offset change the default offset (10000) added to gids
- in domain or foreign server accounts.
- -g,--group groupname only return information for the specified group
- one of -l, -L, -d, -D must be specified, too
- -b,--no-builtin don't print BUILTIN groups
- -U,--unix grouplist additionally print UNIX groups when using -l or -L
- on a UNIX Samba server
- grouplist is a comma-separated list of groupnames
- or gid ranges (root,-25,50-100).
- (enumerating large ranges can take a long time!)
- -s,--no-sids (ignored)
- -u,--users (ignored)
- -h,--help print this message
- -V,--version print version information and exit
-
-Default is to print local groups on stand-alone machines, plus domain
-groups on domain controllers and domain member machines.
-</screen>
-
-<para>The <command>mkgroup</command> program can be used to help
-configure Cygwin by creating a <filename>/etc/group</filename>
-file. Its use is essential to include Windows security information.</para>
-
-<para>The command is initially called by <command>setup.exe</command> to
-create a default <filename>/etc/group</filename>. This should be
-sufficient in most circumstances. However, especially when working
-in a multi-domain environment, you can use <command>mkgroup</command>
-manually to create a more complete <filename>/etc/group</filename> file for
-all domains. Especially when you have the same group name used on
-multiple machines or in multiple domains, you can use the <literal>-D</literal>,
-<literal>-L</literal> and <literal>-C</literal> options to create unique
-domain\group style groupnames.</para>
-
-<para>Note that this information is static. If you change the group
-information in your system, you'll need to regenerate the group file
-for it to have the new information.</para>
-
-<para>The <literal>-d/-D</literal> and <literal>-l/-L</literal> options
-allow you to specify where the information comes from, the
-local SAM of a machine or from the domain, or both.
-With the <literal>-d/-D</literal> options the program contacts a Domain
-Controller, which my be unreachable or have restricted access.
-Comma-separated from the machine or domain, you can specify an offset
-which is used as base added to the group's RID to compute the gid
-(offset + RID = gid). This allows you to create the same gids every time you
-re-run <command>mkgroup</command>.
-For very simple needs, an entry for the current user's group can be
-created by using the option <literal>-c</literal> or <literal>-C</literal>.
-If you want to use one of the <literal>-D</literal>, <literal>-L</literal>
-or <literal>-C</literal> options, but you don't like the backslash as
-domain/group separator, you can specify another separator using the
-<literal>-S</literal> option, for instance:</para>
-
-<example id="utils-mkgroup-ex"><title>Setting up group entry for current user with different domain/group separator</title>
-<screen>
-<prompt>$</prompt> <userinput>mkgroup -C -S+ &gt; /etc/group</userinput>
-<prompt>$</prompt> <userinput>cat /etc/group</userinput>
-DOMAIN+my_group:S-1-5-21-2913048732-1697188782-3448811101-1144:11144:
-</screen>
-</example>
-
-<para>The <literal>-o</literal> option allows for special cases
-(such as multiple domains) where the GIDs might match otherwise.
-The <literal>-g</literal> option only prints the information for one group.
-The <literal>-U</literal> option allows you to enumerate the standard UNIX
-groups on a Samba machine. It's used together with
-<literal>-l samba-server</literal> or <literal>-L samba-server</literal>.
-The normal UNIX groups are usually not enumerated, but they can show
-up as a group in <command>ls -l</command> output.
-</para>
-
-</sect2>
-
-<sect2 id="mkpasswd"><title>mkpasswd</title>
-
-<screen>
-Usage: mkpasswd [OPTIONS]...
-
-Print /etc/passwd file to stdout
-
-Options:
-
- -l,--local [machine[,offset]]
- print local user accounts with uid offset offset
- (from local machine if no machine specified)
- -L,--Local [machine[,offset]]
- ditto, but generate username with machine prefix
- -d,--domain [domain[,offset]]
- print domain accounts with uid offset offset
- (from current domain if no domain specified)
- -D,--Domain [domain[,offset]]
- ditto, but generate username with domain prefix
- -c,--current print current user
- -C,--Current ditto, but generate username with machine or
- domain prefix
- -S,--separator char for -L, -D, -C use character char as domain\user
- separator in username instead of the default '\'
- -o,--id-offset offset change the default offset (10000) added to uids
- in domain or foreign server accounts.
- -u,--username username only return information for the specified user
- one of -l, -L, -d, -D must be specified, too
- -p,--path-to-home path use specified path instead of user account home dir
- or /home prefix
- -U,--unix userlist additionally print UNIX users when using -l or -L\
- on a UNIX Samba server
- userlist is a comma-separated list of usernames
- or uid ranges (root,-25,50-100).
- (enumerating large ranges can take a long time!)
- -s,--no-sids (ignored)
- -m,--no-mount (ignored)
- -g,--local-groups (ignored)
- -h,--help displays this message
- -V,--version version information and exit
-
-Default is to print local accounts on stand-alone machines, domain accounts
-on domain controllers and domain member machines.
-</screen>
-
-<para>The <command>mkpasswd</command> program can be used to help
-configure Cygwin by creating a <filename>/etc/passwd</filename> from
-your system information.
-Its use is essential to include Windows security information. However,
-the actual passwords are determined by Windows, not by the content of
-<filename>/etc/passwd</filename>.</para>
-
-<para>The command is initially called by <command>setup.exe</command> to
-create a default <filename>/etc/passwd</filename>. This should be
-sufficient in most circumstances. However, especially when working
-in a multi-domain environment, you can use <command>mkpasswd</command>
-manually to create a more complete <filename>/etc/passwd</filename> file for
-all domains. Especially when you have the same user name used on
-multiple machines or in multiple domains, you can use the <literal>-D</literal>,
-<literal>-L</literal> and <literal>-C</literal> options to create unique
-domain\user style usernames.</para>
-
-<para>Note that this information is static. If you change the user
-information in your system, you'll need to regenerate the passwd file
-for it to have the new information.</para>
-
-<para>The <literal>-d/-D</literal> and <literal>-l/-L</literal> options
-allow you to specify where the information comes from, the
-local machine or the domain (default or given), or both.
-With the <literal>-d/-D</literal> options the program contacts the Domain
-Controller, which may be unreachable or have restricted access.
-Comma-separated from the machine or domain, you can specify an offset
-which is used as base added to the user's RID to compute the uid
-(offset + RID = uid). This allows to create the same uids every time you
-re-run <command>mkpasswd</command>.
-An entry for the current user can be created by using the
-option <literal>-c</literal> or <literal>-C</literal>.
-If you want to use one of the <literal>-D</literal>, <literal>-L</literal>
-or <literal>-C</literal> options, but you don't like the backslash as
-domain/group separator, you can specify another separator using the
-<literal>-S</literal> option, similar to the <command>mkgroup</command>.
-The <literal>-o</literal> option allows for special cases
-(such as multiple domains) where the UIDs might match otherwise.
-The <literal>-p</literal> option causes <command>mkpasswd</command> to
-use the specified prefix instead of the account home dir or <literal>/home/
-</literal>. For example, this command:
-
-<example id="utils-althome-ex"><title>Using an alternate home root</title>
-<screen>
-<prompt>$</prompt> <userinput>mkpasswd -l -p "$(cygpath -H)" &gt; /etc/passwd</userinput>
-</screen>
-</example>
-
-would put local users' home directories in the Windows 'Profiles' directory.
-The <literal>-u</literal> option creates just an entry for
-the specified user.
-The <literal>-U</literal> option allows you to enumerate the standard UNIX
-users on a Samba machine. It's used together with
-<literal>-l samba-server</literal> or <literal>-L samba-server</literal>.
-The normal UNIX users are usually not enumerated, but they can show
-up as file owners in <command>ls -l</command> output.
-</para>
-
-</sect2>
-
-<sect2 id="mount"><title>mount</title>
-
-<screen>
-Usage: mount [OPTION] [&lt;win32path&gt; &lt;posixpath&gt;]
- mount -a
- mount &lt;posixpath&gt;
-
-Display information about mounted filesystems, or mount a filesystem
-
- -a, --all mount all filesystems mentioned in fstab
- -c, --change-cygdrive-prefix change the cygdrive path prefix to &lt;posixpath&gt;
- -f, --force force mount, don't warn about missing mount
- point directories
- -h, --help output usage information and exit
- -m, --mount-entries write fstab entries to replicate mount points
- and cygdrive prefixes
- -o, --options X[,X...] specify mount options
- -p, --show-cygdrive-prefix show user and/or system cygdrive path prefix
- -V, --version output version information and exit
-</screen>
-
-<para>The <command>mount</command> program is used to map your drives
-and shares onto Cygwin's simulated POSIX directory tree, much like as is
-done by mount commands on typical UNIX systems. However, in contrast to
-mount points given in <filename>/etc/fstab</filename>, mount points
-created or changed with <command>mount</command> are not persistent. They
-disappear immediately after the last process of the current user exited.
-Please see <xref linkend="mount-table"></xref> for more information on the
-concepts behind the Cygwin POSIX file system and strategies for using
-mounts. To remove mounts temporarily, use <command>umount</command></para>
-
-<sect3 id="utils-mount"><title>Using mount</title>
-
-<para>If you just type <command>mount</command> with no parameters, it
-will display the current mount table for you.</para>
-
-<example id="utils-mount-ex">
-<title>Displaying the current set of mount points</title>
-<screen>
-<prompt>$</prompt> <userinput>mount</userinput>
-C:/cygwin/bin on /usr/bin type ntfs (binary)
-C:/cygwin/lib on /usr/lib type ntfs (binary)
-C:/cygwin on / type ntfs (binary)
-C: on /mnt/c type ntfs (binary,user,noumount)
-D: on /mnt/d type fat (binary,user,noumount)
-</screen>
-</example>
-
-<para>In this example, c:/cygwin is the POSIX root and the D drive is
-mapped to <filename>/mnt/d</filename>. Note that in this case, the root
-mount is a system-wide mount point that is visible to all users running
-Cygwin programs, whereas the <filename>/mnt/d</filename> mount is only
-visible to the current user.</para>
-
-<para>The <command>mount</command> utility is also the mechanism for
-adding new mounts to the mount table in memory. The following example
-demonstrates how to mount the directory
-<filename>//pollux/home/joe/data</filename> to <filename>/data</filename>
-for the duration of the current session.
-</para>
-
-<example id="utils-mount-add-ex">
-<title>Adding mount points</title>
-<screen>
-<prompt>$</prompt> <userinput>ls /data</userinput>
-ls: /data: No such file or directory
-<prompt>$</prompt> <userinput>mount //pollux/home/joe/data /data</userinput>
-mount: warning - /data does not exist!
-<prompt>$</prompt> <userinput>mount</userinput>
-//pollux/home/joe/data on /data type smbfs (binary)
-C:/cygwin/bin on /usr/bin type ntfs (binary)
-C:/cygwin/lib on /usr/lib type ntfs (binary)
-C:/cygwin on / type ntfs (binary)
-C: on /c type ntfs (binary,user,noumount)
-D: on /d type fat (binary,user,noumount)
-</screen>
-</example>
-
-<para>A given POSIX path may only exist once in the mount table. Attempts to
-replace the mount will fail with a busy error. The <literal>-f</literal>
-(force) option causes the old mount to be silently replaced with the new one,
-provided the old mount point was a user mount point. It's not valid to
-replace system-wide mount points. Additionally, the <literal>-f</literal>
-option will silence warnings about the non-existence of directories at the
-Win32 path location.</para>
-
-<para>
-The <literal>-o</literal> option is the method via which various options about
-the mount point may be recorded. The following options are available (note that
-most of the options are duplicates of other mount flags):</para>
-
-<screen>
- acl - Use the filesystem's access control lists (ACLs) to
- implement real POSIX permissions (default).
- binary - Files default to binary mode (default).
- bind - Allows to remount part of the file hierarchy somewhere else.
- Different from other mount calls, the first argument
- specifies an absolute POSIX path, rather than a Win32 path.
- This POSIX path is remounted to the POSIX path specified as
- the second parameter. The conversion to a Win32 path is done
- within Cygwin immediately at the time of the call. Note that
- symlinks are ignored while performing this path conversion.
- cygexec - Treat all files below mount point as cygwin executables.
- dos - Always convert leading spaces and trailing dots and spaces to
- characters in the UNICODE private use area. This allows to use
- broken filesystems which only allow DOS filenames, even if they
- are not recognized as such by Cygwin.
- exec - Treat all files below mount point as executable.
- ihash - Always fake inode numbers rather than using the ones returned
- by the filesystem. This allows to use broken filesystems which
- don't return unambiguous inode numbers, even if they are not
- recognized as such by Cygwin.
- noacl - Ignore ACLs and fake POSIX permissions.
- nosuid - No suid files are allowed (currently unimplemented)
- notexec - Treat all files below mount point as not executable.
- override - Override immutable mount points.
- posix=0 - Switch off case sensitivity for paths under this mount point.
- posix=1 - Switch on case sensitivity for paths under this mount point
- (default).
- sparse - Switch on support for sparse files. This option only makes
- sense on NTFS and then only if you really need sparse files.
- text - Files default to CRLF text mode line endings.
-</screen>
-
-<para>For a more complete description of the mount options and the
-<filename>/etc/fstab</filename> file, see
-<xref linkend="mount-table"></xref>.</para>
-
-<para>Note that all mount points added with <command>mount</command> are
-user mount points. System mount points can only be specified in
-the <filename>/etc/fstab</filename> file.</para>
-
-<para>If you added mount points to <filename>/etc/fstab</filename> or your
-<filename>/etc/fstab.d/&lt;username&gt;</filename> file, you can add these
-mount points to your current user session using the <literal>-a/--all</literal>
-option, or by specifing the posix path alone on the command line. As an
-example, consider you added a mount point with the POSIX path
-<filename>/my/mount</filename>. You can add this mount point with either
-one of the following two commands to your current user session.</para>
-
-<screen>
-<prompt>$</prompt> <userinput>mount /my/mount</userinput>
-<prompt>$</prompt> <userinput>mount -a</userinput>
-</screen>
-
-<para>The first command just adds the <filename>/my/mount</filename> mount
-point to your current session, the <command>mount -a</command> adds all
-new mount points to your user session.</para>
-
-<para>If you change a mount point to point to another native path, or
-if you changed the flags of a mount point, you have to <command>umount</command>
-the mount point first, before you can add it again. Please note that
-all such added mount points are added as user mount points, and that the
-rule that system mount points can't be removed or replaced in a running
-session still applies.</para>
-
-<para>To bind a POSIX path to another POSIX path, use the
-<literal>bind</literal> mount flag.</para>
-
-<screen>
-<prompt>$</prompt> <userinput>mount -o bind /var /usr/var</userinput>
-</screen>
-
-<para>This command makes the file hirarchy under <filename>/var</filename>
-additionally available under <filename>/usr/var</filename>.</para>
-
-<para>
-The <literal>-m</literal> option causes the <command>mount</command> utility
-to output the current mount table in a series of fstab entries.
-You can save this output as a backup when experimenting with the mount table.
-Copy the output to <filename>/etc/fstab</filename> to restore the old state.
-It also makes moving your settings to a different machine much easier.</para>
-
-</sect3>
-
-<sect3 id="utils-cygdrive"><title>Cygdrive mount points</title>
-
-<para>Whenever Cygwin cannot use any of the existing mounts to convert
-from a particular Win32 path to a POSIX one, Cygwin will, instead,
-convert to a POSIX path using a default mount point:
-<filename>/cygdrive</filename>. For example, if Cygwin accesses
-<filename>z:\foo</filename> and the z drive is not currently in the
-mount table, then <filename>z:\</filename> will be accessible as
-<filename>/cygdrive/z</filename>. The <command>mount</command> utility
-can be used to change this default automount prefix through the use of the
-"--change-cygdrive-prefix" option. In the following example, we will
-set the automount prefix to <filename>/mnt</filename>:</para>
-
-<example id="utils-cygdrive-ex">
-<title>Changing the default prefix</title>
-<screen>
-<prompt>$</prompt> <userinput>mount --change-cygdrive-prefix /mnt</userinput>
-</screen>
-</example>
-
-<para>Note that the cygdrive prefix can be set both per-user and system-wide,
-and that as with all mounts, a user-specific mount takes precedence over the
-system-wide setting. The <command>mount</command> utility creates system-wide
-mounts by default if you do not specify a type.
-You can always see the user and system cygdrive prefixes with the
-<literal>-p</literal> option. Using the <literal>--options</literal>
-flag with <literal>--change-cygdrive-prefix</literal> makes all new
-automounted filesystems default to this set of options. For instance
-(using the short form of the command line flags)</para>
-
-<example id="utils-cygdrive-ex2">
-<title>Changing the default prefix with specific mount options</title>
-<screen>
-<prompt>$</prompt> <userinput>mount -c /mnt -o binary,noacl</userinput>
-</screen>
-</example>
-
-
-</sect3>
-
-<sect3 id="utils-limitations"><title>Limitations</title>
-
-<para>Limitations: there is a hard-coded limit of 64 mount points
-(up to Cygwin 1.7.9: 30 mount points). Also, although you can mount
-to pathnames that do not start with "/", there is no way to make use
-of such mount points.</para>
-
-<para>Normally the POSIX mount point in Cygwin is an existing empty
-directory, as in standard UNIX. If this is the case, or if there is a
-place-holder for the mount point (such as a file, a symbolic link
-pointing anywhere, or a non-empty directory), you will get the expected
-behavior. Files present in a mount point directory before the mount
-become invisible to Cygwin programs.
-</para>
-
-<para>It is sometimes desirable to mount to a non-existent directory,
-for example to avoid cluttering the root directory with names
-such as
-<filename>a</filename>, <filename>b</filename>, <filename>c</filename>
-pointing to disks.
-Although <command>mount</command> will give you a warning, most
-everything will work properly when you refer to the mount point
-explicitly. Some strange effects can occur however.
-For example if your current working directory is
-<filename>/dir</filename>,
-say, and <filename>/dir/mtpt</filename> is a mount point, then
-<filename>mtpt</filename> will not show up in an <command>ls</command>
-or
-<command>echo *</command> command and <command>find .</command> will
-not
-find <filename>mtpt</filename>.
-</para>
-
-</sect3>
-
-</sect2>
-
-<sect2 id="passwd"><title>passwd</title>
-
-<screen>
-Usage: passwd [OPTION] [USER]
-
-Change USER's password or password attributes.
-
-User operations:
- -l, --lock lock USER's account.
- -u, --unlock unlock USER's account.
- -c, --cannot-change USER can't change password.
- -C, --can-change USER can change password.
- -e, --never-expires USER's password never expires.
- -E, --expires USER's password expires according to system's
- password aging rule.
- -p, --pwd-not-required no password required for USER.
- -P, --pwd-required password is required for USER.
- -R, --reg-store-pwd enter password to store it in the registry for
- later usage by services to be able to switch
- to this user context with network credentials.
-
-System operations:
- -i, --inactive NUM set NUM of days before inactive accounts are disabled
- (inactive accounts are those with expired passwords).
- -n, --minage DAYS set system minimum password age to DAYS days.
- -x, --maxage DAYS set system maximum password age to DAYS days.
- -L, --length LEN set system minimum password length to LEN.
-
-Other options:
- -d, --logonserver SERVER connect to SERVER (e.g. domain controller).
- Default server is the local system, unless
- changing the current user, in which case the
- default is the content of $LOGONSERVER.
- -S, --status display password status for USER (locked, expired,
- etc.) plus global system password settings.
- -h, --help output usage information and exit.
- -V, --version output version information and exit.
-
-If no option is given, change USER's password. If no user name is given,
-operate on current user. System operations must not be mixed with user
-operations. Don't specify a USER when triggering a system operation.
-
-Don't specify a user or any other option together with the -R option.
-Non-Admin users can only store their password if cygserver is running.
-Note that storing even obfuscated passwords in the registry is not overly
-secure. Use this feature only if the machine is adequately locked down.
-Don't use this feature if you don't need network access within a remote
-session. You can delete your stored password by using `passwd -R' and
-specifying an empty password.
-</screen>
-
-<para> <command>passwd</command> changes passwords for user accounts.
-A normal user may only change the password for their own account,
-but administrators may change passwords on any account.
-<command>passwd</command> also changes account information, such as
-password expiry dates and intervals.</para>
-
-<para>For password changes, the user is first prompted for their old
-password, if one is present. This password is then encrypted and
-compared against the stored password. The user has only one chance to
-enter the correct password. The administrators are permitted to
-bypass this step so that forgotten passwords may be changed.</para>
-
-<para>The user is then prompted for a replacement password.
-<command>passwd</command> will prompt twice for this replacement and
-compare the second entry against the first. Both entries are required to
-match in order for the password to be changed.</para>
-
-<para>After the password has been entered, password aging information
-is checked to see if the user is permitted to change their password
-at this time. If not, <command>passwd</command> refuses to change the
-password and exits.</para>
-
-<para>
-To get current password status information, use the
-<literal>-S</literal> option. Administrators can use
-<command>passwd</command> to perform several account maintenance
-functions (users may perform some of these functions on their own
-accounts). Accounts may be locked with the <literal>-l</literal> flag
-and unlocked with the <literal>-u</literal> flag. Similarly,
-<literal>-c</literal> disables a user's ability to change passwords, and
-<literal>-C</literal> allows a user to change passwords. For password
-expiry, the <literal>-e</literal> option disables expiration, while the
-<literal>-E</literal> option causes the password to expire according to
-the system's normal aging rules. Use <literal>-p</literal> to disable
-the password requirement for a user, or <literal>-P</literal> to require
-a password.
-</para>
-
-<para>Administrators can also use <command>passwd</command> to change
-system-wide password expiry and length requirements with the
-<literal>-i</literal>, <literal>-n</literal>, <literal>-x</literal>,
-and <literal>-L</literal> options. The <literal>-i</literal>
-option is used to disable an account after the password has been expired
-for a number of days. After a user account has had an expired password
-for <emphasis>NUM</emphasis> days, the user may no longer sign on to
-the account. The <literal>-n</literal> option is
-used to set the minimum number of days before a password may be changed.
-The user will not be permitted to change the password until
-<emphasis>MINDAYS</emphasis> days have elapsed. The
-<literal>-x</literal> option is used to set the maximum number of days
-a password remains valid. After <emphasis>MAXDAYS</emphasis> days, the
-password is required to be changed. Allowed values for the above options
-are 0 to 999. The <literal>-L</literal> option sets the minimum length of
-allowed passwords for users who don't belong to the administrators group
-to <emphasis>LEN</emphasis> characters. Allowed values for the minimum
-password length are 0 to 14. In any of the above cases, a value of 0
-means `no restrictions'.</para>
-
-<para>
-All operations affecting the current user are by default run against
-the logon server of the current user (taken from the environment
-variable <envar>LOGONSERVER</envar>. When password or account information
-of other users should be changed, the default server is the local system.
-To change a user account on a remote machine, use the <literal>-d</literal>
-option to specify the machine to run the command against. Note that the
-current user must be a valid member of the administrators group on the remote
-machine to perform such actions.
-</para>
-
-<para>Users can use the <command>passwd -R</command> to enter
-a password which then gets stored in a special area of the registry on the
-local system, which is also used by Windows to store passwords of accounts
-running Windows services. When a privileged Cygwin application calls the
-<command>set{e}uid(user_id)</command> system call, Cygwin checks if a
-password for that user has been stored in this registry area. If so, it
-uses this password to switch to this user account using that password.
-This allows you to logon through, for instance, <command>ssh</command> with
-public key authentication and get a full qualified user token with
-all credentials for network access. However, the method has some
-drawbacks security-wise. This is explained in more detail in
-<xref linkend="ntsec"></xref>.</para>
-
-<para>Please note that storing passwords in that registry area is a
-privileged operation which only administrative accounts are allowed to
-do. Administrators can enter the password for other user accounts into
-the registry by specifying the username on the commandline. If normal,
-non-admin users should be allowed to enter their passwords using
-<command>passwd -R</command>, it's required to run <command>cygserver</command>
-as a service under the LocalSystem account before running
-<command>passwd -R</command>. This only affects storing passwords. Using
-passwords in privileged processes does not require <command>cygserver</command>
-to run.</para>
-
-<para>Limitations: Users may not be able to change their password on
-some systems.</para>
-
-</sect2>
-
-<sect2 id="pldd"><title>pldd</title>
-
-<screen>
-Usage: pldd [OPTION...] PID
-
-List dynamic shared objects loaded into a process.
-
- -?, --help Give this help list
- --usage Give a short usage message
- -V, --version Print program version
-</screen>
-
-<para><command>pldd</command> prints the shared libraries (DLLs) loaded
-by the process with the given PID.</para>
-
-</sect2>
-
-<sect2 id="ps"><title>ps</title>
-
-<screen>
-Usage: ps [-aefls] [-u UID]
-
-Report process status
-
- -a, --all show processes of all users
- -e, --everyone show processes of all users
- -f, --full show process uids, ppids
- -h, --help output usage information and exit
- -l, --long show process uids, ppids, pgids, winpids
- -p, --process show information for specified PID
- -s, --summary show process summary
- -u, --user list processes owned by UID
- -V, --version output version information and exit
- -W, --windows show windows as well as cygwin processes
-With no options, ps outputs the long format by default
-</screen>
-
-<para>The <command>ps</command> program gives the status of all the
-Cygwin processes running on the system (ps = "process status"). Due
-to the limitations of simulating a POSIX environment under Windows,
-there is little information to give.
-</para>
-
-<para>
-The PID column is the process ID you need to give to the
-<command>kill</command> command. The PPID is the parent process ID,
-and PGID is the process group ID. The WINPID column is the process
-ID displayed by NT's Task Manager program. The TTY column gives which
-pseudo-terminal a process is running on, or a <literal>'?'</literal>
-for services. The UID column shows which user owns each process.
-STIME is the time the process was started, and COMMAND gives the name
-of the program running. Listings may also have a status flag in
-column zero; <literal>S</literal> means stopped or suspended (in other
-words, in the background), <literal>I</literal> means waiting for
-input or interactive (foreground), and <literal>O</literal> means
-waiting to output.
-</para>
-
-<para>
-By default, <command>ps</command> will only show processes owned by the
-current user. With either the <literal>-a</literal> or <literal>-e</literal>
-option, all user's processes (and system processes) are listed. There are
-historical UNIX reasons for the synonomous options, which are functionally
-identical. The <literal>-f</literal> option outputs a "full" listing with
-usernames for UIDs. The <literal>-l</literal> option is the default display
-mode, showing a "long" listing with all the above columns. The other display
-option is <literal>-s</literal>, which outputs a shorter listing of just
-PID, TTY, STIME, and COMMAND. The <literal>-u</literal> option allows you
-to show only processes owned by a specific user. The <literal>-p</literal>
-option allows you to show information for only the process with the
-specified PID. The <literal>-W</literal>
-option causes <command>ps</command> show non-Cygwin Windows processes as
-well as Cygwin processes. The WINPID is also the PID, and they can be killed
-with the Cygwin <command>kill</command> command's <literal>-f</literal>
-option.
-</para>
-
-</sect2>
-
-<sect2 id="regtool"><title>regtool</title>
-
-<screen>
-Usage: regtool [OPTION] (add|check|get|list|remove|unset|load|unload|save) KEY
-
-View or edit the Win32 registry
-
-Actions:
-
- add KEY\SUBKEY add new SUBKEY
- check KEY exit 0 if KEY exists, 1 if not
- get KEY\VALUE prints VALUE to stdout
- list KEY list SUBKEYs and VALUEs
- remove KEY remove KEY
- set KEY\VALUE [data ...] set VALUE
- unset KEY\VALUE removes VALUE from KEY
- load KEY\SUBKEY PATH load hive from PATH into new SUBKEY
- unload KEY\SUBKEY unload hive and remove SUBKEY
- save KEY\SUBKEY PATH save SUBKEY into new hive PATH
-
-Options for 'list' Action:
-
- -k, --keys print only KEYs
- -l, --list print only VALUEs
- -p, --postfix like ls -p, appends '\' postfix to KEY names
-
-Options for 'get' Action:
-
- -b, --binary print REG_BINARY data as hex bytes
- -n, --none print data as stream of bytes as stored in registry
- -x, --hex print numerical data as hex numbers
-
-Options for 'set' Action:
-
- -b, --binary set type to REG_BINARY (hex args or '-')
- -D, --dword-be set type to REG_DWORD_BIG_ENDIAN
- -e, --expand-string set type to REG_EXPAND_SZ
- -i, --integer set type to REG_DWORD
- -m, --multi-string set type to REG_MULTI_SZ
- -n, --none set type to REG_NONE
- -Q, --qword set type to REG_QWORD
- -s, --string set type to REG_SZ
-
-Options for 'set' and 'unset' Actions:
-
- -K&lt;c&gt;, --key-separator[=]&lt;c&gt; set key separator to &lt;c&gt; instead of '\'
-
-Other Options:
-
- -h, --help output usage information and exit
- -q, --quiet no error output, just nonzero return if KEY/VALUE missing
- -v, --verbose verbose output, including VALUE contents when applicable
- -w, --wow64 access 64 bit registry view (ignored on 32 bit Windows)
- -W, --wow32 access 32 bit registry view (ignored on 32 bit Windows)
- -V, --version output version information and exit
-
-KEY is in the format [host]\prefix\KEY\KEY\VALUE, where host is optional
-remote host in either \\hostname or hostname: format and prefix is any of:
- root HKCR HKEY_CLASSES_ROOT (local only)
- config HKCC HKEY_CURRENT_CONFIG (local only)
- user HKCU HKEY_CURRENT_USER (local only)
- machine HKLM HKEY_LOCAL_MACHINE
- users HKU HKEY_USERS
-
-You can use forward slash ('/') as a separator instead of backslash, in
-that case backslash is treated as escape character
-Example: regtool.exe get '\user\software\Microsoft\Clock\iFormat'
-</screen>
-
-<para>The <command>regtool</command> program allows shell scripts
-to access and modify the Windows registry. Note that modifying the
-Windows registry is dangerous, and carelessness here can result
-in an unusable system. Be careful.</para>
-
-<para>The <literal>-v</literal> option means "verbose". For most
-commands, this causes additional or lengthier messages to be printed.
-Conversely, the <literal>-q</literal> option supresses error messages,
-so you can use the exit status of the program to detect if a key
-exists or not (for example).</para>
-
-<para>The <literal>-w</literal> option allows you to access the 64 bit view
-of the registry. Several subkeys exist in a 32 bit and a 64 bit version
-when running on Windows 64. Since Cygwin is running in 32 bit mode, it
-only has access to the 32 bit view of these registry keys. When using
-the <literal>-w</literal> switch, the 64 bit view is used and
-<command>regtool</command> can access the entire registry.
-This option is simply ignored when running on 32 bit Windows versions.
-</para>
-
-<para>The <literal>-W</literal> option allows you to access the 32 bit view
-on the registry. The purpose of this option is mainly for symmetry. It
-permits creation of OS agnostic scripts which would also work in a hypothetical
-64 bit version of Cygwin.</para>
-
-<para>You must provide <command>regtool</command> with an
-<emphasis>action</emphasis> following options (if any). Currently,
-the action must be <literal>add</literal>, <literal>set</literal>,
-<literal>check</literal>, <literal>get</literal>, <literal>list</literal>,
-<literal>remove</literal>, <literal>set</literal>, or <literal>unset</literal>.
-</para>
-
-<para>The <literal>add</literal> action adds a new key. The
-<literal>check</literal> action checks to see if a key exists (the
-exit code of the program is zero if it does, nonzero if it does not).
-The <literal>get</literal> action gets the value of a key,
-and prints it (and nothing else) to stdout. Note: if the value
-doesn't exist, an error message is printed and the program returns a
-non-zero exit code. If you give <literal>-q</literal>, it doesn't
-print the message but does return the non-zero exit code.</para>
-
-<para>
-The <literal>list</literal> action lists the subkeys and values
-belonging to the given key. With <literal>list</literal>, the
-<literal>-k</literal> option instructs <command>regtool</command>
-to print only KEYs, and the <literal>-l</literal> option to print
-only VALUEs. The <literal>-p</literal> option postfixes a
-<literal>'/'</literal> to each KEY, but leave VALUEs with no
-postfix. The <literal>remove</literal> action
-removes a key. Note that you may need to remove everything in the key
-before you may remove it, but don't rely on this stopping you from
-accidentally removing too much.
-</para>
-
-<para>The <literal>get</literal> action prints a value within a key.
-With the <literal>-b</literal> option, data is printed as hex bytes.
-<literal>-n</literal> allows to print the data as a typeless stream of
-bytes. Integer values (REG_DWORD, REG_QWORD) are usually printed
-as decimal values. The <literal>-x</literal> option allows to print
-the numbers as hexadecimal values.</para>
-
-<para>The <literal>set</literal> action sets a value within a key.
-<literal>-b</literal> means it's binary data (REG_BINARY).
-The binary values are specified as hex bytes in the argument list.
-If the argument is <literal>'-'</literal>, binary data is read
-from stdin instead.
-<literal>-d</literal> or <literal>-i</literal> means the value is a 32 bit
-integer value (REG_DWORD).
-<literal>-D</literal> means the value is a 32 bit integer value in
-Big Endian representation (REG_DWORD_BIG_ENDIAN).
-<literal>-Q</literal> means the value is a 64 bit integer value (REG_QWORD).
-<literal>-s</literal> means the value is a string (REG_SZ).
-<literal>-e</literal> means it's an expanding string (REG_EXPAND_SZ)
-that contains embedded environment variables.
-<literal>-m</literal> means it's a multi-string (REG_MULTI_SZ).
-If you don't specify one of these, <command>regtool</command> tries to
-guess the type based on the value you give. If it looks like a
-number, it's a DWORD, unless it's value doesn't fit into 32 bit, in which
-case it's a QWORD. If it starts with a percent, it's an expanding
-string. If you give multiple values, it's a multi-string. Else, it's
-a regular string.</para>
-
-<para>The <literal>unset</literal> action removes a value from a key.</para>
-
-<para>The <literal>load</literal> action adds a new subkey and loads
-the contents of a registry hive into it.
-The parent key must be HKEY_LOCAL_MACHINE or HKEY_USERS.
-The <literal>unload</literal> action unloads the file and removes
-the subkey.
-</para>
-
-<para>The <literal>save</literal> action saves a subkey into a
-registry hive.
-</para>
-
-<para>
-By default, the last "\" or "/" is assumed to be the separator between the
-key and the value. You can use the <literal>-K</literal> option to provide
-an alternate key/value separator character.
-</para>
-
-</sect2>
-
-<sect2 id="setfacl"><title>setfacl</title>
-
-<screen>
-Usage: setfacl [-r] (-f ACL_FILE | -s acl_entries) FILE...
- setfacl [-r] ([-d acl_entries] [-m acl_entries]) FILE...
-
-Modify file and directory access control lists (ACLs)
-
- -d, --delete delete one or more specified ACL entries
- -f, --file set ACL entries for FILE to ACL entries read
- from a ACL_FILE
- -m, --modify modify one or more specified ACL entries
- -r, --replace replace mask entry with maximum permissions
- needed for the file group class
- -s, --substitute substitute specified ACL entries for the
- ACL of FILE
- -h, --help output usage information and exit
- -V, --version output version information and exit
-
-At least one of (-d, -f, -m, -s) must be specified
-</screen>
-
-<para>
-For each file given as parameter, <command>setfacl</command> will
-either replace its complete ACL (<literal>-s</literal>, <literal>-f</literal>),
-or it will add, modify, or delete ACL entries.
-For more information on Cygwin and Windows ACLs, see
-see <xref linkend="ntsec"></xref> in the Cygwin User's Guide.
-</para>
-
-<para>
-Acl_entries are one or more comma-separated ACL entries
-from the following list:
-<screen>
- u[ser]::perm
- u[ser]:uid:perm
- g[roup]::perm
- g[roup]:gid:perm
- m[ask]::perm
- o[ther]::perm
-</screen>
-Default entries are like the above with the additional
-default identifier. For example:
-<screen>
- d[efault]:u[ser]:uid:perm
-</screen>
-</para>
-
-<para>
-<emphasis>perm</emphasis> is either a 3-char permissions string in the form
-"rwx" with the character <literal>'-'</literal> for no permission
-or it is the octal representation of the permissions, a
-value from 0 (equivalent to "---") to 7 ("rwx").
-<emphasis>uid</emphasis> is a user name or a numerical uid.
-<emphasis>gid</emphasis> is a group name or a numerical gid.
-</para>
-
-<para>
-The following options are supported:
-</para>
-
-<para>
-<literal>-d</literal>
-Delete one or more specified entries from the file's ACL.
-The owner, group and others entries must not be deleted.
-Acl_entries to be deleted should be specified without
-permissions, as in the following list:
-<screen>
- u[ser]:uid
- g[roup]:gid
- d[efault]:u[ser]:uid
- d[efault]:g[roup]:gid
- d[efault]:m[ask]:
- d[efault]:o[ther]:
-</screen>
-</para>
-
-<para>
-<literal>-f</literal>
-Take the Acl_entries from ACL_FILE one per line. Whitespace
-characters are ignored, and the character "#" may be used
-to start a comment. The special filename "-" indicates
-reading from stdin. Note that you can use this with
-<command>getfacl</command> and <command>setfacl</command> to copy
-ACLs from one file to another:
-<screen>
-$ getfacl source_file | setfacl -f - target_file
-</screen>
-</para>
-
-<para>
-Required entries are:
-one user entry for the owner of the file,
-one group entry for the group of the file, and
-one other entry.
-</para>
-
-<para>
-If additional user and group entries are given:
-a mask entry for the file group class of the file, and
-no duplicate user or group entries with the same uid/gid.
-</para>
-
-<para>
-If it is a directory:
-one default user entry for the owner of the file,
-one default group entry for the group of the file,
-one default mask entry for the file group class, and
-one default other entry.
-</para>
-
-<para>
-<literal>-m</literal>
-Add or modify one or more specified ACL entries. Acl_entries is a
-comma-separated list of entries from the same list as above.
-</para>
-
-<para>
-<literal>-r</literal>
-Causes the permissions specified in the mask
-entry to be ignored and replaced by the maximum permissions needed for
-the file group class.
-</para>
-
-<para>
-<literal>-s</literal>
-Like <literal>-f</literal>, but substitute the
-file's ACL with Acl_entries specified in a comma-separated list on the
-command line.
-</para>
-
-<para>
-While the <literal>-d</literal> and <literal>-m</literal> options may be used
-in the same command, the <literal>-f</literal> and <literal>-s</literal>
-options may be used only exclusively.
-</para>
-
-<para>
-Directories may contain default ACL entries. Files created
-in a directory that contains default ACL entries will have
-permissions according to the combination of the current umask,
-the explicit permissions requested and the default ACL entries
-</para>
-
-<para>
-Limitations: Under Cygwin, the default ACL entries are not taken into
-account currently.
-</para>
-
-</sect2>
-
-<sect2 id="setmetamode"><title>setmetamode</title>
-
-<screen>
-Usage: setmetamode [metabit|escprefix]
-
-Get or set keyboard meta mode
-
- Without argument, it shows the current meta key mode.
- metabit|meta|bit The meta key sets the top bit of the character.
- escprefix|esc|prefix The meta key sends an escape prefix.
-
-Other options:
-
- -h, --help This text
- -V, --version Print program version and exit
-</screen>
-
-<para><command>setmetamode</command> can be used to determine and set the
-key code sent by the meta (aka <literal>Alt</literal>) key.</para>
-
-</sect2>
-
-<sect2 id="ssp"><title>ssp</title>
-
-<screen>
-Usage: ssp [options] low_pc high_pc command...
-
-Single-step profile COMMAND
-
- -c, --console-trace trace every EIP value to the console. *Lots* slower.
- -d, --disable disable single-stepping by default; use
- OutputDebugString ("ssp on") to enable stepping
- -e, --enable enable single-stepping by default; use
- OutputDebugString ("ssp off") to disable stepping
- -h, --help output usage information and exit
- -l, --dll enable dll profiling. A chart of relative DLL usage
- is produced after the run.
- -s, --sub-threads trace sub-threads too. Dangerous if you have
- race conditions.
- -t, --trace-eip trace every EIP value to a file TRACE.SSP. This
- gets big *fast*.
- -v, --verbose output verbose messages about debug events.
- -V, --version output version information and exit
-
-Example: ssp 0x401000 0x403000 hello.exe
-</screen>
-
-<para>
-SSP - The Single Step Profiler
-</para>
-
-<para>
-Original Author: DJ Delorie
-</para>
-
-<para>
-The SSP is a program that uses the Win32 debug API to run a program
-one ASM instruction at a time. It records the location of each
-instruction used, how many times that instruction is used, and all
-function calls. The results are saved in a format that is usable by
-the profiling program <command>gprof</command>, although
-<command>gprof</command> will claim the values
-are seconds, they really are instruction counts. More on that later.
-</para>
-
-<para>
-Because the SSP was originally designed to profile the Cygwin DLL, it
-does not automatically select a block of code to report statistics on.
-You must specify the range of memory addresses to keep track of
-manually, but it's not hard to figure out what to specify. Use the
-"objdump" program to determine the bounds of the target's ".text"
-section. Let's say we're profiling cygwin1.dll. Make sure you've
-built it with debug symbols (else <command>gprof</command> won't run)
-and run objdump like this:
-
-<screen>
-$ objdump -h cygwin1.dll
-</screen>
-
-It will print a report like this:
-<screen>
-cygwin1.dll: file format pei-i386
-
-Sections:
-Idx Name Size VMA LMA File off Algn
- 0 .text 0007ea00 61001000 61001000 00000400 2**2
- CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
- 1 .data 00008000 61080000 61080000 0007ee00 2**2
- CONTENTS, ALLOC, LOAD, DATA
- . . .
-</screen>
-</para>
-
-<para>
-The only information we're concerned with are the VMA of
-the .text section and the VMA of the section after it
-(sections are usually contiguous; you can also add the
-Size to the VMA to get the end address). In this case,
-the VMA is 0x61001000 and the ending address is either
-0x61080000 (start of .data method) or 0x0x6107fa00 (VMA+Size
-method).
-</para>
-
-<para>
-There are two basic ways to use SSP - either profiling a whole
-program, or selectively profiling parts of the program.
-</para>
-
-<para>
-To profile a whole program, just run <command>ssp</command> without options.
-By default, it will step the whole program. Here's a simple example, using
-the numbers above:
-
-<screen>
-$ ssp 0x61001000 0x61080000 hello.exe
-</screen>
-
-This will step the whole program. It will take at least 8 minutes on
-a PII/300 (yes, really). When it's done, it will create a file called
-"gmon.out". You can turn this data file into a readable report with
-<command>gprof</command>:
-
-<screen>
-$ gprof -b cygwin1.dll
-</screen>
-
-The "-b" means 'skip the help pages'. You can omit this until you're
-familiar with the report layout. The <command>gprof</command> documentation
-explains a lot about this report, but <command>ssp</command> changes a few
-things. For example, the first part of the report reports the amount of time
-spent in each function, like this:
-
-<screen>
-Each sample counts as 0.01 seconds.
- % cumulative self self total
- time seconds seconds calls ms/call ms/call name
- 10.02 231.22 72.43 46 1574.57 1574.57 strcspn
- 7.95 288.70 57.48 130 442.15 442.15 strncasematch
-</screen>
-
-The "seconds" columns are really CPU opcodes, 1/100 second per opcode.
-So, "231.22" above means 23,122 opcodes. The ms/call values are 10x
-too big; 1574.57 means 157.457 opcodes per call. Similar adjustments
-need to be made for the "self" and "children" columns in the second
-part of the report.
-</para>
-
-<para>
-OK, so now we've got a huge report that took a long time to generate,
-and we've identified a spot we want to work on optimizing. Let's say
-it's the time() function. We can use SSP to selectively profile this
-function by using OutputDebugString() to control SSP from within the
-program. Here's a sample program:
-
-<screen>
- #include &lt;windows.h&gt;
- main()
- {
- time_t t;
- OutputDebugString("ssp on");
- time(&amp;t);
- OutputDebugString("ssp off");
- }
-</screen>
-</para>
-
-<para>
-Then, add the <literal>-d</literal> option to ssp to default to
-*disabling* profiling. The program will run at full speed until the first
-OutputDebugString, then step until the second.
-You can then use <command>gprof</command> (as usual) to see the performance
-profile for just that portion of the program's execution.
-</para>
-
-<para>
-There are many options to ssp. Since step-profiling makes your
-program run about 1,000 times slower than normal, it's best to
-understand all the options so that you can narrow down the parts
-of your program you need to single-step.
-</para>
-
-<para>
-<literal>-v</literal> - verbose. This prints messages about threads
-starting and stopping, OutputDebugString calls, DLLs loading, etc.
-</para>
-
-<para>
-<literal>-t</literal> and <literal>-c</literal> - tracing.
-With <literal>-t</literal>, *every* step's address is written
-to the file "trace.ssp". This can be used to help debug functions,
-since it can trace multiple threads. Clever use of scripts can match
-addresses with disassembled opcodes if needed. Warning: creates
-*huge* files, very quickly. <literal>-c</literal> prints each address to
-the console, useful for debugging key chunks of assembler. Use
-<literal>addr2line -C -f -s -e foo.exe &lt; trace.ssp &gt; lines.ssp</literal>
-and then <literal>perl cvttrace</literal> to convert to symbolic traces.
-</para>
-
-<para>
-<literal>-s</literal> - subthreads. Usually, you only need to trace the
-main thread, but sometimes you need to trace all threads, so this enables that.
-It's also needed when you want to profile a function that only a
-subthread calls. However, using OutputDebugString automatically
-enables profiling on the thread that called it, not the main thread.
-</para>
-
-<para>
-<literal>-l</literal> - dll profiling. Generates a pretty table of how much
-time was spent in each dll the program used. No sense optimizing a function in
-your program if most of the time is spent in the DLL.
-I usually use the <literal>-v</literal>, <literal>-s</literal>, and
-<literal>-l</literal> options:
-
-<screen>
-$ ssp <literal>-v</literal> <literal>-s</literal> <literal>-l</literal> <literal>-d</literal> 0x61001000 0x61080000 hello.exe
-</screen>
-</para>
-</sect2>
-
-<sect2 id="strace"><title>strace</title>
-
-<screen>
-Usage: strace.exe [OPTIONS] &lt;command-line&gt;
-Usage: strace.exe [OPTIONS] -p &lt;pid&gt;
-
-Trace system calls and signals
-
- -b, --buffer-size=SIZE set size of output file buffer
- -d, --no-delta don't display the delta-t microsecond timestamp
- -f, --trace-children trace child processes (toggle - default true)
- -h, --help output usage information and exit
- -m, --mask=MASK set message filter mask
- -n, --crack-error-numbers output descriptive text instead of error
- numbers for Windows errors
- -o, --output=FILENAME set output file to FILENAME
- -p, --pid=n attach to executing program with cygwin pid n
- -q, --quiet toggle "quiet" flag. Defaults to on if "-p",
- off otherwise.
- -S, --flush-period=PERIOD flush buffered strace output every PERIOD secs
- -t, --timestamp use an absolute hh:mm:ss timestamp insted of
- the default microsecond timestamp. Implies -d
- -T, --toggle toggle tracing in a process already being
- traced. Requires -p &lt;pid&gt;
- -u, --usecs toggle printing of microseconds timestamp
- -V, --version output version information and exit
- -w, --new-window spawn program under test in a new window
-
- MASK can be any combination of the following mnemonics and/or hex values
- (0x is optional). Combine masks with '+' or ',' like so:
-
- --mask=wm+system,malloc+0x00800
-
- Mnemonic Hex Corresponding Def Description
- =========================================================================
- all 0x000001 (_STRACE_ALL) All strace messages.
- flush 0x000002 (_STRACE_FLUSH) Flush output buffer after each message.
- inherit 0x000004 (_STRACE_INHERIT) Children inherit mask from parent.
- uhoh 0x000008 (_STRACE_UHOH) Unusual or weird phenomenon.
- syscall 0x000010 (_STRACE_SYSCALL) System calls.
- startup 0x000020 (_STRACE_STARTUP) argc/envp printout at startup.
- debug 0x000040 (_STRACE_DEBUG) Info to help debugging.
- paranoid 0x000080 (_STRACE_PARANOID) Paranoid info.
- termios 0x000100 (_STRACE_TERMIOS) Info for debugging termios stuff.
- select 0x000200 (_STRACE_SELECT) Info on ugly select internals.
- wm 0x000400 (_STRACE_WM) Trace Windows msgs (enable _strace_wm).
- sigp 0x000800 (_STRACE_SIGP) Trace signal and process handling.
- minimal 0x001000 (_STRACE_MINIMAL) Very minimal strace output.
- pthread 0x002000 (_STRACE_PTHREAD) Pthread calls.
- exitdump 0x004000 (_STRACE_EXITDUMP) Dump strace cache on exit.
- system 0x008000 (_STRACE_SYSTEM) Serious error; goes to console and log.
- nomutex 0x010000 (_STRACE_NOMUTEX) Don't use mutex for synchronization.
- malloc 0x020000 (_STRACE_MALLOC) Trace malloc calls.
- thread 0x040000 (_STRACE_THREAD) Thread-locking calls.
- special 0x100000 (_STRACE_SPECIAL) Special debugging printfs for
- non-checked-in code
-</screen>
-
-<para>The <command>strace</command> program executes a program, and
-optionally the children of the program, reporting any Cygwin DLL output
-from the program(s) to stdout, or to a file with the <literal>-o</literal>
-option. With the <literal>-w</literal> option, you can start an strace
-session in a new window, for example:
-
-<screen>
-$ strace -o tracing_output -w sh -c 'while true; do echo "tracing..."; done' &amp;
-</screen>
-This is particularly useful for <command>strace</command> sessions that
-take a long time to complete.
-</para>
-
-<para>
-Note that <command>strace</command> is a standalone Windows program and so does
-not rely on the Cygwin DLL itself (you can verify this with
-<command>cygcheck</command>). As a result it does not understand symlinks.
-This program is mainly useful for debugging the Cygwin DLL itself.</para>
-
-</sect2>
-
-<sect2 id="tzset"><title>tzset</title>
-
-<screen>
-Usage: tzset [OPTION]
-
-Print POSIX-compatible timezone ID from current Windows timezone setting
-
-Options:
- -h, --help output usage information and exit.
- -V, --version output version information and exit.
-
-Use tzset to set your TZ variable. In POSIX-compatible shells like bash,
-dash, mksh, or zsh:
-
- export TZ=$(tzset)
-
-In csh-compatible shells like tcsh:
-
- setenv TZ `tzset`
-</screen>
-
-<para>The <command>tzset</command> tool reads the current timezone from Windows
-and generates a POSIX-compatible timezone information for the TZ environment
-variable from that information. That's all there is to it. For the way how
-to use it, see the above usage information.</para>
-
-</sect2>
-
-<sect2 id="umount"><title>umount</title>
-
-<screen>
-Usage: umount.exe [OPTION] [&lt;posixpath&gt;]
-
-Unmount filesystems
-
- -h, --help output usage information and exit
- -U, --remove-user-mounts remove all user mounts
- -V, --version output version information and exit
-</screen>
-
-<para>The <command>umount</command> program removes mounts from the
-mount table in the current session. If you specify a POSIX path that
-corresponds to a current mount point, <command>umount</command> will
-remove it from the current mount table. Note that you can only remove
-user mount points. The <literal>-U</literal> flag may be used to
-specify removing all user mount points from the current user session.</para>
-
-<para>See <xref linkend="mount-table"></xref> for more information on the mount
-table.</para>
-</sect2>
-
-</sect1>
diff --git a/winsup/utils/utils.xml b/winsup/utils/utils.xml
new file mode 100644
index 000000000..f3539239a
--- /dev/null
+++ b/winsup/utils/utils.xml
@@ -0,0 +1,2091 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
+<sect1 id="using-utils">
+ <title>Cygwin Utilities</title>
+
+ <para>Cygwin comes with a number of command-line utilities that are used to
+ manage the UNIX emulation portion of the Cygwin environment. While many of
+ these reflect their UNIX counterparts, each was written specifically for
+ Cygwin. You may use the long or short option names interchangeably; for
+ example, <literal>--help</literal> and <literal>-h</literal> function
+ identically. All of the Cygwin command-line utilities support the
+ <literal>--help</literal> and <literal>--version</literal> options. </para>
+
+ <sect2 id="cygcheck">
+ <title>cygcheck</title>
+
+ <screen>
+Usage: cygcheck [-v] [-h] PROGRAM
+ cygcheck -c [-d] [PACKAGE]
+ cygcheck -s [-r] [-v] [-h]
+ cygcheck -k
+ cygcheck -f FILE [FILE]...
+ cygcheck -l [PACKAGE]...
+ cygcheck -p REGEXP
+ cygcheck --delete-orphaned-installation-keys
+ cygcheck --enable-unique-object-names Cygwin-DLL
+ cygcheck --disable-unique-object-names Cygwin-DLL
+ cygcheck --show-unique-object-names Cygwin-DLL
+ cygcheck -h
+
+List system information, check installed packages, or query package database.
+
+At least one command option or a PROGRAM is required, as shown above.
+
+ PROGRAM list library (DLL) dependencies of PROGRAM
+ -c, --check-setup show installed version of PACKAGE and verify integrity
+ (or for all installed packages if none specified)
+ -d, --dump-only just list packages, do not verify (with -c)
+ -s, --sysinfo produce diagnostic system information (implies -c -d)
+ -r, --registry also scan registry for Cygwin settings (with -s)
+ -k, --keycheck perform a keyboard check session (must be run from a
+ plain console only, not from a pty/rxvt/xterm)
+ -f, --find-package find the package to which FILE belongs
+ -l, --list-package list contents of PACKAGE (or all packages if none given)
+ -p, --package-query search for REGEXP in the entire cygwin.com package
+ repository (requires internet connectivity)
+ --delete-orphaned-installation-keys
+ Delete installation keys of old, now unused
+ installations from the registry. Requires the right
+ to change the registry.
+ --enable-unique-object-names Cygwin-DLL
+ --disable-unique-object-names Cygwin-DLL
+ --show-unique-object-names Cygwin-DLL
+ Enable, disable, or show the setting of the
+ \"unique object names\" setting in the Cygwin DLL
+ given as argument to this option. The DLL path must
+ be given as valid Windows(!) path.
+ See the users guide for more information.
+ If you don't know what this means, don't change it.
+ -v, --verbose produce more verbose output
+ -h, --help annotate output with explanatory comments when given
+ with another command, otherwise print this help
+ -V, --version print the version of cygcheck and exit
+
+Note: -c, -f, and -l only report on packages that are currently installed. To
+ search all official Cygwin packages use -p instead. The -p REGEXP matches
+ package names, descriptions, and names of files/paths within all packages.
+</screen>
+
+ <para> The <command>cygcheck</command> program is a diagnostic utility for
+ dealing with Cygwin programs. If you are familiar with
+ <command>dpkg</command> or <command>rpm</command>,
+ <command>cygcheck</command> is similar in many ways. (The major
+ difference is that <command>setup.exe</command> handles installing and
+ uninstalling packages; see <xref linkend="internet-setup"/> for more
+ information.) </para>
+ <para> The <literal>-c</literal> option checks the version and status of
+ installed Cygwin packages. If you specify one or more package names,
+ <command>cygcheck</command> will limit its output to those packages, or
+ with no arguments it lists all packages. A package will be marked
+ <literal>Incomplete</literal> if files originally installed are no longer
+ present. The best thing to do in that situation is reinstall the package
+ with <command>setup.exe</command>. To see which files are missing, use
+ the <literal>-v</literal> option. If you do not need to know the status
+ of each package and want <command>cygcheck</command> to run faster, add
+ the <literal>-d</literal> option and <command>cygcheck</command> will
+ only output the name and version for each package. </para>
+ <para> If you list one or more programs on the command line,
+ <command>cygcheck</command> will diagnose the runtime environment of that
+ program or programs, providing the names of DLL files on which the
+ program depends. If you specify the <literal>-s</literal> option,
+ <command>cygcheck</command> will give general system information. If you
+ list one or more programs on the command line and specify
+ <literal>-s</literal>, <command>cygcheck</command> will report on
+ both.</para>
+ <para> The <literal>-f</literal> option helps you to track down which
+ package a file came from, and <literal>-l</literal> lists all files in a
+ package. For example, to find out about
+ <filename>/usr/bin/less</filename> and its package: <example
+ id="utils-cygcheck-ex"><title>Example <command>cygcheck</command>
+ usage</title>
+ <screen>
+$ cygcheck -f /usr/bin/less
+less-381-1
+
+$ cygcheck -l less
+/usr/bin/less.exe
+/usr/bin/lessecho.exe
+/usr/bin/lesskey.exe
+/usr/man/man1/less.1
+/usr/man/man1/lesskey.1
+</screen>
+ </example> </para>
+
+ <para>The <literal>-h</literal> option prints additional helpful messages
+ in the report, at the beginning of each section. It also adds table
+ column headings. While this is useful information, it also adds some to
+ the size of the report, so if you want a compact report or if you know
+ what everything is already, just leave this out.</para>
+
+ <para>The <literal>-v</literal> option causes the output to be more
+ verbose. What this means is that additional information will be reported
+ which is usually not interesting, such as the internal version numbers of
+ DLLs, additional information about recursive DLL usage, and if a file in
+ one directory in the PATH also occurs in other directories on the PATH. </para>
+
+ <para>The <literal>-r</literal> option causes <command>cygcheck</command>
+ to search your registry for information that is relevant to Cygwin
+ programs. These registry entries are the ones that have "Cygwin" in the
+ name. If you are paranoid about privacy, you may remove information from
+ this report, but please keep in mind that doing so makes it harder to
+ diagnose your problems.</para>
+
+ <para>In contrast to the other options that search the packages that are
+ installed on your local system, the <literal>-p</literal> option can be
+ used to search the entire official Cygwin package repository. It takes as
+ argument a Perl-compatible regular expression which is used to match
+ package names, package descriptions, and path/filenames of the contents
+ of packages. This feature requires an active internet connection, since
+ it must query the <literal>cygwin.com</literal> web site. In fact, it is
+ equivalent to the search that is available on the <ulink
+ url="http://cygwin.com/packages/">Cygwin package listing</ulink>
+ page.</para>
+
+ <para>For example, perhaps you are getting an error because you are missing
+ a certain DLL and you want to know which package includes that file:
+ <example id="utils-search-ex"><title>Searching all packages for a
+ file</title>
+ <screen>
+$ cygcheck -p 'cygintl-2\.dll'
+Found 1 matches for 'cygintl-2\.dll'.
+
+libintl2-0.12.1-3 GNU Internationalization runtime library
+
+$ cygcheck -p 'libexpat.*\.a'
+Found 2 matches for 'libexpat.*\.a'.
+
+expat-1.95.7-1 XML parser library written in C
+expat-1.95.8-1 XML parser library written in C
+
+$ cygcheck -p '/ls\.exe'
+Found 2 matches for '/ls\.exe'.
+
+coreutils-5.2.1-5 GNU core utilities (includes fileutils, sh-utils and textutils)
+coreutils-5.3.0-6 GNU core utilities (includes fileutils, sh-utils and textutils)
+</screen>
+ </example> </para>
+
+ <para>Note that this option takes a regular expression, not a glob or
+ wildcard. This means that you need to use <literal>.*</literal> if you
+ want something similar to the wildcard <literal>*</literal> commonly used
+ in filename globbing. Similarly, to match the period character you should
+ use <literal>\.</literal> since the <literal>.</literal> character in a
+ regexp is a metacharacter that will match any character. Also be aware
+ that the characters such as <literal>\</literal> and <literal>*</literal>
+ are shell metacharacters, so they must be either escaped or quoted, as in
+ the example above.</para>
+
+ <para>The third example above illustrates that if you want to match a whole
+ filename, you should include the <literal>/</literal> path seperator. In
+ the given example this ensures that filenames that happen to end in
+ <literal>ls.exe</literal> such as <literal>ncftpls.exe</literal> are not
+ shown. Note that this use does not mean "look for packages with
+ <literal>ls</literal> in the root directory," since the
+ <literal>/</literal> can match anywhere in the path. It's just there to
+ anchor the match so that it matches a full filename.</para>
+
+ <para>By default the matching is case-sensitive. To get a case insensitive
+ match, begin your regexp with <literal>(?i)</literal> which is a
+ PCRE-specific feature. For complete documentation on Perl-compatible
+ regular expression syntax and options, read the <command>perlre</command>
+ manpage, or one of many websites such as <literal>perldoc.com</literal>
+ that document the Perl language.</para>
+
+ <para>The <command>cygcheck</command> program should be used to send
+ information about your system for troubleshooting when requested. When
+ asked to run this command save the output so that you can email it, for
+ example:</para>
+
+ <screen>
+<prompt>$</prompt> <userinput>cygcheck -s -v -r -h &gt; cygcheck_output.txt</userinput>
+</screen>
+
+ <para> Each Cygwin DLL stores its path and installation key in the
+ registry. This allows troubleshooting of problems which could be a result
+ of having multiple concurrent Cygwin installations. However, if you're
+ experimenting a lot with different Cygwin installation paths, your
+ registry could accumulate a lot of old Cygwin installation entries for
+ which the installation doesn't exist anymore. To get rid of these
+ orphaned registry entries, use the <command>cygcheck
+ --delete-orphaned-installation-keys</command> command.</para>
+
+ <para> Each Cygwin DLL generates a key value from its installation path.
+ This value is not only stored in the registry, it's also used to generate
+ global object names used for interprocess communication. This keeps
+ different Cygwin installations separate. Processes running under a Cygwin
+ DLL installed in C:\cygwin don't see processes running under a Cygwin DLL
+ installed in C:\Program Files\cygwin. This allows running multiple
+ versions of Cygwin DLLs without these versions to interfere with each
+ other, or to run small third-party installations for a specific purpose
+ independently from a Cygwin net distribution. </para>
+
+ <para> For debugging purposes it could be desired that the various Cygwin
+ DLLs use the same key, independently from their installation paths. If
+ the DLLs have different versions, trying to run processes under these
+ DLLs concurrently will result in error messages like this one:</para>
+
+ <screen>
+*** shared version mismatch detected - 0x8A88009C/0x75BE0074.
+This problem is probably due to using incompatible versions of the Cygwin DLL.
+Search for cygwin1.dll using the Windows Start->Find/Search facility
+and delete all but the most recent version. The most recent version *should*
+reside in x:\\cygwin\\bin, where 'x' is the drive on which you have
+installed the cygwin distribution. Rebooting is also suggested if you
+are unable to find another Cygwin DLL.
+</screen>
+
+ <para> To disable the usage of a unique key value of a certain Cygwin DLL,
+ use the <command>cygcheck --disable-unique-object-names
+ Cygwin-DLL</command> command. <literal>Cygwin-DLL</literal> is the
+ Windows path (*not* a Cygwin POSIX path) to the DLL for which you want to
+ disable this feature. Note that you have to stop all Cygwin processes
+ running under this DLL, before you're allowed to change this setting. For
+ instance, run <command>cygcheck</command> from a DOS command line for
+ this purpose.</para>
+
+ <para>To re-enable the usage of a unique key, use the <command>cygcheck
+ --enable-unique-object-names Cygwin-DLL</command> command. This option
+ has the same characteristics as the
+ <literal>--disable-unique-object-names</literal> option</para>
+
+ <para>Finally, you can use <command>cygcheck --show-unique-object-names
+ Cygwin-DLL</command> to find out if the given Cygwin DLL use unique
+ object names or not. In contrast to the <literal>--disable-...</literal>
+ and <literal>--enable-...</literal> options, the
+ <literal>--show-unique-object-names</literal> option also works for
+ Cygwin DLLs which are currently in use.</para>
+
+ </sect2>
+
+ <sect2 id="cygpath">
+ <title>cygpath</title>
+
+ <screen>
+Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
+ cygpath [-c HANDLE]
+ cygpath [-ADHOPSW]
+ cygpath [-F ID]
+
+Convert Unix and Windows format paths, or output system path information
+
+Output type options:
+
+ -d, --dos print DOS (short) form of NAMEs (C:\PROGRA~1\)
+ -m, --mixed like --windows, but with regular slashes (C:/WINNT)
+ -M, --mode report on mode of file (currently binmode or textmode)
+ -u, --unix (default) print Unix form of NAMEs (/cygdrive/c/winnt)
+ -w, --windows print Windows form of NAMEs (C:\WINNT)
+ -t, --type TYPE print TYPE form: 'dos', 'mixed', 'unix', or 'windows'
+
+Path conversion options:
+
+ -a, --absolute output absolute path
+ -l, --long-name print Windows long form of NAMEs (with -w, -m only)
+ -p, --path NAME is a PATH list (i.e., '/bin:/usr/bin')
+ -s, --short-name print DOS (short) form of NAMEs (with -w, -m only)
+ -C, --codepage CP print DOS, Windows, or mixed pathname in Windows
+ codepage CP. CP can be a numeric codepage identifier,
+ or one of the reserved words ANSI, OEM, or UTF8.
+ If this option is missing, cygpath defaults to the
+ character set defined by the current locale.
+
+System information:
+
+ -A, --allusers use `All Users' instead of current user for -D, -P
+ -D, --desktop output `Desktop' directory and exit
+ -H, --homeroot output `Profiles' directory (home root) and exit
+ -O, --mydocs output `My Documents' directory and exit
+ -P, --smprograms output Start Menu `Programs' directory and exit
+ -S, --sysdir output system directory and exit
+ -W, --windir output `Windows' directory and exit
+ -F, --folder ID output special folder with numeric ID and exit
+
+Other options:
+
+ -f, --file FILE read FILE for input; use - to read from STDIN
+ -o, --option read options from FILE as well (for use with --file)
+ -c, --close HANDLE close HANDLE (for use in captured process)
+ -i, --ignore ignore missing argument
+ -h, --help output usage information and exit
+ -V, --version output version information and exit
+</screen>
+
+ <para>The <command>cygpath</command> program is a utility that converts
+ Windows native filenames to Cygwin POSIX-style pathnames and vice versa.
+ It can be used when a Cygwin program needs to pass a file name to a
+ native Windows program, or expects to get a file name from a native
+ Windows program. Alternatively, <command>cygpath</command> can output
+ information about the location of important system directories in either
+ format. </para>
+
+ <para>The <literal>-u</literal> and <literal>-w</literal> options indicate
+ whether you want a conversion to UNIX (POSIX) format
+ (<literal>-u</literal>) or to Windows format (<literal>-w</literal>). Use
+ the <literal>-d</literal> to get DOS-style (8.3) file and path names. The
+ <literal>-m</literal> option will output Windows-style format but with
+ forward slashes instead of backslashes. This option is especially useful
+ in shell scripts, which use backslashes as an escape character.</para>
+
+ <para> In combination with the <literal>-w</literal> option, you can use
+ the <literal>-l</literal> and <literal>-s</literal> options to use normal
+ (long) or DOS-style (short) form. The <literal>-d</literal> option is
+ identical to <literal>-w</literal> and <literal>-s</literal> together. </para>
+
+ <para>The <literal>-C</literal> option allows to specify a Windows codepage
+ to print DOS and Windows paths created with one of the
+ <literal>-d</literal>, <literal>-m</literal>, or <literal>-w</literal>
+ options. The default is to use the character set of the current locale
+ defined by one of the internationalization environment variables
+ <envar>LC_ALL</envar>, <envar>LC_CTYPE</envar>, or <envar>LANG</envar>,
+ see <xref linkend="setup-locale"/>. This is sometimes not sufficient for
+ interaction with native Windows tools, which might expect native,
+ non-ASCII characters in a specific Windows codepage. Console tools, for
+ instance, might expect pathnames in the current OEM codepage, while
+ graphical tools like Windows Explorer might expect pathnames in the
+ current ANSI codepage.</para>
+
+ <para>The <literal>-C</literal> option takes a single parameter:</para>
+ <itemizedlist spacing="compact">
+ <listitem>
+ <para><literal>ANSI</literal>, to specify the current ANSI
+ codepage</para>
+ </listitem>
+ <listitem>
+ <para><literal>OEM</literal>, to specify the current OEM (console)
+ codepage</para>
+ </listitem>
+ <listitem>
+ <para><literal>UTF8</literal>, to specify UTF-8.</para>
+ </listitem>
+ <listitem>
+ <para>A numerical, decimal codepage number, for instance 936 for GBK,
+ 28593 for ISO-8859-3, etc. A full list of supported codepages is
+ listed on the Microsoft MSDN page <ulink
+ url="http://msdn.microsoft.com/en-us/library/dd317756(VS.85).aspx"
+ >Code Page Identifiers</ulink>. A codepage of 0 is the same as if the
+ <literal>-C</literal> hasn't been specified at all.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>The <literal>-p</literal> option means that you want to convert a
+ path-style string rather than a single filename. For example, the PATH
+ environment variable is semicolon-delimited in Windows, but
+ colon-delimited in UNIX. By giving <literal>-p</literal> you are
+ instructing <command>cygpath</command> to convert between these
+ formats.</para>
+
+ <para>The <literal>-i</literal> option supresses the print out of the usage
+ message if no filename argument was given. It can be used in make file
+ rules converting variables that may be omitted to a proper format. Note
+ that <command>cygpath</command> output may contain spaces (C:\Program
+ Files) so should be enclosed in quotes. </para>
+
+
+ <example id="utils-cygpath-ex">
+ <title>Example <command>cygpath</command> usage</title>
+ <screen>
+<![CDATA[
+#!/bin/sh
+if [ "${1}" = "" ];
+ then
+ XPATH=".";
+ else
+ XPATH="$(cygpath -C ANSI -w "${1}")";
+fi
+explorer $XPATH &
+]]>
+</screen>
+ </example>
+
+ <para>The capital options <literal>-D</literal>, <literal>-H</literal>,
+ <literal>-P</literal>, <literal>-S</literal>, and <literal>-W</literal>
+ output directories used by Windows that are not the same on all systems,
+ for example <literal>-S</literal> might output C:\WINNT\system32 or
+ C:\Windows\System32. The <literal>-H</literal> shows the Windows profiles
+ directory that can be used as root of home. The <literal>-A</literal>
+ option forces use of the "All Users" directories instead of the current
+ user for the <literal>-D</literal>, <literal>-O</literal> and
+ <literal>-P</literal> options. The <literal>-F</literal> outputs other
+ special folders specified by their internal numeric code (decimal or
+ 0x-prefixed hex). For valid codes and symbolic names, see the CSIDL_*
+ definitions in the include file /usr/include/w32api/shlobj.h from package
+ w32api. The current valid range of codes for folders is 0 (Desktop) to 59
+ (CDBurn area). By default the output is in UNIX (POSIX) format; use the
+ <literal>-w</literal> or <literal>-d</literal> options to get other
+ formats.</para>
+
+ </sect2>
+
+ <sect2 id="dumper">
+ <title>dumper</title>
+
+ <screen>
+Usage: dumper [OPTION] FILENAME WIN32PID
+
+Dump core from WIN32PID to FILENAME.core
+
+-d, --verbose be verbose while dumping
+-h, --help output help information and exit
+-q, --quiet be quiet while dumping (default)
+-V, --version output version information and exit
+</screen>
+
+ <para>The <command>dumper</command> utility can be used to create a core
+ dump of running Windows process. This core dump can be later loaded to
+ <command>gdb</command> and analyzed. One common way to use
+ <command>dumper</command> is to plug it into cygwin's Just-In-Time
+ debugging facility by adding
+ <screen>
+error_start=x:\path\to\dumper.exe
+</screen> to the
+ <emphasis>CYGWIN</emphasis> environment variable. Please note that
+ <literal>x:\path\to\dumper.exe</literal> is Windows-style and not cygwin
+ path. If <literal>error_start</literal> is set this way, then dumper will
+ be started whenever some program encounters a fatal error. </para>
+
+ <para> <command>dumper</command> can be also be started from the command
+ line to create a core dump of any running process. Unfortunately, because
+ of a Windows API limitation, when a core dump is created and
+ <command>dumper</command> exits, the target process is terminated too. </para>
+
+ <para> To save space in the core dump, <command>dumper</command> doesn't
+ write those portions of target process' memory space that are loaded from
+ executable and dll files and are unchangeable, such as program code and
+ debug info. Instead, <command>dumper</command> saves paths to files which
+ contain that data. When a core dump is loaded into gdb, it uses these
+ paths to load appropriate files. That means that if you create a core
+ dump on one machine and try to debug it on another, you'll need to place
+ identical copies of the executable and dlls in the same directories as on
+ the machine where the core dump was created. </para>
+
+ </sect2>
+
+ <sect2 id="getconf">
+ <title>getconf</title>
+
+ <screen>
+Usage: getconf [-v specification] variable_name [pathname]
+ getconf -a [pathname]
+
+Get configuration values
+
+ -v specification Indicate specific version for which configuration
+ values shall be fetched.
+ -a, --all Print all known configuration values
+
+Other options:
+
+ -h, --help This text
+ -V, --version Print program version and exit
+</screen>
+
+ <para>The <command>getconf</command> utility prints the value of the
+ configuration variable specified by <literal>variable_name</literal>. If
+ no <literal>pathname</literal> is given, <command>getconf</command>
+ serves as a wrapper for the <literal>confstr</literal> and
+ <literal>sysconf</literal> functions, supporting the symbolic constants
+ defined in the <literal>limits.h</literal> and
+ <literal>unistd.h</literal> headers, without their respective
+ <literal>_CS_</literal> or <literal>_SC_</literal> prefixes. </para>
+
+ <para>If <literal>pathname</literal> is given, <command>getconf</command>
+ prints the value of the configuration variable for the specified
+ pathname. In this form, <command>getconf</command> serves as a wrapper
+ for the <literal>pathconf</literal> function, supporting the symbolic
+ constants defined in the <literal>unistd.h</literal> header, without the
+ <literal>_PC_</literal> prefix. </para>
+
+ <para>If you specify the <literal>-v</literal> option, the parameter
+ denotes a specification for which the value of the configuration variable
+ should be printed. Note that the only specifications supported by Cygwin
+ are <literal>POSIX_V7_ILP32_OFFBIG</literal> and the legacy
+ <literal>POSIX_V6_ILP32_OFFBIG</literal> and
+ <literal>XBS5_ILP32_OFFBIG</literal> equivalents.</para>
+
+ <para>Use the <literal>-a</literal> option to print a list of all available
+ configuration variables for the system, or given
+ <literal>pathname</literal>, and their values.</para>
+
+ </sect2>
+
+ <sect2 id="getfacl">
+ <title>getfacl</title>
+
+ <screen>
+Usage: getfacl [-adn] FILE [FILE2...]
+
+Display file and directory access control lists (ACLs).
+
+ -a, --all display the filename, the owner, the group, and
+ the ACL of the file
+ -d, --dir display the filename, the owner, the group, and
+ the default ACL of the directory, if it exists
+ -h, --help output usage information and exit
+ -n, --noname display user and group IDs instead of names
+ -V, --version output version information and exit
+
+When multiple files are specified on the command line, a blank
+line separates the ACLs for each file.
+</screen>
+
+ <para> For each argument that is a regular file, special file or directory,
+ <command>getfacl</command> displays the owner, the group, and the ACL.
+ For directories <command>getfacl</command> displays additionally the
+ default ACL. With no options specified, <command>getfacl</command>
+ displays the filename, the owner, the group, and both the ACL and the
+ default ACL, if it exists. For more information on Cygwin and Windows
+ ACLs, see <xref linkend="ntsec"/> in the Cygwin User's Guide. The format
+ for ACL output is as follows:
+ <screen>
+ # file: filename
+ # owner: name or uid
+ # group: name or uid
+ user::perm
+ user:name or uid:perm
+ group::perm
+ group:name or gid:perm
+ mask:perm
+ other:perm
+ default:user::perm
+ default:user:name or uid:perm
+ default:group::perm
+ default:group:name or gid:perm
+ default:mask:perm
+ default:other:perm
+</screen>
+ </para>
+ </sect2>
+
+ <sect2 id="kill">
+ <title>kill</title>
+
+ <screen>
+Usage: kill [-f] [-signal] [-s signal] pid1 [pid2 ...]
+ kill -l [signal]
+
+Send signals to processes
+
+ -f, --force force, using win32 interface if necessary
+ -l, --list print a list of signal names
+ -s, --signal send signal (use kill --list for a list)
+ -h, --help output usage information and exit
+ -V, --version output version information and exit
+</screen>
+
+ <para>The <command>kill</command> program allows you to send arbitrary
+ signals to other Cygwin programs. The usual purpose is to end a running
+ program from some other window when ^C won't work, but you can also send
+ program-specified signals such as SIGUSR1 to trigger actions within the
+ program, like enabling debugging or re-opening log files. Each program
+ defines the signals they understand.</para>
+
+ <para>You may need to specify the full path to use <command>kill</command>
+ from within some shells, including <command>bash</command>, the default
+ Cygwin shell. This is because <command>bash</command> defines a
+ <command>kill</command> builtin function; see the <command>bash</command>
+ man page under <emphasis>BUILTIN COMMANDS</emphasis> for more
+ information. To make sure you are using the Cygwin version, try
+ <screen>
+$ /bin/kill --version
+</screen> which should give the Cygwin
+ <command>kill</command> version number and copyright information. </para>
+
+ <para>Unless you specific the <literal>-f</literal> option, the "pid"
+ values used by <command>kill</command> are the Cygwin pids, not the
+ Windows pids. To get a list of running programs and their Cygwin pids,
+ use the Cygwin <command>ps</command> program. <command>ps -W</command>
+ will display <emphasis>all</emphasis> windows pids.</para>
+
+ <para>The <command>kill -l</command> option prints the name of the given
+ signal, or a list of all signal names if no signal is given.</para>
+
+ <para>To send a specific signal, use the <literal>-signN</literal> option,
+ either with a signal number or a signal name (minus the "SIG" part), as
+ shown in these examples:</para>
+
+ <example id="utils-kill-ex">
+ <title>Using the kill command</title>
+ <screen>
+<prompt>$</prompt> <userinput>kill 123</userinput>
+<prompt>$</prompt> <userinput>kill -1 123</userinput>
+<prompt>$</prompt> <userinput>kill -HUP 123</userinput>
+<prompt>$</prompt> <userinput>kill -f 123</userinput>
+</screen>
+ </example>
+
+ <para>Here is a list of available signals, their numbers, and some
+ commentary on them, from the file
+ <literal>&lt;sys/signal.h&gt;</literal>, which should be considered the
+ official source of this information.</para>
+
+ <screen>
+SIGHUP 1 hangup
+SIGINT 2 interrupt
+SIGQUIT 3 quit
+SIGILL 4 illegal instruction (not reset when caught)
+SIGTRAP 5 trace trap (not reset when caught)
+SIGABRT 6 used by abort
+SIGEMT 7 EMT instruction
+SIGFPE 8 floating point exception
+SIGKILL 9 kill (cannot be caught or ignored)
+SIGBUS 10 bus error
+SIGSEGV 11 segmentation violation
+SIGSYS 12 bad argument to system call
+SIGPIPE 13 write on a pipe with no one to read it
+SIGALRM 14 alarm clock
+SIGTERM 15 software termination signal from kill
+SIGURG 16 urgent condition on IO channel
+SIGSTOP 17 sendable stop signal not from tty
+SIGTSTP 18 stop signal from tty
+SIGCONT 19 continue a stopped process
+SIGCHLD 20 to parent on child stop or exit
+SIGCLD 20 System V name for SIGCHLD
+SIGTTIN 21 to readers pgrp upon background tty read
+SIGTTOU 22 like TTIN for output if (tp-&gt;t_local&amp;LTOSTOP)
+SIGIO 23 input/output possible
+SIGPOLL 23 System V name for SIGIO
+SIGXCPU 24 exceeded CPU time limit
+SIGXFSZ 25 exceeded file size limit
+SIGVTALRM 26 virtual time alarm
+SIGPROF 27 profiling time alarm
+SIGWINCH 28 window changed
+SIGLOST 29 resource lost (eg, record-lock lost)
+SIGPWR 29 power failure
+SIGUSR1 30 user defined signal 1
+SIGUSR2 31 user defined signal 2
+</screen>
+
+ </sect2>
+
+ <sect2 id="ldd">
+ <title>ldd</title>
+
+ <screen>
+Usage: ldd [OPTION]... FILE...
+
+Print shared library dependencies
+
+ -h, --help print this help and exit
+ -V, --version print version information and exit
+ -r, --function-relocs process data and function relocations
+ (currently unimplemented)
+ -u, --unused print unused direct dependencies
+ (currently unimplemented)
+ -v, --verbose print all information
+ (currently unimplemented)
+</screen>
+
+ <para><command>ldd</command> prints the shared libraries (DLLs) an
+ executable or DLL is linked against. No modifying option is implemented
+ yet.</para>
+
+ </sect2>
+
+ <sect2 id="locale">
+ <title>locale</title>
+
+ <screen>
+Usage: locale [-amvhV]
+ or: locale [-ck] NAME
+ or: locale [-usfnU]
+
+Get locale-specific information.
+
+System information:
+
+ -a, --all-locales List all available supported locales
+ -m, --charmaps List all available character maps
+ -v, --verbose More verbose output
+
+Modify output format:
+
+ -c, --category-name List information about given category NAME
+ -k, --keyword-name Print information about given keyword NAME
+
+Default locale information:
+
+ -u, --user Print locale of user's default UI language
+ -s, --system Print locale of system default UI language
+ -f, --format Print locale of user's regional format settings
+ (time, numeric &amp; monetary)
+ -n, --no-unicode Print system default locale for non-Unicode programs
+ -U, --utf Attach \".UTF-8\" to the result
+
+Other options:
+
+ -h, --help This text
+ -V, --version Print program version and exit
+</screen>
+
+ <para><command>locale</command> without parameters prints information about
+ the current locale environment settings.</para>
+
+ <para>The <literal>-u</literal>, <literal>-s</literal>,
+ <literal>-f</literal>, and <literal>-n</literal> options can be used to
+ request the various Windows locale settings. The purpose is to use this
+ command in scripts to set the POSIX locale variables.</para>
+
+ <para>The <literal>-u</literal> option prints the current user's Windows UI
+ locale to stdout. In Windows Vista and Windows 7 this setting is called
+ the "Display Language"; there was no corresponding user setting in
+ Windows XP. The <literal>-s</literal> option prints the systems default
+ instead. The <literal>-f</literal> option prints the user's setting for
+ time, date, number and currency. That's equivalent to the setting in the
+ "Formats" or "Regional Options" tab in the "Region and Language" or
+ "Regional and Language Options" dialog. With the <literal>-U</literal>
+ option <command>locale</command> appends a ".UTF-8".</para>
+
+ <para>Usage example:</para>
+
+ <screen>
+bash$ export LANG=$(locale -uU)
+bash$ echo $LANG
+en_US.UTF-8
+bash$ export LC_TIME=$(locale -fU)
+bash$ echo $LC_TIME
+de_DE.UTF-8
+</screen>
+
+ <para>The <literal>-a</literal> option is helpful to learn which locales
+ are supported by your Windows machine. It prints all available locales
+ and the allowed modifiers. Example:</para>
+
+ <screen>
+bash$ locale -a
+C
+C.utf8
+POSIX
+af_ZA
+af_ZA.utf8
+am_ET
+am_ET.utf8
+...
+be_BY
+be_BY.utf8
+be_BY@latin
+...
+ca_ES
+ca_ES.utf8
+ca_ES@euro
+catalan
+...
+</screen>
+
+ <para>The <literal>-v</literal> option prints more detailed information
+ about each available locale. Example:</para>
+
+ <screen>
+bash$ locale -av
+locale: af_ZA archive: /cygdrive/c/Windows/system32/kernel32.dll
+-------------------------------------------------------------------------------
+ language | Afrikaans
+territory | South Africa
+ codeset | ISO-8859-1
+
+locale: af_ZA.utf8 archive: /cygdrive/c/Windows/system32/kernel32.dll
+-------------------------------------------------------------------------------
+ language | Afrikaans
+territory | South Africa
+ codeset | UTF-8
+
+...
+
+locale: ca_ES@euro archive: /cygdrive/c/Windows/system32/kernel32.dll
+-------------------------------------------------------------------------------
+ language | Catalan
+territory | Spain
+ codeset | ISO-8859-15
+
+locale: catalan archive: /usr/share/locale/locale.alias
+-------------------------------------------------------------------------------
+ language | Catalan
+territory | Spain
+ codeset | ISO-8859-1
+
+...
+</screen>
+
+ <para>The <literal>-m</literal> option prints the names of the available
+ charmaps supported by Cygwin to stdout.</para>
+
+ <para>Otherwise, if arguments are given, <command>locale</command> prints
+ the values assigned to these arguments. Arguments can be names of locale
+ categories (for instance: LC_CTYPE, LC_MONETARY), or names of keywords
+ supported in the locale categories (for instance: thousands_sep,
+ charmap). The <literal>-c</literal> option prints additionally the name
+ of the category. The <literal>-k</literal> option prints additionally the
+ name of the keyword. Example:</para>
+
+ <screen>
+bash$ locale -ck LC_MESSAGES
+LC_MESSAGES
+yesexpr="^[yY]"
+noexpr="^[nN]"
+yesstr="yes"
+nostr="no"
+messages-codeset="UTF-8"
+bash$ locale noexpr
+^[nN]
+</screen>
+
+ </sect2>
+
+ <sect2 id="mkgroup">
+ <title>mkgroup</title>
+
+ <screen>
+Usage: mkgroup [OPTION]...
+
+Print /etc/group file to stdout
+
+Options:
+
+ -l,--local [machine[,offset]]
+ print local groups with gid offset offset
+ (from local machine if no machine specified)
+ -L,--Local [machine[,offset]]
+ ditto, but generate groupname with machine prefix
+ -d,--domain [domain[,offset]]
+ print domain groups with gid offset offset
+ (from current domain if no domain specified)
+ -D,--Domain [domain[,offset]]
+ ditto, but generate groupname with machine prefix
+ -c,--current print current group
+ -C,--Current ditto, but generate groupname with machine or
+ domain prefix
+ -S,--separator char for -L, -D, -C use character char as domain\group
+ separator in groupname instead of the default '\'
+ -o,--id-offset offset change the default offset (10000) added to gids
+ in domain or foreign server accounts.
+ -g,--group groupname only return information for the specified group
+ one of -l, -L, -d, -D must be specified, too
+ -b,--no-builtin don't print BUILTIN groups
+ -U,--unix grouplist additionally print UNIX groups when using -l or -L
+ on a UNIX Samba server
+ grouplist is a comma-separated list of groupnames
+ or gid ranges (root,-25,50-100).
+ (enumerating large ranges can take a long time!)
+ -s,--no-sids (ignored)
+ -u,--users (ignored)
+ -h,--help print this message
+ -V,--version print version information and exit
+
+Default is to print local groups on stand-alone machines, plus domain
+groups on domain controllers and domain member machines.
+</screen>
+
+ <para>The <command>mkgroup</command> program can be used to help configure
+ Cygwin by creating a <filename>/etc/group</filename> file. Its use is
+ essential to include Windows security information.</para>
+
+ <para>The command is initially called by <command>setup.exe</command> to
+ create a default <filename>/etc/group</filename>. This should be
+ sufficient in most circumstances. However, especially when working in a
+ multi-domain environment, you can use <command>mkgroup</command> manually
+ to create a more complete <filename>/etc/group</filename> file for all
+ domains. Especially when you have the same group name used on multiple
+ machines or in multiple domains, you can use the <literal>-D</literal>,
+ <literal>-L</literal> and <literal>-C</literal> options to create unique
+ domain\group style groupnames.</para>
+
+ <para>Note that this information is static. If you change the group
+ information in your system, you'll need to regenerate the group file for
+ it to have the new information.</para>
+
+ <para>The <literal>-d/-D</literal> and <literal>-l/-L</literal> options
+ allow you to specify where the information comes from, the local SAM of a
+ machine or from the domain, or both. With the <literal>-d/-D</literal>
+ options the program contacts a Domain Controller, which my be unreachable
+ or have restricted access. Comma-separated from the machine or domain,
+ you can specify an offset which is used as base added to the group's RID
+ to compute the gid (offset + RID = gid). This allows you to create the
+ same gids every time you re-run <command>mkgroup</command>. For very
+ simple needs, an entry for the current user's group can be created by
+ using the option <literal>-c</literal> or <literal>-C</literal>. If you
+ want to use one of the <literal>-D</literal>, <literal>-L</literal> or
+ <literal>-C</literal> options, but you don't like the backslash as
+ domain/group separator, you can specify another separator using the
+ <literal>-S</literal> option, for instance:</para>
+
+ <example id="utils-mkgroup-ex">
+ <title>Setting up group entry for current user with different
+ domain/group separator</title>
+ <screen>
+<prompt>$</prompt> <userinput>mkgroup -C -S+ &gt; /etc/group</userinput>
+<prompt>$</prompt> <userinput>cat /etc/group</userinput>
+DOMAIN+my_group:S-1-5-21-2913048732-1697188782-3448811101-1144:11144:
+</screen>
+ </example>
+
+ <para>The <literal>-o</literal> option allows for special cases (such as
+ multiple domains) where the GIDs might match otherwise. The
+ <literal>-g</literal> option only prints the information for one group.
+ The <literal>-U</literal> option allows you to enumerate the standard
+ UNIX groups on a Samba machine. It's used together with <literal>-l
+ samba-server</literal> or <literal>-L samba-server</literal>. The normal
+ UNIX groups are usually not enumerated, but they can show up as a group
+ in <command>ls -l</command> output. </para>
+
+ </sect2>
+
+ <sect2 id="mkpasswd">
+ <title>mkpasswd</title>
+
+ <screen>
+Usage: mkpasswd [OPTIONS]...
+
+Print /etc/passwd file to stdout
+
+Options:
+
+ -l,--local [machine[,offset]]
+ print local user accounts with uid offset offset
+ (from local machine if no machine specified)
+ -L,--Local [machine[,offset]]
+ ditto, but generate username with machine prefix
+ -d,--domain [domain[,offset]]
+ print domain accounts with uid offset offset
+ (from current domain if no domain specified)
+ -D,--Domain [domain[,offset]]
+ ditto, but generate username with domain prefix
+ -c,--current print current user
+ -C,--Current ditto, but generate username with machine or
+ domain prefix
+ -S,--separator char for -L, -D, -C use character char as domain\user
+ separator in username instead of the default '\'
+ -o,--id-offset offset change the default offset (10000) added to uids
+ in domain or foreign server accounts.
+ -u,--username username only return information for the specified user
+ one of -l, -L, -d, -D must be specified, too
+ -p,--path-to-home path use specified path instead of user account home dir
+ or /home prefix
+ -U,--unix userlist additionally print UNIX users when using -l or -L\
+ on a UNIX Samba server
+ userlist is a comma-separated list of usernames
+ or uid ranges (root,-25,50-100).
+ (enumerating large ranges can take a long time!)
+ -s,--no-sids (ignored)
+ -m,--no-mount (ignored)
+ -g,--local-groups (ignored)
+ -h,--help displays this message
+ -V,--version version information and exit
+
+Default is to print local accounts on stand-alone machines, domain accounts
+on domain controllers and domain member machines.
+</screen>
+
+ <para>The <command>mkpasswd</command> program can be used to help configure
+ Cygwin by creating a <filename>/etc/passwd</filename> from your system
+ information. Its use is essential to include Windows security
+ information. However, the actual passwords are determined by Windows, not
+ by the content of <filename>/etc/passwd</filename>.</para>
+
+ <para>The command is initially called by <command>setup.exe</command> to
+ create a default <filename>/etc/passwd</filename>. This should be
+ sufficient in most circumstances. However, especially when working in a
+ multi-domain environment, you can use <command>mkpasswd</command>
+ manually to create a more complete <filename>/etc/passwd</filename> file
+ for all domains. Especially when you have the same user name used on
+ multiple machines or in multiple domains, you can use the
+ <literal>-D</literal>, <literal>-L</literal> and <literal>-C</literal>
+ options to create unique domain\user style usernames.</para>
+
+ <para>Note that this information is static. If you change the user
+ information in your system, you'll need to regenerate the passwd file for
+ it to have the new information.</para>
+
+ <para>The <literal>-d/-D</literal> and <literal>-l/-L</literal> options
+ allow you to specify where the information comes from, the local machine
+ or the domain (default or given), or both. With the
+ <literal>-d/-D</literal> options the program contacts the Domain
+ Controller, which may be unreachable or have restricted access.
+ Comma-separated from the machine or domain, you can specify an offset
+ which is used as base added to the user's RID to compute the uid (offset
+ + RID = uid). This allows to create the same uids every time you re-run
+ <command>mkpasswd</command>. An entry for the current user can be created
+ by using the option <literal>-c</literal> or <literal>-C</literal>. If
+ you want to use one of the <literal>-D</literal>, <literal>-L</literal>
+ or <literal>-C</literal> options, but you don't like the backslash as
+ domain/group separator, you can specify another separator using the
+ <literal>-S</literal> option, similar to the <command>mkgroup</command>.
+ The <literal>-o</literal> option allows for special cases (such as
+ multiple domains) where the UIDs might match otherwise. The
+ <literal>-p</literal> option causes <command>mkpasswd</command> to use
+ the specified prefix instead of the account home dir or <literal>/home/
+ </literal>. For example, this command: <example id="utils-althome-ex"
+ ><title>Using an alternate home root</title>
+ <screen>
+<prompt>$</prompt> <userinput>mkpasswd -l -p "$(cygpath -H)" &gt; /etc/passwd</userinput>
+</screen>
+ </example> would put local users' home directories in the Windows
+ 'Profiles' directory. The <literal>-u</literal> option creates just an
+ entry for the specified user. The <literal>-U</literal> option allows you
+ to enumerate the standard UNIX users on a Samba machine. It's used
+ together with <literal>-l samba-server</literal> or <literal>-L
+ samba-server</literal>. The normal UNIX users are usually not enumerated,
+ but they can show up as file owners in <command>ls -l</command> output. </para>
+
+ </sect2>
+
+ <sect2 id="mount">
+ <title>mount</title>
+
+ <screen>
+Usage: mount [OPTION] [&lt;win32path&gt; &lt;posixpath&gt;]
+ mount -a
+ mount &lt;posixpath&gt;
+
+Display information about mounted filesystems, or mount a filesystem
+
+ -a, --all mount all filesystems mentioned in fstab
+ -c, --change-cygdrive-prefix change the cygdrive path prefix to &lt;posixpath&gt;
+ -f, --force force mount, don't warn about missing mount
+ point directories
+ -h, --help output usage information and exit
+ -m, --mount-entries write fstab entries to replicate mount points
+ and cygdrive prefixes
+ -o, --options X[,X...] specify mount options
+ -p, --show-cygdrive-prefix show user and/or system cygdrive path prefix
+ -V, --version output version information and exit
+</screen>
+
+ <para>The <command>mount</command> program is used to map your drives and
+ shares onto Cygwin's simulated POSIX directory tree, much like as is done
+ by mount commands on typical UNIX systems. However, in contrast to mount
+ points given in <filename>/etc/fstab</filename>, mount points created or
+ changed with <command>mount</command> are not persistent. They disappear
+ immediately after the last process of the current user exited. Please see
+ <xref linkend="mount-table"/> for more information on the concepts behind
+ the Cygwin POSIX file system and strategies for using mounts. To remove
+ mounts temporarily, use <command>umount</command></para>
+
+ <sect3 id="utils-mount">
+ <title>Using mount</title>
+
+ <para>If you just type <command>mount</command> with no parameters, it
+ will display the current mount table for you.</para>
+
+ <example id="utils-mount-ex">
+ <title>Displaying the current set of mount points</title>
+ <screen>
+<prompt>$</prompt> <userinput>mount</userinput>
+C:/cygwin/bin on /usr/bin type ntfs (binary)
+C:/cygwin/lib on /usr/lib type ntfs (binary)
+C:/cygwin on / type ntfs (binary)
+C: on /mnt/c type ntfs (binary,user,noumount)
+D: on /mnt/d type fat (binary,user,noumount)
+</screen>
+ </example>
+
+ <para>In this example, c:/cygwin is the POSIX root and the D drive is
+ mapped to <filename>/mnt/d</filename>. Note that in this case, the root
+ mount is a system-wide mount point that is visible to all users running
+ Cygwin programs, whereas the <filename>/mnt/d</filename> mount is only
+ visible to the current user.</para>
+
+ <para>The <command>mount</command> utility is also the mechanism for
+ adding new mounts to the mount table in memory. The following example
+ demonstrates how to mount the directory
+ <filename>//pollux/home/joe/data</filename> to
+ <filename>/data</filename> for the duration of the current session. </para>
+
+ <example id="utils-mount-add-ex">
+ <title>Adding mount points</title>
+ <screen>
+<prompt>$</prompt> <userinput>ls /data</userinput>
+ls: /data: No such file or directory
+<prompt>$</prompt> <userinput>mount //pollux/home/joe/data /data</userinput>
+mount: warning - /data does not exist!
+<prompt>$</prompt> <userinput>mount</userinput>
+//pollux/home/joe/data on /data type smbfs (binary)
+C:/cygwin/bin on /usr/bin type ntfs (binary)
+C:/cygwin/lib on /usr/lib type ntfs (binary)
+C:/cygwin on / type ntfs (binary)
+C: on /c type ntfs (binary,user,noumount)
+D: on /d type fat (binary,user,noumount)
+</screen>
+ </example>
+
+ <para>A given POSIX path may only exist once in the mount table. Attempts
+ to replace the mount will fail with a busy error. The
+ <literal>-f</literal> (force) option causes the old mount to be
+ silently replaced with the new one, provided the old mount point was a
+ user mount point. It's not valid to replace system-wide mount points.
+ Additionally, the <literal>-f</literal> option will silence warnings
+ about the non-existence of directories at the Win32 path
+ location.</para>
+
+ <para> The <literal>-o</literal> option is the method via which various
+ options about the mount point may be recorded. The following options
+ are available (note that most of the options are duplicates of other
+ mount flags):</para>
+
+ <screen>
+ acl - Use the filesystem's access control lists (ACLs) to
+ implement real POSIX permissions (default).
+ binary - Files default to binary mode (default).
+ bind - Allows to remount part of the file hierarchy somewhere else.
+ Different from other mount calls, the first argument
+ specifies an absolute POSIX path, rather than a Win32 path.
+ This POSIX path is remounted to the POSIX path specified as
+ the second parameter. The conversion to a Win32 path is done
+ within Cygwin immediately at the time of the call. Note that
+ symlinks are ignored while performing this path conversion.
+ cygexec - Treat all files below mount point as cygwin executables.
+ dos - Always convert leading spaces and trailing dots and spaces to
+ characters in the UNICODE private use area. This allows to use
+ broken filesystems which only allow DOS filenames, even if they
+ are not recognized as such by Cygwin.
+ exec - Treat all files below mount point as executable.
+ ihash - Always fake inode numbers rather than using the ones returned
+ by the filesystem. This allows to use broken filesystems which
+ don't return unambiguous inode numbers, even if they are not
+ recognized as such by Cygwin.
+ noacl - Ignore ACLs and fake POSIX permissions.
+ nosuid - No suid files are allowed (currently unimplemented)
+ notexec - Treat all files below mount point as not executable.
+ override - Override immutable mount points.
+ posix=0 - Switch off case sensitivity for paths under this mount point.
+ posix=1 - Switch on case sensitivity for paths under this mount point
+ (default).
+ sparse - Switch on support for sparse files. This option only makes
+ sense on NTFS and then only if you really need sparse files.
+ text - Files default to CRLF text mode line endings.
+</screen>
+
+ <para>For a more complete description of the mount options and the
+ <filename>/etc/fstab</filename> file, see <xref linkend="mount-table"
+ />.</para>
+
+ <para>Note that all mount points added with <command>mount</command> are
+ user mount points. System mount points can only be specified in the
+ <filename>/etc/fstab</filename> file.</para>
+
+ <para>If you added mount points to <filename>/etc/fstab</filename> or
+ your <filename>/etc/fstab.d/&lt;username&gt;</filename> file, you can
+ add these mount points to your current user session using the
+ <literal>-a/--all</literal> option, or by specifing the posix path
+ alone on the command line. As an example, consider you added a mount
+ point with the POSIX path <filename>/my/mount</filename>. You can add
+ this mount point with either one of the following two commands to your
+ current user session.</para>
+
+ <screen>
+<prompt>$</prompt> <userinput>mount /my/mount</userinput>
+<prompt>$</prompt> <userinput>mount -a</userinput>
+</screen>
+
+ <para>The first command just adds the <filename>/my/mount</filename>
+ mount point to your current session, the <command>mount -a</command>
+ adds all new mount points to your user session.</para>
+
+ <para>If you change a mount point to point to another native path, or if
+ you changed the flags of a mount point, you have to
+ <command>umount</command> the mount point first, before you can add it
+ again. Please note that all such added mount points are added as user
+ mount points, and that the rule that system mount points can't be
+ removed or replaced in a running session still applies.</para>
+
+ <para>To bind a POSIX path to another POSIX path, use the
+ <literal>bind</literal> mount flag.</para>
+
+ <screen>
+<prompt>$</prompt> <userinput>mount -o bind /var /usr/var</userinput>
+</screen>
+
+ <para>This command makes the file hirarchy under
+ <filename>/var</filename> additionally available under
+ <filename>/usr/var</filename>.</para>
+
+ <para> The <literal>-m</literal> option causes the
+ <command>mount</command> utility to output the current mount table in a
+ series of fstab entries. You can save this output as a backup when
+ experimenting with the mount table. Copy the output to
+ <filename>/etc/fstab</filename> to restore the old state. It also makes
+ moving your settings to a different machine much easier.</para>
+
+ </sect3>
+
+ <sect3 id="utils-cygdrive">
+ <title>Cygdrive mount points</title>
+
+ <para>Whenever Cygwin cannot use any of the existing mounts to convert
+ from a particular Win32 path to a POSIX one, Cygwin will, instead,
+ convert to a POSIX path using a default mount point:
+ <filename>/cygdrive</filename>. For example, if Cygwin accesses
+ <filename>z:\foo</filename> and the z drive is not currently in the
+ mount table, then <filename>z:\</filename> will be accessible as
+ <filename>/cygdrive/z</filename>. The <command>mount</command> utility
+ can be used to change this default automount prefix through the use of
+ the "--change-cygdrive-prefix" option. In the following example, we
+ will set the automount prefix to <filename>/mnt</filename>:</para>
+
+ <example id="utils-cygdrive-ex">
+ <title>Changing the default prefix</title>
+ <screen>
+<prompt>$</prompt> <userinput>mount --change-cygdrive-prefix /mnt</userinput>
+</screen>
+ </example>
+
+ <para>Note that the cygdrive prefix can be set both per-user and
+ system-wide, and that as with all mounts, a user-specific mount takes
+ precedence over the system-wide setting. The <command>mount</command>
+ utility creates system-wide mounts by default if you do not specify a
+ type. You can always see the user and system cygdrive prefixes with the
+ <literal>-p</literal> option. Using the <literal>--options</literal>
+ flag with <literal>--change-cygdrive-prefix</literal> makes all new
+ automounted filesystems default to this set of options. For instance
+ (using the short form of the command line flags)</para>
+
+ <example id="utils-cygdrive-ex2">
+ <title>Changing the default prefix with specific mount options</title>
+ <screen>
+<prompt>$</prompt> <userinput>mount -c /mnt -o binary,noacl</userinput>
+</screen>
+ </example>
+
+
+ </sect3>
+
+ <sect3 id="utils-limitations">
+ <title>Limitations</title>
+
+ <para>Limitations: there is a hard-coded limit of 64 mount points (up to
+ Cygwin 1.7.9: 30 mount points). Also, although you can mount to
+ pathnames that do not start with "/", there is no way to make use of
+ such mount points.</para>
+
+ <para>Normally the POSIX mount point in Cygwin is an existing empty
+ directory, as in standard UNIX. If this is the case, or if there is a
+ place-holder for the mount point (such as a file, a symbolic link
+ pointing anywhere, or a non-empty directory), you will get the expected
+ behavior. Files present in a mount point directory before the mount
+ become invisible to Cygwin programs. </para>
+
+ <para>It is sometimes desirable to mount to a non-existent directory, for
+ example to avoid cluttering the root directory with names such as
+ <filename>a</filename>, <filename>b</filename>, <filename>c</filename>
+ pointing to disks. Although <command>mount</command> will give you a
+ warning, most everything will work properly when you refer to the mount
+ point explicitly. Some strange effects can occur however. For example
+ if your current working directory is <filename>/dir</filename>, say,
+ and <filename>/dir/mtpt</filename> is a mount point, then
+ <filename>mtpt</filename> will not show up in an <command>ls</command>
+ or <command>echo *</command> command and <command>find .</command> will
+ not find <filename>mtpt</filename>. </para>
+
+ </sect3>
+
+ </sect2>
+
+ <sect2 id="passwd">
+ <title>passwd</title>
+
+ <screen>
+Usage: passwd [OPTION] [USER]
+
+Change USER's password or password attributes.
+
+User operations:
+ -l, --lock lock USER's account.
+ -u, --unlock unlock USER's account.
+ -c, --cannot-change USER can't change password.
+ -C, --can-change USER can change password.
+ -e, --never-expires USER's password never expires.
+ -E, --expires USER's password expires according to system's
+ password aging rule.
+ -p, --pwd-not-required no password required for USER.
+ -P, --pwd-required password is required for USER.
+ -R, --reg-store-pwd enter password to store it in the registry for
+ later usage by services to be able to switch
+ to this user context with network credentials.
+
+System operations:
+ -i, --inactive NUM set NUM of days before inactive accounts are disabled
+ (inactive accounts are those with expired passwords).
+ -n, --minage DAYS set system minimum password age to DAYS days.
+ -x, --maxage DAYS set system maximum password age to DAYS days.
+ -L, --length LEN set system minimum password length to LEN.
+
+Other options:
+ -d, --logonserver SERVER connect to SERVER (e.g. domain controller).
+ Default server is the local system, unless
+ changing the current user, in which case the
+ default is the content of $LOGONSERVER.
+ -S, --status display password status for USER (locked, expired,
+ etc.) plus global system password settings.
+ -h, --help output usage information and exit.
+ -V, --version output version information and exit.
+
+If no option is given, change USER's password. If no user name is given,
+operate on current user. System operations must not be mixed with user
+operations. Don't specify a USER when triggering a system operation.
+
+Don't specify a user or any other option together with the -R option.
+Non-Admin users can only store their password if cygserver is running.
+Note that storing even obfuscated passwords in the registry is not overly
+secure. Use this feature only if the machine is adequately locked down.
+Don't use this feature if you don't need network access within a remote
+session. You can delete your stored password by using `passwd -R' and
+specifying an empty password.
+</screen>
+
+ <para> <command>passwd</command> changes passwords for user accounts. A
+ normal user may only change the password for their own account, but
+ administrators may change passwords on any account.
+ <command>passwd</command> also changes account information, such as
+ password expiry dates and intervals.</para>
+
+ <para>For password changes, the user is first prompted for their old
+ password, if one is present. This password is then encrypted and compared
+ against the stored password. The user has only one chance to enter the
+ correct password. The administrators are permitted to bypass this step so
+ that forgotten passwords may be changed.</para>
+
+ <para>The user is then prompted for a replacement password.
+ <command>passwd</command> will prompt twice for this replacement and
+ compare the second entry against the first. Both entries are required to
+ match in order for the password to be changed.</para>
+
+ <para>After the password has been entered, password aging information is
+ checked to see if the user is permitted to change their password at this
+ time. If not, <command>passwd</command> refuses to change the password
+ and exits.</para>
+
+ <para> To get current password status information, use the
+ <literal>-S</literal> option. Administrators can use
+ <command>passwd</command> to perform several account maintenance
+ functions (users may perform some of these functions on their own
+ accounts). Accounts may be locked with the <literal>-l</literal> flag and
+ unlocked with the <literal>-u</literal> flag. Similarly,
+ <literal>-c</literal> disables a user's ability to change passwords, and
+ <literal>-C</literal> allows a user to change passwords. For password
+ expiry, the <literal>-e</literal> option disables expiration, while the
+ <literal>-E</literal> option causes the password to expire according to
+ the system's normal aging rules. Use <literal>-p</literal> to disable the
+ password requirement for a user, or <literal>-P</literal> to require a
+ password. </para>
+
+ <para>Administrators can also use <command>passwd</command> to change
+ system-wide password expiry and length requirements with the
+ <literal>-i</literal>, <literal>-n</literal>, <literal>-x</literal>, and
+ <literal>-L</literal> options. The <literal>-i</literal> option is used
+ to disable an account after the password has been expired for a number of
+ days. After a user account has had an expired password for
+ <emphasis>NUM</emphasis> days, the user may no longer sign on to the
+ account. The <literal>-n</literal> option is used to set the minimum
+ number of days before a password may be changed. The user will not be
+ permitted to change the password until <emphasis>MINDAYS</emphasis> days
+ have elapsed. The <literal>-x</literal> option is used to set the maximum
+ number of days a password remains valid. After
+ <emphasis>MAXDAYS</emphasis> days, the password is required to be
+ changed. Allowed values for the above options are 0 to 999. The
+ <literal>-L</literal> option sets the minimum length of allowed passwords
+ for users who don't belong to the administrators group to
+ <emphasis>LEN</emphasis> characters. Allowed values for the minimum
+ password length are 0 to 14. In any of the above cases, a value of 0
+ means `no restrictions'.</para>
+
+ <para> All operations affecting the current user are by default run against
+ the logon server of the current user (taken from the environment variable
+ <envar>LOGONSERVER</envar>. When password or account information of other
+ users should be changed, the default server is the local system. To
+ change a user account on a remote machine, use the <literal>-d</literal>
+ option to specify the machine to run the command against. Note that the
+ current user must be a valid member of the administrators group on the
+ remote machine to perform such actions. </para>
+
+ <para>Users can use the <command>passwd -R</command> to enter a password
+ which then gets stored in a special area of the registry on the local
+ system, which is also used by Windows to store passwords of accounts
+ running Windows services. When a privileged Cygwin application calls the
+ <command>set{e}uid(user_id)</command> system call, Cygwin checks if a
+ password for that user has been stored in this registry area. If so, it
+ uses this password to switch to this user account using that password.
+ This allows you to logon through, for instance, <command>ssh</command>
+ with public key authentication and get a full qualified user token with
+ all credentials for network access. However, the method has some
+ drawbacks security-wise. This is explained in more detail in <xref
+ linkend="ntsec"/>.</para>
+
+ <para>Please note that storing passwords in that registry area is a
+ privileged operation which only administrative accounts are allowed to
+ do. Administrators can enter the password for other user accounts into
+ the registry by specifying the username on the commandline. If normal,
+ non-admin users should be allowed to enter their passwords using
+ <command>passwd -R</command>, it's required to run
+ <command>cygserver</command> as a service under the LocalSystem account
+ before running <command>passwd -R</command>. This only affects storing
+ passwords. Using passwords in privileged processes does not require
+ <command>cygserver</command> to run.</para>
+
+ <para>Limitations: Users may not be able to change their password on some
+ systems.</para>
+
+ </sect2>
+
+ <sect2 id="pldd">
+ <title>pldd</title>
+
+ <screen>
+Usage: pldd [OPTION...] PID
+
+List dynamic shared objects loaded into a process.
+
+ -?, --help Give this help list
+ --usage Give a short usage message
+ -V, --version Print program version
+</screen>
+
+ <para><command>pldd</command> prints the shared libraries (DLLs) loaded by
+ the process with the given PID.</para>
+
+ </sect2>
+
+ <sect2 id="ps">
+ <title>ps</title>
+
+ <screen>
+Usage: ps [-aefls] [-u UID]
+
+Report process status
+
+ -a, --all show processes of all users
+ -e, --everyone show processes of all users
+ -f, --full show process uids, ppids
+ -h, --help output usage information and exit
+ -l, --long show process uids, ppids, pgids, winpids
+ -p, --process show information for specified PID
+ -s, --summary show process summary
+ -u, --user list processes owned by UID
+ -V, --version output version information and exit
+ -W, --windows show windows as well as cygwin processes
+With no options, ps outputs the long format by default
+</screen>
+
+ <para>The <command>ps</command> program gives the status of all the Cygwin
+ processes running on the system (ps = "process status"). Due to the
+ limitations of simulating a POSIX environment under Windows, there is
+ little information to give. </para>
+
+ <para> The PID column is the process ID you need to give to the
+ <command>kill</command> command. The PPID is the parent process ID, and
+ PGID is the process group ID. The WINPID column is the process ID
+ displayed by NT's Task Manager program. The TTY column gives which
+ pseudo-terminal a process is running on, or a <literal>'?'</literal> for
+ services. The UID column shows which user owns each process. STIME is the
+ time the process was started, and COMMAND gives the name of the program
+ running. Listings may also have a status flag in column zero;
+ <literal>S</literal> means stopped or suspended (in other words, in the
+ background), <literal>I</literal> means waiting for input or interactive
+ (foreground), and <literal>O</literal> means waiting to output. </para>
+
+ <para> By default, <command>ps</command> will only show processes owned by
+ the current user. With either the <literal>-a</literal> or
+ <literal>-e</literal> option, all user's processes (and system processes)
+ are listed. There are historical UNIX reasons for the synonomous options,
+ which are functionally identical. The <literal>-f</literal> option
+ outputs a "full" listing with usernames for UIDs. The
+ <literal>-l</literal> option is the default display mode, showing a
+ "long" listing with all the above columns. The other display option is
+ <literal>-s</literal>, which outputs a shorter listing of just PID, TTY,
+ STIME, and COMMAND. The <literal>-u</literal> option allows you to show
+ only processes owned by a specific user. The <literal>-p</literal> option
+ allows you to show information for only the process with the specified
+ PID. The <literal>-W</literal> option causes <command>ps</command> show
+ non-Cygwin Windows processes as well as Cygwin processes. The WINPID is
+ also the PID, and they can be killed with the Cygwin
+ <command>kill</command> command's <literal>-f</literal> option. </para>
+
+ </sect2>
+
+ <sect2 id="regtool">
+ <title>regtool</title>
+
+ <screen>
+Usage: regtool [OPTION] (add|check|get|list|remove|unset|load|unload|save) KEY
+
+View or edit the Win32 registry
+
+Actions:
+
+ add KEY\SUBKEY add new SUBKEY
+ check KEY exit 0 if KEY exists, 1 if not
+ get KEY\VALUE prints VALUE to stdout
+ list KEY list SUBKEYs and VALUEs
+ remove KEY remove KEY
+ set KEY\VALUE [data ...] set VALUE
+ unset KEY\VALUE removes VALUE from KEY
+ load KEY\SUBKEY PATH load hive from PATH into new SUBKEY
+ unload KEY\SUBKEY unload hive and remove SUBKEY
+ save KEY\SUBKEY PATH save SUBKEY into new hive PATH
+
+Options for 'list' Action:
+
+ -k, --keys print only KEYs
+ -l, --list print only VALUEs
+ -p, --postfix like ls -p, appends '\' postfix to KEY names
+
+Options for 'get' Action:
+
+ -b, --binary print REG_BINARY data as hex bytes
+ -n, --none print data as stream of bytes as stored in registry
+ -x, --hex print numerical data as hex numbers
+
+Options for 'set' Action:
+
+ -b, --binary set type to REG_BINARY (hex args or '-')
+ -D, --dword-be set type to REG_DWORD_BIG_ENDIAN
+ -e, --expand-string set type to REG_EXPAND_SZ
+ -i, --integer set type to REG_DWORD
+ -m, --multi-string set type to REG_MULTI_SZ
+ -n, --none set type to REG_NONE
+ -Q, --qword set type to REG_QWORD
+ -s, --string set type to REG_SZ
+
+Options for 'set' and 'unset' Actions:
+
+ -K&lt;c&gt;, --key-separator[=]&lt;c&gt; set key separator to &lt;c&gt; instead of '\'
+
+Other Options:
+
+ -h, --help output usage information and exit
+ -q, --quiet no error output, just nonzero return if KEY/VALUE missing
+ -v, --verbose verbose output, including VALUE contents when applicable
+ -w, --wow64 access 64 bit registry view (ignored on 32 bit Windows)
+ -W, --wow32 access 32 bit registry view (ignored on 32 bit Windows)
+ -V, --version output version information and exit
+
+KEY is in the format [host]\prefix\KEY\KEY\VALUE, where host is optional
+remote host in either \\hostname or hostname: format and prefix is any of:
+ root HKCR HKEY_CLASSES_ROOT (local only)
+ config HKCC HKEY_CURRENT_CONFIG (local only)
+ user HKCU HKEY_CURRENT_USER (local only)
+ machine HKLM HKEY_LOCAL_MACHINE
+ users HKU HKEY_USERS
+
+You can use forward slash ('/') as a separator instead of backslash, in
+that case backslash is treated as escape character
+Example: regtool.exe get '\user\software\Microsoft\Clock\iFormat'
+</screen>
+
+ <para>The <command>regtool</command> program allows shell scripts to access
+ and modify the Windows registry. Note that modifying the Windows registry
+ is dangerous, and carelessness here can result in an unusable system. Be
+ careful.</para>
+
+ <para>The <literal>-v</literal> option means "verbose". For most commands,
+ this causes additional or lengthier messages to be printed. Conversely,
+ the <literal>-q</literal> option supresses error messages, so you can use
+ the exit status of the program to detect if a key exists or not (for
+ example).</para>
+
+ <para>The <literal>-w</literal> option allows you to access the 64 bit view
+ of the registry. Several subkeys exist in a 32 bit and a 64 bit version
+ when running on Windows 64. Since Cygwin is running in 32 bit mode, it
+ only has access to the 32 bit view of these registry keys. When using the
+ <literal>-w</literal> switch, the 64 bit view is used and
+ <command>regtool</command> can access the entire registry. This option is
+ simply ignored when running on 32 bit Windows versions. </para>
+
+ <para>The <literal>-W</literal> option allows you to access the 32 bit view
+ on the registry. The purpose of this option is mainly for symmetry. It
+ permits creation of OS agnostic scripts which would also work in a
+ hypothetical 64 bit version of Cygwin.</para>
+
+ <para>You must provide <command>regtool</command> with an
+ <emphasis>action</emphasis> following options (if any). Currently, the
+ action must be <literal>add</literal>, <literal>set</literal>,
+ <literal>check</literal>, <literal>get</literal>,
+ <literal>list</literal>, <literal>remove</literal>,
+ <literal>set</literal>, or <literal>unset</literal>. </para>
+
+ <para>The <literal>add</literal> action adds a new key. The
+ <literal>check</literal> action checks to see if a key exists (the exit
+ code of the program is zero if it does, nonzero if it does not). The
+ <literal>get</literal> action gets the value of a key, and prints it (and
+ nothing else) to stdout. Note: if the value doesn't exist, an error
+ message is printed and the program returns a non-zero exit code. If you
+ give <literal>-q</literal>, it doesn't print the message but does return
+ the non-zero exit code.</para>
+
+ <para> The <literal>list</literal> action lists the subkeys and values
+ belonging to the given key. With <literal>list</literal>, the
+ <literal>-k</literal> option instructs <command>regtool</command> to
+ print only KEYs, and the <literal>-l</literal> option to print only
+ VALUEs. The <literal>-p</literal> option postfixes a
+ <literal>'/'</literal> to each KEY, but leave VALUEs with no postfix. The
+ <literal>remove</literal> action removes a key. Note that you may need to
+ remove everything in the key before you may remove it, but don't rely on
+ this stopping you from accidentally removing too much. </para>
+
+ <para>The <literal>get</literal> action prints a value within a key. With
+ the <literal>-b</literal> option, data is printed as hex bytes.
+ <literal>-n</literal> allows to print the data as a typeless stream of
+ bytes. Integer values (REG_DWORD, REG_QWORD) are usually printed as
+ decimal values. The <literal>-x</literal> option allows to print the
+ numbers as hexadecimal values.</para>
+
+ <para>The <literal>set</literal> action sets a value within a key.
+ <literal>-b</literal> means it's binary data (REG_BINARY). The binary
+ values are specified as hex bytes in the argument list. If the argument
+ is <literal>'-'</literal>, binary data is read from stdin instead.
+ <literal>-d</literal> or <literal>-i</literal> means the value is a 32
+ bit integer value (REG_DWORD). <literal>-D</literal> means the value is a
+ 32 bit integer value in Big Endian representation (REG_DWORD_BIG_ENDIAN).
+ <literal>-Q</literal> means the value is a 64 bit integer value
+ (REG_QWORD). <literal>-s</literal> means the value is a string (REG_SZ).
+ <literal>-e</literal> means it's an expanding string (REG_EXPAND_SZ) that
+ contains embedded environment variables. <literal>-m</literal> means it's
+ a multi-string (REG_MULTI_SZ). If you don't specify one of these,
+ <command>regtool</command> tries to guess the type based on the value you
+ give. If it looks like a number, it's a DWORD, unless it's value doesn't
+ fit into 32 bit, in which case it's a QWORD. If it starts with a percent,
+ it's an expanding string. If you give multiple values, it's a
+ multi-string. Else, it's a regular string.</para>
+
+ <para>The <literal>unset</literal> action removes a value from a
+ key.</para>
+
+ <para>The <literal>load</literal> action adds a new subkey and loads the
+ contents of a registry hive into it. The parent key must be
+ HKEY_LOCAL_MACHINE or HKEY_USERS. The <literal>unload</literal> action
+ unloads the file and removes the subkey. </para>
+
+ <para>The <literal>save</literal> action saves a subkey into a registry
+ hive. </para>
+
+ <para> By default, the last "\" or "/" is assumed to be the separator
+ between the key and the value. You can use the <literal>-K</literal>
+ option to provide an alternate key/value separator character. </para>
+
+ </sect2>
+
+ <sect2 id="setfacl">
+ <title>setfacl</title>
+
+ <screen>
+Usage: setfacl [-r] (-f ACL_FILE | -s acl_entries) FILE...
+ setfacl [-r] ([-d acl_entries] [-m acl_entries]) FILE...
+
+Modify file and directory access control lists (ACLs)
+
+ -d, --delete delete one or more specified ACL entries
+ -f, --file set ACL entries for FILE to ACL entries read
+ from a ACL_FILE
+ -m, --modify modify one or more specified ACL entries
+ -r, --replace replace mask entry with maximum permissions
+ needed for the file group class
+ -s, --substitute substitute specified ACL entries for the
+ ACL of FILE
+ -h, --help output usage information and exit
+ -V, --version output version information and exit
+
+At least one of (-d, -f, -m, -s) must be specified
+</screen>
+
+ <para> For each file given as parameter, <command>setfacl</command> will
+ either replace its complete ACL (<literal>-s</literal>,
+ <literal>-f</literal>), or it will add, modify, or delete ACL entries.
+ For more information on Cygwin and Windows ACLs, see see <xref
+ linkend="ntsec"/> in the Cygwin User's Guide. </para>
+
+ <para> Acl_entries are one or more comma-separated ACL entries from the
+ following list:
+ <screen>
+ u[ser]::perm
+ u[ser]:uid:perm
+ g[roup]::perm
+ g[roup]:gid:perm
+ m[ask]::perm
+ o[ther]::perm
+</screen>
+ Default entries are like the above with the additional default
+ identifier. For example:
+ <screen>
+ d[efault]:u[ser]:uid:perm
+</screen> </para>
+
+ <para> <emphasis>perm</emphasis> is either a 3-char permissions string in
+ the form "rwx" with the character <literal>'-'</literal> for no
+ permission or it is the octal representation of the permissions, a value
+ from 0 (equivalent to "---") to 7 ("rwx"). <emphasis>uid</emphasis> is a
+ user name or a numerical uid. <emphasis>gid</emphasis> is a group name or
+ a numerical gid. </para>
+
+ <para> The following options are supported: </para>
+
+ <para> <literal>-d</literal> Delete one or more specified entries from the
+ file's ACL. The owner, group and others entries must not be deleted.
+ Acl_entries to be deleted should be specified without permissions, as in
+ the following list:
+ <screen>
+ u[ser]:uid
+ g[roup]:gid
+ d[efault]:u[ser]:uid
+ d[efault]:g[roup]:gid
+ d[efault]:m[ask]:
+ d[efault]:o[ther]:
+</screen> </para>
+
+ <para> <literal>-f</literal> Take the Acl_entries from ACL_FILE one per
+ line. Whitespace characters are ignored, and the character "#" may be
+ used to start a comment. The special filename "-" indicates reading from
+ stdin. Note that you can use this with <command>getfacl</command> and
+ <command>setfacl</command> to copy ACLs from one file to another:
+ <screen>
+$ getfacl source_file | setfacl -f - target_file
+</screen> </para>
+
+ <para> Required entries are: one user entry for the owner of the file, one
+ group entry for the group of the file, and one other entry. </para>
+
+ <para> If additional user and group entries are given: a mask entry for the
+ file group class of the file, and no duplicate user or group entries with
+ the same uid/gid. </para>
+
+ <para> If it is a directory: one default user entry for the owner of the
+ file, one default group entry for the group of the file, one default mask
+ entry for the file group class, and one default other entry. </para>
+
+ <para> <literal>-m</literal> Add or modify one or more specified ACL
+ entries. Acl_entries is a comma-separated list of entries from the same
+ list as above. </para>
+
+ <para> <literal>-r</literal> Causes the permissions specified in the mask
+ entry to be ignored and replaced by the maximum permissions needed for
+ the file group class. </para>
+
+ <para> <literal>-s</literal> Like <literal>-f</literal>, but substitute the
+ file's ACL with Acl_entries specified in a comma-separated list on the
+ command line. </para>
+
+ <para> While the <literal>-d</literal> and <literal>-m</literal> options
+ may be used in the same command, the <literal>-f</literal> and
+ <literal>-s</literal> options may be used only exclusively. </para>
+
+ <para> Directories may contain default ACL entries. Files created in a
+ directory that contains default ACL entries will have permissions
+ according to the combination of the current umask, the explicit
+ permissions requested and the default ACL entries </para>
+
+ <para> Limitations: Under Cygwin, the default ACL entries are not taken
+ into account currently. </para>
+
+ </sect2>
+
+ <sect2 id="setmetamode">
+ <title>setmetamode</title>
+
+ <screen>
+Usage: setmetamode [metabit|escprefix]
+
+Get or set keyboard meta mode
+
+ Without argument, it shows the current meta key mode.
+ metabit|meta|bit The meta key sets the top bit of the character.
+ escprefix|esc|prefix The meta key sends an escape prefix.
+
+Other options:
+
+ -h, --help This text
+ -V, --version Print program version and exit
+</screen>
+
+ <para><command>setmetamode</command> can be used to determine and set the
+ key code sent by the meta (aka <literal>Alt</literal>) key.</para>
+
+ </sect2>
+
+ <sect2 id="ssp">
+ <title>ssp</title>
+
+ <screen>
+Usage: ssp [options] low_pc high_pc command...
+
+Single-step profile COMMAND
+
+ -c, --console-trace trace every EIP value to the console. *Lots* slower.
+ -d, --disable disable single-stepping by default; use
+ OutputDebugString ("ssp on") to enable stepping
+ -e, --enable enable single-stepping by default; use
+ OutputDebugString ("ssp off") to disable stepping
+ -h, --help output usage information and exit
+ -l, --dll enable dll profiling. A chart of relative DLL usage
+ is produced after the run.
+ -s, --sub-threads trace sub-threads too. Dangerous if you have
+ race conditions.
+ -t, --trace-eip trace every EIP value to a file TRACE.SSP. This
+ gets big *fast*.
+ -v, --verbose output verbose messages about debug events.
+ -V, --version output version information and exit
+
+Example: ssp 0x401000 0x403000 hello.exe
+</screen>
+
+ <para> SSP - The Single Step Profiler </para>
+
+ <para> Original Author: DJ Delorie </para>
+
+ <para> The SSP is a program that uses the Win32 debug API to run a program
+ one ASM instruction at a time. It records the location of each
+ instruction used, how many times that instruction is used, and all
+ function calls. The results are saved in a format that is usable by the
+ profiling program <command>gprof</command>, although
+ <command>gprof</command> will claim the values are seconds, they really
+ are instruction counts. More on that later. </para>
+
+ <para> Because the SSP was originally designed to profile the Cygwin DLL,
+ it does not automatically select a block of code to report statistics on.
+ You must specify the range of memory addresses to keep track of manually,
+ but it's not hard to figure out what to specify. Use the "objdump"
+ program to determine the bounds of the target's ".text" section. Let's
+ say we're profiling cygwin1.dll. Make sure you've built it with debug
+ symbols (else <command>gprof</command> won't run) and run objdump like
+ this: <screen>
+$ objdump -h cygwin1.dll
+</screen> It will print a report
+ like this:
+ <screen>
+cygwin1.dll: file format pei-i386
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 .text 0007ea00 61001000 61001000 00000400 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
+ 1 .data 00008000 61080000 61080000 0007ee00 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ . . .
+</screen> </para>
+
+ <para> The only information we're concerned with are the VMA of the .text
+ section and the VMA of the section after it (sections are usually
+ contiguous; you can also add the Size to the VMA to get the end address).
+ In this case, the VMA is 0x61001000 and the ending address is either
+ 0x61080000 (start of .data method) or 0x0x6107fa00 (VMA+Size method). </para>
+
+ <para> There are two basic ways to use SSP - either profiling a whole
+ program, or selectively profiling parts of the program. </para>
+
+ <para> To profile a whole program, just run <command>ssp</command> without
+ options. By default, it will step the whole program. Here's a simple
+ example, using the numbers above:
+ <screen>
+$ ssp 0x61001000 0x61080000 hello.exe
+</screen> This will step
+ the whole program. It will take at least 8 minutes on a PII/300 (yes,
+ really). When it's done, it will create a file called "gmon.out". You can
+ turn this data file into a readable report with <command>gprof</command>:
+ <screen>
+$ gprof -b cygwin1.dll
+</screen> The "-b" means 'skip the help
+ pages'. You can omit this until you're familiar with the report layout.
+ The <command>gprof</command> documentation explains a lot about this
+ report, but <command>ssp</command> changes a few things. For example, the
+ first part of the report reports the amount of time spent in each
+ function, like this:
+ <screen>
+Each sample counts as 0.01 seconds.
+ % cumulative self self total
+ time seconds seconds calls ms/call ms/call name
+ 10.02 231.22 72.43 46 1574.57 1574.57 strcspn
+ 7.95 288.70 57.48 130 442.15 442.15 strncasematch
+</screen>
+ The "seconds" columns are really CPU opcodes, 1/100 second per opcode.
+ So, "231.22" above means 23,122 opcodes. The ms/call values are 10x too
+ big; 1574.57 means 157.457 opcodes per call. Similar adjustments need to
+ be made for the "self" and "children" columns in the second part of the
+ report. </para>
+
+ <para> OK, so now we've got a huge report that took a long time to
+ generate, and we've identified a spot we want to work on optimizing.
+ Let's say it's the time() function. We can use SSP to selectively profile
+ this function by using OutputDebugString() to control SSP from within the
+ program. Here's a sample program:
+ <screen>
+ #include &lt;windows.h&gt;
+ main()
+ {
+ time_t t;
+ OutputDebugString("ssp on");
+ time(&amp;t);
+ OutputDebugString("ssp off");
+ }
+</screen> </para>
+
+ <para> Then, add the <literal>-d</literal> option to ssp to default to
+ *disabling* profiling. The program will run at full speed until the first
+ OutputDebugString, then step until the second. You can then use
+ <command>gprof</command> (as usual) to see the performance profile for
+ just that portion of the program's execution. </para>
+
+ <para> There are many options to ssp. Since step-profiling makes your
+ program run about 1,000 times slower than normal, it's best to understand
+ all the options so that you can narrow down the parts of your program you
+ need to single-step. </para>
+
+ <para> <literal>-v</literal> - verbose. This prints messages about threads
+ starting and stopping, OutputDebugString calls, DLLs loading, etc. </para>
+
+ <para> <literal>-t</literal> and <literal>-c</literal> - tracing. With
+ <literal>-t</literal>, *every* step's address is written to the file
+ "trace.ssp". This can be used to help debug functions, since it can trace
+ multiple threads. Clever use of scripts can match addresses with
+ disassembled opcodes if needed. Warning: creates *huge* files, very
+ quickly. <literal>-c</literal> prints each address to the console, useful
+ for debugging key chunks of assembler. Use <literal>addr2line -C -f -s -e
+ foo.exe &lt; trace.ssp &gt; lines.ssp</literal> and then <literal>perl
+ cvttrace</literal> to convert to symbolic traces. </para>
+
+ <para> <literal>-s</literal> - subthreads. Usually, you only need to trace
+ the main thread, but sometimes you need to trace all threads, so this
+ enables that. It's also needed when you want to profile a function that
+ only a subthread calls. However, using OutputDebugString automatically
+ enables profiling on the thread that called it, not the main thread. </para>
+
+ <para> <literal>-l</literal> - dll profiling. Generates a pretty table of
+ how much time was spent in each dll the program used. No sense optimizing
+ a function in your program if most of the time is spent in the DLL. I
+ usually use the <literal>-v</literal>, <literal>-s</literal>, and
+ <literal>-l</literal> options:
+ <screen>
+$ ssp <literal>-v</literal> <literal>-s</literal> <literal>-l</literal> <literal>-d</literal> 0x61001000 0x61080000 hello.exe
+</screen>
+ </para>
+ </sect2>
+
+ <sect2 id="strace">
+ <title>strace</title>
+
+ <screen>
+Usage: strace.exe [OPTIONS] &lt;command-line&gt;
+Usage: strace.exe [OPTIONS] -p &lt;pid&gt;
+
+Trace system calls and signals
+
+ -b, --buffer-size=SIZE set size of output file buffer
+ -d, --no-delta don't display the delta-t microsecond timestamp
+ -f, --trace-children trace child processes (toggle - default true)
+ -h, --help output usage information and exit
+ -m, --mask=MASK set message filter mask
+ -n, --crack-error-numbers output descriptive text instead of error
+ numbers for Windows errors
+ -o, --output=FILENAME set output file to FILENAME
+ -p, --pid=n attach to executing program with cygwin pid n
+ -q, --quiet toggle "quiet" flag. Defaults to on if "-p",
+ off otherwise.
+ -S, --flush-period=PERIOD flush buffered strace output every PERIOD secs
+ -t, --timestamp use an absolute hh:mm:ss timestamp insted of
+ the default microsecond timestamp. Implies -d
+ -T, --toggle toggle tracing in a process already being
+ traced. Requires -p &lt;pid&gt;
+ -u, --usecs toggle printing of microseconds timestamp
+ -V, --version output version information and exit
+ -w, --new-window spawn program under test in a new window
+
+ MASK can be any combination of the following mnemonics and/or hex values
+ (0x is optional). Combine masks with '+' or ',' like so:
+
+ --mask=wm+system,malloc+0x00800
+
+ Mnemonic Hex Corresponding Def Description
+ =========================================================================
+ all 0x000001 (_STRACE_ALL) All strace messages.
+ flush 0x000002 (_STRACE_FLUSH) Flush output buffer after each message.
+ inherit 0x000004 (_STRACE_INHERIT) Children inherit mask from parent.
+ uhoh 0x000008 (_STRACE_UHOH) Unusual or weird phenomenon.
+ syscall 0x000010 (_STRACE_SYSCALL) System calls.
+ startup 0x000020 (_STRACE_STARTUP) argc/envp printout at startup.
+ debug 0x000040 (_STRACE_DEBUG) Info to help debugging.
+ paranoid 0x000080 (_STRACE_PARANOID) Paranoid info.
+ termios 0x000100 (_STRACE_TERMIOS) Info for debugging termios stuff.
+ select 0x000200 (_STRACE_SELECT) Info on ugly select internals.
+ wm 0x000400 (_STRACE_WM) Trace Windows msgs (enable _strace_wm).
+ sigp 0x000800 (_STRACE_SIGP) Trace signal and process handling.
+ minimal 0x001000 (_STRACE_MINIMAL) Very minimal strace output.
+ pthread 0x002000 (_STRACE_PTHREAD) Pthread calls.
+ exitdump 0x004000 (_STRACE_EXITDUMP) Dump strace cache on exit.
+ system 0x008000 (_STRACE_SYSTEM) Serious error; goes to console and log.
+ nomutex 0x010000 (_STRACE_NOMUTEX) Don't use mutex for synchronization.
+ malloc 0x020000 (_STRACE_MALLOC) Trace malloc calls.
+ thread 0x040000 (_STRACE_THREAD) Thread-locking calls.
+ special 0x100000 (_STRACE_SPECIAL) Special debugging printfs for
+ non-checked-in code
+</screen>
+
+ <para>The <command>strace</command> program executes a program, and
+ optionally the children of the program, reporting any Cygwin DLL output
+ from the program(s) to stdout, or to a file with the
+ <literal>-o</literal> option. With the <literal>-w</literal> option, you
+ can start an strace session in a new window, for example:
+ <screen>
+$ strace -o tracing_output -w sh -c 'while true; do echo "tracing..."; done' &amp;
+</screen>
+ This is particularly useful for <command>strace</command> sessions that
+ take a long time to complete. </para>
+
+ <para> Note that <command>strace</command> is a standalone Windows program
+ and so does not rely on the Cygwin DLL itself (you can verify this with
+ <command>cygcheck</command>). As a result it does not understand
+ symlinks. This program is mainly useful for debugging the Cygwin DLL
+ itself.</para>
+
+ </sect2>
+
+ <sect2 id="tzset">
+ <title>tzset</title>
+
+ <screen>
+Usage: tzset [OPTION]
+
+Print POSIX-compatible timezone ID from current Windows timezone setting
+
+Options:
+ -h, --help output usage information and exit.
+ -V, --version output version information and exit.
+
+Use tzset to set your TZ variable. In POSIX-compatible shells like bash,
+dash, mksh, or zsh:
+
+ export TZ=$(tzset)
+
+In csh-compatible shells like tcsh:
+
+ setenv TZ `tzset`
+</screen>
+
+ <para>The <command>tzset</command> tool reads the current timezone from
+ Windows and generates a POSIX-compatible timezone information for the TZ
+ environment variable from that information. That's all there is to it.
+ For the way how to use it, see the above usage information.</para>
+
+ </sect2>
+
+ <sect2 id="umount">
+ <title>umount</title>
+
+ <screen>
+Usage: umount.exe [OPTION] [&lt;posixpath&gt;]
+
+Unmount filesystems
+
+ -h, --help output usage information and exit
+ -U, --remove-user-mounts remove all user mounts
+ -V, --version output version information and exit
+</screen>
+
+ <para>The <command>umount</command> program removes mounts from the mount
+ table in the current session. If you specify a POSIX path that
+ corresponds to a current mount point, <command>umount</command> will
+ remove it from the current mount table. Note that you can only remove
+ user mount points. The <literal>-U</literal> flag may be used to specify
+ removing all user mount points from the current user session.</para>
+
+ <para>See <xref linkend="mount-table"/> for more information on the mount
+ table.</para>
+ </sect2>
+
+</sect1>