diff options
-rw-r--r-- | lang/gcc-aux/DESCR | 17 | ||||
-rw-r--r-- | lang/gcc-aux/Makefile | 337 | ||||
-rw-r--r-- | lang/gcc-aux/buildlink3.mk | 18 | ||||
-rw-r--r-- | lang/gcc-aux/distinfo | 20 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-ada | 9357 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-ada-testsuite | 169 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-core | 1486 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-cxx | 920 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-cxx-testsuite | 4536 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-fortran | 72 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-fortran-testsuite | 31 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-gcc-testsuite | 10 | ||||
-rw-r--r-- | lang/gcc-aux/files/diff-static-version | 16 | ||||
-rw-r--r-- | lang/gcc-aux/options.mk | 96 |
14 files changed, 17085 insertions, 0 deletions
diff --git a/lang/gcc-aux/DESCR b/lang/gcc-aux/DESCR new file mode 100644 index 00000000000..f14dc216ff7 --- /dev/null +++ b/lang/gcc-aux/DESCR @@ -0,0 +1,17 @@ +The AUX compiler supports several languages: Ada, C, C++, Fortran and +Objective-C. Since Ada support must be built by an Ada-capable compiler, +only platforms for which a bootstrap compiler is available can build the +AUX compiler. + +The AUX compiler is based on release versions of the Free Software +Foundation's GNU Compiler Collection. It carries with it the GMGPL license, +the modified version of the GPL that exempts generic instantiation from +resulting in a GPL-licensed executable. It also carries the GCC Runtime +Library Exception, so the resulting binaries have no licensing requirements. +Binaries produced by the AUX compiler should be legally handled the same as +binaries produced by any FSF compiler. + +The AUX GNAT compiler the full Ada-83, Ada-95, Ada-2005 standard and +provides a partial implementation of Ada-2012. The Ada-2012 reference manual +was submitted to the International Organization for Standardization (ISO) +in June 2012. diff --git a/lang/gcc-aux/Makefile b/lang/gcc-aux/Makefile new file mode 100644 index 00000000000..c06d744abed --- /dev/null +++ b/lang/gcc-aux/Makefile @@ -0,0 +1,337 @@ +# $NetBSD: Makefile,v 1.1 2012/07/08 19:30:38 marino Exp $ +# + +PKGNAME= gcc-aux-${SNAPSHOT} +DISTNAME= gcc-${GCC_VERSION} +CATEGORIES= lang +MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/} +DISTFILES= ${DISTNAME}.tar.bz2 + +MAINTAINER= draco@marino.st +HOMEPAGE= http://www.dragonlace.net/ +COMMENT= GNAT Ada compiler based on GCC ${GCC_BRANCH} +LICENSE= gnu-gpl-v3 AND gnu-lgpl-v3 + +SNAPSHOT= 20120614 +GCC_BRANCH= 4.7 +GCC_POINT= 1 +GCC_VERSION= ${GCC_BRANCH}.${GCC_POINT} +LANGS= c + +PKG_DESTDIR_SUPPORT= user-destdir + +USE_TOOLS+= gmake sed:run perl makeinfo bzip2 patch pod2man +USE_BUILTIN.iconv= no +APPLY_DIFFS= core + +.include "../../mk/bsd.prefs.mk" +.include "options.mk" + +# Requires bootstrap compiler, which is only available for NetBSD i386/AMD64 +# DragonFly i386/AMD64 and SunOS i386 Bootstrap compilers for OpenBSD and +# FreeBSD also exist, but are currently reserved for the native package systems +# of those platforms. + +ONLY_FOR_PLATFORM= DragonFly-*-* \ + NetBSD-[5-9]*-i386 \ + NetBSD-[5-9]*-x86_64 \ + SunOS-5.1[1-9]*-i386 + +BLD_TARGET= ${MACHINE_ARCH}-aux-${LOWER_OPSYS}${OS_VERSION} +THREAD_MODEL= posix +OS_LABEL4VERS= [pkgsrc] +BOOTSTRAP_COMPILER= NOT_REQUIRED +INTENDED_COMPILER= NATIVE +BOOTSTRAP_TRIPLET= NOT SET +FULL_GNATGCC= NOT SET +FULL_PATH= /sbin:/bin:/usr/sbin:/usr/bin:${PREFIX}/sbin:${PREFIX}/bin:${PREFIX}/gcc-aux/bin +OLD_EH= register_frame +REBUILD_LIB= Rebuild the following library first: +STICONV= ${PREFIX}/lib/libiconv.a +STINTL= \$${top_builddir}/../intl/libintl.a + + +.if ${OPSYS} == "DragonFly" +.if ${MACHINE_ARCH} == "i386" + OS_LABEL4VERS= [DragonFly] + BOOTSTRAP_TRIPLET= i386-bootstrap-dragonfly2.8/4.6.0 +.endif +.if ${MACHINE_ARCH} == "x86_64" + OS_LABEL4VERS= [DragonFly64] + BOOTSTRAP_TRIPLET= x86_64-bootstrap-dragonfly2.8/4.6.0 +.endif +BOOTSTRAP_COMPILER= gnat-bootstrap.${MACHINE_ARCH}.dragonfly.tar.bz2 +LINK_HEADER= /usr/include/sys/link_elf.h +.endif + + +.if ${OPSYS} == "NetBSD" +.if !empty(OS_VERSION:M5.99.*) + NSUFF= 6.0_DEV +.elif !empty(OS_VERSION:M6.99.*) + NSUFF= 7.0_DEV +.else + NSUFF= ${OS_VERSION} +.endif +.if ${MACHINE_ARCH} == "i386" + OS_LABEL4VERS= [NetBSD] + BOOTSTRAP_TRIPLET= i386-bootstrap-netbsdelf5.1/4.6.0 + BLD_TARGET= ${MACHINE_ARCH}-aux-netbsdelf${NSUFF} +.endif +.if ${MACHINE_ARCH} == "x86_64" + OS_LABEL4VERS= [NetBSD64] + BOOTSTRAP_TRIPLET= x86_64-bootstrap-netbsd5.1/4.6.0 + BLD_TARGET= ${MACHINE_ARCH}-aux-netbsd${NSUFF} +.endif +BOOTSTRAP_COMPILER= gnat-bootstrap.${MACHINE_ARCH}.netbsd.tar.bz2 +LINK_HEADER= /usr/include/link_elf.h +.endif + + +.if ${OPSYS} == "SunOS" +.if ${MACHINE_ARCH} == "i386" + OS_LABEL4VERS= [Solaris] + BOOTSTRAP_TRIPLET= i386-bootstrap-solaris5.11/4.6.1 +.endif +SOL_OSV= `expr substr ${OS_VERSION} 3 2` +BLD_TARGET= ${MACHINE_ARCH}-aux-${LOWER_OPSYS}2.${SOL_OSV} +BOOTSTRAP_COMPILER= gnat-bootstrap.${MACHINE_ARCH}.solaris.tar.bz2 +MY_CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump +. if exists(/usr/sfw/bin/gld) +EXTRA_CONFARGS+= --with-gnu-ld --with-ld=/usr/sfw/bin/gld +. else +EXTRA_CONFARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld +. endif +. if exists(/usr/sfw/bin/gas) +EXTRA_CONFARGS+= --with-gnu-as --with-as=/usr/sfw/bin/gas +. else +EXTRA_CONFARGS+= --without-gnu-as --with-as=/usr/ccs/bin/as +. endif +.endif + + +# define some important directories and files +BUILDDIR= ${WRKDIR}/build +WRKSRC= ${WRKDIR}/gcc-${GCC_VERSION} +PKG_PREFIX= ${PREFIX}/gcc-aux +CFG_SCRIPT= ${WRKSRC}/configure +BOOTSTRAP_PREFIX= ${WRKDIR}/bootstrap +REVFILE= ${WRKSRC}/gcc/REVISION +BASELIB= ${PREFIX}/lib + + + +# testing if gcc-aux, gnatlink, gnatbind and gnatmake are in standard location +# exists function will NOT expand any variable, so it has to be hard-coded +.if exists(/usr/pkg/gcc-aux/bin/ada) || exists(/opt/ipp/pkg/gcc-aux/bin/ada) +.if exists(/usr/pkg/gcc-aux/bin/gnatbind) || exists(/opt/ipp/pkg/gcc-aux/bin/gnatbind) +.if exists(/usr/pkg/gcc-aux/bin/gnatlink) || exists(/opt/ipp/pkg/gcc-aux/bin/gnatlink) +.if exists(/usr/pkg/gcc-aux/bin/gnatmake) || exists(/opt/ipp/pkg/gcc-aux/bin/gnatmake) +FULL_GNATGCC=${PREFIX}/gcc-aux/bin/ada +.endif #gnatmake +.endif #gnatlink +.endif #gnatbind +.endif #gnatgcc + + +.if ${FULL_GNATGCC} == "NOT SET" +# here we know we need to install the bootstrap compiler +INTENDED_COMPILER=BOOTSTRAP +FULL_GNATGCC=${BOOTSTRAP_PREFIX}/bin/gnatgcc +DISTFILES+= ${BOOTSTRAP_COMPILER} +SITES.${BOOTSTRAP_COMPILER}= http://downloads.dragonlace.net/src/ \ + http://dragonlace.mirrors.ada.cx/src/ +FULL_PATH=${BOOTSTRAP_PREFIX}/bin:/sbin:/bin:/usr/sbin:/usr/bin:${PREFIX}/sbin:${PREFIX}/bin +.endif + + +# For pkg maintenance, uncomment to invoke "bmake mdi" +#DISTFILES+= \ +# gnat-bootstrap.i386.dragonfly.tar.bz2 \ +# gnat-bootstrap.x86_64.dragonfly.tar.bz2 \ +# gnat-bootstrap.i386.netbsd.tar.bz2 \ +# gnat-bootstrap.x86_64.netbsd.tar.bz2 \ +# gnat-bootstrap.i386.solaris.tar.bz2 + + +# establish ada-aware compiler for use +MY_CONFIGURE_ENV+= CC=${FULL_GNATGCC} +MY_CONFIGURE_ENV+= PATH=${FULL_PATH} +MY_MAKE_ENV= PATH=${FULL_PATH} +MY_MAKE_ENV+= ICONVPREFIX=${PREFIX} +MY_MAKE_ENV+= LD_LIBRARY_PATH=${BUILDDIR}/gcc +# ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into +# a binary so we need to make sure we give it the installed sed and not +# the tool wrapped one. +MY_MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} +MY_MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} + + +# The standard configuration options +CONFIGURE_ARGS= --enable-languages=${LANGS:Q} +CONFIGURE_ARGS+= --build=${BLD_TARGET} +CONFIGURE_ARGS+= --prefix=${PKG_PREFIX:Q} +CONFIGURE_ARGS+= --with-system-zlib +CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp} +CONFIGURE_ARGS+= --with-mpfr=${BUILDLINK_PREFIX.mpfr} +CONFIGURE_ARGS+= --with-mpc=${BUILDLINK_PREFIX.mpcomplex} +CONFIGURE_ARGS+= --with-libiconv-prefix=${PREFIX} +CONFIGURE_ARGS+= --enable-shared +CONFIGURE_ARGS+= --enable-threads=${THREAD_MODEL} +CONFIGURE_ARGS+= --disable-bootstrap +CONFIGURE_ARGS+= --disable-libmudflap +CONFIGURE_ARGS+= --disable-libgomp +CONFIGURE_ARGS+= --disable-libssp +CONFIGURE_ARGS+= ${EXTRA_CONFARGS} + +# Automatic package list generation +GENERATE_PLIST= cd ${DESTDIR}${PREFIX}; +GENERATE_PLIST+= ${FIND} * \( -type f -or -type l \) | ${SORT} -dr; + + +post-extract: + # Personalize GNAT for each different machine + @${ECHO} "-=> GCC AUX ${OS_LABEL4VERS}" > ${REVFILE} + + # Create new directories in preparation of applying diff files +.if !empty(PKG_OPTIONS:Mcxx) + ${MKDIR} ${WRKSRC}/libstdc++-v3/config/locale/dragonfly + ${MKDIR} ${WRKSRC}/libstdc++-v3/config/os/bsd/dragonfly +.endif + + # Apply required composite diff files +.for suffix in ${APPLY_DIFFS} + @${ECHO} "Applying composite patch diff-${suffix}" + @${PATCH} -d ${WRKSRC} -s -E < ${FILESDIR}/diff-${suffix} +.endfor + +.if !empty(PKG_OPTIONS:Mstatic) || ${OPSYS} == "NetBSD" + @${ECHO} "Reconfiguring GCC Makefile to build compiler statically" + @${PATCH} -d ${WRKSRC} -s -E < ${FILESDIR}/diff-static-version +.if empty(PKG_OPTIONS:Mnls) + @perl -pi -e 's;\@LIBICONV\@;${STICONV};' \ + ${WRKSRC}/gcc/Makefile.in \ + ${WRKSRC}/libcpp/Makefile.in \ + ${WRKSRC}/gcc/ada/gcc-interface/Makefile.in +.else + @perl -pi -e 's;\@LIBINTL\@;${STINTL} ${STICONV};' ${WRKSRC}/intl/config.intl.in + @perl -pi -e 's;\@LIBICONV\@;;' \ + ${WRKSRC}/gcc/Makefile.in \ + ${WRKSRC}/libcpp/Makefile.in \ + ${WRKSRC}/gcc/ada/gcc-interface/Makefile.in +.endif +.endif + +.if ${INTENDED_COMPILER} == "BOOTSTRAP" + # Bootstrap compiler has statically linked z, gmp, mpc, mpfr and iconv + # The only shared lib is libc.so.7, so it should work for a long time. + # It is at least 28MB and doesn't come with shared libraries. + + ${MKDIR} ${BOOTSTRAP_PREFIX} + mv ${BOOTSTRAP_PREFIX}/../bin ${BOOTSTRAP_PREFIX} + mv ${BOOTSTRAP_PREFIX}/../lib ${BOOTSTRAP_PREFIX} + mv ${BOOTSTRAP_PREFIX}/../libexec ${BOOTSTRAP_PREFIX} + + # Bootstrap compiler malfunctions in NetBSD 6 unless include-fixed + # directory is removed first. It will eventually cause problems + # for DragonFly and Solaris as well, so just unconditionally kill it. + ${RM} -rf ${BOOTSTRAP_PREFIX}/lib/gcc/${BOOTSTRAP_TRIPLET}/include-fixed +.endif + + +pre-configure: +# NetBSD's system compiler is not configured to use dl_iterate_phdr which is +# required to build shared libraries if gnat-aux handles exceptions via +# dl_iterate_phdr. Therefore the feature requires statically built +# gmp, mpc, mpfr, and iconv libraries in order to build on NetBSD. +# DragonFly introduced this functionality with 2.11, but it's possible the +# shared libraries were built with an earlier compiler in the case of an +# upgrade. We need to detect this situation on shared library builds and +# stop the build if the libraries need to be rebuilt. +.if ${OPSYS} == "DragonFly" && empty(PKG_OPTIONS:Mstatic) + @if ${GREP} dl_iterate_phdr ${LINK_HEADER} > /dev/null; then \ + if ${GREP} ${OLD_EH} ${BASELIB}/libmpc.so > /dev/null; then \ + ${ERROR_MSG} "${REBUILD_LIB} math/mpcomplex"; \ + exit 101; \ + fi; \ + if ${GREP} ${OLD_EH} ${BASELIB}/libmpfr.so > /dev/null; then \ + ${ERROR_MSG} "${REBUILD_LIB} math/mpfr"; \ + exit 102; \ + fi; \ + if ${GREP} ${OLD_EH} ${BASELIB}/libgmp.so > /dev/null; then \ + ${ERROR_MSG} "${REBUILD_LIB} devel/gmp"; \ + exit 103; \ + fi; \ + if ${GREP} ${OLD_EH} ${BASELIB}/libiconv.so > /dev/null; then \ + ${ERROR_MSG} "${REBUILD_LIB} converters/libiconv"; \ + exit 104; \ + fi; \ + fi +.endif + + +do-configure: + ${MKDIR} ${BUILDDIR} + cd ${BUILDDIR} && ${SETENV} ${MY_CONFIGURE_ENV} \ + ${CFG_SCRIPT} ${CONFIGURE_ARGS} + + +do-build: + # The unlimited stacksize is for NetBSD64 + cd ${BUILDDIR} && \ + ${ULIMIT_CMD_stacksize} && \ + ${SETENV} ${MY_MAKE_ENV} ${GMAKE} -j${MAKE_JOBS:U1:Q} all + + +do-test: build test-ada test-fortran test-objc test-cxx test-c + +test-ada: +.if !empty(PKG_OPTIONS:Mtestsuite) && !empty(PKG_OPTIONS:Mada) +.if (${OPSYS} == "NetBSD") && (${MACHINE_ARCH} == "x86_64") + # NetBSD has an extremely small default stacksize of 2MB, which is + # insufficient for the gnat.dg testsuite. + # specifically: entry_queues test on AMD64 + # Unlimiting stack resources on i386-netbsdelf* will result in + # failure of gnat.dg/task_stack_align.adb execution test. + cd ${BUILDDIR} && \ + ${ULIMIT_CMD_stacksize} && \ + ${SETENV} ${MY_MAKE_ENV} ${GMAKE} -sk check-ada +.else + cd ${BUILDDIR} && ${SETENV} ${MY_MAKE_ENV} ${GMAKE} -sk check-ada +.endif +.endif + +test-fortran: +.if !empty(PKG_OPTIONS:Mtestsuite) && !empty(PKG_OPTIONS:Mfortran) + cd ${BUILDDIR} && ${SETENV} ${MY_MAKE_ENV} ${GMAKE} -sk check-fortran +.endif + +test-objc: +.if !empty(PKG_OPTIONS:Mtestsuite) && !empty(PKG_OPTIONS:Mobjc) + cd ${BUILDDIR} && ${SETENV} ${MY_MAKE_ENV} ${GMAKE} -sk check-objc +.endif + +test-cxx: +.if !empty(PKG_OPTIONS:Mtestsuite) && !empty(PKG_OPTIONS:Mcxx) + # libstdc++ always ends with error status, so ignore it + cd ${BUILDDIR} && ${SETENV} ${MY_MAKE_ENV} ${GMAKE} -sk \ + check-c++ || ${TRUE} +.endif + +test-c: +.if !empty(PKG_OPTIONS:Mtestsuite) + cd ${BUILDDIR} && ${SETENV} ${MY_MAKE_ENV} ${GMAKE} -sk check-c +.endif + + +do-install: + cd ${BUILDDIR} && ${SETENV} ${MY_MAKE_ENV} ${GMAKE} install-strip \ + DESTDIR=${DESTDIR} + + + +.include "../../converters/libiconv/buildlink3.mk" +.include "../../devel/gmp/buildlink3.mk" +.include "../../math/mpfr/buildlink3.mk" +.include "../../math/mpcomplex/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/lang/gcc-aux/buildlink3.mk b/lang/gcc-aux/buildlink3.mk new file mode 100644 index 00000000000..6e260842daa --- /dev/null +++ b/lang/gcc-aux/buildlink3.mk @@ -0,0 +1,18 @@ +# $NetBSD: buildlink3.mk,v 1.1 2012/07/08 19:30:38 marino Exp $ + +BUILDLINK_TREE+= gcc-aux + +.if !defined(GCC_AUX_BUILDLINK3_MK) +GCC_AUX_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.gcc-aux+= gcc-aux>=20120614 +BUILDLINK_PKGSRCDIR.gcc-aux?= ../../lang/gcc-aux + +.include "../../converters/libiconv/buildlink3.mk" +.include "../../devel/gettext-lib/buildlink3.mk" +.include "../../devel/gmp/buildlink3.mk" +.include "../../math/mpfr/buildlink3.mk" +.include "../../math/mpcomplex/buildlink3.mk" +.endif + +BUILDLINK_TREE+= -gcc-aux diff --git a/lang/gcc-aux/distinfo b/lang/gcc-aux/distinfo new file mode 100644 index 00000000000..b051258e026 --- /dev/null +++ b/lang/gcc-aux/distinfo @@ -0,0 +1,20 @@ +$NetBSD: distinfo,v 1.1 2012/07/08 19:30:38 marino Exp $ + +SHA1 (gcc-4.7.1.tar.bz2) = 3ab74e63a8f2120b4f2c5557f5ffec6907337137 +RMD160 (gcc-4.7.1.tar.bz2) = 4b52d867d06288a0b3bb33c845cac0112c22b513 +Size (gcc-4.7.1.tar.bz2) = 82639660 bytes +SHA1 (gnat-bootstrap.i386.dragonfly.tar.bz2) = d7a8103243a2df3723d9d3c3ec0da9c3bb725214 +RMD160 (gnat-bootstrap.i386.dragonfly.tar.bz2) = 9e6fde444e0ed76ee404810af6d6b7eb48659c09 +Size (gnat-bootstrap.i386.dragonfly.tar.bz2) = 28205489 bytes +SHA1 (gnat-bootstrap.i386.netbsd.tar.bz2) = 19b61f54fae8e237a4e678ff03f20f50b47db1df +RMD160 (gnat-bootstrap.i386.netbsd.tar.bz2) = ade03f223b2af229daece20a749915f7da0eb0a6 +Size (gnat-bootstrap.i386.netbsd.tar.bz2) = 27654956 bytes +SHA1 (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 77a637a497c61e4085de31b24a205f24b1776a15 +RMD160 (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 4d0eb7b8a5f901333f1ffd190a5bf72072b2b52e +Size (gnat-bootstrap.x86_64.dragonfly.tar.bz2) = 31380342 bytes +SHA1 (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 84f0e9179998daa643046a5d139321c4130ea84d +RMD160 (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 0b2943349536c323a62b56dc05ff1fedd6d7e17a +Size (gnat-bootstrap.x86_64.netbsd.tar.bz2) = 30572187 bytes +SHA1 (gnat-bootstrap.i386.solaris.tar.bz2) = 4962657bfc894a20ad3102c1f6fe8e566b47cb51 +RMD160 (gnat-bootstrap.i386.solaris.tar.bz2) = ae72e76d0aba94451d99b9a70a3c049c9258cc82 +Size (gnat-bootstrap.i386.solaris.tar.bz2) = 43247034 bytes diff --git a/lang/gcc-aux/files/diff-ada b/lang/gcc-aux/files/diff-ada new file mode 100644 index 00000000000..c17a55e7cdf --- /dev/null +++ b/lang/gcc-aux/files/diff-ada @@ -0,0 +1,9357 @@ +--- gcc/ada/a-exetim-posix.adb.orig ++++ gcc/ada/a-exetim-posix.adb +@@ -106,11 +106,11 @@ + -- Time is equal to Duration (although it is a private type) and + -- CPU_Time is equal to Time. + +- function clock_gettime ++ function clock_gettime_int + (clock_id : Interfaces.C.int; + tp : access timespec) + return int; +- pragma Import (C, clock_gettime, "clock_gettime"); ++ pragma Import (C, clock_gettime_int, "clock_gettime"); + -- Function from the POSIX.1b Realtime Extensions library + + begin +@@ -118,7 +118,7 @@ + raise Program_Error; + end if; + +- Result := clock_gettime ++ Result := clock_gettime_int + (clock_id => CLOCK_THREAD_CPUTIME_ID, tp => TS'Unchecked_Access); + pragma Assert (Result = 0); + +--- /dev/null ++++ gcc/ada/a-intnam-dragonfly.ads +@@ -0,0 +1,136 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- A D A . I N T E R R U P T S . N A M E S -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the DragonFly BSD THREADS version of this package ++ ++with System.OS_Interface; ++ ++package Ada.Interrupts.Names is ++ ++ -- All identifiers in this unit are implementation defined ++ ++ pragma Implementation_Defined; ++ ++ -- Beware that the mapping of names to signals may be many-to-one. There ++ -- may be aliases. Also, for all signal names that are not supported on ++ -- the current system the value of the corresponding constant will be zero. ++ ++ SIGHUP : constant Interrupt_ID := ++ System.OS_Interface.SIGHUP; -- hangup ++ ++ SIGINT : constant Interrupt_ID := ++ System.OS_Interface.SIGINT; -- interrupt (rubout) ++ ++ SIGQUIT : constant Interrupt_ID := ++ System.OS_Interface.SIGQUIT; -- quit (ASCD FS) ++ ++ SIGILL : constant Interrupt_ID := ++ System.OS_Interface.SIGILL; -- illegal instruction (not reset) ++ ++ SIGTRAP : constant Interrupt_ID := ++ System.OS_Interface.SIGTRAP; -- trace trap (not reset) ++ ++ SIGIOT : constant Interrupt_ID := ++ System.OS_Interface.SIGIOT; -- IOT instruction ++ ++ SIGABRT : constant Interrupt_ID := -- used by abort, ++ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future ++ ++ SIGFPE : constant Interrupt_ID := ++ System.OS_Interface.SIGFPE; -- floating point exception ++ ++ SIGKILL : constant Interrupt_ID := ++ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored) ++ ++ SIGBUS : constant Interrupt_ID := ++ System.OS_Interface.SIGBUS; -- bus error ++ ++ SIGSEGV : constant Interrupt_ID := ++ System.OS_Interface.SIGSEGV; -- segmentation violation ++ ++ SIGPIPE : constant Interrupt_ID := -- write on a pipe with ++ System.OS_Interface.SIGPIPE; -- no one to read it ++ ++ SIGALRM : constant Interrupt_ID := ++ System.OS_Interface.SIGALRM; -- alarm clock ++ ++ SIGTERM : constant Interrupt_ID := ++ System.OS_Interface.SIGTERM; -- software termination signal from kill ++ ++ SIGURG : constant Interrupt_ID := ++ System.OS_Interface.SIGURG; -- urgent condition on IO channel ++ ++ SIGSTOP : constant Interrupt_ID := ++ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored) ++ ++ SIGTSTP : constant Interrupt_ID := ++ System.OS_Interface.SIGTSTP; -- user stop requested from tty ++ ++ SIGCONT : constant Interrupt_ID := ++ System.OS_Interface.SIGCONT; -- stopped process has been continued ++ ++ SIGCHLD : constant Interrupt_ID := ++ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD ++ ++ SIGCLD : constant Interrupt_ID := ++ System.OS_Interface.SIGCLD; -- child status change ++ ++ SIGTTIN : constant Interrupt_ID := ++ System.OS_Interface.SIGTTIN; -- background tty read attempted ++ ++ SIGTTOU : constant Interrupt_ID := ++ System.OS_Interface.SIGTTOU; -- background tty write attempted ++ ++ SIGIO : constant Interrupt_ID := -- input/output possible, ++ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris) ++ ++ SIGXCPU : constant Interrupt_ID := ++ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded ++ ++ SIGXFSZ : constant Interrupt_ID := ++ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded ++ ++ SIGVTALRM : constant Interrupt_ID := ++ System.OS_Interface.SIGVTALRM; -- virtual timer expired ++ ++ SIGPROF : constant Interrupt_ID := ++ System.OS_Interface.SIGPROF; -- profiling timer expired ++ ++ SIGWINCH : constant Interrupt_ID := ++ System.OS_Interface.SIGWINCH; -- window size change ++ ++ SIGUSR1 : constant Interrupt_ID := ++ System.OS_Interface.SIGUSR1; -- user defined signal 1 ++ ++ SIGUSR2 : constant Interrupt_ID := ++ System.OS_Interface.SIGUSR2; -- user defined signal 2 ++ ++end Ada.Interrupts.Names; +--- /dev/null ++++ gcc/ada/a-intnam-netbsd.ads +@@ -0,0 +1,139 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- A D A . I N T E R R U P T S . N A M E S -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the NetBSD THREADS version of this package ++ ++with System.OS_Interface; ++ ++package Ada.Interrupts.Names is ++ ++ -- All identifiers in this unit are implementation defined ++ ++ pragma Implementation_Defined; ++ ++ -- Beware that the mapping of names to signals may be many-to-one. There ++ -- may be aliases. Also, for all signal names that are not supported on ++ -- the current system the value of the corresponding constant will be zero. ++ ++ SIGHUP : constant Interrupt_ID := ++ System.OS_Interface.SIGHUP; -- hangup ++ ++ SIGINT : constant Interrupt_ID := ++ System.OS_Interface.SIGINT; -- interrupt (rubout) ++ ++ SIGQUIT : constant Interrupt_ID := ++ System.OS_Interface.SIGQUIT; -- quit (ASCD FS) ++ ++ SIGILL : constant Interrupt_ID := ++ System.OS_Interface.SIGILL; -- illegal instruction (not reset) ++ ++ SIGTRAP : constant Interrupt_ID := ++ System.OS_Interface.SIGTRAP; -- trace trap (not reset) ++ ++ SIGIOT : constant Interrupt_ID := ++ System.OS_Interface.SIGIOT; -- IOT instruction ++ ++ SIGABRT : constant Interrupt_ID := -- used by abort, ++ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future ++ ++ SIGFPE : constant Interrupt_ID := ++ System.OS_Interface.SIGFPE; -- floating point exception ++ ++ SIGKILL : constant Interrupt_ID := ++ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored) ++ ++ SIGBUS : constant Interrupt_ID := ++ System.OS_Interface.SIGBUS; -- bus error ++ ++ SIGSEGV : constant Interrupt_ID := ++ System.OS_Interface.SIGSEGV; -- segmentation violation ++ ++ SIGPIPE : constant Interrupt_ID := -- write on a pipe with ++ System.OS_Interface.SIGPIPE; -- no one to read it ++ ++ SIGALRM : constant Interrupt_ID := ++ System.OS_Interface.SIGALRM; -- alarm clock ++ ++ SIGTERM : constant Interrupt_ID := ++ System.OS_Interface.SIGTERM; -- software termination signal from kill ++ ++ SIGURG : constant Interrupt_ID := ++ System.OS_Interface.SIGURG; -- urgent condition on IO channel ++ ++ SIGSTOP : constant Interrupt_ID := ++ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored) ++ ++ SIGTSTP : constant Interrupt_ID := ++ System.OS_Interface.SIGTSTP; -- user stop requested from tty ++ ++ SIGCONT : constant Interrupt_ID := ++ System.OS_Interface.SIGCONT; -- stopped process has been continued ++ ++ SIGCHLD : constant Interrupt_ID := ++ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD ++ ++ SIGCLD : constant Interrupt_ID := ++ System.OS_Interface.SIGCLD; -- child status change ++ ++ SIGTTIN : constant Interrupt_ID := ++ System.OS_Interface.SIGTTIN; -- background tty read attempted ++ ++ SIGTTOU : constant Interrupt_ID := ++ System.OS_Interface.SIGTTOU; -- background tty write attempted ++ ++ SIGIO : constant Interrupt_ID := -- input/output possible, ++ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris) ++ ++ SIGXCPU : constant Interrupt_ID := ++ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded ++ ++ SIGXFSZ : constant Interrupt_ID := ++ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded ++ ++ SIGVTALRM : constant Interrupt_ID := ++ System.OS_Interface.SIGVTALRM; -- virtual timer expired ++ ++ SIGPROF : constant Interrupt_ID := ++ System.OS_Interface.SIGPROF; -- profiling timer expired ++ ++ SIGWINCH : constant Interrupt_ID := ++ System.OS_Interface.SIGWINCH; -- window size change ++ ++ SIGUSR1 : constant Interrupt_ID := ++ System.OS_Interface.SIGUSR1; -- user defined signal 1 ++ ++ SIGUSR2 : constant Interrupt_ID := ++ System.OS_Interface.SIGUSR2; -- user defined signal 2 ++ ++ SIGPWR : constant Interrupt_ID := ++ System.OS_Interface.SIGPWR; -- power fail/restart ++ ++end Ada.Interrupts.Names; +--- /dev/null ++++ gcc/ada/a-intnam-openbsd.ads +@@ -0,0 +1,136 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- A D A . I N T E R R U P T S . N A M E S -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the OpenBSD THREADS version of this package ++ ++with System.OS_Interface; ++ ++package Ada.Interrupts.Names is ++ ++ -- All identifiers in this unit are implementation defined ++ ++ pragma Implementation_Defined; ++ ++ -- Beware that the mapping of names to signals may be many-to-one. There ++ -- may be aliases. Also, for all signal names that are not supported on ++ -- the current system the value of the corresponding constant will be zero. ++ ++ SIGHUP : constant Interrupt_ID := ++ System.OS_Interface.SIGHUP; -- hangup ++ ++ SIGINT : constant Interrupt_ID := ++ System.OS_Interface.SIGINT; -- interrupt (rubout) ++ ++ SIGQUIT : constant Interrupt_ID := ++ System.OS_Interface.SIGQUIT; -- quit (ASCD FS) ++ ++ SIGILL : constant Interrupt_ID := ++ System.OS_Interface.SIGILL; -- illegal instruction (not reset) ++ ++ SIGTRAP : constant Interrupt_ID := ++ System.OS_Interface.SIGTRAP; -- trace trap (not reset) ++ ++ SIGIOT : constant Interrupt_ID := ++ System.OS_Interface.SIGIOT; -- IOT instruction ++ ++ SIGABRT : constant Interrupt_ID := -- used by abort, ++ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future ++ ++ SIGFPE : constant Interrupt_ID := ++ System.OS_Interface.SIGFPE; -- floating point exception ++ ++ SIGKILL : constant Interrupt_ID := ++ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored) ++ ++ SIGBUS : constant Interrupt_ID := ++ System.OS_Interface.SIGBUS; -- bus error ++ ++ SIGSEGV : constant Interrupt_ID := ++ System.OS_Interface.SIGSEGV; -- segmentation violation ++ ++ SIGPIPE : constant Interrupt_ID := -- write on a pipe with ++ System.OS_Interface.SIGPIPE; -- no one to read it ++ ++ SIGALRM : constant Interrupt_ID := ++ System.OS_Interface.SIGALRM; -- alarm clock ++ ++ SIGTERM : constant Interrupt_ID := ++ System.OS_Interface.SIGTERM; -- software termination signal from kill ++ ++ SIGURG : constant Interrupt_ID := ++ System.OS_Interface.SIGURG; -- urgent condition on IO channel ++ ++ SIGSTOP : constant Interrupt_ID := ++ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored) ++ ++ SIGTSTP : constant Interrupt_ID := ++ System.OS_Interface.SIGTSTP; -- user stop requested from tty ++ ++ SIGCONT : constant Interrupt_ID := ++ System.OS_Interface.SIGCONT; -- stopped process has been continued ++ ++ SIGCHLD : constant Interrupt_ID := ++ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD ++ ++ SIGCLD : constant Interrupt_ID := ++ System.OS_Interface.SIGCLD; -- child status change ++ ++ SIGTTIN : constant Interrupt_ID := ++ System.OS_Interface.SIGTTIN; -- background tty read attempted ++ ++ SIGTTOU : constant Interrupt_ID := ++ System.OS_Interface.SIGTTOU; -- background tty write attempted ++ ++ SIGIO : constant Interrupt_ID := -- input/output possible, ++ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris) ++ ++ SIGXCPU : constant Interrupt_ID := ++ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded ++ ++ SIGXFSZ : constant Interrupt_ID := ++ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded ++ ++ SIGVTALRM : constant Interrupt_ID := ++ System.OS_Interface.SIGVTALRM; -- virtual timer expired ++ ++ SIGPROF : constant Interrupt_ID := ++ System.OS_Interface.SIGPROF; -- profiling timer expired ++ ++ SIGWINCH : constant Interrupt_ID := ++ System.OS_Interface.SIGWINCH; -- window size change ++ ++ SIGUSR1 : constant Interrupt_ID := ++ System.OS_Interface.SIGUSR1; -- user defined signal 1 ++ ++ SIGUSR2 : constant Interrupt_ID := ++ System.OS_Interface.SIGUSR2; -- user defined signal 2 ++ ++end Ada.Interrupts.Names; +--- gcc/ada/adaint.c.orig ++++ gcc/ada/adaint.c +@@ -1077,6 +1077,7 @@ + strcpy (path, "GNAT-XXXXXX"); + + #if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \ ++ || defined (DragonFly) \ + || defined (linux) || defined(__GLIBC__)) && !defined (__vxworks) + return mkstemp (path); + #elif defined (__Lynx__) +@@ -1227,7 +1228,49 @@ + free (pname); + } + ++#elif defined (__ANDROID__) ++ ++ /* ++ * ext2 /ext3/ext4/fat16/fat32 have no path limits ++ * /data/local/tmp normally requires rooted devices, if it even exists ++ * /sdcard is the standard location for external storage. Nativeactivity ++ * manifest needs to authorize its use, otherwise it might not have the ++ * proper permissions. ++ */ ++ ++ int testfd; ++ char *datadir = getenv ("ANDROID_DATA"); ++ ++ if (datadir == NULL) ++ strcpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX"); ++ else ++ sprintf (tmp_filename, "%s/local/tmp/gnat-XXXXXX", datadir); ++ ++ testfd = mkstemp (tmp_filename); ++ if (testfd != -1) ++ { ++ close (testfd); ++ return; ++ } ++ ++ char *sdcard = getenv ("EXTERNAL_STORAGE"); ++ ++ if (sdcard == NULL) ++ strcpy (tmp_filename, "/sdcard/gnat-XXXXXX"); ++ else ++ sprintf (tmp_filename, "%s/gnat-XXXXXX", sdcard); ++ ++ testfd = mkstemp (tmp_filename); ++ if (testfd != -1) ++ { ++ close (testfd); ++ return; ++ } ++ ++ tmpnam (tmp_filename); ++ + #elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) \ ++ || defined (__DragonFly__) \ + || defined (__OpenBSD__) || defined(__GLIBC__) + #define MAX_SAFE_PATH 1000 + char *tmpdir = getenv ("TMPDIR"); +@@ -2468,6 +2511,8 @@ + int cores = 1; + + #if defined (linux) || defined (sun) || defined (AIX) \ ++ || defined (__FreeBSD__) || defined (__DragonFly__) \ ++ || defined (__OpenBSD__) || defined (__NetBSD__) \ + || (defined (__alpha__) && defined (_osf_)) || defined (__APPLE__) + cores = (int) sysconf (_SC_NPROCESSORS_ONLN); + +@@ -3530,26 +3575,214 @@ + } + #endif + +-#if defined (IS_CROSS) \ +- || (! ((defined (sparc) || defined (i386)) && defined (sun) \ +- && defined (__SVR4)) \ +- && ! (defined (linux) && (defined (i386) || defined (__x86_64__))) \ +- && ! (defined (linux) && defined (__ia64__)) \ +- && ! (defined (linux) && defined (powerpc)) \ +- && ! defined (__FreeBSD__) \ +- && ! defined (__Lynx__) \ +- && ! defined (__hpux__) \ +- && ! defined (__APPLE__) \ +- && ! defined (_AIX) \ +- && ! (defined (__alpha__) && defined (__osf__)) \ +- && ! defined (VMS) \ +- && ! defined (__MINGW32__) \ +- && ! (defined (__mips) && defined (__sgi))) +- +-/* Dummy function to satisfy g-trasym.o. See the preprocessor conditional +- just above for a list of native platforms that provide a non-dummy +- version of this procedure in libaddr2line.a. */ ++/* run-time symbolic traceback support */ ++#if defined (__DragonFly__) \ ++ || defined (__FreeBSD__) \ ++ || defined (__OpenBSD__) \ ++ || defined (__NetBSD__) \ ++ || (defined (__sun__) && defined (__i386__) && defined (__SVR4)) ++ ++/* The above platforms use the external program /usr/bin/addr2line */ ++#define EXTERNAL_SYMTRACE ++ ++#elif defined (VMS) \ ++ || defined (_AIX) \ ++ || defined (__Lynx__) \ ++ || defined (__hpux__) \ ++ || defined (__APPLE__) \ ++ || defined (__MINGW32__) \ ++ || (defined (__mips) && defined (__sgi)) \ ++ || (defined (__alpha__) && defined (__osf__)) \ ++ || (defined (linux) && defined (i386)) \ ++ || (defined (linux) && defined (powerpc)) \ ++ || (defined (linux) && defined (__ia64__)) \ ++ || (defined (linux) && defined (__x86_64__)) \ ++ || (defined (__SVR4) && defined (__sun__) && defined (sparc)) ++ ++/* The above platforms use the system library libaddr2line.a */ ++#define NATIVE_SYMTRACE ++#endif ++ ++#if defined (EXTERNAL_SYMTRACE) && !defined (IS_CROSS) ++ ++/* ++ Copyright (C) 1999 by Juergen Pfeifer <juergen.pfeifer@gmx.net> ++ Ada for Linux Team (ALT) ++ Heavily modified by John Marino <http://www.dragonlace.net> ++ ++ Permission is hereby granted, free of charge, to any person obtaining a ++ copy of this software and associated documentation files (the ++ "Software"), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, distribute with modifications, sublicense, and/or sell ++ copies of the Software, and to permit persons to whom the Software is ++ furnished to do so, subject to the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, ++ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ++ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR ++ THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ ++ Except as contained in this notice, the name(s) of the above copyright ++ holders shall not be used in advertising or otherwise to promote the ++ sale, use or other dealings in this Software without prior written ++ authorization. ++*/ ++ ++#include <sys/types.h> ++#include <stdlib.h> ++#include <unistd.h> ++#include <string.h> ++#include <signal.h> ++ ++#define CLOSE_SENDPIPE close(sendpipe[0]); close(sendpipe[1]) ++#define CLOSE_READPIPE close(readpipe[0]); close(readpipe[1]) ++#define DUP2CLOSE(oldfd, newfd) dup2(oldfd, newfd); close(oldfd); ++#define RESTSIG sigaction(SIGPIPE,&oact,NULL) ++ ++#define MAX_LINE 1024 ++#define PARENT_READ readpipe[0] ++#define CHILD_WRITE readpipe[1] ++#define CHILD_READ sendpipe[0] ++#define PARENT_WRITE sendpipe[1] ++ ++#if defined (__sun__) ++#define ADDR2LINE_PROG "/usr/gnu/bin/addr2line" ++#else ++#define ADDR2LINE_PROG "/usr/bin/addr2line" ++#endif ++ ++void ++convert_addresses (const char *file_name, ++ void *addrs, ++ int n_addr, ++ void *buf, ++ int *len) ++{ ++ int max_len = *len; ++ pid_t childpid; ++ ++ struct sigaction act, oact; ++ ++ int sendpipe[2] = {-1,-1}, /* parent -> child */ ++ readpipe[2] = {-1,-1}; /* parent <- child */ ++ ++ *len = 0; ++ act.sa_handler = SIG_IGN; ++ sigemptyset(&act.sa_mask); ++ act.sa_flags = 0; ++ if (sigaction(SIGPIPE,&act,&oact) < 0) ++ return; ++ ++ if (pipe(sendpipe) < 0) { RESTSIG; return; } ++ if (pipe(readpipe) < 0) { CLOSE_SENDPIPE; RESTSIG; return; } ++ if ((childpid = fork()) < 0) { ++ CLOSE_READPIPE; ++ CLOSE_SENDPIPE; ++ RESTSIG; ++ return; ++ } ++ ++ if (childpid == 0) { /* child process */ ++ close(PARENT_WRITE); ++ close(PARENT_READ); ++ if ((CHILD_READ != STDIN_FILENO) && (CHILD_WRITE != STDOUT_FILENO)) { ++ if ((CHILD_READ == STDOUT_FILENO) && (CHILD_WRITE == STDIN_FILENO)) { ++ const int temp_fd = dup(CHILD_WRITE); ++ close (CHILD_WRITE); ++ DUP2CLOSE (CHILD_READ, STDIN_FILENO); ++ DUP2CLOSE (temp_fd, STDOUT_FILENO); ++ } ++ else if ((CHILD_READ == STDIN_FILENO) && (CHILD_WRITE > 1)) { ++ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO); ++ } ++ else if ((CHILD_READ > 1) && (CHILD_WRITE == STDOUT_FILENO)) { ++ DUP2CLOSE (CHILD_READ, STDIN_FILENO); ++ } ++ else if ((CHILD_READ > 1) && (CHILD_WRITE == STDIN_FILENO)) { ++ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO); ++ DUP2CLOSE (CHILD_READ, STDIN_FILENO); ++ } ++ else { ++ /* CHILD_READ >= 1 and CHILD_WRITE > 1 */ ++ DUP2CLOSE (CHILD_READ, STDIN_FILENO); ++ DUP2CLOSE (CHILD_WRITE, STDOUT_FILENO); ++ } ++ } ++ /* As pointed out by Florian Weimer to JP, it is a security threat to call ++ the script with a user defined environment and using the path. That ++ would be Trojans pleasure. Therefore the absolute path to addr2line ++ and an empty environment is used. That should be safe. ++ */ ++ char *const argv[] = { "addr2line", ++ "-e", file_name, ++ "--demangle=gnat", ++ "--functions", ++ "--basenames", ++ NULL }; ++ char *const envp[] = { NULL }; ++ if (execve(ADDR2LINE_PROG, argv, envp) < 0) { ++ close (CHILD_WRITE); ++ close (CHILD_READ); ++ RESTSIG; ++ exit (1); ++ } ++ } ++ ++ /* Below this line is parent process */ ++ int i, n; ++ char hex[16]; ++ char line[MAX_LINE + 1]; ++ char *p; ++ char *s = buf; ++ long *trace_address = addrs; ++ ++ close(CHILD_WRITE); ++ close(CHILD_READ); ++ ++ for(i=0; i < n_addr; i++) { ++ snprintf(hex,sizeof(hex),"%#lx\n",*trace_address); ++ write(PARENT_WRITE,hex,strlen(hex)); ++ n = read(PARENT_READ,line,MAX_LINE); ++ if (n<=0) ++ break; ++ ++ line[n]=0; ++ /* We have approx. 16 additional chars for "%#lx in " clause. ++ We use this info to prevent a buffer overrun. */ ++ if (n + 16 + (*len) > max_len) ++ break; ++ ++ p = strchr(line,'\n'); ++ if (p) { ++ if (*(p+1)) { ++ *p = 0; ++ *len += snprintf(s, (max_len - (*len)), "%#lx in %s at %s", ++ *trace_address, line, p+1); ++ } ++ else { ++ *len += snprintf(s, (max_len - (*len)), "%#lx at %s", ++ *trace_address, line); ++ } ++ s = buf + (*len); ++ } ++ trace_address += 1; ++ } ++ close (PARENT_WRITE); ++ close (PARENT_READ); ++ RESTSIG; ++} ++ ++#elif defined (IS_CROSS) || !defined (NATIVE_SYMTRACE) + ++/* run-time symbolic traceback support ++ Dummy function to satisfy g-trasym.o. */ + void + convert_addresses (const char *file_name ATTRIBUTE_UNUSED, + void *addrs ATTRIBUTE_UNUSED, +--- gcc/ada/cio.c.orig ++++ gcc/ada/cio.c +@@ -46,7 +46,8 @@ + + /* Don't use macros on GNU/Linux since they cause incompatible changes between + glibc 2.0 and 2.1 */ +-#ifdef linux ++/* Android is The exception because it uses the BIONIC library */ ++#if defined(linux) && !defined(__ANDROID__) + #undef putchar + #undef getchar + #undef fputc +--- gcc/ada/cstreams.c.orig ++++ gcc/ada/cstreams.c +@@ -54,9 +54,10 @@ + #include <unixlib.h> + #endif + +-#ifdef linux ++#if defined(linux) && !defined(__ANDROID__) + /* Don't use macros on GNU/Linux since they cause incompatible changes between + glibc 2.0 and 2.1 */ ++/* Android is The exception because it uses the BIONIC library */ + + #ifdef stderr + # undef stderr +@@ -187,7 +188,10 @@ + *p = '\\'; + } + +-#elif defined (sgi) || defined (__FreeBSD__) ++#elif defined (sgi) \ ++ || defined (__FreeBSD__) \ ++ || defined (__DragonFly__) \ ++ || defined (__OpenBSD__) + + /* Use realpath function which resolves links and references to . and .. + on those Unix systems that support it. Note that GNU/Linux provides it but +--- gcc/ada/env.c.orig ++++ gcc/ada/env.c +@@ -188,7 +188,9 @@ + LIB$SIGNAL (status); + } + +-#elif (defined (__vxworks) && defined (__RTP__)) || defined (__APPLE__) ++#elif (defined (__vxworks) && defined (__RTP__)) \ ++ || defined (__APPLE__) \ ++ || defined (__OpenBSD__) + setenv (name, value, 1); + + #else +@@ -310,6 +312,7 @@ + } + #elif defined (__MINGW32__) || defined (__FreeBSD__) || defined (__APPLE__) \ + || (defined (__vxworks) && defined (__RTP__)) || defined (__CYGWIN__) \ ++ || defined (__DragonFly__) \ + || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__rtems__) + /* On Windows, FreeBSD and MacOS there is no function to clean all the + environment but there is a "clean" way to unset a variable. So go +--- gcc/ada/errno.c.orig ++++ gcc/ada/errno.c +@@ -39,6 +39,7 @@ + #define _REENTRANT + #define _THREAD_SAFE + #define _SGI_MP_SOURCE ++#define GNAT_SET_ERRNO + + #ifdef MaRTE + +@@ -52,6 +53,17 @@ + + #endif + ++#ifdef __ANDROID__ ++ ++/* The ANDROID errno.h file also defines __set_errno as an external variable ++ for use with syscalls. It should not be referenced directly, but we are ++ going to do it anyway because the alternative solution is to rename all ++ uses of __set_errno in GNAT. */ ++ ++#undef GNAT_SET_ERRNO ++#endif ++ ++ + #include <errno.h> + int + __get_errno(void) +@@ -59,8 +71,10 @@ + return errno; + } + ++#ifdef GNAT_SET_ERRNO + void + __set_errno(int err) + { + errno = err; + } ++#endif +--- gcc/ada/g-comlin.adb.orig ++++ gcc/ada/g-comlin.adb +@@ -514,6 +514,7 @@ + begin + Index_In_Switches := 0; + Switch_Length := 0; ++ Param := Parameter_None; + + -- Remove all leading spaces first to make sure that Index points + -- at the start of the first switch. +--- gcc/ada/g-expect.adb.orig ++++ gcc/ada/g-expect.adb +@@ -1332,15 +1332,20 @@ + + -- The following commands are not executed on Unix systems, and are only + -- required for Windows systems. We are now in the parent process. ++ -- Although the if-statement is redundant, it's here so the compiler ++ -- doesn't complain about uninitialized variables. + +- -- Restore the old descriptors ++ if No_Fork_On_Target then + +- Dup2 (Input, GNAT.OS_Lib.Standin); +- Dup2 (Output, GNAT.OS_Lib.Standout); +- Dup2 (Error, GNAT.OS_Lib.Standerr); +- Close (Input); +- Close (Output); +- Close (Error); ++ -- Restore the old descriptors ++ ++ Dup2 (Input, GNAT.OS_Lib.Standin); ++ Dup2 (Output, GNAT.OS_Lib.Standout); ++ Dup2 (Error, GNAT.OS_Lib.Standerr); ++ Close (Input); ++ Close (Output); ++ Close (Error); ++ end if; + end Set_Up_Child_Communications; + + --------------------------- +--- /dev/null ++++ gcc/ada/g-socthi-bsd.adb +@@ -0,0 +1,376 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT COMPILER COMPONENTS -- ++-- -- ++-- G N A T . S O C K E T S . T H I N -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 2001-2010, AdaCore -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This package provides a target dependent thin interface to the sockets ++-- layer for use by the GNAT.Sockets package (g-socket.ads). This package ++-- should not be directly with'ed by an applications program. ++ ++-- This is the *BSD version which uses fcntl rather than ioctl ++-- The constant SCON.Thread_Blocking_IO is always true (for all platforms, not ++-- just *BSD), so this binding is significantly simpler than the standard ++-- one it replaces. ++ ++with GNAT.OS_Lib; use GNAT.OS_Lib; ++ ++with Interfaces.C; use Interfaces.C; ++ ++package body GNAT.Sockets.Thin is ++ ++ Unknown_System_Error : constant C.Strings.chars_ptr := ++ C.Strings.New_String ("Unknown system error"); ++ ++ function Syscall_Accept ++ (S : C.int; ++ Addr : System.Address; ++ Addrlen : not null access C.int) return C.int; ++ pragma Import (C, Syscall_Accept, "accept"); ++ -- The accept() function accepts a connection on a socket. An incoming ++ -- connection is acknowledged and associated with an immediately created ++ -- socket. The original socket is returned to the listening state. ++ ++ function Syscall_Connect ++ (S : C.int; ++ Name : System.Address; ++ Namelen : C.int) return C.int; ++ pragma Import (C, Syscall_Connect, "connect"); ++ -- The connect() system call initiates a connection on a socket. If the ++ -- parameter S is of type SOCK_DGRAM then connect() permanently specifies ++ -- the peer to which datagrams are to be sent. If S is type SOCK_STREAM ++ -- then connect() attempts to make a connection with another socket, which ++ -- is identified by the parameter Name. ++ ++ function Syscall_Recv ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int) return C.int; ++ pragma Import (C, Syscall_Recv, "recv"); ++ -- The recv() function receives a message from a socket. The call can be ++ -- used on a connection mode socket or a bound, connectionless socket. If ++ -- no messages are available at the socket, the recv() call waits for a ++ -- message to arrive unless the socket is non-blocking. If a socket is ++ -- non-blocking, the call returns a -1 and ERRNO is set to EWOULDBLOCK. ++ ++ function Syscall_Recvfrom ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ From : System.Address; ++ Fromlen : not null access C.int) return C.int; ++ pragma Import (C, Syscall_Recvfrom, "recvfrom"); ++ -- The recvfrom() system call receives a message from a socket and captures ++ -- the address from which the data was sent. It can be used to receive ++ -- data on an unconnected socket as well. If no messages are available, ++ -- the call waits for a message to arrive on blocking sockets. For ++ -- non-blocking sockets without messages, -1 is returned and ERRNO is set ++ -- to EAGAIN or EWOULDBLOCK. ++ ++ function Syscall_Recvmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t; ++ pragma Import (C, Syscall_Recvmsg, "recvmsg"); ++ -- The recvmsg call receives a message from a socket, and can be used to ++ -- receive data on an unconnected socket as well. If no messages are ++ -- available, the call waits for a message to arrive on blocking sockets. ++ -- For non-blocking sockets without messages, -1 is returned and ERRNO is ++ -- set to EAGAIN or EWOULDBLOCK. ++ ++ function Syscall_Sendmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t; ++ pragma Import (C, Syscall_Sendmsg, "sendmsg"); ++ -- The sendmsg() function sends a message to a socket, and can be used with ++ -- unconnected sockets as well (the msg is ignored in this case). The ++ -- function returns the number of bytes sent when successful, otherwise it ++ -- returns -1 and ERRNO is set (many possible values). ++ ++ function Syscall_Sendto ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ To : System.Address; ++ Tolen : C.int) return C.int; ++ pragma Import (C, Syscall_Sendto, "sendto"); ++ -- The sendto() function only works for connected sockets and it initiates ++ -- the transmission of a message. A successful call returns the numbers of ++ -- bytes sent, and a failure returns a -1 and ERRNO is set. ++ ++ function Syscall_Socket ++ (Domain : C.int; ++ Typ : C.int; ++ Protocol : C.int) return C.int; ++ pragma Import (C, Syscall_Socket, "socket"); ++ -- The socket() function is used to create an unbound socket and returns a ++ -- file descriptor that can be used with other socket functions. Upon ++ -- failure, a -1 is returned and ERRNO is set. ++ ++ procedure Disable_SIGPIPE (S : C.int); ++ pragma Import (C, Disable_SIGPIPE, "__gnat_disable_sigpipe"); ++ ++ procedure Disable_All_SIGPIPEs; ++ pragma Import (C, Disable_All_SIGPIPEs, "__gnat_disable_all_sigpipes"); ++ -- Sets the process to ignore all SIGPIPE signals on platforms that ++ -- don't support Disable_SIGPIPE for particular streams. ++ ++ function C_Fcntl ++ (Fd : C.int; ++ Cmd : C.int; ++ Val : C.int) return C.int; ++ pragma Import (C, C_Fcntl, "fcntl"); ++ -- The ioctl of 64-bit DragonFlyBSD, OpenBSD, and NetBSD does not support ++ -- setting a socket in non-blocking mode. fcntl must be used instead. ++ ++ -------------- ++ -- C_Accept -- ++ -------------- ++ ++ function C_Accept ++ (S : C.int; ++ Addr : System.Address; ++ Addrlen : not null access C.int) return C.int ++ is ++ Res : constant C.int := Syscall_Accept (S, Addr, Addrlen); ++ begin ++ ++ Disable_SIGPIPE (Res); ++ return Res; ++ ++ end C_Accept; ++ ++ --------------- ++ -- C_Connect -- ++ --------------- ++ ++ function C_Connect ++ (S : C.int; ++ Name : System.Address; ++ Namelen : C.int) return C.int ++ is ++ begin ++ ++ return Syscall_Connect (S, Name, Namelen); ++ ++ end C_Connect; ++ ++ ------------------ ++ -- Socket_Ioctl -- ++ ------------------ ++ ++ function Socket_Ioctl ++ (S : C.int; ++ Req : C.int; ++ Arg : access C.int) return C.int ++ is ++ -- Currently all requests are of the FIONBIO type, so always calc flags ++ use Interfaces; ++ flags : constant Unsigned_32 := ++ Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0)); ++ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.FNDELAY); ++ enabled : constant Boolean := Arg.all = 1; ++ newval : C.int; ++ begin ++ if Req = SOSC.FIONBIO then ++ if enabled then ++ newval := C.int (flags or nonblock); ++ elsif (flags and nonblock) > 0 then ++ newval := C.int (flags - nonblock); ++ else ++ newval := C.int (flags); ++ end if; ++ return C_Fcntl (Fd => S, Cmd => SOSC.F_SETFL, Val => newval); ++ else ++ return C_Ioctl (Fd => S, Req => Req, Arg => Arg); ++ end if; ++ end Socket_Ioctl; ++ ++ ------------ ++ -- C_Recv -- ++ ------------ ++ ++ function C_Recv ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int) return C.int ++ is ++ begin ++ ++ return Syscall_Recv (S, Msg, Len, Flags); ++ ++ end C_Recv; ++ ++ ---------------- ++ -- C_Recvfrom -- ++ ---------------- ++ ++ function C_Recvfrom ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ From : System.Address; ++ Fromlen : not null access C.int) return C.int ++ is ++ begin ++ ++ return Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen); ++ ++ end C_Recvfrom; ++ ++ --------------- ++ -- C_Recvmsg -- ++ --------------- ++ ++ function C_Recvmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t ++ is ++ begin ++ ++ return Syscall_Recvmsg (S, Msg, Flags); ++ ++ end C_Recvmsg; ++ ++ --------------- ++ -- C_Sendmsg -- ++ --------------- ++ ++ function C_Sendmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t ++ is ++ begin ++ ++ return Syscall_Sendmsg (S, Msg, Flags); ++ ++ end C_Sendmsg; ++ ++ -------------- ++ -- C_Sendto -- ++ -------------- ++ ++ function C_Sendto ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ To : System.Address; ++ Tolen : C.int) return C.int ++ is ++ begin ++ ++ return Syscall_Sendto (S, Msg, Len, Flags, To, Tolen); ++ ++ end C_Sendto; ++ ++ -------------- ++ -- C_Socket -- ++ -------------- ++ ++ function C_Socket ++ (Domain : C.int; ++ Typ : C.int; ++ Protocol : C.int) return C.int ++ is ++ Res : constant C.int := Syscall_Socket (Domain, Typ, Protocol); ++ begin ++ ++ Disable_SIGPIPE (Res); ++ return Res; ++ ++ end C_Socket; ++ ++ -------------- ++ -- Finalize -- ++ -------------- ++ ++ procedure Finalize is ++ begin ++ null; ++ end Finalize; ++ ++ ------------------------- ++ -- Host_Error_Messages -- ++ ------------------------- ++ ++ package body Host_Error_Messages is separate; ++ ++ ---------------- ++ -- Initialize -- ++ ---------------- ++ ++ procedure Initialize is ++ begin ++ Disable_All_SIGPIPEs; ++ end Initialize; ++ ++ -------------------- ++ -- Signalling_Fds -- ++ -------------------- ++ ++ package body Signalling_Fds is ++ ++ -- In this default implementation, we use a C version of these ++ -- subprograms provided by socket.c. ++ ++ function C_Create (Fds : not null access Fd_Pair) return C.int; ++ function C_Read (Rsig : C.int) return C.int; ++ function C_Write (Wsig : C.int) return C.int; ++ procedure C_Close (Sig : C.int); ++ ++ pragma Import (C, C_Create, "__gnat_create_signalling_fds"); ++ pragma Import (C, C_Read, "__gnat_read_signalling_fd"); ++ pragma Import (C, C_Write, "__gnat_write_signalling_fd"); ++ pragma Import (C, C_Close, "__gnat_close_signalling_fd"); ++ ++ function Create ++ (Fds : not null access Fd_Pair) return C.int renames C_Create; ++ function Read (Rsig : C.int) return C.int renames C_Read; ++ function Write (Wsig : C.int) return C.int renames C_Write; ++ procedure Close (Sig : C.int) renames C_Close; ++ ++ end Signalling_Fds; ++ ++ -------------------------- ++ -- Socket_Error_Message -- ++ -------------------------- ++ ++ function Socket_Error_Message ++ (Errno : Integer) return C.Strings.chars_ptr ++ is separate; ++ ++end GNAT.Sockets.Thin; +--- /dev/null ++++ gcc/ada/g-socthi-netbsd.adb +@@ -0,0 +1,378 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT COMPILER COMPONENTS -- ++-- -- ++-- G N A T . S O C K E T S . T H I N -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 2001-2010, AdaCore -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This package provides a target dependent thin interface to the sockets ++-- layer for use by the GNAT.Sockets package (g-socket.ads). This package ++-- should not be directly with'ed by an applications program. ++ ++-- This is the NetBSD version which uses fcntl rather than ioctl ++-- The constant SCON.Thread_Blocking_IO is always true (for all platforms, not ++-- just *BSD), so this binding is significantly simpler than the standard ++-- one it replaces. ++-- NetBSD uses binary compatibility functions that are forcing the use of ++-- their own files rather than sharing the *BSD versions. ++ ++with GNAT.OS_Lib; use GNAT.OS_Lib; ++ ++with Interfaces.C; use Interfaces.C; ++ ++package body GNAT.Sockets.Thin is ++ ++ Unknown_System_Error : constant C.Strings.chars_ptr := ++ C.Strings.New_String ("Unknown system error"); ++ ++ function Syscall_Accept ++ (S : C.int; ++ Addr : System.Address; ++ Addrlen : not null access C.int) return C.int; ++ pragma Import (C, Syscall_Accept, "accept"); ++ -- The accept() function accepts a connection on a socket. An incoming ++ -- connection is acknowledged and associated with an immediately created ++ -- socket. The original socket is returned to the listening state. ++ ++ function Syscall_Connect ++ (S : C.int; ++ Name : System.Address; ++ Namelen : C.int) return C.int; ++ pragma Import (C, Syscall_Connect, "connect"); ++ -- The connect() system call initiates a connection on a socket. If the ++ -- parameter S is of type SOCK_DGRAM then connect() permanently specifies ++ -- the peer to which datagrams are to be sent. If S is type SOCK_STREAM ++ -- then connect() attempts to make a connection with another socket, which ++ -- is identified by the parameter Name. ++ ++ function Syscall_Recv ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int) return C.int; ++ pragma Import (C, Syscall_Recv, "recv"); ++ -- The recv() function receives a message from a socket. The call can be ++ -- used on a connection mode socket or a bound, connectionless socket. If ++ -- no messages are available at the socket, the recv() call waits for a ++ -- message to arrive unless the socket is non-blocking. If a socket is ++ -- non-blocking, the call returns a -1 and ERRNO is set to EWOULDBLOCK. ++ ++ function Syscall_Recvfrom ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ From : System.Address; ++ Fromlen : not null access C.int) return C.int; ++ pragma Import (C, Syscall_Recvfrom, "recvfrom"); ++ -- The recvfrom() system call receives a message from a socket and captures ++ -- the address from which the data was sent. It can be used to receive ++ -- data on an unconnected socket as well. If no messages are available, ++ -- the call waits for a message to arrive on blocking sockets. For ++ -- non-blocking sockets without messages, -1 is returned and ERRNO is set ++ -- to EAGAIN or EWOULDBLOCK. ++ ++ function Syscall_Recvmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t; ++ pragma Import (C, Syscall_Recvmsg, "recvmsg"); ++ -- The recvmsg call receives a message from a socket, and can be used to ++ -- receive data on an unconnected socket as well. If no messages are ++ -- available, the call waits for a message to arrive on blocking sockets. ++ -- For non-blocking sockets without messages, -1 is returned and ERRNO is ++ -- set to EAGAIN or EWOULDBLOCK. ++ ++ function Syscall_Sendmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t; ++ pragma Import (C, Syscall_Sendmsg, "sendmsg"); ++ -- The sendmsg() function sends a message to a socket, and can be used with ++ -- unconnected sockets as well (the msg is ignored in this case). The ++ -- function returns the number of bytes sent when successful, otherwise it ++ -- returns -1 and ERRNO is set (many possible values). ++ ++ function Syscall_Sendto ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ To : System.Address; ++ Tolen : C.int) return C.int; ++ pragma Import (C, Syscall_Sendto, "sendto"); ++ -- The sendto() function only works for connected sockets and it initiates ++ -- the transmission of a message. A successful call returns the numbers of ++ -- bytes sent, and a failure returns a -1 and ERRNO is set. ++ ++ function Syscall_Socket ++ (Domain : C.int; ++ Typ : C.int; ++ Protocol : C.int) return C.int; ++ pragma Import (C, Syscall_Socket, "__socket30"); ++ -- The socket() function is used to create an unbound socket and returns a ++ -- file descriptor that can be used with other socket functions. Upon ++ -- failure, a -1 is returned and ERRNO is set. ++ ++ procedure Disable_SIGPIPE (S : C.int); ++ pragma Import (C, Disable_SIGPIPE, "__gnat_disable_sigpipe"); ++ ++ procedure Disable_All_SIGPIPEs; ++ pragma Import (C, Disable_All_SIGPIPEs, "__gnat_disable_all_sigpipes"); ++ -- Sets the process to ignore all SIGPIPE signals on platforms that ++ -- don't support Disable_SIGPIPE for particular streams. ++ ++ function C_Fcntl ++ (Fd : C.int; ++ Cmd : C.int; ++ Val : C.int) return C.int; ++ pragma Import (C, C_Fcntl, "fcntl"); ++ -- The ioctl of 64-bit DragonFlyBSD, OpenBSD, and NetBSD does not support ++ -- setting a socket in non-blocking mode. fcntl must be used instead. ++ ++ -------------- ++ -- C_Accept -- ++ -------------- ++ ++ function C_Accept ++ (S : C.int; ++ Addr : System.Address; ++ Addrlen : not null access C.int) return C.int ++ is ++ Res : constant C.int := Syscall_Accept (S, Addr, Addrlen); ++ begin ++ ++ Disable_SIGPIPE (Res); ++ return Res; ++ ++ end C_Accept; ++ ++ --------------- ++ -- C_Connect -- ++ --------------- ++ ++ function C_Connect ++ (S : C.int; ++ Name : System.Address; ++ Namelen : C.int) return C.int ++ is ++ begin ++ ++ return Syscall_Connect (S, Name, Namelen); ++ ++ end C_Connect; ++ ++ ------------------ ++ -- Socket_Ioctl -- ++ ------------------ ++ ++ function Socket_Ioctl ++ (S : C.int; ++ Req : C.int; ++ Arg : access C.int) return C.int ++ is ++ -- Currently all requests are of the FIONBIO type, so always calc flags ++ use Interfaces; ++ flags : constant Unsigned_32 := ++ Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0)); ++ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.FNDELAY); ++ enabled : constant Boolean := Arg.all = 1; ++ newval : C.int; ++ begin ++ if Req = SOSC.FIONBIO then ++ if enabled then ++ newval := C.int (flags or nonblock); ++ elsif (flags and nonblock) > 0 then ++ newval := C.int (flags - nonblock); ++ else ++ newval := C.int (flags); ++ end if; ++ return C_Fcntl (Fd => S, Cmd => SOSC.F_SETFL, Val => newval); ++ else ++ return C_Ioctl (Fd => S, Req => Req, Arg => Arg); ++ end if; ++ end Socket_Ioctl; ++ ++ ------------ ++ -- C_Recv -- ++ ------------ ++ ++ function C_Recv ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int) return C.int ++ is ++ begin ++ ++ return Syscall_Recv (S, Msg, Len, Flags); ++ ++ end C_Recv; ++ ++ ---------------- ++ -- C_Recvfrom -- ++ ---------------- ++ ++ function C_Recvfrom ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ From : System.Address; ++ Fromlen : not null access C.int) return C.int ++ is ++ begin ++ ++ return Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen); ++ ++ end C_Recvfrom; ++ ++ --------------- ++ -- C_Recvmsg -- ++ --------------- ++ ++ function C_Recvmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t ++ is ++ begin ++ ++ return Syscall_Recvmsg (S, Msg, Flags); ++ ++ end C_Recvmsg; ++ ++ --------------- ++ -- C_Sendmsg -- ++ --------------- ++ ++ function C_Sendmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t ++ is ++ begin ++ ++ return Syscall_Sendmsg (S, Msg, Flags); ++ ++ end C_Sendmsg; ++ ++ -------------- ++ -- C_Sendto -- ++ -------------- ++ ++ function C_Sendto ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ To : System.Address; ++ Tolen : C.int) return C.int ++ is ++ begin ++ ++ return Syscall_Sendto (S, Msg, Len, Flags, To, Tolen); ++ ++ end C_Sendto; ++ ++ -------------- ++ -- C_Socket -- ++ -------------- ++ ++ function C_Socket ++ (Domain : C.int; ++ Typ : C.int; ++ Protocol : C.int) return C.int ++ is ++ Res : constant C.int := Syscall_Socket (Domain, Typ, Protocol); ++ begin ++ ++ Disable_SIGPIPE (Res); ++ return Res; ++ ++ end C_Socket; ++ ++ -------------- ++ -- Finalize -- ++ -------------- ++ ++ procedure Finalize is ++ begin ++ null; ++ end Finalize; ++ ++ ------------------------- ++ -- Host_Error_Messages -- ++ ------------------------- ++ ++ package body Host_Error_Messages is separate; ++ ++ ---------------- ++ -- Initialize -- ++ ---------------- ++ ++ procedure Initialize is ++ begin ++ Disable_All_SIGPIPEs; ++ end Initialize; ++ ++ -------------------- ++ -- Signalling_Fds -- ++ -------------------- ++ ++ package body Signalling_Fds is ++ ++ -- In this default implementation, we use a C version of these ++ -- subprograms provided by socket.c. ++ ++ function C_Create (Fds : not null access Fd_Pair) return C.int; ++ function C_Read (Rsig : C.int) return C.int; ++ function C_Write (Wsig : C.int) return C.int; ++ procedure C_Close (Sig : C.int); ++ ++ pragma Import (C, C_Create, "__gnat_create_signalling_fds"); ++ pragma Import (C, C_Read, "__gnat_read_signalling_fd"); ++ pragma Import (C, C_Write, "__gnat_write_signalling_fd"); ++ pragma Import (C, C_Close, "__gnat_close_signalling_fd"); ++ ++ function Create ++ (Fds : not null access Fd_Pair) return C.int renames C_Create; ++ function Read (Rsig : C.int) return C.int renames C_Read; ++ function Write (Wsig : C.int) return C.int renames C_Write; ++ procedure Close (Sig : C.int) renames C_Close; ++ ++ end Signalling_Fds; ++ ++ -------------------------- ++ -- Socket_Error_Message -- ++ -------------------------- ++ ++ function Socket_Error_Message ++ (Errno : Integer) return C.Strings.chars_ptr ++ is separate; ++ ++end GNAT.Sockets.Thin; +--- /dev/null ++++ gcc/ada/g-socthi-netbsd6.ads +@@ -0,0 +1,260 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT COMPILER COMPONENTS -- ++-- -- ++-- G N A T . S O C K E T S . T H I N -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 2001-2010, AdaCore -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This package provides a target dependent thin interface to the sockets ++-- layer for use by the GNAT.Sockets package (g-socket.ads). This package ++-- should not be directly with'ed by an applications program. ++ ++-- This is the NetBSD 6+ version ++ ++with Interfaces.C.Strings; ++ ++with GNAT.OS_Lib; ++with GNAT.Sockets.Thin_Common; ++ ++with System; ++with System.CRTL; ++ ++package GNAT.Sockets.Thin is ++ ++ -- This package is intended for hosts implementing BSD sockets with a ++ -- standard interface. It will be used as a default for all the platforms ++ -- that do not have a specific version of this file. ++ ++ use Thin_Common; ++ ++ package C renames Interfaces.C; ++ ++ use type System.CRTL.ssize_t; ++ ++ function Socket_Errno return Integer renames GNAT.OS_Lib.Errno; ++ -- Returns last socket error number ++ ++ function Socket_Error_Message (Errno : Integer) return C.Strings.chars_ptr; ++ -- Returns the error message string for the error number Errno. If Errno is ++ -- not known, returns "Unknown system error". ++ ++ function Host_Errno return Integer; ++ pragma Import (C, Host_Errno, "__gnat_get_h_errno"); ++ -- Returns last host error number ++ ++ package Host_Error_Messages is ++ ++ function Host_Error_Message ++ (H_Errno : Integer) return C.Strings.chars_ptr; ++ -- Returns the error message string for the host error number H_Errno. ++ -- If H_Errno is not known, returns "Unknown system error". ++ ++ end Host_Error_Messages; ++ ++ -------------------------------- ++ -- Standard library functions -- ++ -------------------------------- ++ ++ function C_Accept ++ (S : C.int; ++ Addr : System.Address; ++ Addrlen : not null access C.int) return C.int; ++ ++ function C_Bind ++ (S : C.int; ++ Name : System.Address; ++ Namelen : C.int) return C.int; ++ ++ function C_Close ++ (Fd : C.int) return C.int; ++ ++ function C_Connect ++ (S : C.int; ++ Name : System.Address; ++ Namelen : C.int) return C.int; ++ ++ function C_Gethostname ++ (Name : System.Address; ++ Namelen : C.int) return C.int; ++ ++ function C_Getpeername ++ (S : C.int; ++ Name : System.Address; ++ Namelen : not null access C.int) return C.int; ++ ++ function C_Getsockname ++ (S : C.int; ++ Name : System.Address; ++ Namelen : not null access C.int) return C.int; ++ ++ function C_Getsockopt ++ (S : C.int; ++ Level : C.int; ++ Optname : C.int; ++ Optval : System.Address; ++ Optlen : not null access C.int) return C.int; ++ ++ function Socket_Ioctl ++ (S : C.int; ++ Req : C.int; ++ Arg : access C.int) return C.int; ++ ++ function C_Listen ++ (S : C.int; ++ Backlog : C.int) return C.int; ++ ++ function C_Recv ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int) return C.int; ++ ++ function C_Recvfrom ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ From : System.Address; ++ Fromlen : not null access C.int) return C.int; ++ ++ function C_Recvmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t; ++ ++ function C_Select ++ (Nfds : C.int; ++ Readfds : access Fd_Set; ++ Writefds : access Fd_Set; ++ Exceptfds : access Fd_Set; ++ Timeout : Timeval_Access) return C.int; ++ ++ function C_Sendmsg ++ (S : C.int; ++ Msg : System.Address; ++ Flags : C.int) return System.CRTL.ssize_t; ++ ++ function C_Sendto ++ (S : C.int; ++ Msg : System.Address; ++ Len : C.int; ++ Flags : C.int; ++ To : System.Address; ++ Tolen : C.int) return C.int; ++ ++ function C_Setsockopt ++ (S : C.int; ++ Level : C.int; ++ Optname : C.int; ++ Optval : System.Address; ++ Optlen : C.int) return C.int; ++ ++ function C_Shutdown ++ (S : C.int; ++ How : C.int) return C.int; ++ ++ function C_Socket ++ (Domain : C.int; ++ Typ : C.int; ++ Protocol : C.int) return C.int; ++ ++ function C_System ++ (Command : System.Address) return C.int; ++ ++ ------------------------------------------------------- ++ -- Signalling file descriptors for selector abortion -- ++ ------------------------------------------------------- ++ ++ package Signalling_Fds is ++ ++ function Create (Fds : not null access Fd_Pair) return C.int; ++ pragma Convention (C, Create); ++ -- Create a pair of connected descriptors suitable for use with C_Select ++ -- (used for signalling in Selector objects). ++ ++ function Read (Rsig : C.int) return C.int; ++ pragma Convention (C, Read); ++ -- Read one byte of data from rsig, the read end of a pair of signalling ++ -- fds created by Create_Signalling_Fds. ++ ++ function Write (Wsig : C.int) return C.int; ++ pragma Convention (C, Write); ++ -- Write one byte of data to wsig, the write end of a pair of signalling ++ -- fds created by Create_Signalling_Fds. ++ ++ procedure Close (Sig : C.int); ++ pragma Convention (C, Close); ++ -- Close one end of a pair of signalling fds (ignoring any error) ++ ++ end Signalling_Fds; ++ ++ ------------------------------------------- ++ -- Nonreentrant network databases access -- ++ ------------------------------------------- ++ ++ -- The following are used only on systems that have nonreentrant ++ -- getXXXbyYYY functions, and do NOT have corresponding getXXXbyYYY_ ++ -- functions. Currently, LynxOS is the only such system. ++ ++ function Nonreentrant_Gethostbyname ++ (Name : C.char_array) return Hostent_Access; ++ ++ function Nonreentrant_Gethostbyaddr ++ (Addr : System.Address; ++ Addr_Len : C.int; ++ Addr_Type : C.int) return Hostent_Access; ++ ++ function Nonreentrant_Getservbyname ++ (Name : C.char_array; ++ Proto : C.char_array) return Servent_Access; ++ ++ function Nonreentrant_Getservbyport ++ (Port : C.int; ++ Proto : C.char_array) return Servent_Access; ++ ++ procedure Initialize; ++ procedure Finalize; ++ ++private ++ pragma Import (C, C_Bind, "bind"); ++ pragma Import (C, C_Close, "close"); ++ pragma Import (C, C_Gethostname, "gethostname"); ++ pragma Import (C, C_Getpeername, "getpeername"); ++ pragma Import (C, C_Getsockname, "getsockname"); ++ pragma Import (C, C_Getsockopt, "getsockopt"); ++ pragma Import (C, C_Listen, "listen"); ++ pragma Import (C, C_Select, "__select50"); ++ pragma Import (C, C_Setsockopt, "setsockopt"); ++ pragma Import (C, C_Shutdown, "shutdown"); ++ pragma Import (C, C_System, "system"); ++ ++ pragma Import (C, Nonreentrant_Gethostbyname, "gethostbyname"); ++ pragma Import (C, Nonreentrant_Gethostbyaddr, "gethostbyaddr"); ++ pragma Import (C, Nonreentrant_Getservbyname, "getservbyname"); ++ pragma Import (C, Nonreentrant_Getservbyport, "getservbyport"); ++ ++end GNAT.Sockets.Thin; +--- /dev/null ++++ gcc/ada/g-trasym-bsd.adb +@@ -0,0 +1,150 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME COMPONENTS -- ++-- -- ++-- G N A T . T R A C E B A C K . S Y M B O L I C -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1999-2009, AdaCore -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 2, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT 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 distributed with GNAT; see file COPYING. If not, write -- ++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- ++-- Boston, MA 02110-1301, USA. -- ++-- -- ++-- As a special exception, if other files instantiate generics from this -- ++-- unit, or you link this unit with other files to produce an executable, -- ++-- this unit does not by itself cause the resulting executable to be -- ++-- covered by the GNU General Public License. This exception does not -- ++-- however invalidate any other reasons why the executable file might be -- ++-- covered by the GNU Public License. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- Run-time symbolic traceback support ++-- This file is based on the work by Juergen Pfiefer which is still used ++-- today to provide symbolic traceback support for gnu/kFreeBSD. ++-- Incorporated in GNAT-AUX by John Marino <http://www.dragonlace.net> ++ ++with System.Soft_Links; ++with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback; ++ ++package body GNAT.Traceback.Symbolic is ++ ++ package TSL renames System.Soft_Links; ++ ++ -- To perform the raw addresses to symbolic form translation we rely on a ++ -- libaddr2line symbolizer which examines debug info from a provided ++ -- executable file name, and an absolute path is needed to ensure the file ++ -- is always found. This is "__gnat_locate_exec_on_path (gnat_argv [0])" ++ -- for our executable file, a fairly heavy operation so we cache the ++ -- result. ++ ++ Exename : System.Address; ++ -- Pointer to the name of the executable file to be used on all ++ -- invocations of the libaddr2line symbolization service. ++ ++ Exename_Resolved : Boolean := False; ++ -- Flag to indicate whether we have performed the executable file name ++ -- resolution already. Relying on a not null Exename for this purpose ++ -- would be potentially inefficient as this is what we will get if the ++ -- resolution attempt fails. ++ ++ ------------------------ ++ -- Symbolic_Traceback -- ++ ------------------------ ++ ++ function Symbolic_Traceback (Traceback : Tracebacks_Array) return String is ++ ++ procedure convert_addresses ++ (filename : System.Address; ++ addrs : System.Address; ++ n_addrs : Integer; ++ buf : System.Address; ++ len : System.Address); ++ pragma Import (C, convert_addresses, "convert_addresses"); ++ -- This is the procedure version of the Ada-aware addr2line. It places ++ -- in BUF a string representing the symbolic translation of the N_ADDRS ++ -- raw addresses provided in ADDRS, looked up in debug information from ++ -- FILENAME. LEN points to an integer which contains the size of the ++ -- BUF buffer at input and the result length at output. ++ -- ++ -- Note that this procedure is *not* thread-safe. ++ ++ type Argv_Array is array (0 .. 0) of System.Address; ++ gnat_argv : access Argv_Array; ++ pragma Import (C, gnat_argv, "gnat_argv"); ++ ++ function locate_exec_on_path ++ (c_exename : System.Address) return System.Address; ++ pragma Import (C, locate_exec_on_path, "__gnat_locate_exec_on_path"); ++ ++ B_Size : constant Integer := 256 * Traceback'Length; ++ Len : Integer := B_Size; ++ Res : String (1 .. B_Size); ++ ++ use type System.Address; ++ ++ begin ++ -- The symbolic translation of an empty set of addresses is an empty ++ -- string. ++ ++ if Traceback'Length = 0 then ++ return ""; ++ end if; ++ ++ -- If our input set of raw addresses is not empty, resort to the ++ -- libaddr2line service to symbolize it all. ++ ++ -- Compute, cache and provide the absolute path to our executable file ++ -- name as the binary file where the relevant debug information is to be ++ -- found. If the executable file name resolution fails, we have no ++ -- sensible basis to invoke the symbolizer at all. ++ ++ -- Protect all this against concurrent accesses explicitly, as the ++ -- underlying services are potentially thread unsafe. ++ ++ TSL.Lock_Task.all; ++ ++ if not Exename_Resolved then ++ Exename := locate_exec_on_path (gnat_argv (0)); ++ Exename_Resolved := True; ++ end if; ++ ++ if Exename /= System.Null_Address then ++ Len := Res'Length; ++ convert_addresses ++ (Exename, Traceback'Address, Traceback'Length, ++ Res (1)'Address, Len'Address); ++ end if; ++ ++ TSL.Unlock_Task.all; ++ ++ -- Return what the addr2line symbolizer has produced if we have called ++ -- it (the executable name resolution succeeded), or an empty string ++ -- otherwise. ++ ++ if Exename /= System.Null_Address then ++ return Res (1 .. Len); ++ else ++ return ""; ++ end if; ++ ++ end Symbolic_Traceback; ++ ++ function Symbolic_Traceback (E : Exception_Occurrence) return String is ++ begin ++ return Symbolic_Traceback (Tracebacks (E)); ++ end Symbolic_Traceback; ++ ++end GNAT.Traceback.Symbolic; +--- gcc/ada/gnatchop.adb.orig ++++ gcc/ada/gnatchop.adb +@@ -45,7 +45,7 @@ + Config_File_Name : constant String_Access := new String'("gnat.adc"); + -- The name of the file holding the GNAT configuration pragmas + +- Gcc : String_Access := new String'("gcc"); ++ Gcc : String_Access := new String'("ada"); + -- May be modified by switch --GCC= + + Gcc_Set : Boolean := False; +--- gcc/ada/gnatlink.adb.orig ++++ gcc/ada/gnatlink.adb +@@ -137,7 +137,7 @@ + -- This table collects the arguments to be passed to compile the binder + -- generated file. + +- Gcc : String_Access := Program_Name ("gcc", "gnatlink"); ++ Gcc : String_Access := Program_Name ("ada", "gnatlink"); + + Read_Mode : constant String := "r" & ASCII.NUL; + +--- gcc/ada/gsocket.h.orig ++++ gcc/ada/gsocket.h +@@ -203,8 +203,19 @@ + #include <netdb.h> + #endif + +-#if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || \ +- defined (__osf__) || defined (_WIN32) || defined (__APPLE__) ++#if defined(__ANDROID__) ++#include <sys/select.h> ++#endif ++ ++#if defined (_AIX) \ ++ || defined (__FreeBSD__) \ ++ || defined (__DragonFly__) \ ++ || defined (__NetBSD__) \ ++ || defined (__OpenBSD__) \ ++ || defined (__hpux__) \ ++ || defined (__osf__) \ ++ || defined (_WIN32) \ ++ || defined (__APPLE__) + # define HAVE_THREAD_SAFE_GETxxxBYyyy 1 + + #elif defined (sgi) || defined (linux) || defined (__GLIBC__) || \ +@@ -236,7 +247,13 @@ + # endif + #endif + +-#if defined (__FreeBSD__) || defined (__vxworks) || defined(__rtems__) ++#if defined (__FreeBSD__) \ ++ || defined (__DragonFly__) \ ++ || defined (__OpenBSD__) \ ++ || defined (__NetBSD__) \ ++ || defined (__ANDROID__) \ ++ || defined (__vxworks) \ ++ || defined(__rtems__) + # define Has_Sockaddr_Len 1 + #else + # define Has_Sockaddr_Len 0 +--- gcc/ada/init.c.orig ++++ gcc/ada/init.c +@@ -536,7 +536,7 @@ + /* GNU/Linux Section */ + /*********************/ + +-#elif defined (linux) ++#elif defined (linux) && !defined(__ANDROID__) + + #include <signal.h> + +@@ -1787,7 +1787,7 @@ + /* FreeBSD Section */ + /*******************/ + +-#elif defined (__FreeBSD__) ++#elif defined (__FreeBSD__) || defined (__DragonFly__) + + #include <signal.h> + #include <sys/ucontext.h> +@@ -1832,7 +1832,7 @@ + } + + void +-__gnat_install_handler () ++__gnat_install_handler (void) + { + struct sigaction act; + +@@ -1854,6 +1854,77 @@ + } + + /*******************/ ++/* Android Section */ ++/*******************/ ++ ++#elif defined(__ANDROID__) ++ ++#include <signal.h> ++ ++static void ++__gnat_error_handler (int sig, ++ struct siginfo *si ATTRIBUTE_UNUSED, ++ void *ucontext ATTRIBUTE_UNUSED) ++{ ++ struct Exception_Data *exception; ++ const char *msg; ++ ++ switch (sig) ++ { ++ case SIGFPE: ++ exception = &constraint_error; ++ msg = "SIGFPE"; ++ break; ++ ++ case SIGILL: ++ exception = &constraint_error; ++ msg = "SIGILL"; ++ break; ++ ++ case SIGSEGV: ++ exception = &storage_error; ++ msg = "stack overflow or erroneous memory access"; ++ break; ++ ++ case SIGBUS: ++ exception = &constraint_error; ++ msg = "SIGBUS"; ++ break; ++ ++ default: ++ exception = &program_error; ++ msg = "unhandled signal"; ++ } ++ ++ Raise_From_Signal_Handler (exception, msg); ++} ++ ++void ++__gnat_install_handler (void) ++{ ++ struct sigaction act; ++ ++ act.sa_sigaction = __gnat_error_handler; ++ act.sa_flags = SA_NODEFER | SA_RESTART | SA_SIGINFO; ++ sigemptyset (&act.sa_mask); ++ ++ /* Do not install handlers if interrupt state is "System". */ ++ if (__gnat_get_interrupt_state (SIGABRT) != 's') ++ sigaction (SIGABRT, &act, NULL); ++ if (__gnat_get_interrupt_state (SIGFPE) != 's') ++ sigaction (SIGFPE, &act, NULL); ++ if (__gnat_get_interrupt_state (SIGILL) != 's') ++ sigaction (SIGILL, &act, NULL); ++ if (__gnat_get_interrupt_state (SIGBUS) != 's') ++ sigaction (SIGBUS, &act, NULL); ++ if (__gnat_get_interrupt_state (SIGSEGV) != 's') ++ sigaction (SIGSEGV, &act, NULL); ++ ++ __gnat_handler_installed = 1; ++} ++ ++ ++/*******************/ + /* VxWorks Section */ + /*******************/ + +@@ -2416,9 +2487,13 @@ + initialization of the FP processor. This version is used under INTERIX + and WIN32. */ + +-#if defined (_WIN32) || defined (__INTERIX) \ +- || defined (__Lynx__) || defined(__NetBSD__) || defined(__FreeBSD__) \ +- || defined (__OpenBSD__) ++#if defined (_WIN32) \ ++ || defined (__INTERIX) \ ++ || defined (__Lynx__) \ ++ || defined (__NetBSD__) \ ++ || defined (__FreeBSD__) \ ++ || defined (__DragonFly__) \ ++ || defined (__OpenBSD__) + + #define HAVE_GNAT_INIT_FLOAT + +--- gcc/ada/initialize.c.orig ++++ gcc/ada/initialize.c +@@ -257,8 +257,11 @@ + /* __gnat_initialize (init_float version) */ + /******************************************/ + +-#elif defined (__Lynx__) || defined (__FreeBSD__) || defined(__NetBSD__) \ +- || defined (__OpenBSD__) ++#elif defined (__Lynx__) \ ++ || defined (__FreeBSD__) \ ++ || defined (__DragonFly__) \ ++ || defined (__NetBSD__) \ ++ || defined (__OpenBSD__) + + extern void __gnat_init_float (void); + +--- gcc/ada/link.c.orig ++++ gcc/ada/link.c +@@ -133,7 +133,10 @@ + unsigned char __gnat_separate_run_path_options = 0; + const char *__gnat_default_libgcc_subdir = "lib"; + +-#elif defined (__FreeBSD__) ++#elif defined (__FreeBSD__) \ ++ || defined (__DragonFly__) \ ++ || defined (__OpenBSD__) \ ++ || defined (__NetBSD__) + const char *__gnat_object_file_option = "-Wl,@"; + const char *__gnat_run_path_option = "-Wl,-rpath,"; + char __gnat_shared_libgnat_default = STATIC; +--- gcc/ada/make.adb.orig ++++ gcc/ada/make.adb +@@ -669,7 +669,7 @@ + -- Compiler, Binder & Linker Data and Subprograms -- + ---------------------------------------------------- + +- Gcc : String_Access := Program_Name ("gcc", "gnatmake"); ++ Gcc : String_Access := Program_Name ("ada", "gnatmake"); + Original_Gcc : constant String_Access := Gcc; + -- Original_Gcc is used to check if Gcc has been modified by a switch + -- --GCC=, so that for VM platforms, it is not modified again, as it can +--- gcc/ada/mlib-prj.adb.orig ++++ gcc/ada/mlib-prj.adb +@@ -339,6 +339,11 @@ + + Foreign_Sources : Boolean; + ++ Rpath_Disabled : Boolean := False; ++ -- If -R is passed through the library options for the linker, it will ++ -- prevent the implemented libraries portion of the rpath switch from ++ -- being built, even if the linker is capable of supporting rpath. ++ + Rpath : String_Access := null; + -- Allocated only if Path Option is supported + +@@ -782,7 +787,7 @@ + Opts.Table (Opts.Last) := + new String'("-L" & Name_Buffer (1 .. Name_Len)); + +- if Path_Option /= null then ++ if not Rpath_Disabled and then Path_Option /= null then + Add_Rpath (Name_Buffer (1 .. Name_Len)); + end if; + +@@ -1323,9 +1328,13 @@ + Get_Name_String (Element.Value); + + if Name_Len /= 0 then +- Opts.Increment_Last; +- Opts.Table (Opts.Last) := +- new String'(Name_Buffer (1 .. Name_Len)); ++ if Name_Buffer (1 .. Name_Len) = "-R" then ++ Rpath_Disabled := True; ++ else ++ Opts.Increment_Last; ++ Opts.Table (Opts.Last) := ++ new String'(Name_Buffer (1 .. Name_Len)); ++ end if; + end if; + + Current := Element.Next; +--- gcc/ada/mlib-utl.adb.orig ++++ gcc/ada/mlib-utl.adb +@@ -433,7 +433,7 @@ + if Driver_Name = No_Name then + if Gcc_Exec = null then + if Gcc_Name = null then +- Gcc_Name := Osint.Program_Name ("gcc", "gnatmake"); ++ Gcc_Name := Osint.Program_Name ("ada", "gnatmake"); + end if; + + Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all); +--- gcc/ada/prj-makr.adb.orig ++++ gcc/ada/prj-makr.adb +@@ -114,7 +114,7 @@ + + procedure Dup2 (Old_Fd, New_Fd : File_Descriptor); + +- Gcc : constant String := "gcc"; ++ Gcc : constant String := "ada"; + Gcc_Path : String_Access := null; + + Non_Empty_Node : constant Project_Node_Id := 1; +--- gcc/ada/s-fileio.adb.orig ++++ gcc/ada/s-fileio.adb +@@ -231,7 +231,7 @@ + Close_Status : int := 0; + Dup_Strm : Boolean := False; + File : AFCB_Ptr renames File_Ptr.all; +- Errno : Integer; ++ Errno : Integer := 0; + + begin + -- Take a task lock, to protect the global data value Open_Files +--- /dev/null ++++ gcc/ada/s-osinte-android.ads +@@ -0,0 +1,566 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-1994, Florida State University -- ++-- Copyright (C) 1995-2010, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 2, or (at your option) any later ver- -- ++-- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- ++-- OUT 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 distributed with GNARL; see file COPYING. If not, write -- ++-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- ++-- Boston, MA 02110-1301, USA. -- ++-- -- ++-- As a special exception, if other files instantiate generics from this -- ++-- unit, or you link this unit with other files to produce an executable, -- ++-- this unit does not by itself cause the resulting executable to be -- ++-- covered by the GNU General Public License. This exception does not -- ++-- however invalidate any other reasons why the executable file might be -- ++-- covered by the GNU Public License. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is a GNU/Linux (GNU/LinuxThreads) version of this package ++ ++-- This package encapsulates all direct interfaces to OS services ++-- that are needed by the tasking run-time (libgnarl). ++ ++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma ++-- Preelaborate. This package is designed to be a bottom-level (leaf) package. ++ ++with Ada.Unchecked_Conversion; ++with Interfaces.C; ++with System.Linux; ++ ++package System.OS_Interface is ++ pragma Preelaborate; ++ ++ subtype int is Interfaces.C.int; ++ subtype char is Interfaces.C.char; ++ subtype short is Interfaces.C.short; ++ subtype long is Interfaces.C.long; ++ subtype unsigned is Interfaces.C.unsigned; ++ subtype unsigned_short is Interfaces.C.unsigned_short; ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ subtype unsigned_char is Interfaces.C.unsigned_char; ++ subtype plain_char is Interfaces.C.plain_char; ++ subtype size_t is Interfaces.C.size_t; ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function errno return int; ++ pragma Import (C, errno, "__get_errno"); ++ ++ EAGAIN : constant := System.Linux.EAGAIN; ++ EINTR : constant := System.Linux.EINTR; ++ EINVAL : constant := System.Linux.EINVAL; ++ ENOMEM : constant := System.Linux.ENOMEM; ++ EPERM : constant := System.Linux.EPERM; ++ ETIMEDOUT : constant := System.Linux.ETIMEDOUT; ++ ++ ------------- ++ -- Signals -- ++ ------------- ++ ++ Max_Interrupt : constant := 63; ++ type Signal is new int range 0 .. Max_Interrupt; ++ for Signal'Size use int'Size; ++ ++ SIGHUP : constant := System.Linux.SIGHUP; ++ SIGINT : constant := System.Linux.SIGINT; ++ SIGQUIT : constant := System.Linux.SIGQUIT; ++ SIGILL : constant := System.Linux.SIGILL; ++ SIGTRAP : constant := System.Linux.SIGTRAP; ++ SIGIOT : constant := System.Linux.SIGIOT; ++ SIGABRT : constant := System.Linux.SIGABRT; ++ SIGFPE : constant := System.Linux.SIGFPE; ++ SIGKILL : constant := System.Linux.SIGKILL; ++ SIGBUS : constant := System.Linux.SIGBUS; ++ SIGSEGV : constant := System.Linux.SIGSEGV; ++ SIGPIPE : constant := System.Linux.SIGPIPE; ++ SIGALRM : constant := System.Linux.SIGALRM; ++ SIGTERM : constant := System.Linux.SIGTERM; ++ SIGUSR1 : constant := System.Linux.SIGUSR1; ++ SIGUSR2 : constant := System.Linux.SIGUSR2; ++ SIGCLD : constant := System.Linux.SIGCLD; ++ SIGCHLD : constant := System.Linux.SIGCHLD; ++ SIGPWR : constant := System.Linux.SIGPWR; ++ SIGWINCH : constant := System.Linux.SIGWINCH; ++ SIGURG : constant := System.Linux.SIGURG; ++ SIGPOLL : constant := System.Linux.SIGPOLL; ++ SIGIO : constant := System.Linux.SIGIO; ++ SIGLOST : constant := System.Linux.SIGLOST; ++ SIGSTOP : constant := System.Linux.SIGSTOP; ++ SIGTSTP : constant := System.Linux.SIGTSTP; ++ SIGCONT : constant := System.Linux.SIGCONT; ++ SIGTTIN : constant := System.Linux.SIGTTIN; ++ SIGTTOU : constant := System.Linux.SIGTTOU; ++ SIGVTALRM : constant := System.Linux.SIGVTALRM; ++ SIGPROF : constant := System.Linux.SIGPROF; ++ SIGXCPU : constant := System.Linux.SIGXCPU; ++ SIGXFSZ : constant := System.Linux.SIGXFSZ; ++ SIGUNUSED : constant := System.Linux.SIGUNUSED; ++ SIGSTKFLT : constant := System.Linux.SIGSTKFLT; ++ SIGLTHRRES : constant := System.Linux.SIGLTHRRES; ++ SIGLTHRCAN : constant := System.Linux.SIGLTHRCAN; ++ SIGLTHRDBG : constant := System.Linux.SIGLTHRDBG; ++ ++ SIGADAABORT : constant := SIGABRT; ++ -- Change this if you want to use another signal for task abort. ++ -- SIGTERM might be a good one. ++ ++ type Signal_Set is array (Natural range <>) of Signal; ++ ++ Unmasked : constant Signal_Set := ( ++ SIGTRAP, ++ -- To enable debugging on multithreaded applications, mark SIGTRAP to ++ -- be kept unmasked. ++ ++ SIGBUS, ++ ++ SIGTTIN, SIGTTOU, SIGTSTP, ++ -- Keep these three signals unmasked so that background processes ++ -- and IO behaves as normal "C" applications ++ ++ SIGPROF, ++ -- To avoid confusing the profiler ++ ++ SIGKILL, SIGSTOP, ++ -- These two signals actually cannot be masked; ++ -- POSIX simply won't allow it. ++ ++ SIGLTHRRES, SIGLTHRCAN, SIGLTHRDBG); ++ -- These three signals are used by GNU/LinuxThreads starting from ++ -- glibc 2.1 (future 2.2). ++ ++ Reserved : constant Signal_Set := ++ -- I am not sure why the following two signals are reserved. ++ -- I guess they are not supported by this version of GNU/Linux. ++ (SIGVTALRM, SIGUNUSED); ++ ++ type sigset_t is private; ++ ++ function sigaddset (set : access sigset_t; sig : Signal) return int; ++ pragma Import (C, sigaddset, "sigaddset"); ++ ++ function sigdelset (set : access sigset_t; sig : Signal) return int; ++ pragma Import (C, sigdelset, "sigdelset"); ++ ++ function sigfillset (set : access sigset_t) return int; ++ pragma Import (C, sigfillset, "sigfillset"); ++ ++ function sigismember (set : access sigset_t; sig : Signal) return int; ++ pragma Import (C, sigismember, "sigismember"); ++ ++ function sigemptyset (set : access sigset_t) return int; ++ pragma Import (C, sigemptyset, "sigemptyset"); ++ ++ type union_type_3 is new String (1 .. 116); ++ type siginfo_t is record ++ si_signo : int; ++ si_code : int; ++ si_errno : int; ++ X_data : union_type_3; ++ end record; ++ pragma Convention (C, siginfo_t); ++ ++ type struct_sigaction is record ++ sa_handler : System.Address; ++ sa_mask : sigset_t; ++ sa_flags : Interfaces.C.unsigned_long; ++ sa_restorer : System.Address; ++ end record; ++ pragma Convention (C, struct_sigaction); ++ ++ type struct_sigaction_ptr is access all struct_sigaction; ++ ++ type Machine_State is record ++ eip : unsigned_long; ++ ebx : unsigned_long; ++ esp : unsigned_long; ++ ebp : unsigned_long; ++ esi : unsigned_long; ++ edi : unsigned_long; ++ end record; ++ type Machine_State_Ptr is access all Machine_State; ++ ++ SA_SIGINFO : constant := System.Linux.SA_SIGINFO; ++ SA_ONSTACK : constant := System.Linux.SA_ONSTACK; ++ ++ SIG_BLOCK : constant := 0; ++ SIG_UNBLOCK : constant := 1; ++ SIG_SETMASK : constant := 2; ++ ++ SIG_DFL : constant := 0; ++ SIG_IGN : constant := 1; ++ ++ function sigaction ++ (sig : Signal; ++ act : struct_sigaction_ptr; ++ oact : struct_sigaction_ptr) return int; ++ pragma Import (C, sigaction, "sigaction"); ++ ++ ---------- ++ -- Time -- ++ ---------- ++ ++ type timespec is private; ++ ++ function To_Duration (TS : timespec) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timespec (D : Duration) return timespec; ++ pragma Inline (To_Timespec); ++ ++ function sysconf (name : int) return long; ++ pragma Import (C, sysconf); ++ ++ SC_CLK_TCK : constant := 2; ++ SC_NPROCESSORS_ONLN : constant := 84; ++ ++ ------------------------- ++ -- Priority Scheduling -- ++ ------------------------- ++ ++ SCHED_OTHER : constant := 0; ++ SCHED_FIFO : constant := 1; ++ SCHED_RR : constant := 2; ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int; ++ -- Maps System.Any_Priority to a POSIX priority ++ ++ ------------- ++ -- Process -- ++ ------------- ++ ++ type pid_t is private; ++ ++ function kill (pid : pid_t; sig : Signal) return int; ++ pragma Import (C, kill, "kill"); ++ ++ function getpid return pid_t; ++ pragma Import (C, getpid, "getpid"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++ type Thread_Body is access ++ function (arg : System.Address) return System.Address; ++ pragma Convention (C, Thread_Body); ++ ++ function Thread_Body_Access is new ++ Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ type pthread_t is new unsigned_long; ++ subtype Thread_Id is pthread_t; ++ ++ function To_pthread_t is new Ada.Unchecked_Conversion ++ (unsigned_long, pthread_t); ++ ++ type pthread_mutex_t is limited private; ++ type pthread_cond_t is limited private; ++ type pthread_attr_t is limited private; ++ type pthread_mutexattr_t is limited private; ++ type pthread_condattr_t is limited private; ++ type pthread_key_t is private; ++ ++ PTHREAD_CREATE_DETACHED : constant := 1; ++ ++ ----------- ++ -- Stack -- ++ ----------- ++ ++ type stack_t is record ++ ss_sp : System.Address; ++ ss_flags : int; ++ ss_size : size_t; ++ end record; ++ pragma Convention (C, stack_t); ++ ++ function sigaltstack ++ (ss : not null access stack_t; ++ oss : access stack_t) return int; ++ pragma Import (C, sigaltstack, "sigaltstack"); ++ ++ Alternate_Stack : aliased System.Address; ++ pragma Import (C, Alternate_Stack, "__gnat_alternate_stack"); ++ -- The alternate signal stack for stack overflows ++ ++ Alternate_Stack_Size : constant := 16 * 1024; ++ -- This must be in keeping with init.c:__gnat_alternate_stack ++ ++ function Get_Stack_Base (thread : pthread_t) return Address; ++ pragma Inline (Get_Stack_Base); ++ -- This is a dummy procedure to share some GNULLI files ++ ++ --------------------------------------- ++ -- Nonstandard Thread Initialization -- ++ --------------------------------------- ++ ++ procedure pthread_init; ++ pragma Inline (pthread_init); ++ -- This is a dummy procedure to share some GNULLI files ++ ++ ------------------------- ++ -- POSIX.1c Section 3 -- ++ ------------------------- ++ ++ function sigwait (set : access sigset_t; sig : access Signal) return int; ++ pragma Import (C, sigwait, "sigwait"); ++ ++ function pthread_kill (thread : pthread_t; sig : Signal) return int; ++ pragma Import (C, pthread_kill, "pthread_kill"); ++ ++ function pthread_sigmask ++ (how : int; ++ set : access sigset_t; ++ oset : access sigset_t) return int; ++ pragma Import (C, pthread_sigmask, "pthread_sigmask"); ++ ++ -------------------------- ++ -- POSIX.1c Section 11 -- ++ -------------------------- ++ ++ function pthread_mutexattr_init ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); ++ ++ function pthread_mutexattr_destroy ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); ++ ++ function pthread_mutex_init ++ (mutex : access pthread_mutex_t; ++ attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); ++ ++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); ++ ++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); ++ ++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); ++ ++ function pthread_condattr_init ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); ++ ++ function pthread_condattr_destroy ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); ++ ++ function pthread_cond_init ++ (cond : access pthread_cond_t; ++ attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_cond_init, "pthread_cond_init"); ++ ++ function pthread_cond_destroy (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); ++ ++ function pthread_cond_signal (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); ++ ++ function pthread_cond_wait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); ++ ++ function pthread_cond_timedwait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t; ++ abstime : access timespec) return int; ++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); ++ ++ -------------------------- ++ -- POSIX.1c Section 13 -- ++ -------------------------- ++ ++ type struct_sched_param is record ++ sched_priority : int; -- scheduling priority ++ end record; ++ pragma Convention (C, struct_sched_param); ++ ++ function pthread_setschedparam ++ (thread : pthread_t; ++ policy : int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); ++ ++ function pthread_attr_setschedpolicy ++ (attr : access pthread_attr_t; ++ policy : int) return int; ++ pragma Import ++ (C, pthread_attr_setschedpolicy, "pthread_attr_setschedpolicy"); ++ ++ function sched_yield return int; ++ pragma Import (C, sched_yield, "sched_yield"); ++ ++ --------------------------- ++ -- P1003.1c - Section 16 -- ++ --------------------------- ++ ++ function pthread_attr_init ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_init, "pthread_attr_init"); ++ ++ function pthread_attr_destroy ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); ++ ++ function pthread_attr_setdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : int) return int; ++ pragma Import ++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); ++ ++ function pthread_attr_setstacksize ++ (attr : access pthread_attr_t; ++ stacksize : size_t) return int; ++ pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); ++ ++ function pthread_create ++ (thread : access pthread_t; ++ attributes : access pthread_attr_t; ++ start_routine : Thread_Body; ++ arg : System.Address) return int; ++ pragma Import (C, pthread_create, "pthread_create"); ++ ++ procedure pthread_exit (status : System.Address); ++ pragma Import (C, pthread_exit, "pthread_exit"); ++ ++ function pthread_self return pthread_t; ++ pragma Import (C, pthread_self, "pthread_self"); ++ ++ function lwp_self return System.Address; ++ pragma Import (C, lwp_self, "__gnat_lwp_self"); ++ ++ -------------------------- ++ -- POSIX.1c Section 17 -- ++ -------------------------- ++ ++ function pthread_setspecific ++ (key : pthread_key_t; ++ value : System.Address) return int; ++ pragma Import (C, pthread_setspecific, "pthread_setspecific"); ++ ++ function pthread_getspecific (key : pthread_key_t) return System.Address; ++ pragma Import (C, pthread_getspecific, "pthread_getspecific"); ++ ++ type destructor_pointer is access procedure (arg : System.Address); ++ pragma Convention (C, destructor_pointer); ++ ++ function pthread_key_create ++ (key : access pthread_key_t; ++ destructor : destructor_pointer) return int; ++ pragma Import (C, pthread_key_create, "pthread_key_create"); ++ ++ CPU_SETSIZE : constant := 1_024; ++ ++ type bit_field is array (1 .. CPU_SETSIZE) of Boolean; ++ for bit_field'Size use CPU_SETSIZE; ++ pragma Pack (bit_field); ++ pragma Convention (C, bit_field); ++ ++ type cpu_set_t is record ++ bits : bit_field; ++ end record; ++ pragma Convention (C, cpu_set_t); ++ ++ function pthread_setaffinity_np ++ (thread : pthread_t; ++ cpusetsize : size_t; ++ cpuset : access cpu_set_t) return int; ++ pragma Import (C, pthread_setaffinity_np, "pthread_setaffinity_np"); ++ pragma Weak_External (pthread_setaffinity_np); ++ -- Use a weak symbol because this function may be available or not, ++ -- depending on the version of the system. ++ ++ function pthread_attr_setaffinity_np ++ (attr : access pthread_attr_t; ++ cpusetsize : size_t; ++ cpuset : access cpu_set_t) return int; ++ pragma Import (C, pthread_attr_setaffinity_np, ++ "pthread_attr_setaffinity_np"); ++ pragma Weak_External (pthread_attr_setaffinity_np); ++ -- Use a weak symbol because this function may be available or not, ++ -- depending on the version of the system. ++ ++private ++ ++ type sigset_t is array (0 .. 127) of unsigned_char; ++ pragma Convention (C, sigset_t); ++ for sigset_t'Alignment use Interfaces.C.unsigned_long'Alignment; ++ ++ pragma Warnings (Off); ++ for struct_sigaction use record ++ sa_handler at Linux.sa_handler_pos range 0 .. Standard'Address_Size - 1; ++ sa_mask at Linux.sa_mask_pos range 0 .. 1023; ++ sa_flags at Linux.sa_flags_pos range 0 .. Standard'Address_Size - 1; ++ end record; ++ -- We intentionally leave sa_restorer unspecified and let the compiler ++ -- append it after the last field, so disable corresponding warning. ++ pragma Warnings (On); ++ ++ type pid_t is new int; ++ ++ type time_t is new long; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type pthread_attr_t is record ++ detachstate : int; ++ schedpolicy : int; ++ schedparam : struct_sched_param; ++ inheritsched : int; ++ scope : int; ++ guardsize : size_t; ++ stackaddr_set : int; ++ stackaddr : System.Address; ++ stacksize : size_t; ++ end record; ++ pragma Convention (C, pthread_attr_t); ++ ++ type pthread_condattr_t is record ++ dummy : int; ++ end record; ++ pragma Convention (C, pthread_condattr_t); ++ ++ type pthread_mutexattr_t is record ++ mutexkind : int; ++ end record; ++ pragma Convention (C, pthread_mutexattr_t); ++ ++ type pthread_mutex_t is new System.Linux.pthread_mutex_t; ++ ++ type unsigned_long_long_t is mod 2 ** 64; ++ -- Interfaces.C.Extensions isn't preelaborated so cannot be with-ed ++ ++ type pthread_cond_t is array (0 .. 47) of unsigned_char; ++ pragma Convention (C, pthread_cond_t); ++ for pthread_cond_t'Alignment use unsigned_long_long_t'Alignment; ++ ++ type pthread_key_t is new unsigned; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-dragonfly.adb +@@ -0,0 +1,116 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the DragonFly THREADS version of this package ++ ++with Interfaces.C; use Interfaces.C; ++ ++package body System.OS_Interface is ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int is ++ type int_ptr is access all int; ++ ++ function internal_errno return int_ptr; ++ pragma Import (C, internal_errno, "__get_errno"); ++ ++ begin ++ return (internal_errno.all); ++ end Errno; ++ ++ -------------------- ++ -- Get_Stack_Base -- ++ -------------------- ++ ++ function Get_Stack_Base (thread : pthread_t) return Address is ++ pragma Unreferenced (thread); ++ begin ++ return Null_Address; ++ end Get_Stack_Base; ++ ++ ------------------ ++ -- pthread_init -- ++ ------------------ ++ ++ procedure pthread_init is ++ begin ++ null; ++ end pthread_init; ++ ++ ----------------- ++ -- To_Duration -- ++ ----------------- ++ ++ function To_Duration (TS : timespec) return Duration is ++ begin ++ return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; ++ end To_Duration; ++ ++ ------------------------ ++ -- To_Target_Priority -- ++ ------------------------ ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int ++ is ++ begin ++ return Interfaces.C.int (Prio); ++ end To_Target_Priority; ++ ++ ----------------- ++ -- To_Timespec -- ++ ----------------- ++ ++ function To_Timespec (D : Duration) return timespec is ++ S : time_t; ++ F : Duration; ++ ++ begin ++ S := time_t (Long_Long_Integer (D)); ++ F := D - Duration (S); ++ ++ -- If F has negative value due to a round-up, adjust for positive F ++ -- value. ++ ++ if F < 0.0 then ++ S := S - 1; ++ F := F + 1.0; ++ end if; ++ ++ return timespec'(tv_sec => S, ++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); ++ end To_Timespec; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-dragonfly.ads +@@ -0,0 +1,648 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-1994, Florida State University -- ++-- Copyright (C) 1995-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the DragonFly BSD PTHREADS version of this package ++ ++-- This package encapsulates all direct interfaces to OS services ++-- that are needed by the tasking run-time (libgnarl). ++ ++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma ++-- Preelaborate. This package is designed to be a bottom-level (leaf) package. ++ ++with Ada.Unchecked_Conversion; ++ ++with Interfaces.C; ++ ++package System.OS_Interface is ++ pragma Preelaborate; ++ ++ pragma Linker_Options ("-pthread"); ++ ++ subtype int is Interfaces.C.int; ++ subtype short is Interfaces.C.short; ++ subtype long is Interfaces.C.long; ++ subtype unsigned is Interfaces.C.unsigned; ++ subtype unsigned_short is Interfaces.C.unsigned_short; ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ subtype unsigned_char is Interfaces.C.unsigned_char; ++ subtype plain_char is Interfaces.C.plain_char; ++ subtype size_t is Interfaces.C.size_t; ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int; ++ pragma Inline (Errno); ++ ++ EAGAIN : constant := 35; ++ EINTR : constant := 4; ++ EINVAL : constant := 22; ++ ENOMEM : constant := 12; ++ ETIMEDOUT : constant := 60; ++ ++ ------------- ++ -- Signals -- ++ ------------- ++ ++ Max_Interrupt : constant := 31; ++ type Signal is new int range 0 .. Max_Interrupt; ++ for Signal'Size use int'Size; ++ ++ SIGHUP : constant := 1; -- hangup ++ SIGINT : constant := 2; -- interrupt (rubout) ++ SIGQUIT : constant := 3; -- quit (ASCD FS) ++ SIGILL : constant := 4; -- illegal instruction (not reset) ++ SIGTRAP : constant := 5; -- trace trap (not reset) ++ SIGIOT : constant := 6; -- IOT instruction ++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future ++ SIGEMT : constant := 7; -- EMT instruction ++ SIGFPE : constant := 8; -- floating point exception ++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored) ++ SIGBUS : constant := 10; -- bus error ++ SIGSEGV : constant := 11; -- segmentation violation ++ SIGSYS : constant := 12; -- bad argument to system call ++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it ++ SIGALRM : constant := 14; -- alarm clock ++ SIGTERM : constant := 15; -- software termination signal from kill ++ SIGURG : constant := 16; -- urgent condition on IO channel ++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored) ++ SIGTSTP : constant := 18; -- user stop requested from tty ++ SIGCONT : constant := 19; -- stopped process has been continued ++ SIGCLD : constant := 20; -- alias for SIGCHLD ++ SIGCHLD : constant := 20; -- child status change ++ SIGTTIN : constant := 21; -- background tty read attempted ++ SIGTTOU : constant := 22; -- background tty write attempted ++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias) ++ SIGXCPU : constant := 24; -- CPU time limit exceeded ++ SIGXFSZ : constant := 25; -- filesize limit exceeded ++ SIGVTALRM : constant := 26; -- virtual timer expired ++ SIGPROF : constant := 27; -- profiling timer expired ++ SIGWINCH : constant := 28; -- window size change ++ SIGINFO : constant := 29; -- information request (BSD) ++ SIGUSR1 : constant := 30; -- user defined signal 1 ++ SIGUSR2 : constant := 31; -- user defined signal 2 ++ ++ SIGADAABORT : constant := SIGABRT; ++ -- Change this if you want to use another signal for task abort. ++ -- SIGTERM might be a good one. ++ ++ type Signal_Set is array (Natural range <>) of Signal; ++ ++ -- Interrupts that must be unmasked at all times. DragonFlyBSD ++ -- pthreads will not allow an application to mask out any ++ -- interrupt needed by the threads library. ++ Unmasked : constant Signal_Set := ++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP); ++ ++ -- DragonFlyBSD will uses SIGPROF for timing. Do not allow a ++ -- handler to attach to this signal. ++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF); ++ ++ type sigset_t is private; ++ ++ function sigaddset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigaddset, "sigaddset"); ++ ++ function sigdelset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigdelset, "sigdelset"); ++ ++ function sigfillset (set : access sigset_t) return int; ++ pragma Import (C, sigfillset, "sigfillset"); ++ ++ function sigismember ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigismember, "sigismember"); ++ ++ function sigemptyset (set : access sigset_t) return int; ++ pragma Import (C, sigemptyset, "sigemptyset"); ++ ++ -- sigcontext is architecture dependent, so define it private ++ type struct_sigcontext is private; ++ ++ type old_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_mask : sigset_t; ++ sa_flags : int; ++ end record; ++ pragma Convention (C, old_struct_sigaction); ++ ++ type new_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_flags : int; ++ sa_mask : sigset_t; ++ end record; ++ pragma Convention (C, new_struct_sigaction); ++ ++ subtype struct_sigaction is new_struct_sigaction; ++ type struct_sigaction_ptr is access all struct_sigaction; ++ ++ SIG_BLOCK : constant := 1; ++ SIG_UNBLOCK : constant := 2; ++ SIG_SETMASK : constant := 3; ++ ++ SIG_DFL : constant := 0; ++ SIG_IGN : constant := 1; ++ ++ SA_SIGINFO : constant := 16#0040#; ++ SA_ONSTACK : constant := 16#0001#; ++ ++ function sigaction ++ (sig : Signal; ++ act : struct_sigaction_ptr; ++ oact : struct_sigaction_ptr) return int; ++ pragma Import (C, sigaction, "sigaction"); ++ ++ ---------- ++ -- Time -- ++ ---------- ++ ++ Time_Slice_Supported : constant Boolean := True; ++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) ++ ++ type timespec is private; ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "nanosleep"); ++ ++ type clockid_t is new unsigned_long; ++ ++ function clock_gettime ++ (clock_id : clockid_t; ++ tp : access timespec) ++ return int; ++ pragma Import (C, clock_gettime, "clock_gettime"); ++ ++ function To_Duration (TS : timespec) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timespec (D : Duration) return timespec; ++ pragma Inline (To_Timespec); ++ ++ type struct_timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, struct_timezone); ++ ++ procedure usleep (useconds : unsigned_long); ++ pragma Import (C, usleep, "usleep"); ++ ++ ------------------------- ++ -- Priority Scheduling -- ++ ------------------------- ++ ++ SCHED_FIFO : constant := 1; ++ SCHED_OTHER : constant := 2; ++ SCHED_RR : constant := 3; ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int; ++ -- Maps System.Any_Priority to a POSIX priority ++ ++ ------------- ++ -- Process -- ++ ------------- ++ ++ type pid_t is private; ++ ++ function kill (pid : pid_t; sig : Signal) return int; ++ pragma Import (C, kill, "kill"); ++ ++ function getpid return pid_t; ++ pragma Import (C, getpid, "getpid"); ++ ++ --------- ++ -- LWP -- ++ --------- ++ ++ function lwp_self return System.Address; ++ -- lwp_self does not exist on this thread library, revert to pthread_self ++ -- which is the closest approximation (with getpid). This function is ++ -- needed to share 7staprop.adb across POSIX-like targets. ++ pragma Import (C, lwp_self, "pthread_self"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++ type Thread_Body is access ++ function (arg : System.Address) return System.Address; ++ pragma Convention (C, Thread_Body); ++ ++ function Thread_Body_Access is new ++ Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ type pthread_t is private; ++ subtype Thread_Id is pthread_t; ++ ++ type pthread_mutex_t is limited private; ++ type pthread_cond_t is limited private; ++ type pthread_attr_t is limited private; ++ type pthread_mutexattr_t is limited private; ++ type pthread_condattr_t is limited private; ++ type pthread_key_t is private; ++ ++ PTHREAD_CREATE_DETACHED : constant := 1; ++ PTHREAD_CREATE_JOINABLE : constant := 0; ++ ++ PTHREAD_SCOPE_PROCESS : constant := 0; ++ PTHREAD_SCOPE_SYSTEM : constant := 2; ++ ++ -- Read/Write lock not supported on DragonFly. To add support both types ++ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined ++ -- with the associated routines pthread_rwlock_[init/destroy] and ++ -- pthread_rwlock_[rdlock/wrlock/unlock]. ++ ++ subtype pthread_rwlock_t is pthread_mutex_t; ++ subtype pthread_rwlockattr_t is pthread_mutexattr_t; ++ ++ ----------- ++ -- Stack -- ++ ----------- ++ ++ type stack_t is record ++ ss_sp : System.Address; ++ ss_size : size_t; ++ ss_flags : int; ++ end record; ++ pragma Convention (C, stack_t); ++ ++ function sigaltstack ++ (ss : not null access stack_t; ++ oss : access stack_t) return int; ++ pragma Import (C, sigaltstack, "sigaltstack"); ++ ++ Alternate_Stack : aliased System.Address; ++ -- This is a dummy definition, never used (Alternate_Stack_Size is null) ++ ++ Alternate_Stack_Size : constant := 0; ++ -- No alternate signal stack is used on this platform ++ ++ Stack_Base_Available : constant Boolean := False; ++ -- Indicates whether the stack base is available on this target. This ++ -- allows us to share s-osinte.adb between all the FSU run time. Note that ++ -- this value can only be true if pthread_t has a complete definition that ++ -- corresponds exactly to the C header files. ++ ++ function Get_Stack_Base (thread : pthread_t) return Address; ++ pragma Inline (Get_Stack_Base); ++ -- returns the stack base of the specified thread. Only call this function ++ -- when Stack_Base_Available is True. ++ ++ function Get_Page_Size return size_t; ++ function Get_Page_Size return Address; ++ pragma Import (C, Get_Page_Size, "getpagesize"); ++ -- Returns the size of a page ++ ++ PROT_NONE : constant := 0; ++ PROT_READ : constant := 1; ++ PROT_WRITE : constant := 2; ++ PROT_EXEC : constant := 4; ++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC; ++ PROT_ON : constant := PROT_NONE; ++ PROT_OFF : constant := PROT_ALL; ++ ++ function mprotect (addr : Address; len : size_t; prot : int) return int; ++ pragma Import (C, mprotect); ++ ++ --------------------------------------- ++ -- Nonstandard Thread Initialization -- ++ --------------------------------------- ++ ++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should ++ -- be invoked during the elaboration of s-taprop.adb. ++ ++ -- DragonFlyBSD does not require this so we provide an empty Ada body ++ ++ procedure pthread_init; ++ ++ ------------------------- ++ -- POSIX.1c Section 3 -- ++ ------------------------- ++ ++ function sigwait ++ (set : access sigset_t; ++ sig : access Signal) return int; ++ pragma Import (C, sigwait, "sigwait"); ++ ++ function pthread_kill ++ (thread : pthread_t; ++ sig : Signal) return int; ++ pragma Import (C, pthread_kill, "pthread_kill"); ++ ++ function pthread_sigmask ++ (how : int; ++ set : access sigset_t; ++ oset : access sigset_t) return int; ++ pragma Import (C, pthread_sigmask, "pthread_sigmask"); ++ ++ -------------------------- ++ -- POSIX.1c Section 11 -- ++ -------------------------- ++ ++ function pthread_mutexattr_init ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); ++ ++ function pthread_mutexattr_destroy ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); ++ ++ function pthread_mutex_init ++ (mutex : access pthread_mutex_t; ++ attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); ++ ++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); ++ ++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); ++ ++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); ++ ++ function pthread_condattr_init ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); ++ ++ function pthread_condattr_destroy ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); ++ ++ function pthread_cond_init ++ (cond : access pthread_cond_t; ++ attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_cond_init, "pthread_cond_init"); ++ ++ function pthread_cond_destroy (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); ++ ++ function pthread_cond_signal (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); ++ ++ function pthread_cond_wait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); ++ ++ function pthread_cond_timedwait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t; ++ abstime : access timespec) return int; ++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); ++ ++ Relative_Timed_Wait : constant Boolean := False; ++ -- pthread_cond_timedwait requires an absolute delay time ++ ++ -------------------------- ++ -- POSIX.1c Section 13 -- ++ -------------------------- ++ ++ PTHREAD_PRIO_NONE : constant := 0; ++ PTHREAD_PRIO_PROTECT : constant := 2; ++ PTHREAD_PRIO_INHERIT : constant := 1; ++ ++ function pthread_mutexattr_setprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : int) return int; ++ pragma Import ++ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol"); ++ ++ function pthread_mutexattr_getprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : access int) return int; ++ pragma Import ++ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol"); ++ ++ function pthread_mutexattr_setprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : int) return int; ++ pragma Import ++ (C, pthread_mutexattr_setprioceiling, ++ "pthread_mutexattr_setprioceiling"); ++ ++ function pthread_mutexattr_getprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : access int) return int; ++ pragma Import ++ (C, pthread_mutexattr_getprioceiling, ++ "pthread_mutexattr_getprioceiling"); ++ ++ type struct_sched_param is record ++ sched_priority : int; ++ end record; ++ pragma Convention (C, struct_sched_param); ++ ++ function pthread_getschedparam ++ (thread : pthread_t; ++ policy : access int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam"); ++ ++ function pthread_setschedparam ++ (thread : pthread_t; ++ policy : int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); ++ ++ function pthread_attr_setscope ++ (attr : access pthread_attr_t; ++ contentionscope : int) return int; ++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope"); ++ ++ function pthread_attr_getscope ++ (attr : access pthread_attr_t; ++ contentionscope : access int) return int; ++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope"); ++ ++ function pthread_attr_setinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : int) return int; ++ pragma Import ++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched"); ++ ++ function pthread_attr_getinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : access int) return int; ++ pragma Import ++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched"); ++ ++ function pthread_attr_setschedpolicy ++ (attr : access pthread_attr_t; ++ policy : int) return int; ++ pragma Import (C, pthread_attr_setschedpolicy, ++ "pthread_attr_setschedpolicy"); ++ ++ function pthread_attr_getschedpolicy ++ (attr : access pthread_attr_t; ++ policy : access int) return int; ++ pragma Import (C, pthread_attr_getschedpolicy, ++ "pthread_attr_getschedpolicy"); ++ ++ function pthread_attr_setschedparam ++ (attr : access pthread_attr_t; ++ sched_param : int) return int; ++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam"); ++ ++ function pthread_attr_getschedparam ++ (attr : access pthread_attr_t; ++ sched_param : access int) return int; ++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam"); ++ ++ function sched_yield return int; ++ pragma Import (C, sched_yield, "pthread_yield"); ++ ++ -------------------------- ++ -- P1003.1c Section 16 -- ++ -------------------------- ++ ++ function pthread_attr_init (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_init, "pthread_attr_init"); ++ ++ function pthread_attr_destroy ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); ++ ++ function pthread_attr_setdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : int) return int; ++ pragma Import ++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); ++ ++ function pthread_attr_getdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : access int) return int; ++ pragma Import ++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate"); ++ ++ function pthread_attr_getstacksize ++ (attr : access pthread_attr_t; ++ stacksize : access size_t) return int; ++ pragma Import ++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize"); ++ ++ function pthread_attr_setstacksize ++ (attr : access pthread_attr_t; ++ stacksize : size_t) return int; ++ pragma Import ++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); ++ ++ function pthread_create ++ (thread : access pthread_t; ++ attributes : access pthread_attr_t; ++ start_routine : Thread_Body; ++ arg : System.Address) return int; ++ pragma Import (C, pthread_create, "pthread_create"); ++ ++ function pthread_detach (thread : pthread_t) return int; ++ pragma Import (C, pthread_detach, "pthread_detach"); ++ ++ procedure pthread_exit (status : System.Address); ++ pragma Import (C, pthread_exit, "pthread_exit"); ++ ++ function pthread_self return pthread_t; ++ pragma Import (C, pthread_self, "pthread_self"); ++ ++ -------------------------- ++ -- POSIX.1c Section 17 -- ++ -------------------------- ++ ++ function pthread_setspecific ++ (key : pthread_key_t; ++ value : System.Address) return int; ++ pragma Import (C, pthread_setspecific, "pthread_setspecific"); ++ ++ function pthread_getspecific (key : pthread_key_t) return System.Address; ++ pragma Import (C, pthread_getspecific, "pthread_getspecific"); ++ ++ type destructor_pointer is access procedure (arg : System.Address); ++ pragma Convention (C, destructor_pointer); ++ ++ function pthread_key_create ++ (key : access pthread_key_t; ++ destructor : destructor_pointer) return int; ++ pragma Import (C, pthread_key_create, "pthread_key_create"); ++ ++ ------------------------------------ ++ -- Non-portable Pthread Functions -- ++ ------------------------------------ ++ ++ function pthread_set_name_np ++ (thread : pthread_t; ++ name : System.Address) return int; ++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np"); ++ ++private ++ ++ type sigset_t is array (1 .. 4) of unsigned; ++ ++ -- In DragonFlyBSD the component sa_handler turns out to ++ -- be one a union type, and the selector is a macro: ++ -- #define sa_handler __sigaction_u._handler ++ -- #define sa_sigaction __sigaction_u._sigaction ++ ++ -- Should we add a signal_context type here ??? ++ -- How could it be done independent of the CPU architecture ??? ++ -- sigcontext type is opaque, so it is architecturally neutral. ++ -- It is always passed as an access type, so define it as an empty record ++ -- since the contents are not used anywhere. ++ ++ type struct_sigcontext is null record; ++ pragma Convention (C, struct_sigcontext); ++ ++ type pid_t is new int; ++ ++ type time_t is new long; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type pthread_t is new System.Address; ++ type pthread_attr_t is new System.Address; ++ type pthread_mutex_t is new System.Address; ++ type pthread_mutexattr_t is new System.Address; ++ type pthread_cond_t is new System.Address; ++ type pthread_condattr_t is new System.Address; ++ type pthread_key_t is new int; ++ ++end System.OS_Interface; +--- gcc/ada/s-osinte-freebsd.adb.orig ++++ gcc/ada/s-osinte-freebsd.adb +@@ -44,7 +44,7 @@ + type int_ptr is access all int; + + function internal_errno return int_ptr; +- pragma Import (C, internal_errno, "__error"); ++ pragma Import (C, internal_errno, "__get_errno"); + + begin + return (internal_errno.all); +@@ -57,7 +57,7 @@ + function Get_Stack_Base (thread : pthread_t) return Address is + pragma Unreferenced (thread); + begin +- return (0); ++ return Null_Address; + end Get_Stack_Base; + + ------------------ +@@ -75,7 +75,7 @@ + + function To_Duration (TS : timespec) return Duration is + begin +- return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9; ++ return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; + end To_Duration; + + ------------------------ +@@ -108,8 +108,8 @@ + F := F + 1.0; + end if; + +- return timespec'(ts_sec => S, +- ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); ++ return timespec'(tv_sec => S, ++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); + end To_Timespec; + + end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-freebsd32.ads +@@ -0,0 +1,648 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-1994, Florida State University -- ++-- Copyright (C) 1995-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the FreeBSD PTHREADS version of this package ++ ++-- This package encapsulates all direct interfaces to OS services ++-- that are needed by the tasking run-time (libgnarl). ++ ++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma ++-- Preelaborate. This package is designed to be a bottom-level (leaf) package. ++ ++with Ada.Unchecked_Conversion; ++ ++with Interfaces.C; ++ ++package System.OS_Interface is ++ pragma Preelaborate; ++ ++ pragma Linker_Options ("-pthread"); ++ ++ subtype int is Interfaces.C.int; ++ subtype short is Interfaces.C.short; ++ subtype long is Interfaces.C.long; ++ subtype unsigned is Interfaces.C.unsigned; ++ subtype unsigned_short is Interfaces.C.unsigned_short; ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ subtype unsigned_char is Interfaces.C.unsigned_char; ++ subtype plain_char is Interfaces.C.plain_char; ++ subtype size_t is Interfaces.C.size_t; ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int; ++ pragma Inline (Errno); ++ ++ EAGAIN : constant := 35; ++ EINTR : constant := 4; ++ EINVAL : constant := 22; ++ ENOMEM : constant := 12; ++ ETIMEDOUT : constant := 60; ++ ++ ------------- ++ -- Signals -- ++ ------------- ++ ++ Max_Interrupt : constant := 31; ++ type Signal is new int range 0 .. Max_Interrupt; ++ for Signal'Size use int'Size; ++ ++ SIGHUP : constant := 1; -- hangup ++ SIGINT : constant := 2; -- interrupt (rubout) ++ SIGQUIT : constant := 3; -- quit (ASCD FS) ++ SIGILL : constant := 4; -- illegal instruction (not reset) ++ SIGTRAP : constant := 5; -- trace trap (not reset) ++ SIGIOT : constant := 6; -- IOT instruction ++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future ++ SIGEMT : constant := 7; -- EMT instruction ++ SIGFPE : constant := 8; -- floating point exception ++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored) ++ SIGBUS : constant := 10; -- bus error ++ SIGSEGV : constant := 11; -- segmentation violation ++ SIGSYS : constant := 12; -- bad argument to system call ++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it ++ SIGALRM : constant := 14; -- alarm clock ++ SIGTERM : constant := 15; -- software termination signal from kill ++ SIGURG : constant := 16; -- urgent condition on IO channel ++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored) ++ SIGTSTP : constant := 18; -- user stop requested from tty ++ SIGCONT : constant := 19; -- stopped process has been continued ++ SIGCLD : constant := 20; -- alias for SIGCHLD ++ SIGCHLD : constant := 20; -- child status change ++ SIGTTIN : constant := 21; -- background tty read attempted ++ SIGTTOU : constant := 22; -- background tty write attempted ++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias) ++ SIGXCPU : constant := 24; -- CPU time limit exceeded ++ SIGXFSZ : constant := 25; -- filesize limit exceeded ++ SIGVTALRM : constant := 26; -- virtual timer expired ++ SIGPROF : constant := 27; -- profiling timer expired ++ SIGWINCH : constant := 28; -- window size change ++ SIGINFO : constant := 29; -- information request (BSD) ++ SIGUSR1 : constant := 30; -- user defined signal 1 ++ SIGUSR2 : constant := 31; -- user defined signal 2 ++ ++ SIGADAABORT : constant := SIGABRT; ++ -- Change this if you want to use another signal for task abort. ++ -- SIGTERM might be a good one. ++ ++ type Signal_Set is array (Natural range <>) of Signal; ++ ++ -- Interrupts that must be unmasked at all times. FreeBSD ++ -- pthreads will not allow an application to mask out any ++ -- interrupt needed by the threads library. ++ Unmasked : constant Signal_Set := ++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP); ++ ++ -- FreeBSD will uses SIGPROF for timing. Do not allow a ++ -- handler to attach to this signal. ++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF); ++ ++ type sigset_t is private; ++ ++ function sigaddset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigaddset, "sigaddset"); ++ ++ function sigdelset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigdelset, "sigdelset"); ++ ++ function sigfillset (set : access sigset_t) return int; ++ pragma Import (C, sigfillset, "sigfillset"); ++ ++ function sigismember ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigismember, "sigismember"); ++ ++ function sigemptyset (set : access sigset_t) return int; ++ pragma Import (C, sigemptyset, "sigemptyset"); ++ ++ -- sigcontext is architecture dependent, so define it private ++ type struct_sigcontext is private; ++ ++ type old_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_mask : sigset_t; ++ sa_flags : int; ++ end record; ++ pragma Convention (C, old_struct_sigaction); ++ ++ type new_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_flags : int; ++ sa_mask : sigset_t; ++ end record; ++ pragma Convention (C, new_struct_sigaction); ++ ++ subtype struct_sigaction is new_struct_sigaction; ++ type struct_sigaction_ptr is access all struct_sigaction; ++ ++ SIG_BLOCK : constant := 1; ++ SIG_UNBLOCK : constant := 2; ++ SIG_SETMASK : constant := 3; ++ ++ SIG_DFL : constant := 0; ++ SIG_IGN : constant := 1; ++ ++ SA_SIGINFO : constant := 16#0040#; ++ SA_ONSTACK : constant := 16#0001#; ++ ++ function sigaction ++ (sig : Signal; ++ act : struct_sigaction_ptr; ++ oact : struct_sigaction_ptr) return int; ++ pragma Import (C, sigaction, "sigaction"); ++ ++ ---------- ++ -- Time -- ++ ---------- ++ ++ Time_Slice_Supported : constant Boolean := True; ++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) ++ ++ type timespec is private; ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "nanosleep"); ++ ++ type clockid_t is new int; ++ ++ function clock_gettime ++ (clock_id : clockid_t; ++ tp : access timespec) ++ return int; ++ pragma Import (C, clock_gettime, "clock_gettime"); ++ ++ function To_Duration (TS : timespec) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timespec (D : Duration) return timespec; ++ pragma Inline (To_Timespec); ++ ++ type struct_timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, struct_timezone); ++ ++ procedure usleep (useconds : unsigned_long); ++ pragma Import (C, usleep, "usleep"); ++ ++ ------------------------- ++ -- Priority Scheduling -- ++ ------------------------- ++ ++ SCHED_FIFO : constant := 1; ++ SCHED_OTHER : constant := 2; ++ SCHED_RR : constant := 3; ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int; ++ -- Maps System.Any_Priority to a POSIX priority ++ ++ ------------- ++ -- Process -- ++ ------------- ++ ++ type pid_t is private; ++ ++ function kill (pid : pid_t; sig : Signal) return int; ++ pragma Import (C, kill, "kill"); ++ ++ function getpid return pid_t; ++ pragma Import (C, getpid, "getpid"); ++ ++ --------- ++ -- LWP -- ++ --------- ++ ++ function lwp_self return System.Address; ++ -- lwp_self does not exist on this thread library, revert to pthread_self ++ -- which is the closest approximation (with getpid). This function is ++ -- needed to share 7staprop.adb across POSIX-like targets. ++ pragma Import (C, lwp_self, "pthread_self"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++ type Thread_Body is access ++ function (arg : System.Address) return System.Address; ++ pragma Convention (C, Thread_Body); ++ ++ function Thread_Body_Access is new ++ Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ type pthread_t is private; ++ subtype Thread_Id is pthread_t; ++ ++ type pthread_mutex_t is limited private; ++ type pthread_cond_t is limited private; ++ type pthread_attr_t is limited private; ++ type pthread_mutexattr_t is limited private; ++ type pthread_condattr_t is limited private; ++ type pthread_key_t is private; ++ ++ PTHREAD_CREATE_DETACHED : constant := 1; ++ PTHREAD_CREATE_JOINABLE : constant := 0; ++ ++ PTHREAD_SCOPE_PROCESS : constant := 0; ++ PTHREAD_SCOPE_SYSTEM : constant := 2; ++ ++ -- Read/Write lock not supported on freebsd. To add support both types ++ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined ++ -- with the associated routines pthread_rwlock_[init/destroy] and ++ -- pthread_rwlock_[rdlock/wrlock/unlock]. ++ ++ subtype pthread_rwlock_t is pthread_mutex_t; ++ subtype pthread_rwlockattr_t is pthread_mutexattr_t; ++ ++ ----------- ++ -- Stack -- ++ ----------- ++ ++ type stack_t is record ++ ss_sp : System.Address; ++ ss_size : size_t; ++ ss_flags : int; ++ end record; ++ pragma Convention (C, stack_t); ++ ++ function sigaltstack ++ (ss : not null access stack_t; ++ oss : access stack_t) return int; ++ pragma Import (C, sigaltstack, "sigaltstack"); ++ ++ Alternate_Stack : aliased System.Address; ++ -- This is a dummy definition, never used (Alternate_Stack_Size is null) ++ ++ Alternate_Stack_Size : constant := 0; ++ -- No alternate signal stack is used on this platform ++ ++ Stack_Base_Available : constant Boolean := False; ++ -- Indicates whether the stack base is available on this target. This ++ -- allows us to share s-osinte.adb between all the FSU run time. Note that ++ -- this value can only be true if pthread_t has a complete definition that ++ -- corresponds exactly to the C header files. ++ ++ function Get_Stack_Base (thread : pthread_t) return Address; ++ pragma Inline (Get_Stack_Base); ++ -- returns the stack base of the specified thread. Only call this function ++ -- when Stack_Base_Available is True. ++ ++ function Get_Page_Size return size_t; ++ function Get_Page_Size return Address; ++ pragma Import (C, Get_Page_Size, "getpagesize"); ++ -- Returns the size of a page ++ ++ PROT_NONE : constant := 0; ++ PROT_READ : constant := 1; ++ PROT_WRITE : constant := 2; ++ PROT_EXEC : constant := 4; ++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC; ++ PROT_ON : constant := PROT_NONE; ++ PROT_OFF : constant := PROT_ALL; ++ ++ function mprotect (addr : Address; len : size_t; prot : int) return int; ++ pragma Import (C, mprotect); ++ ++ --------------------------------------- ++ -- Nonstandard Thread Initialization -- ++ --------------------------------------- ++ ++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should ++ -- be invoked during the elaboration of s-taprop.adb. ++ ++ -- FreeBSD does not require this so we provide an empty Ada body ++ ++ procedure pthread_init; ++ ++ ------------------------- ++ -- POSIX.1c Section 3 -- ++ ------------------------- ++ ++ function sigwait ++ (set : access sigset_t; ++ sig : access Signal) return int; ++ pragma Import (C, sigwait, "sigwait"); ++ ++ function pthread_kill ++ (thread : pthread_t; ++ sig : Signal) return int; ++ pragma Import (C, pthread_kill, "pthread_kill"); ++ ++ function pthread_sigmask ++ (how : int; ++ set : access sigset_t; ++ oset : access sigset_t) return int; ++ pragma Import (C, pthread_sigmask, "pthread_sigmask"); ++ ++ -------------------------- ++ -- POSIX.1c Section 11 -- ++ -------------------------- ++ ++ function pthread_mutexattr_init ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); ++ ++ function pthread_mutexattr_destroy ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); ++ ++ function pthread_mutex_init ++ (mutex : access pthread_mutex_t; ++ attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); ++ ++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); ++ ++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); ++ ++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); ++ ++ function pthread_condattr_init ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); ++ ++ function pthread_condattr_destroy ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); ++ ++ function pthread_cond_init ++ (cond : access pthread_cond_t; ++ attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_cond_init, "pthread_cond_init"); ++ ++ function pthread_cond_destroy (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); ++ ++ function pthread_cond_signal (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); ++ ++ function pthread_cond_wait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); ++ ++ function pthread_cond_timedwait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t; ++ abstime : access timespec) return int; ++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); ++ ++ Relative_Timed_Wait : constant Boolean := False; ++ -- pthread_cond_timedwait requires an absolute delay time ++ ++ -------------------------- ++ -- POSIX.1c Section 13 -- ++ -------------------------- ++ ++ PTHREAD_PRIO_NONE : constant := 0; ++ PTHREAD_PRIO_PROTECT : constant := 2; ++ PTHREAD_PRIO_INHERIT : constant := 1; ++ ++ function pthread_mutexattr_setprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : int) return int; ++ pragma Import ++ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol"); ++ ++ function pthread_mutexattr_getprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : access int) return int; ++ pragma Import ++ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol"); ++ ++ function pthread_mutexattr_setprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : int) return int; ++ pragma Import ++ (C, pthread_mutexattr_setprioceiling, ++ "pthread_mutexattr_setprioceiling"); ++ ++ function pthread_mutexattr_getprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : access int) return int; ++ pragma Import ++ (C, pthread_mutexattr_getprioceiling, ++ "pthread_mutexattr_getprioceiling"); ++ ++ type struct_sched_param is record ++ sched_priority : int; ++ end record; ++ pragma Convention (C, struct_sched_param); ++ ++ function pthread_getschedparam ++ (thread : pthread_t; ++ policy : access int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam"); ++ ++ function pthread_setschedparam ++ (thread : pthread_t; ++ policy : int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); ++ ++ function pthread_attr_setscope ++ (attr : access pthread_attr_t; ++ contentionscope : int) return int; ++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope"); ++ ++ function pthread_attr_getscope ++ (attr : access pthread_attr_t; ++ contentionscope : access int) return int; ++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope"); ++ ++ function pthread_attr_setinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : int) return int; ++ pragma Import ++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched"); ++ ++ function pthread_attr_getinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : access int) return int; ++ pragma Import ++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched"); ++ ++ function pthread_attr_setschedpolicy ++ (attr : access pthread_attr_t; ++ policy : int) return int; ++ pragma Import (C, pthread_attr_setschedpolicy, ++ "pthread_attr_setschedpolicy"); ++ ++ function pthread_attr_getschedpolicy ++ (attr : access pthread_attr_t; ++ policy : access int) return int; ++ pragma Import (C, pthread_attr_getschedpolicy, ++ "pthread_attr_getschedpolicy"); ++ ++ function pthread_attr_setschedparam ++ (attr : access pthread_attr_t; ++ sched_param : int) return int; ++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam"); ++ ++ function pthread_attr_getschedparam ++ (attr : access pthread_attr_t; ++ sched_param : access int) return int; ++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam"); ++ ++ function sched_yield return int; ++ pragma Import (C, sched_yield, "pthread_yield"); ++ ++ -------------------------- ++ -- P1003.1c Section 16 -- ++ -------------------------- ++ ++ function pthread_attr_init (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_init, "pthread_attr_init"); ++ ++ function pthread_attr_destroy ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); ++ ++ function pthread_attr_setdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : int) return int; ++ pragma Import ++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); ++ ++ function pthread_attr_getdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : access int) return int; ++ pragma Import ++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate"); ++ ++ function pthread_attr_getstacksize ++ (attr : access pthread_attr_t; ++ stacksize : access size_t) return int; ++ pragma Import ++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize"); ++ ++ function pthread_attr_setstacksize ++ (attr : access pthread_attr_t; ++ stacksize : size_t) return int; ++ pragma Import ++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); ++ ++ function pthread_create ++ (thread : access pthread_t; ++ attributes : access pthread_attr_t; ++ start_routine : Thread_Body; ++ arg : System.Address) return int; ++ pragma Import (C, pthread_create, "pthread_create"); ++ ++ function pthread_detach (thread : pthread_t) return int; ++ pragma Import (C, pthread_detach, "pthread_detach"); ++ ++ procedure pthread_exit (status : System.Address); ++ pragma Import (C, pthread_exit, "pthread_exit"); ++ ++ function pthread_self return pthread_t; ++ pragma Import (C, pthread_self, "pthread_self"); ++ ++ -------------------------- ++ -- POSIX.1c Section 17 -- ++ -------------------------- ++ ++ function pthread_setspecific ++ (key : pthread_key_t; ++ value : System.Address) return int; ++ pragma Import (C, pthread_setspecific, "pthread_setspecific"); ++ ++ function pthread_getspecific (key : pthread_key_t) return System.Address; ++ pragma Import (C, pthread_getspecific, "pthread_getspecific"); ++ ++ type destructor_pointer is access procedure (arg : System.Address); ++ pragma Convention (C, destructor_pointer); ++ ++ function pthread_key_create ++ (key : access pthread_key_t; ++ destructor : destructor_pointer) return int; ++ pragma Import (C, pthread_key_create, "pthread_key_create"); ++ ++ ------------------------------------ ++ -- Non-portable Pthread Functions -- ++ ------------------------------------ ++ ++ function pthread_set_name_np ++ (thread : pthread_t; ++ name : System.Address) return int; ++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np"); ++ ++private ++ ++ type sigset_t is array (1 .. 4) of unsigned; ++ ++ -- In FreeBSD the component sa_handler turns out to ++ -- be one a union type, and the selector is a macro: ++ -- #define sa_handler __sigaction_u._handler ++ -- #define sa_sigaction __sigaction_u._sigaction ++ ++ -- Should we add a signal_context type here ??? ++ -- How could it be done independent of the CPU architecture ??? ++ -- sigcontext type is opaque, so it is architecturally neutral. ++ -- It is always passed as an access type, so define it as an empty record ++ -- since the contents are not used anywhere. ++ ++ type struct_sigcontext is null record; ++ pragma Convention (C, struct_sigcontext); ++ ++ type pid_t is new int; ++ ++ type time_t is new int; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type pthread_t is new System.Address; ++ type pthread_attr_t is new System.Address; ++ type pthread_mutex_t is new System.Address; ++ type pthread_mutexattr_t is new System.Address; ++ type pthread_cond_t is new System.Address; ++ type pthread_condattr_t is new System.Address; ++ type pthread_key_t is new int; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-freebsd64.ads +@@ -0,0 +1,649 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-1994, Florida State University -- ++-- Copyright (C) 1995-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the FreeBSD PTHREADS version of this package ++ ++-- This package encapsulates all direct interfaces to OS services ++-- that are needed by the tasking run-time (libgnarl). ++ ++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma ++-- Preelaborate. This package is designed to be a bottom-level (leaf) package. ++ ++with Ada.Unchecked_Conversion; ++ ++with Interfaces.C; ++ ++package System.OS_Interface is ++ pragma Preelaborate; ++ ++ pragma Linker_Options ("-pthread"); ++ ++ subtype int is Interfaces.C.int; ++ subtype short is Interfaces.C.short; ++ subtype long is Interfaces.C.long; ++ subtype unsigned is Interfaces.C.unsigned; ++ subtype unsigned_short is Interfaces.C.unsigned_short; ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ subtype unsigned_char is Interfaces.C.unsigned_char; ++ subtype plain_char is Interfaces.C.plain_char; ++ subtype size_t is Interfaces.C.size_t; ++ subtype int64_t is Interfaces.Integer_64; ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int; ++ pragma Inline (Errno); ++ ++ EAGAIN : constant := 35; ++ EINTR : constant := 4; ++ EINVAL : constant := 22; ++ ENOMEM : constant := 12; ++ ETIMEDOUT : constant := 60; ++ ++ ------------- ++ -- Signals -- ++ ------------- ++ ++ Max_Interrupt : constant := 31; ++ type Signal is new int range 0 .. Max_Interrupt; ++ for Signal'Size use int'Size; ++ ++ SIGHUP : constant := 1; -- hangup ++ SIGINT : constant := 2; -- interrupt (rubout) ++ SIGQUIT : constant := 3; -- quit (ASCD FS) ++ SIGILL : constant := 4; -- illegal instruction (not reset) ++ SIGTRAP : constant := 5; -- trace trap (not reset) ++ SIGIOT : constant := 6; -- IOT instruction ++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future ++ SIGEMT : constant := 7; -- EMT instruction ++ SIGFPE : constant := 8; -- floating point exception ++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored) ++ SIGBUS : constant := 10; -- bus error ++ SIGSEGV : constant := 11; -- segmentation violation ++ SIGSYS : constant := 12; -- bad argument to system call ++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it ++ SIGALRM : constant := 14; -- alarm clock ++ SIGTERM : constant := 15; -- software termination signal from kill ++ SIGURG : constant := 16; -- urgent condition on IO channel ++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored) ++ SIGTSTP : constant := 18; -- user stop requested from tty ++ SIGCONT : constant := 19; -- stopped process has been continued ++ SIGCLD : constant := 20; -- alias for SIGCHLD ++ SIGCHLD : constant := 20; -- child status change ++ SIGTTIN : constant := 21; -- background tty read attempted ++ SIGTTOU : constant := 22; -- background tty write attempted ++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias) ++ SIGXCPU : constant := 24; -- CPU time limit exceeded ++ SIGXFSZ : constant := 25; -- filesize limit exceeded ++ SIGVTALRM : constant := 26; -- virtual timer expired ++ SIGPROF : constant := 27; -- profiling timer expired ++ SIGWINCH : constant := 28; -- window size change ++ SIGINFO : constant := 29; -- information request (BSD) ++ SIGUSR1 : constant := 30; -- user defined signal 1 ++ SIGUSR2 : constant := 31; -- user defined signal 2 ++ ++ SIGADAABORT : constant := SIGABRT; ++ -- Change this if you want to use another signal for task abort. ++ -- SIGTERM might be a good one. ++ ++ type Signal_Set is array (Natural range <>) of Signal; ++ ++ -- Interrupts that must be unmasked at all times. FreeBSD ++ -- pthreads will not allow an application to mask out any ++ -- interrupt needed by the threads library. ++ Unmasked : constant Signal_Set := ++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP); ++ ++ -- FreeBSD will uses SIGPROF for timing. Do not allow a ++ -- handler to attach to this signal. ++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF); ++ ++ type sigset_t is private; ++ ++ function sigaddset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigaddset, "sigaddset"); ++ ++ function sigdelset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigdelset, "sigdelset"); ++ ++ function sigfillset (set : access sigset_t) return int; ++ pragma Import (C, sigfillset, "sigfillset"); ++ ++ function sigismember ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigismember, "sigismember"); ++ ++ function sigemptyset (set : access sigset_t) return int; ++ pragma Import (C, sigemptyset, "sigemptyset"); ++ ++ -- sigcontext is architecture dependent, so define it private ++ type struct_sigcontext is private; ++ ++ type old_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_mask : sigset_t; ++ sa_flags : int; ++ end record; ++ pragma Convention (C, old_struct_sigaction); ++ ++ type new_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_flags : int; ++ sa_mask : sigset_t; ++ end record; ++ pragma Convention (C, new_struct_sigaction); ++ ++ subtype struct_sigaction is new_struct_sigaction; ++ type struct_sigaction_ptr is access all struct_sigaction; ++ ++ SIG_BLOCK : constant := 1; ++ SIG_UNBLOCK : constant := 2; ++ SIG_SETMASK : constant := 3; ++ ++ SIG_DFL : constant := 0; ++ SIG_IGN : constant := 1; ++ ++ SA_SIGINFO : constant := 16#0040#; ++ SA_ONSTACK : constant := 16#0001#; ++ ++ function sigaction ++ (sig : Signal; ++ act : struct_sigaction_ptr; ++ oact : struct_sigaction_ptr) return int; ++ pragma Import (C, sigaction, "sigaction"); ++ ++ ---------- ++ -- Time -- ++ ---------- ++ ++ Time_Slice_Supported : constant Boolean := True; ++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) ++ ++ type timespec is private; ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "nanosleep"); ++ ++ type clockid_t is new int; ++ ++ function clock_gettime ++ (clock_id : clockid_t; ++ tp : access timespec) ++ return int; ++ pragma Import (C, clock_gettime, "clock_gettime"); ++ ++ function To_Duration (TS : timespec) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timespec (D : Duration) return timespec; ++ pragma Inline (To_Timespec); ++ ++ type struct_timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, struct_timezone); ++ ++ procedure usleep (useconds : unsigned_long); ++ pragma Import (C, usleep, "usleep"); ++ ++ ------------------------- ++ -- Priority Scheduling -- ++ ------------------------- ++ ++ SCHED_FIFO : constant := 1; ++ SCHED_OTHER : constant := 2; ++ SCHED_RR : constant := 3; ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int; ++ -- Maps System.Any_Priority to a POSIX priority ++ ++ ------------- ++ -- Process -- ++ ------------- ++ ++ type pid_t is private; ++ ++ function kill (pid : pid_t; sig : Signal) return int; ++ pragma Import (C, kill, "kill"); ++ ++ function getpid return pid_t; ++ pragma Import (C, getpid, "getpid"); ++ ++ --------- ++ -- LWP -- ++ --------- ++ ++ function lwp_self return System.Address; ++ -- lwp_self does not exist on this thread library, revert to pthread_self ++ -- which is the closest approximation (with getpid). This function is ++ -- needed to share 7staprop.adb across POSIX-like targets. ++ pragma Import (C, lwp_self, "pthread_self"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++ type Thread_Body is access ++ function (arg : System.Address) return System.Address; ++ pragma Convention (C, Thread_Body); ++ ++ function Thread_Body_Access is new ++ Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ type pthread_t is private; ++ subtype Thread_Id is pthread_t; ++ ++ type pthread_mutex_t is limited private; ++ type pthread_cond_t is limited private; ++ type pthread_attr_t is limited private; ++ type pthread_mutexattr_t is limited private; ++ type pthread_condattr_t is limited private; ++ type pthread_key_t is private; ++ ++ PTHREAD_CREATE_DETACHED : constant := 1; ++ PTHREAD_CREATE_JOINABLE : constant := 0; ++ ++ PTHREAD_SCOPE_PROCESS : constant := 0; ++ PTHREAD_SCOPE_SYSTEM : constant := 2; ++ ++ -- Read/Write lock not supported on freebsd. To add support both types ++ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined ++ -- with the associated routines pthread_rwlock_[init/destroy] and ++ -- pthread_rwlock_[rdlock/wrlock/unlock]. ++ ++ subtype pthread_rwlock_t is pthread_mutex_t; ++ subtype pthread_rwlockattr_t is pthread_mutexattr_t; ++ ++ ----------- ++ -- Stack -- ++ ----------- ++ ++ type stack_t is record ++ ss_sp : System.Address; ++ ss_size : size_t; ++ ss_flags : int; ++ end record; ++ pragma Convention (C, stack_t); ++ ++ function sigaltstack ++ (ss : not null access stack_t; ++ oss : access stack_t) return int; ++ pragma Import (C, sigaltstack, "sigaltstack"); ++ ++ Alternate_Stack : aliased System.Address; ++ -- This is a dummy definition, never used (Alternate_Stack_Size is null) ++ ++ Alternate_Stack_Size : constant := 0; ++ -- No alternate signal stack is used on this platform ++ ++ Stack_Base_Available : constant Boolean := False; ++ -- Indicates whether the stack base is available on this target. This ++ -- allows us to share s-osinte.adb between all the FSU run time. Note that ++ -- this value can only be true if pthread_t has a complete definition that ++ -- corresponds exactly to the C header files. ++ ++ function Get_Stack_Base (thread : pthread_t) return Address; ++ pragma Inline (Get_Stack_Base); ++ -- returns the stack base of the specified thread. Only call this function ++ -- when Stack_Base_Available is True. ++ ++ function Get_Page_Size return size_t; ++ function Get_Page_Size return Address; ++ pragma Import (C, Get_Page_Size, "getpagesize"); ++ -- Returns the size of a page ++ ++ PROT_NONE : constant := 0; ++ PROT_READ : constant := 1; ++ PROT_WRITE : constant := 2; ++ PROT_EXEC : constant := 4; ++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC; ++ PROT_ON : constant := PROT_NONE; ++ PROT_OFF : constant := PROT_ALL; ++ ++ function mprotect (addr : Address; len : size_t; prot : int) return int; ++ pragma Import (C, mprotect); ++ ++ --------------------------------------- ++ -- Nonstandard Thread Initialization -- ++ --------------------------------------- ++ ++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should ++ -- be invoked during the elaboration of s-taprop.adb. ++ ++ -- FreeBSD does not require this so we provide an empty Ada body ++ ++ procedure pthread_init; ++ ++ ------------------------- ++ -- POSIX.1c Section 3 -- ++ ------------------------- ++ ++ function sigwait ++ (set : access sigset_t; ++ sig : access Signal) return int; ++ pragma Import (C, sigwait, "sigwait"); ++ ++ function pthread_kill ++ (thread : pthread_t; ++ sig : Signal) return int; ++ pragma Import (C, pthread_kill, "pthread_kill"); ++ ++ function pthread_sigmask ++ (how : int; ++ set : access sigset_t; ++ oset : access sigset_t) return int; ++ pragma Import (C, pthread_sigmask, "pthread_sigmask"); ++ ++ -------------------------- ++ -- POSIX.1c Section 11 -- ++ -------------------------- ++ ++ function pthread_mutexattr_init ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); ++ ++ function pthread_mutexattr_destroy ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); ++ ++ function pthread_mutex_init ++ (mutex : access pthread_mutex_t; ++ attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); ++ ++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); ++ ++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); ++ ++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); ++ ++ function pthread_condattr_init ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); ++ ++ function pthread_condattr_destroy ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); ++ ++ function pthread_cond_init ++ (cond : access pthread_cond_t; ++ attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_cond_init, "pthread_cond_init"); ++ ++ function pthread_cond_destroy (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); ++ ++ function pthread_cond_signal (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); ++ ++ function pthread_cond_wait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); ++ ++ function pthread_cond_timedwait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t; ++ abstime : access timespec) return int; ++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); ++ ++ Relative_Timed_Wait : constant Boolean := False; ++ -- pthread_cond_timedwait requires an absolute delay time ++ ++ -------------------------- ++ -- POSIX.1c Section 13 -- ++ -------------------------- ++ ++ PTHREAD_PRIO_NONE : constant := 0; ++ PTHREAD_PRIO_PROTECT : constant := 2; ++ PTHREAD_PRIO_INHERIT : constant := 1; ++ ++ function pthread_mutexattr_setprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : int) return int; ++ pragma Import ++ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol"); ++ ++ function pthread_mutexattr_getprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : access int) return int; ++ pragma Import ++ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol"); ++ ++ function pthread_mutexattr_setprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : int) return int; ++ pragma Import ++ (C, pthread_mutexattr_setprioceiling, ++ "pthread_mutexattr_setprioceiling"); ++ ++ function pthread_mutexattr_getprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : access int) return int; ++ pragma Import ++ (C, pthread_mutexattr_getprioceiling, ++ "pthread_mutexattr_getprioceiling"); ++ ++ type struct_sched_param is record ++ sched_priority : int; ++ end record; ++ pragma Convention (C, struct_sched_param); ++ ++ function pthread_getschedparam ++ (thread : pthread_t; ++ policy : access int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam"); ++ ++ function pthread_setschedparam ++ (thread : pthread_t; ++ policy : int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); ++ ++ function pthread_attr_setscope ++ (attr : access pthread_attr_t; ++ contentionscope : int) return int; ++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope"); ++ ++ function pthread_attr_getscope ++ (attr : access pthread_attr_t; ++ contentionscope : access int) return int; ++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope"); ++ ++ function pthread_attr_setinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : int) return int; ++ pragma Import ++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched"); ++ ++ function pthread_attr_getinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : access int) return int; ++ pragma Import ++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched"); ++ ++ function pthread_attr_setschedpolicy ++ (attr : access pthread_attr_t; ++ policy : int) return int; ++ pragma Import (C, pthread_attr_setschedpolicy, ++ "pthread_attr_setschedpolicy"); ++ ++ function pthread_attr_getschedpolicy ++ (attr : access pthread_attr_t; ++ policy : access int) return int; ++ pragma Import (C, pthread_attr_getschedpolicy, ++ "pthread_attr_getschedpolicy"); ++ ++ function pthread_attr_setschedparam ++ (attr : access pthread_attr_t; ++ sched_param : int) return int; ++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam"); ++ ++ function pthread_attr_getschedparam ++ (attr : access pthread_attr_t; ++ sched_param : access int) return int; ++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam"); ++ ++ function sched_yield return int; ++ pragma Import (C, sched_yield, "pthread_yield"); ++ ++ -------------------------- ++ -- P1003.1c Section 16 -- ++ -------------------------- ++ ++ function pthread_attr_init (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_init, "pthread_attr_init"); ++ ++ function pthread_attr_destroy ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); ++ ++ function pthread_attr_setdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : int) return int; ++ pragma Import ++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); ++ ++ function pthread_attr_getdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : access int) return int; ++ pragma Import ++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate"); ++ ++ function pthread_attr_getstacksize ++ (attr : access pthread_attr_t; ++ stacksize : access size_t) return int; ++ pragma Import ++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize"); ++ ++ function pthread_attr_setstacksize ++ (attr : access pthread_attr_t; ++ stacksize : size_t) return int; ++ pragma Import ++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); ++ ++ function pthread_create ++ (thread : access pthread_t; ++ attributes : access pthread_attr_t; ++ start_routine : Thread_Body; ++ arg : System.Address) return int; ++ pragma Import (C, pthread_create, "pthread_create"); ++ ++ function pthread_detach (thread : pthread_t) return int; ++ pragma Import (C, pthread_detach, "pthread_detach"); ++ ++ procedure pthread_exit (status : System.Address); ++ pragma Import (C, pthread_exit, "pthread_exit"); ++ ++ function pthread_self return pthread_t; ++ pragma Import (C, pthread_self, "pthread_self"); ++ ++ -------------------------- ++ -- POSIX.1c Section 17 -- ++ -------------------------- ++ ++ function pthread_setspecific ++ (key : pthread_key_t; ++ value : System.Address) return int; ++ pragma Import (C, pthread_setspecific, "pthread_setspecific"); ++ ++ function pthread_getspecific (key : pthread_key_t) return System.Address; ++ pragma Import (C, pthread_getspecific, "pthread_getspecific"); ++ ++ type destructor_pointer is access procedure (arg : System.Address); ++ pragma Convention (C, destructor_pointer); ++ ++ function pthread_key_create ++ (key : access pthread_key_t; ++ destructor : destructor_pointer) return int; ++ pragma Import (C, pthread_key_create, "pthread_key_create"); ++ ++ ------------------------------------ ++ -- Non-portable Pthread Functions -- ++ ------------------------------------ ++ ++ function pthread_set_name_np ++ (thread : pthread_t; ++ name : System.Address) return int; ++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np"); ++ ++private ++ ++ type sigset_t is array (1 .. 4) of unsigned; ++ ++ -- In FreeBSD the component sa_handler turns out to ++ -- be one a union type, and the selector is a macro: ++ -- #define sa_handler __sigaction_u._handler ++ -- #define sa_sigaction __sigaction_u._sigaction ++ ++ -- Should we add a signal_context type here ??? ++ -- How could it be done independent of the CPU architecture ??? ++ -- sigcontext type is opaque, so it is architecturally neutral. ++ -- It is always passed as an access type, so define it as an empty record ++ -- since the contents are not used anywhere. ++ ++ type struct_sigcontext is null record; ++ pragma Convention (C, struct_sigcontext); ++ ++ type pid_t is new int; ++ ++ type time_t is new int64_t; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type pthread_t is new System.Address; ++ type pthread_attr_t is new System.Address; ++ type pthread_mutex_t is new System.Address; ++ type pthread_mutexattr_t is new System.Address; ++ type pthread_cond_t is new System.Address; ++ type pthread_condattr_t is new System.Address; ++ type pthread_key_t is new int; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-netbsd.adb +@@ -0,0 +1,140 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the NetBSD THREADS version of this package ++ ++with Interfaces.C; use Interfaces.C; ++ ++package body System.OS_Interface is ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int is ++ type int_ptr is access all int; ++ ++ function internal_errno return int_ptr; ++ pragma Import (C, internal_errno, "__errno"); ++ ++ begin ++ return (internal_errno.all); ++ end Errno; ++ ++ -------------------- ++ -- Get_Stack_Base -- ++ -------------------- ++ ++ function Get_Stack_Base (thread : pthread_t) return Address is ++ pragma Unreferenced (thread); ++ begin ++ return Null_Address; ++ end Get_Stack_Base; ++ ++ ------------------ ++ -- pthread_init -- ++ ------------------ ++ ++ procedure pthread_init is ++ begin ++ null; ++ end pthread_init; ++ ++ ----------------------------------- ++ -- pthread_mutexattr_setprotocol -- ++ ----------------------------------- ++ ++ function pthread_mutexattr_setprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : int) return int is ++ pragma Unreferenced (attr, protocol); ++ begin ++ return 0; ++ end pthread_mutexattr_setprotocol; ++ ++ -------------------------------------- ++ -- pthread_mutexattr_setprioceiling -- ++ -------------------------------------- ++ ++ function pthread_mutexattr_setprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : int) return int is ++ pragma Unreferenced (attr, prioceiling); ++ begin ++ return 0; ++ end pthread_mutexattr_setprioceiling; ++ ++ ----------------- ++ -- To_Duration -- ++ ----------------- ++ ++ function To_Duration (TS : timespec) return Duration is ++ begin ++ return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; ++ end To_Duration; ++ ++ ------------------------ ++ -- To_Target_Priority -- ++ ------------------------ ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int ++ is ++ begin ++ return Interfaces.C.int (Prio); ++ end To_Target_Priority; ++ ++ ----------------- ++ -- To_Timespec -- ++ ----------------- ++ ++ function To_Timespec (D : Duration) return timespec is ++ S : time_t; ++ F : Duration; ++ ++ begin ++ S := time_t (Long_Long_Integer (D)); ++ F := D - Duration (S); ++ ++ -- If F has negative value due to a round-up, adjust for positive F ++ -- value. ++ ++ if F < 0.0 then ++ S := S - 1; ++ F := F + 1.0; ++ end if; ++ ++ return timespec'(tv_sec => S, ++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); ++ end To_Timespec; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-netbsd.ads +@@ -0,0 +1,674 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-1994, Florida State University -- ++-- Copyright (C) 1995-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the NetBSD PTHREADS version of this package. ++-- It is based off of the FreeBSD PTHREADS as of 4.2.3. ++ ++-- This package encapsulates all direct interfaces to OS services ++-- that are needed by the tasking run-time (libgnarl). ++ ++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma ++-- Preelaborate. This package is designed to be a bottom-level (leaf) package. ++ ++with Ada.Unchecked_Conversion; ++ ++with Interfaces.C; ++ ++package System.OS_Interface is ++ pragma Preelaborate; ++ ++ pragma Linker_Options ("-pthread"); ++ ++ subtype int is Interfaces.C.int; ++ subtype short is Interfaces.C.short; ++ subtype long is Interfaces.C.long; ++ subtype unsigned is Interfaces.C.unsigned; ++ subtype unsigned_short is Interfaces.C.unsigned_short; ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ subtype unsigned_char is Interfaces.C.unsigned_char; ++ subtype plain_char is Interfaces.C.plain_char; ++ subtype size_t is Interfaces.C.size_t; ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int; ++ pragma Inline (Errno); ++ ++ EAGAIN : constant := 35; ++ EINTR : constant := 4; ++ EINVAL : constant := 22; ++ ENOMEM : constant := 12; ++ ETIMEDOUT : constant := 60; ++ ++ ------------- ++ -- Signals -- ++ ------------- ++ ++ Max_Interrupt : constant := 63; ++ type Signal is new int range 0 .. Max_Interrupt; ++ for Signal'Size use int'Size; ++ ++ SIGHUP : constant := 1; -- hangup ++ SIGINT : constant := 2; -- interrupt (rubout) ++ SIGQUIT : constant := 3; -- quit (ASCD FS) ++ SIGILL : constant := 4; -- illegal instruction (not reset) ++ SIGTRAP : constant := 5; -- trace trap (not reset) ++ SIGIOT : constant := 6; -- IOT instruction ++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future ++ SIGEMT : constant := 7; -- EMT instruction ++ SIGFPE : constant := 8; -- floating point exception ++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored) ++ SIGBUS : constant := 10; -- bus error ++ SIGSEGV : constant := 11; -- segmentation violation ++ SIGSYS : constant := 12; -- bad argument to system call ++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it ++ SIGALRM : constant := 14; -- alarm clock ++ SIGTERM : constant := 15; -- software termination signal from kill ++ SIGURG : constant := 16; -- urgent condition on IO channel ++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored) ++ SIGTSTP : constant := 18; -- user stop requested from tty ++ SIGCONT : constant := 19; -- stopped process has been continued ++ SIGCLD : constant := 20; -- alias for SIGCHLD ++ SIGCHLD : constant := 20; -- child status change ++ SIGTTIN : constant := 21; -- background tty read attempted ++ SIGTTOU : constant := 22; -- background tty write attempted ++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias) ++ SIGXCPU : constant := 24; -- CPU time limit exceeded ++ SIGXFSZ : constant := 25; -- filesize limit exceeded ++ SIGVTALRM : constant := 26; -- virtual timer expired ++ SIGPROF : constant := 27; -- profiling timer expired ++ SIGWINCH : constant := 28; -- window size change ++ SIGINFO : constant := 29; -- information request (BSD) ++ SIGUSR1 : constant := 30; -- user defined signal 1 ++ SIGUSR2 : constant := 31; -- user defined signal 2 ++ SIGPWR : constant := 32; -- power fail/restart (not reset when caught) ++ ++ SIGADAABORT : constant := SIGABRT; ++ -- Change this if you want to use another signal for task abort. ++ -- SIGTERM might be a good one. ++ ++ type Signal_Set is array (Natural range <>) of Signal; ++ ++ -- Interrupts that must be unmasked at all times. NetBSD ++ -- pthreads will not allow an application to mask out any ++ -- interrupt needed by the threads library. ++ Unmasked : constant Signal_Set := ++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP); ++ ++ -- NetBSD will uses SIGPROF for timing. Do not allow a ++ -- handler to attach to this signal. ++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF); ++ ++ type sigset_t is private; ++ ++ function sigaddset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigaddset, "__sigaddset14"); ++ ++ function sigdelset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigdelset, "__sigdelset14"); ++ ++ function sigfillset (set : access sigset_t) return int; ++ pragma Import (C, sigfillset, "__sigfillset14"); ++ ++ function sigismember ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigismember, "__sigismember14"); ++ ++ function sigemptyset (set : access sigset_t) return int; ++ pragma Import (C, sigemptyset, "__sigemptyset14"); ++ ++ -- sigcontext is architecture dependent, so define it private ++ type struct_sigcontext is private; ++ ++ type old_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_mask : sigset_t; ++ sa_flags : int; ++ end record; ++ pragma Convention (C, old_struct_sigaction); ++ ++ type new_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_flags : int; ++ sa_mask : sigset_t; ++ end record; ++ pragma Convention (C, new_struct_sigaction); ++ ++ subtype struct_sigaction is new_struct_sigaction; ++ type struct_sigaction_ptr is access all struct_sigaction; ++ ++ SIG_BLOCK : constant := 1; ++ SIG_UNBLOCK : constant := 2; ++ SIG_SETMASK : constant := 3; ++ ++ SIG_DFL : constant := 0; ++ SIG_IGN : constant := 1; ++ SIG_ERR : constant := -1; ++ SIG_HOLD : constant := 3; ++ ++ SA_SIGINFO : constant := 16#0040#; ++ SA_ONSTACK : constant := 16#0001#; ++ ++ function sigaction ++ (sig : Signal; ++ act : struct_sigaction_ptr; ++ oact : struct_sigaction_ptr) return int; ++ pragma Import (C, sigaction, "__sigaction14"); ++ ++ ---------- ++ -- Time -- ++ ---------- ++ ++ Time_Slice_Supported : constant Boolean := True; ++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) ++ ++ type timespec is private; ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "nanosleep"); ++ ++ type clockid_t is new int; ++ ++ function clock_gettime ++ (clock_id : clockid_t; ++ tp : access timespec) ++ return int; ++ pragma Import (C, clock_gettime, "clock_gettime"); ++ ++ function To_Duration (TS : timespec) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timespec (D : Duration) return timespec; ++ pragma Inline (To_Timespec); ++ ++ type struct_timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, struct_timezone); ++ ++ ------------------------- ++ -- Priority Scheduling -- ++ ------------------------- ++ ++ SCHED_FIFO : constant := 1; ++ SCHED_OTHER : constant := 2; ++ SCHED_RR : constant := 3; ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int; ++ -- Maps System.Any_Priority to a POSIX priority ++ ++ ------------- ++ -- Process -- ++ ------------- ++ ++ type pid_t is private; ++ ++ function kill (pid : pid_t; sig : Signal) return int; ++ pragma Import (C, kill, "kill"); ++ ++ function getpid return pid_t; ++ pragma Import (C, getpid, "getpid"); ++ ++ --------- ++ -- LWP -- ++ --------- ++ ++ function lwp_self return System.Address; ++ -- lwp_self does not exist on this thread library, revert to pthread_self ++ -- which is the closest approximation (with getpid). This function is ++ -- needed to share 7staprop.adb across POSIX-like targets. ++ pragma Import (C, lwp_self, "pthread_self"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++ type Thread_Body is access ++ function (arg : System.Address) return System.Address; ++ pragma Convention (C, Thread_Body); ++ ++ function Thread_Body_Access is new ++ Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ type pthread_t is private; ++ subtype Thread_Id is pthread_t; ++ ++ type pthread_mutex_t is limited private; ++ type pthread_cond_t is limited private; ++ type pthread_attr_t is limited private; ++ type pthread_mutexattr_t is limited private; ++ type pthread_condattr_t is limited private; ++ type pthread_key_t is private; ++ ++ PTHREAD_CREATE_DETACHED : constant := 1; ++ PTHREAD_CREATE_JOINABLE : constant := 0; ++ ++ PTHREAD_SCOPE_PROCESS : constant := 0; ++ PTHREAD_SCOPE_SYSTEM : constant := 2; ++ ++ -- Read/Write lock not supported on OpenBSD. To add support both types ++ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined ++ -- with the associated routines pthread_rwlock_[init/destroy] and ++ -- pthread_rwlock_[rdlock/wrlock/unlock]. ++ ++ subtype pthread_rwlock_t is pthread_mutex_t; ++ subtype pthread_rwlockattr_t is pthread_mutexattr_t; ++ ++ ----------- ++ -- Stack -- ++ ----------- ++ ++ type stack_t is record ++ ss_sp : System.Address; ++ ss_size : size_t; ++ ss_flags : int; ++ end record; ++ pragma Convention (C, stack_t); ++ ++ function sigaltstack ++ (ss : not null access stack_t; ++ oss : access stack_t) return int; ++ pragma Import (C, sigaltstack, "sigaltstack"); ++ ++ Alternate_Stack : aliased System.Address; ++ -- This is a dummy definition, never used (Alternate_Stack_Size is null) ++ ++ Alternate_Stack_Size : constant := 0; ++ -- No alternate signal stack is used on this platform ++ ++ Stack_Base_Available : constant Boolean := False; ++ -- Indicates whether the stack base is available on this target. This ++ -- allows us to share s-osinte.adb between all the FSU run time. Note that ++ -- this value can only be true if pthread_t has a complete definition that ++ -- corresponds exactly to the C header files. ++ ++ function Get_Stack_Base (thread : pthread_t) return Address; ++ pragma Inline (Get_Stack_Base); ++ -- returns the stack base of the specified thread. Only call this function ++ -- when Stack_Base_Available is True. ++ ++ function Get_Page_Size return size_t; ++ function Get_Page_Size return Address; ++ pragma Import (C, Get_Page_Size, "getpagesize"); ++ -- Returns the size of a page ++ ++ PROT_NONE : constant := 0; ++ PROT_READ : constant := 1; ++ PROT_WRITE : constant := 2; ++ PROT_EXEC : constant := 4; ++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC; ++ PROT_ON : constant := PROT_NONE; ++ PROT_OFF : constant := PROT_ALL; ++ ++ function mprotect (addr : Address; len : size_t; prot : int) return int; ++ pragma Import (C, mprotect); ++ ++ --------------------------------------- ++ -- Nonstandard Thread Initialization -- ++ --------------------------------------- ++ ++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should ++ -- be invoked during the elaboration of s-taprop.adb. ++ ++ -- NetBSD does not require this so we provide an empty Ada body ++ ++ procedure pthread_init; ++ ++ ------------------------- ++ -- POSIX.1c Section 3 -- ++ ------------------------- ++ ++ function sigwait ++ (set : access sigset_t; ++ sig : access Signal) return int; ++ pragma Import (C, sigwait, "sigwait"); ++ ++ function pthread_kill ++ (thread : pthread_t; ++ sig : Signal) return int; ++ pragma Import (C, pthread_kill, "pthread_kill"); ++ ++ function pthread_sigmask ++ (how : int; ++ set : access sigset_t; ++ oset : access sigset_t) return int; ++ pragma Import (C, pthread_sigmask, "pthread_sigmask"); ++ ++ -------------------------- ++ -- POSIX.1c Section 11 -- ++ -------------------------- ++ ++ function pthread_mutexattr_init ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); ++ ++ function pthread_mutexattr_destroy ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); ++ ++ function pthread_mutex_init ++ (mutex : access pthread_mutex_t; ++ attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); ++ ++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); ++ ++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); ++ ++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); ++ ++ function pthread_condattr_init ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); ++ ++ function pthread_condattr_destroy ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); ++ ++ function pthread_cond_init ++ (cond : access pthread_cond_t; ++ attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_cond_init, "pthread_cond_init"); ++ ++ function pthread_cond_destroy (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); ++ ++ function pthread_cond_signal (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); ++ ++ function pthread_cond_wait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); ++ ++ function pthread_cond_timedwait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t; ++ abstime : access timespec) return int; ++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); ++ ++ Relative_Timed_Wait : constant Boolean := False; ++ -- pthread_cond_timedwait requires an absolute delay time ++ ++ -------------------------- ++ -- POSIX.1c Section 13 -- ++ -------------------------- ++ ++ PTHREAD_PRIO_NONE : constant := 0; ++ PTHREAD_PRIO_PROTECT : constant := 2; ++ PTHREAD_PRIO_INHERIT : constant := 1; ++ ++ function pthread_mutexattr_setprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : int) return int; ++ ++ function pthread_mutexattr_setprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : int) return int; ++ ++ type struct_sched_param is record ++ sched_priority : int; ++ end record; ++ pragma Convention (C, struct_sched_param); ++ ++ function pthread_getschedparam ++ (thread : pthread_t; ++ policy : access int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam"); ++ ++ function pthread_setschedparam ++ (thread : pthread_t; ++ policy : int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); ++ ++ function pthread_attr_setscope ++ (attr : access pthread_attr_t; ++ contentionscope : int) return int; ++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope"); ++ ++ function pthread_attr_getscope ++ (attr : access pthread_attr_t; ++ contentionscope : access int) return int; ++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope"); ++ ++ function pthread_attr_setinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : int) return int; ++ pragma Import ++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched"); ++ ++ function pthread_attr_getinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : access int) return int; ++ pragma Import ++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched"); ++ ++ function pthread_attr_setschedpolicy ++ (attr : access pthread_attr_t; ++ policy : int) return int; ++ pragma Import (C, pthread_attr_setschedpolicy, ++ "pthread_attr_setschedpolicy"); ++ ++ function pthread_attr_getschedpolicy ++ (attr : access pthread_attr_t; ++ policy : access int) return int; ++ pragma Import (C, pthread_attr_getschedpolicy, ++ "pthread_attr_getschedpolicy"); ++ ++ function pthread_attr_setschedparam ++ (attr : access pthread_attr_t; ++ sched_param : int) return int; ++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam"); ++ ++ function pthread_attr_getschedparam ++ (attr : access pthread_attr_t; ++ sched_param : access int) return int; ++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam"); ++ ++ function sched_yield return int; ++ pragma Import (C, sched_yield, "sched_yield"); ++ ++ -------------------------- ++ -- P1003.1c Section 16 -- ++ -------------------------- ++ ++ function pthread_attr_init (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_init, "pthread_attr_init"); ++ ++ function pthread_attr_destroy ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); ++ ++ function pthread_attr_setdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : int) return int; ++ pragma Import ++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); ++ ++ function pthread_attr_getdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : access int) return int; ++ pragma Import ++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate"); ++ ++ function pthread_attr_getstacksize ++ (attr : access pthread_attr_t; ++ stacksize : access size_t) return int; ++ pragma Import ++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize"); ++ ++ function pthread_attr_setstacksize ++ (attr : access pthread_attr_t; ++ stacksize : size_t) return int; ++ pragma Import ++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); ++ ++ function pthread_create ++ (thread : access pthread_t; ++ attributes : access pthread_attr_t; ++ start_routine : Thread_Body; ++ arg : System.Address) return int; ++ pragma Import (C, pthread_create, "pthread_create"); ++ ++ function pthread_detach (thread : pthread_t) return int; ++ pragma Import (C, pthread_detach, "pthread_detach"); ++ ++ procedure pthread_exit (status : System.Address); ++ pragma Import (C, pthread_exit, "pthread_exit"); ++ ++ function pthread_self return pthread_t; ++ pragma Import (C, pthread_self, "pthread_self"); ++ ++ -------------------------- ++ -- POSIX.1c Section 17 -- ++ -------------------------- ++ ++ function pthread_setspecific ++ (key : pthread_key_t; ++ value : System.Address) return int; ++ pragma Import (C, pthread_setspecific, "pthread_setspecific"); ++ ++ function pthread_getspecific (key : pthread_key_t) return System.Address; ++ pragma Import (C, pthread_getspecific, "pthread_getspecific"); ++ ++ type destructor_pointer is access procedure (arg : System.Address); ++ pragma Convention (C, destructor_pointer); ++ ++ function pthread_key_create ++ (key : access pthread_key_t; ++ destructor : destructor_pointer) return int; ++ pragma Import (C, pthread_key_create, "pthread_key_create"); ++ ++ ------------------------------------ ++ -- Non-portable Pthread Functions -- ++ ------------------------------------ ++ ++ function pthread_set_name_np ++ (thread : pthread_t; ++ name : System.Address) return int; ++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np"); ++ ++private ++ ++ type sigset_t is array (1 .. 4) of unsigned; ++ ++ -- In NetBSD the component sa_handler turns out to ++ -- be one a union type, and the selector is a macro: ++ -- #define sa_handler __sigaction_u._handler ++ -- #define sa_sigaction __sigaction_u._sigaction ++ ++ -- Should we add a signal_context type here ??? ++ -- How could it be done independent of the CPU architecture ??? ++ -- sigcontext type is opaque, so it is architecturally neutral. ++ -- It is always passed as an access type, so define it as an empty record ++ -- since the contents are not used anywhere. ++ ++ type struct_sigcontext is null record; ++ pragma Convention (C, struct_sigcontext); ++ ++ type pid_t is new int; ++ ++ type time_t is new int; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type pthread_t is new System.Address; ++ type pthread_attr_t is record ++ Pta_Magic : unsigned; ++ Pta_Flags : int; ++ Pta_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_attr_t); ++ ++ -- PORT NOTE: The size of pthread_spin_t is defined in ++ -- /src/sys/arch/*/include/types.h ++ type pthread_spin_t is new unsigned_char; ++ ++ type pthread_queue_t is record ++ Pthqh_First : pthread_t; ++ Pthqh_Last : System.Address; ++ end record; ++ pragma Convention (C, pthread_queue_t); ++ ++ type pthread_mutex_t is record ++ Ptm_Majic : unsigned; ++ Ptm_Lock : pthread_spin_t; ++ Ptm_Interlock : pthread_spin_t; ++ Ptm_Owner : pthread_t; ++ Ptm_Block : pthread_queue_t; ++ Ptm_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_mutex_t); ++ ++ type pthread_mutexattr_t is record ++ Ptma_Majic : unsigned; ++ Ptma_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_mutexattr_t); ++ ++ type pthread_cond_t is record ++ Ptc_Magic : unsigned; ++ Ptc_Lock : pthread_spin_t; ++ Ptc_Waiters : pthread_queue_t; ++ Ptc_Mutex : pthread_mutex_t; ++ Ptc_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_cond_t); ++ ++ type pthread_condattr_t is record ++ Ptca_Magic : unsigned; ++ Ptca_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_condattr_t); ++ ++ type pthread_key_t is new int; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-netbsd6.ads +@@ -0,0 +1,675 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-1994, Florida State University -- ++-- Copyright (C) 1995-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the NetBSD 6+ PTHREADS version of this package. ++-- It is based off of the FreeBSD PTHREADS as of 4.2.3. ++ ++-- This package encapsulates all direct interfaces to OS services ++-- that are needed by the tasking run-time (libgnarl). ++ ++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma ++-- Preelaborate. This package is designed to be a bottom-level (leaf) package. ++ ++with Ada.Unchecked_Conversion; ++ ++with Interfaces.C; ++ ++package System.OS_Interface is ++ pragma Preelaborate; ++ ++ pragma Linker_Options ("-pthread"); ++ ++ subtype int is Interfaces.C.int; ++ subtype short is Interfaces.C.short; ++ subtype long is Interfaces.C.long; ++ subtype unsigned is Interfaces.C.unsigned; ++ subtype unsigned_short is Interfaces.C.unsigned_short; ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ subtype unsigned_char is Interfaces.C.unsigned_char; ++ subtype plain_char is Interfaces.C.plain_char; ++ subtype size_t is Interfaces.C.size_t; ++ subtype int64_t is Interfaces.Integer_64; ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int; ++ pragma Inline (Errno); ++ ++ EAGAIN : constant := 35; ++ EINTR : constant := 4; ++ EINVAL : constant := 22; ++ ENOMEM : constant := 12; ++ ETIMEDOUT : constant := 60; ++ ++ ------------- ++ -- Signals -- ++ ------------- ++ ++ Max_Interrupt : constant := 63; ++ type Signal is new int range 0 .. Max_Interrupt; ++ for Signal'Size use int'Size; ++ ++ SIGHUP : constant := 1; -- hangup ++ SIGINT : constant := 2; -- interrupt (rubout) ++ SIGQUIT : constant := 3; -- quit (ASCD FS) ++ SIGILL : constant := 4; -- illegal instruction (not reset) ++ SIGTRAP : constant := 5; -- trace trap (not reset) ++ SIGIOT : constant := 6; -- IOT instruction ++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future ++ SIGEMT : constant := 7; -- EMT instruction ++ SIGFPE : constant := 8; -- floating point exception ++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored) ++ SIGBUS : constant := 10; -- bus error ++ SIGSEGV : constant := 11; -- segmentation violation ++ SIGSYS : constant := 12; -- bad argument to system call ++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it ++ SIGALRM : constant := 14; -- alarm clock ++ SIGTERM : constant := 15; -- software termination signal from kill ++ SIGURG : constant := 16; -- urgent condition on IO channel ++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored) ++ SIGTSTP : constant := 18; -- user stop requested from tty ++ SIGCONT : constant := 19; -- stopped process has been continued ++ SIGCLD : constant := 20; -- alias for SIGCHLD ++ SIGCHLD : constant := 20; -- child status change ++ SIGTTIN : constant := 21; -- background tty read attempted ++ SIGTTOU : constant := 22; -- background tty write attempted ++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias) ++ SIGXCPU : constant := 24; -- CPU time limit exceeded ++ SIGXFSZ : constant := 25; -- filesize limit exceeded ++ SIGVTALRM : constant := 26; -- virtual timer expired ++ SIGPROF : constant := 27; -- profiling timer expired ++ SIGWINCH : constant := 28; -- window size change ++ SIGINFO : constant := 29; -- information request (BSD) ++ SIGUSR1 : constant := 30; -- user defined signal 1 ++ SIGUSR2 : constant := 31; -- user defined signal 2 ++ SIGPWR : constant := 32; -- power fail/restart (not reset when caught) ++ ++ SIGADAABORT : constant := SIGABRT; ++ -- Change this if you want to use another signal for task abort. ++ -- SIGTERM might be a good one. ++ ++ type Signal_Set is array (Natural range <>) of Signal; ++ ++ -- Interrupts that must be unmasked at all times. NetBSD ++ -- pthreads will not allow an application to mask out any ++ -- interrupt needed by the threads library. ++ Unmasked : constant Signal_Set := ++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP); ++ ++ -- NetBSD will uses SIGPROF for timing. Do not allow a ++ -- handler to attach to this signal. ++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF); ++ ++ type sigset_t is private; ++ ++ function sigaddset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigaddset, "__sigaddset14"); ++ ++ function sigdelset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigdelset, "__sigdelset14"); ++ ++ function sigfillset (set : access sigset_t) return int; ++ pragma Import (C, sigfillset, "__sigfillset14"); ++ ++ function sigismember ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigismember, "__sigismember14"); ++ ++ function sigemptyset (set : access sigset_t) return int; ++ pragma Import (C, sigemptyset, "__sigemptyset14"); ++ ++ -- sigcontext is architecture dependent, so define it private ++ type struct_sigcontext is private; ++ ++ type old_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_mask : sigset_t; ++ sa_flags : int; ++ end record; ++ pragma Convention (C, old_struct_sigaction); ++ ++ type new_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_flags : int; ++ sa_mask : sigset_t; ++ end record; ++ pragma Convention (C, new_struct_sigaction); ++ ++ subtype struct_sigaction is new_struct_sigaction; ++ type struct_sigaction_ptr is access all struct_sigaction; ++ ++ SIG_BLOCK : constant := 1; ++ SIG_UNBLOCK : constant := 2; ++ SIG_SETMASK : constant := 3; ++ ++ SIG_DFL : constant := 0; ++ SIG_IGN : constant := 1; ++ SIG_ERR : constant := -1; ++ SIG_HOLD : constant := 3; ++ ++ SA_SIGINFO : constant := 16#0040#; ++ SA_ONSTACK : constant := 16#0001#; ++ ++ function sigaction ++ (sig : Signal; ++ act : struct_sigaction_ptr; ++ oact : struct_sigaction_ptr) return int; ++ pragma Import (C, sigaction, "__sigaction14"); ++ ++ ---------- ++ -- Time -- ++ ---------- ++ ++ Time_Slice_Supported : constant Boolean := True; ++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) ++ ++ type timespec is private; ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "__nanosleep50"); ++ ++ type clockid_t is new int; ++ ++ function clock_gettime ++ (clock_id : clockid_t; ++ tp : access timespec) ++ return int; ++ pragma Import (C, clock_gettime, "__clock_gettime50"); ++ ++ function To_Duration (TS : timespec) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timespec (D : Duration) return timespec; ++ pragma Inline (To_Timespec); ++ ++ type struct_timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, struct_timezone); ++ ++ ------------------------- ++ -- Priority Scheduling -- ++ ------------------------- ++ ++ SCHED_FIFO : constant := 1; ++ SCHED_OTHER : constant := 2; ++ SCHED_RR : constant := 3; ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int; ++ -- Maps System.Any_Priority to a POSIX priority ++ ++ ------------- ++ -- Process -- ++ ------------- ++ ++ type pid_t is private; ++ ++ function kill (pid : pid_t; sig : Signal) return int; ++ pragma Import (C, kill, "kill"); ++ ++ function getpid return pid_t; ++ pragma Import (C, getpid, "getpid"); ++ ++ --------- ++ -- LWP -- ++ --------- ++ ++ function lwp_self return System.Address; ++ -- lwp_self does not exist on this thread library, revert to pthread_self ++ -- which is the closest approximation (with getpid). This function is ++ -- needed to share 7staprop.adb across POSIX-like targets. ++ pragma Import (C, lwp_self, "pthread_self"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++ type Thread_Body is access ++ function (arg : System.Address) return System.Address; ++ pragma Convention (C, Thread_Body); ++ ++ function Thread_Body_Access is new ++ Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ type pthread_t is private; ++ subtype Thread_Id is pthread_t; ++ ++ type pthread_mutex_t is limited private; ++ type pthread_cond_t is limited private; ++ type pthread_attr_t is limited private; ++ type pthread_mutexattr_t is limited private; ++ type pthread_condattr_t is limited private; ++ type pthread_key_t is private; ++ ++ PTHREAD_CREATE_DETACHED : constant := 1; ++ PTHREAD_CREATE_JOINABLE : constant := 0; ++ ++ PTHREAD_SCOPE_PROCESS : constant := 0; ++ PTHREAD_SCOPE_SYSTEM : constant := 2; ++ ++ -- Read/Write lock not supported on freebsd. To add support both types ++ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined ++ -- with the associated routines pthread_rwlock_[init/destroy] and ++ -- pthread_rwlock_[rdlock/wrlock/unlock]. ++ ++ subtype pthread_rwlock_t is pthread_mutex_t; ++ subtype pthread_rwlockattr_t is pthread_mutexattr_t; ++ ++ ----------- ++ -- Stack -- ++ ----------- ++ ++ type stack_t is record ++ ss_sp : System.Address; ++ ss_size : size_t; ++ ss_flags : int; ++ end record; ++ pragma Convention (C, stack_t); ++ ++ function sigaltstack ++ (ss : not null access stack_t; ++ oss : access stack_t) return int; ++ pragma Import (C, sigaltstack, "sigaltstack"); ++ ++ Alternate_Stack : aliased System.Address; ++ -- This is a dummy definition, never used (Alternate_Stack_Size is null) ++ ++ Alternate_Stack_Size : constant := 0; ++ -- No alternate signal stack is used on this platform ++ ++ Stack_Base_Available : constant Boolean := False; ++ -- Indicates whether the stack base is available on this target. This ++ -- allows us to share s-osinte.adb between all the FSU run time. Note that ++ -- this value can only be true if pthread_t has a complete definition that ++ -- corresponds exactly to the C header files. ++ ++ function Get_Stack_Base (thread : pthread_t) return Address; ++ pragma Inline (Get_Stack_Base); ++ -- returns the stack base of the specified thread. Only call this function ++ -- when Stack_Base_Available is True. ++ ++ function Get_Page_Size return size_t; ++ function Get_Page_Size return Address; ++ pragma Import (C, Get_Page_Size, "getpagesize"); ++ -- Returns the size of a page ++ ++ PROT_NONE : constant := 0; ++ PROT_READ : constant := 1; ++ PROT_WRITE : constant := 2; ++ PROT_EXEC : constant := 4; ++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC; ++ PROT_ON : constant := PROT_NONE; ++ PROT_OFF : constant := PROT_ALL; ++ ++ function mprotect (addr : Address; len : size_t; prot : int) return int; ++ pragma Import (C, mprotect); ++ ++ --------------------------------------- ++ -- Nonstandard Thread Initialization -- ++ --------------------------------------- ++ ++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should ++ -- be invoked during the elaboration of s-taprop.adb. ++ ++ -- NetBSD does not require this so we provide an empty Ada body ++ ++ procedure pthread_init; ++ ++ ------------------------- ++ -- POSIX.1c Section 3 -- ++ ------------------------- ++ ++ function sigwait ++ (set : access sigset_t; ++ sig : access Signal) return int; ++ pragma Import (C, sigwait, "sigwait"); ++ ++ function pthread_kill ++ (thread : pthread_t; ++ sig : Signal) return int; ++ pragma Import (C, pthread_kill, "pthread_kill"); ++ ++ function pthread_sigmask ++ (how : int; ++ set : access sigset_t; ++ oset : access sigset_t) return int; ++ pragma Import (C, pthread_sigmask, "pthread_sigmask"); ++ ++ -------------------------- ++ -- POSIX.1c Section 11 -- ++ -------------------------- ++ ++ function pthread_mutexattr_init ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); ++ ++ function pthread_mutexattr_destroy ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); ++ ++ function pthread_mutex_init ++ (mutex : access pthread_mutex_t; ++ attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); ++ ++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); ++ ++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); ++ ++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); ++ ++ function pthread_condattr_init ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); ++ ++ function pthread_condattr_destroy ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); ++ ++ function pthread_cond_init ++ (cond : access pthread_cond_t; ++ attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_cond_init, "pthread_cond_init"); ++ ++ function pthread_cond_destroy (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); ++ ++ function pthread_cond_signal (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); ++ ++ function pthread_cond_wait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); ++ ++ function pthread_cond_timedwait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t; ++ abstime : access timespec) return int; ++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); ++ ++ Relative_Timed_Wait : constant Boolean := False; ++ -- pthread_cond_timedwait requires an absolute delay time ++ ++ -------------------------- ++ -- POSIX.1c Section 13 -- ++ -------------------------- ++ ++ PTHREAD_PRIO_NONE : constant := 0; ++ PTHREAD_PRIO_PROTECT : constant := 2; ++ PTHREAD_PRIO_INHERIT : constant := 1; ++ ++ function pthread_mutexattr_setprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : int) return int; ++ ++ function pthread_mutexattr_setprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : int) return int; ++ ++ type struct_sched_param is record ++ sched_priority : int; ++ end record; ++ pragma Convention (C, struct_sched_param); ++ ++ function pthread_getschedparam ++ (thread : pthread_t; ++ policy : access int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam"); ++ ++ function pthread_setschedparam ++ (thread : pthread_t; ++ policy : int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); ++ ++ function pthread_attr_setscope ++ (attr : access pthread_attr_t; ++ contentionscope : int) return int; ++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope"); ++ ++ function pthread_attr_getscope ++ (attr : access pthread_attr_t; ++ contentionscope : access int) return int; ++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope"); ++ ++ function pthread_attr_setinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : int) return int; ++ pragma Import ++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched"); ++ ++ function pthread_attr_getinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : access int) return int; ++ pragma Import ++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched"); ++ ++ function pthread_attr_setschedpolicy ++ (attr : access pthread_attr_t; ++ policy : int) return int; ++ pragma Import (C, pthread_attr_setschedpolicy, ++ "pthread_attr_setschedpolicy"); ++ ++ function pthread_attr_getschedpolicy ++ (attr : access pthread_attr_t; ++ policy : access int) return int; ++ pragma Import (C, pthread_attr_getschedpolicy, ++ "pthread_attr_getschedpolicy"); ++ ++ function pthread_attr_setschedparam ++ (attr : access pthread_attr_t; ++ sched_param : int) return int; ++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam"); ++ ++ function pthread_attr_getschedparam ++ (attr : access pthread_attr_t; ++ sched_param : access int) return int; ++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam"); ++ ++ function sched_yield return int; ++ pragma Import (C, sched_yield, "sched_yield"); ++ ++ -------------------------- ++ -- P1003.1c Section 16 -- ++ -------------------------- ++ ++ function pthread_attr_init (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_init, "pthread_attr_init"); ++ ++ function pthread_attr_destroy ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); ++ ++ function pthread_attr_setdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : int) return int; ++ pragma Import ++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); ++ ++ function pthread_attr_getdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : access int) return int; ++ pragma Import ++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate"); ++ ++ function pthread_attr_getstacksize ++ (attr : access pthread_attr_t; ++ stacksize : access size_t) return int; ++ pragma Import ++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize"); ++ ++ function pthread_attr_setstacksize ++ (attr : access pthread_attr_t; ++ stacksize : size_t) return int; ++ pragma Import ++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); ++ ++ function pthread_create ++ (thread : access pthread_t; ++ attributes : access pthread_attr_t; ++ start_routine : Thread_Body; ++ arg : System.Address) return int; ++ pragma Import (C, pthread_create, "pthread_create"); ++ ++ function pthread_detach (thread : pthread_t) return int; ++ pragma Import (C, pthread_detach, "pthread_detach"); ++ ++ procedure pthread_exit (status : System.Address); ++ pragma Import (C, pthread_exit, "pthread_exit"); ++ ++ function pthread_self return pthread_t; ++ pragma Import (C, pthread_self, "pthread_self"); ++ ++ -------------------------- ++ -- POSIX.1c Section 17 -- ++ -------------------------- ++ ++ function pthread_setspecific ++ (key : pthread_key_t; ++ value : System.Address) return int; ++ pragma Import (C, pthread_setspecific, "pthread_setspecific"); ++ ++ function pthread_getspecific (key : pthread_key_t) return System.Address; ++ pragma Import (C, pthread_getspecific, "pthread_getspecific"); ++ ++ type destructor_pointer is access procedure (arg : System.Address); ++ pragma Convention (C, destructor_pointer); ++ ++ function pthread_key_create ++ (key : access pthread_key_t; ++ destructor : destructor_pointer) return int; ++ pragma Import (C, pthread_key_create, "pthread_key_create"); ++ ++ ------------------------------------ ++ -- Non-portable Pthread Functions -- ++ ------------------------------------ ++ ++ function pthread_set_name_np ++ (thread : pthread_t; ++ name : System.Address) return int; ++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np"); ++ ++private ++ ++ type sigset_t is array (1 .. 4) of unsigned; ++ ++ -- In NetBSD the component sa_handler turns out to ++ -- be one a union type, and the selector is a macro: ++ -- #define sa_handler __sigaction_u._handler ++ -- #define sa_sigaction __sigaction_u._sigaction ++ ++ -- Should we add a signal_context type here ??? ++ -- How could it be done independent of the CPU architecture ??? ++ -- sigcontext type is opaque, so it is architecturally neutral. ++ -- It is always passed as an access type, so define it as an empty record ++ -- since the contents are not used anywhere. ++ ++ type struct_sigcontext is null record; ++ pragma Convention (C, struct_sigcontext); ++ ++ type pid_t is new int; ++ ++ type time_t is new int64_t; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type pthread_t is new System.Address; ++ type pthread_attr_t is record ++ Pta_Magic : unsigned; ++ Pta_Flags : int; ++ Pta_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_attr_t); ++ ++ -- PORT NOTE: The size of pthread_spin_t is defined in ++ -- /src/sys/arch/*/include/types.h ++ type pthread_spin_t is new unsigned_char; ++ ++ type pthread_queue_t is record ++ Pthqh_First : pthread_t; ++ Pthqh_Last : System.Address; ++ end record; ++ pragma Convention (C, pthread_queue_t); ++ ++ type pthread_mutex_t is record ++ Ptm_Majic : unsigned; ++ Ptm_Lock : pthread_spin_t; ++ Ptm_Interlock : pthread_spin_t; ++ Ptm_Owner : pthread_t; ++ Ptm_Block : pthread_queue_t; ++ Ptm_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_mutex_t); ++ ++ type pthread_mutexattr_t is record ++ Ptma_Majic : unsigned; ++ Ptma_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_mutexattr_t); ++ ++ type pthread_cond_t is record ++ Ptc_Magic : unsigned; ++ Ptc_Lock : pthread_spin_t; ++ Ptc_Waiters : pthread_queue_t; ++ Ptc_Mutex : pthread_mutex_t; ++ Ptc_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_cond_t); ++ ++ type pthread_condattr_t is record ++ Ptca_Magic : unsigned; ++ Ptca_Private : System.Address; ++ end record; ++ pragma Convention (C, pthread_condattr_t); ++ ++ type pthread_key_t is new int; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-openbsd.adb +@@ -0,0 +1,116 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1991-2009, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the OpenBSD THREADS version of this package ++ ++with Interfaces.C; use Interfaces.C; ++ ++package body System.OS_Interface is ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int is ++ type int_ptr is access all int; ++ ++ function internal_errno return int_ptr; ++ pragma Import (C, internal_errno, "__errno"); ++ ++ begin ++ return (internal_errno.all); ++ end Errno; ++ ++ -------------------- ++ -- Get_Stack_Base -- ++ -------------------- ++ ++ function Get_Stack_Base (thread : pthread_t) return Address is ++ pragma Unreferenced (thread); ++ begin ++ return Null_Address; ++ end Get_Stack_Base; ++ ++ ------------------ ++ -- pthread_init -- ++ ------------------ ++ ++ procedure pthread_init is ++ begin ++ null; ++ end pthread_init; ++ ++ ----------------- ++ -- To_Duration -- ++ ----------------- ++ ++ function To_Duration (TS : timespec) return Duration is ++ begin ++ return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; ++ end To_Duration; ++ ++ ------------------------ ++ -- To_Target_Priority -- ++ ------------------------ ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int ++ is ++ begin ++ return Interfaces.C.int (Prio); ++ end To_Target_Priority; ++ ++ ----------------- ++ -- To_Timespec -- ++ ----------------- ++ ++ function To_Timespec (D : Duration) return timespec is ++ S : time_t; ++ F : Duration; ++ ++ begin ++ S := time_t (Long_Long_Integer (D)); ++ F := D - Duration (S); ++ ++ -- If F has negative value due to a round-up, adjust for positive F ++ -- value. ++ ++ if F < 0.0 then ++ S := S - 1; ++ F := F + 1.0; ++ end if; ++ ++ return timespec'(tv_sec => S, ++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); ++ end To_Timespec; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osinte-openbsd.ads +@@ -0,0 +1,648 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ I N T E R F A C E -- ++-- -- ++-- S p e c -- ++-- -- ++-- Copyright (C) 1991-1994, Florida State University -- ++-- Copyright (C) 1995-2011, Free Software Foundation, Inc. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. It is -- ++-- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- ++-- State University (http://www.gnat.com). -- ++-- -- ++------------------------------------------------------------------------------ ++ ++-- This is the OpenBSD PTHREADS version of this package ++ ++-- This package encapsulates all direct interfaces to OS services ++-- that are needed by the tasking run-time (libgnarl). ++ ++-- PLEASE DO NOT add any with-clauses to this package or remove the pragma ++-- Preelaborate. This package is designed to be a bottom-level (leaf) package. ++ ++with Ada.Unchecked_Conversion; ++ ++with Interfaces.C; ++ ++package System.OS_Interface is ++ pragma Preelaborate; ++ ++ pragma Linker_Options ("-pthread"); ++ ++ subtype int is Interfaces.C.int; ++ subtype short is Interfaces.C.short; ++ subtype long is Interfaces.C.long; ++ subtype unsigned is Interfaces.C.unsigned; ++ subtype unsigned_short is Interfaces.C.unsigned_short; ++ subtype unsigned_long is Interfaces.C.unsigned_long; ++ subtype unsigned_char is Interfaces.C.unsigned_char; ++ subtype plain_char is Interfaces.C.plain_char; ++ subtype size_t is Interfaces.C.size_t; ++ ++ ----------- ++ -- Errno -- ++ ----------- ++ ++ function Errno return int; ++ pragma Inline (Errno); ++ ++ EAGAIN : constant := 35; ++ EINTR : constant := 4; ++ EINVAL : constant := 22; ++ ENOMEM : constant := 12; ++ ETIMEDOUT : constant := 60; ++ ++ ------------- ++ -- Signals -- ++ ------------- ++ ++ Max_Interrupt : constant := 31; ++ type Signal is new int range 0 .. Max_Interrupt; ++ for Signal'Size use int'Size; ++ ++ SIGHUP : constant := 1; -- hangup ++ SIGINT : constant := 2; -- interrupt (rubout) ++ SIGQUIT : constant := 3; -- quit (ASCD FS) ++ SIGILL : constant := 4; -- illegal instruction (not reset) ++ SIGTRAP : constant := 5; -- trace trap (not reset) ++ SIGIOT : constant := 6; -- IOT instruction ++ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future ++ SIGEMT : constant := 7; -- EMT instruction ++ SIGFPE : constant := 8; -- floating point exception ++ SIGKILL : constant := 9; -- kill (cannot be caught or ignored) ++ SIGBUS : constant := 10; -- bus error ++ SIGSEGV : constant := 11; -- segmentation violation ++ SIGSYS : constant := 12; -- bad argument to system call ++ SIGPIPE : constant := 13; -- write on a pipe with no one to read it ++ SIGALRM : constant := 14; -- alarm clock ++ SIGTERM : constant := 15; -- software termination signal from kill ++ SIGURG : constant := 16; -- urgent condition on IO channel ++ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored) ++ SIGTSTP : constant := 18; -- user stop requested from tty ++ SIGCONT : constant := 19; -- stopped process has been continued ++ SIGCLD : constant := 20; -- alias for SIGCHLD ++ SIGCHLD : constant := 20; -- child status change ++ SIGTTIN : constant := 21; -- background tty read attempted ++ SIGTTOU : constant := 22; -- background tty write attempted ++ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias) ++ SIGXCPU : constant := 24; -- CPU time limit exceeded ++ SIGXFSZ : constant := 25; -- filesize limit exceeded ++ SIGVTALRM : constant := 26; -- virtual timer expired ++ SIGPROF : constant := 27; -- profiling timer expired ++ SIGWINCH : constant := 28; -- window size change ++ SIGINFO : constant := 29; -- information request (BSD) ++ SIGUSR1 : constant := 30; -- user defined signal 1 ++ SIGUSR2 : constant := 31; -- user defined signal 2 ++ ++ SIGADAABORT : constant := SIGABRT; ++ -- Change this if you want to use another signal for task abort. ++ -- SIGTERM might be a good one. ++ ++ type Signal_Set is array (Natural range <>) of Signal; ++ ++ -- Interrupts that must be unmasked at all times. OpenBSD ++ -- pthreads will not allow an application to mask out any ++ -- interrupt needed by the threads library. ++ Unmasked : constant Signal_Set := ++ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP); ++ ++ -- OpenBSD will uses SIGPROF for timing. Do not allow a ++ -- handler to attach to this signal. ++ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF); ++ ++ type sigset_t is private; ++ ++ function sigaddset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigaddset, "sigaddset"); ++ ++ function sigdelset ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigdelset, "sigdelset"); ++ ++ function sigfillset (set : access sigset_t) return int; ++ pragma Import (C, sigfillset, "sigfillset"); ++ ++ function sigismember ++ (set : access sigset_t; ++ sig : Signal) return int; ++ pragma Import (C, sigismember, "sigismember"); ++ ++ function sigemptyset (set : access sigset_t) return int; ++ pragma Import (C, sigemptyset, "sigemptyset"); ++ ++ -- sigcontext is architecture dependent, so define it private ++ type struct_sigcontext is private; ++ ++ type old_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_mask : sigset_t; ++ sa_flags : int; ++ end record; ++ pragma Convention (C, old_struct_sigaction); ++ ++ type new_struct_sigaction is record ++ sa_handler : System.Address; ++ sa_flags : int; ++ sa_mask : sigset_t; ++ end record; ++ pragma Convention (C, new_struct_sigaction); ++ ++ subtype struct_sigaction is new_struct_sigaction; ++ type struct_sigaction_ptr is access all struct_sigaction; ++ ++ SIG_BLOCK : constant := 1; ++ SIG_UNBLOCK : constant := 2; ++ SIG_SETMASK : constant := 3; ++ ++ SIG_DFL : constant := 0; ++ SIG_IGN : constant := 1; ++ ++ SA_SIGINFO : constant := 16#0040#; ++ SA_ONSTACK : constant := 16#0001#; ++ ++ function sigaction ++ (sig : Signal; ++ act : struct_sigaction_ptr; ++ oact : struct_sigaction_ptr) return int; ++ pragma Import (C, sigaction, "sigaction"); ++ ++ ---------- ++ -- Time -- ++ ---------- ++ ++ Time_Slice_Supported : constant Boolean := True; ++ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) ++ ++ type timespec is private; ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "nanosleep"); ++ ++ type clockid_t is new int; ++ ++ function clock_gettime ++ (clock_id : clockid_t; ++ tp : access timespec) ++ return int; ++ pragma Import (C, clock_gettime, "clock_gettime"); ++ ++ function To_Duration (TS : timespec) return Duration; ++ pragma Inline (To_Duration); ++ ++ function To_Timespec (D : Duration) return timespec; ++ pragma Inline (To_Timespec); ++ ++ type struct_timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, struct_timezone); ++ ++ procedure usleep (useconds : unsigned_long); ++ pragma Import (C, usleep, "usleep"); ++ ++ ------------------------- ++ -- Priority Scheduling -- ++ ------------------------- ++ ++ SCHED_FIFO : constant := 1; ++ SCHED_OTHER : constant := 2; ++ SCHED_RR : constant := 3; ++ ++ function To_Target_Priority ++ (Prio : System.Any_Priority) return Interfaces.C.int; ++ -- Maps System.Any_Priority to a POSIX priority ++ ++ ------------- ++ -- Process -- ++ ------------- ++ ++ type pid_t is private; ++ ++ function kill (pid : pid_t; sig : Signal) return int; ++ pragma Import (C, kill, "kill"); ++ ++ function getpid return pid_t; ++ pragma Import (C, getpid, "getpid"); ++ ++ --------- ++ -- LWP -- ++ --------- ++ ++ function lwp_self return System.Address; ++ -- lwp_self does not exist on this thread library, revert to pthread_self ++ -- which is the closest approximation (with getpid). This function is ++ -- needed to share 7staprop.adb across POSIX-like targets. ++ pragma Import (C, lwp_self, "pthread_self"); ++ ++ ------------- ++ -- Threads -- ++ ------------- ++ ++ type Thread_Body is access ++ function (arg : System.Address) return System.Address; ++ pragma Convention (C, Thread_Body); ++ ++ function Thread_Body_Access is new ++ Ada.Unchecked_Conversion (System.Address, Thread_Body); ++ ++ type pthread_t is private; ++ subtype Thread_Id is pthread_t; ++ ++ type pthread_mutex_t is limited private; ++ type pthread_cond_t is limited private; ++ type pthread_attr_t is limited private; ++ type pthread_mutexattr_t is limited private; ++ type pthread_condattr_t is limited private; ++ type pthread_key_t is private; ++ ++ PTHREAD_CREATE_DETACHED : constant := 1; ++ PTHREAD_CREATE_JOINABLE : constant := 0; ++ ++ PTHREAD_SCOPE_PROCESS : constant := 0; ++ PTHREAD_SCOPE_SYSTEM : constant := 2; ++ ++ -- Read/Write lock not supported on freebsd. To add support both types ++ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined ++ -- with the associated routines pthread_rwlock_[init/destroy] and ++ -- pthread_rwlock_[rdlock/wrlock/unlock]. ++ ++ subtype pthread_rwlock_t is pthread_mutex_t; ++ subtype pthread_rwlockattr_t is pthread_mutexattr_t; ++ ++ ----------- ++ -- Stack -- ++ ----------- ++ ++ type stack_t is record ++ ss_sp : System.Address; ++ ss_size : size_t; ++ ss_flags : int; ++ end record; ++ pragma Convention (C, stack_t); ++ ++ function sigaltstack ++ (ss : not null access stack_t; ++ oss : access stack_t) return int; ++ pragma Import (C, sigaltstack, "sigaltstack"); ++ ++ Alternate_Stack : aliased System.Address; ++ -- This is a dummy definition, never used (Alternate_Stack_Size is null) ++ ++ Alternate_Stack_Size : constant := 0; ++ -- No alternate signal stack is used on this platform ++ ++ Stack_Base_Available : constant Boolean := False; ++ -- Indicates whether the stack base is available on this target. This ++ -- allows us to share s-osinte.adb between all the FSU run time. Note that ++ -- this value can only be true if pthread_t has a complete definition that ++ -- corresponds exactly to the C header files. ++ ++ function Get_Stack_Base (thread : pthread_t) return Address; ++ pragma Inline (Get_Stack_Base); ++ -- returns the stack base of the specified thread. Only call this function ++ -- when Stack_Base_Available is True. ++ ++ function Get_Page_Size return size_t; ++ function Get_Page_Size return Address; ++ pragma Import (C, Get_Page_Size, "getpagesize"); ++ -- Returns the size of a page ++ ++ PROT_NONE : constant := 0; ++ PROT_READ : constant := 1; ++ PROT_WRITE : constant := 2; ++ PROT_EXEC : constant := 4; ++ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC; ++ PROT_ON : constant := PROT_NONE; ++ PROT_OFF : constant := PROT_ALL; ++ ++ function mprotect (addr : Address; len : size_t; prot : int) return int; ++ pragma Import (C, mprotect); ++ ++ --------------------------------------- ++ -- Nonstandard Thread Initialization -- ++ --------------------------------------- ++ ++ -- FSU_THREADS requires pthread_init, which is nonstandard and this should ++ -- be invoked during the elaboration of s-taprop.adb. ++ ++ -- OpenBSD does not require this so we provide an empty Ada body ++ ++ procedure pthread_init; ++ ++ ------------------------- ++ -- POSIX.1c Section 3 -- ++ ------------------------- ++ ++ function sigwait ++ (set : access sigset_t; ++ sig : access Signal) return int; ++ pragma Import (C, sigwait, "sigwait"); ++ ++ function pthread_kill ++ (thread : pthread_t; ++ sig : Signal) return int; ++ pragma Import (C, pthread_kill, "pthread_kill"); ++ ++ function pthread_sigmask ++ (how : int; ++ set : access sigset_t; ++ oset : access sigset_t) return int; ++ pragma Import (C, pthread_sigmask, "pthread_sigmask"); ++ ++ -------------------------- ++ -- POSIX.1c Section 11 -- ++ -------------------------- ++ ++ function pthread_mutexattr_init ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); ++ ++ function pthread_mutexattr_destroy ++ (attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); ++ ++ function pthread_mutex_init ++ (mutex : access pthread_mutex_t; ++ attr : access pthread_mutexattr_t) return int; ++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); ++ ++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); ++ ++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); ++ ++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); ++ ++ function pthread_condattr_init ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); ++ ++ function pthread_condattr_destroy ++ (attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); ++ ++ function pthread_cond_init ++ (cond : access pthread_cond_t; ++ attr : access pthread_condattr_t) return int; ++ pragma Import (C, pthread_cond_init, "pthread_cond_init"); ++ ++ function pthread_cond_destroy (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); ++ ++ function pthread_cond_signal (cond : access pthread_cond_t) return int; ++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); ++ ++ function pthread_cond_wait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t) return int; ++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); ++ ++ function pthread_cond_timedwait ++ (cond : access pthread_cond_t; ++ mutex : access pthread_mutex_t; ++ abstime : access timespec) return int; ++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); ++ ++ Relative_Timed_Wait : constant Boolean := False; ++ -- pthread_cond_timedwait requires an absolute delay time ++ ++ -------------------------- ++ -- POSIX.1c Section 13 -- ++ -------------------------- ++ ++ PTHREAD_PRIO_NONE : constant := 0; ++ PTHREAD_PRIO_PROTECT : constant := 2; ++ PTHREAD_PRIO_INHERIT : constant := 1; ++ ++ function pthread_mutexattr_setprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : int) return int; ++ pragma Import ++ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol"); ++ ++ function pthread_mutexattr_getprotocol ++ (attr : access pthread_mutexattr_t; ++ protocol : access int) return int; ++ pragma Import ++ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol"); ++ ++ function pthread_mutexattr_setprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : int) return int; ++ pragma Import ++ (C, pthread_mutexattr_setprioceiling, ++ "pthread_mutexattr_setprioceiling"); ++ ++ function pthread_mutexattr_getprioceiling ++ (attr : access pthread_mutexattr_t; ++ prioceiling : access int) return int; ++ pragma Import ++ (C, pthread_mutexattr_getprioceiling, ++ "pthread_mutexattr_getprioceiling"); ++ ++ type struct_sched_param is record ++ sched_priority : int; ++ end record; ++ pragma Convention (C, struct_sched_param); ++ ++ function pthread_getschedparam ++ (thread : pthread_t; ++ policy : access int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_getschedparam, "pthread_getschedparam"); ++ ++ function pthread_setschedparam ++ (thread : pthread_t; ++ policy : int; ++ param : access struct_sched_param) return int; ++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); ++ ++ function pthread_attr_setscope ++ (attr : access pthread_attr_t; ++ contentionscope : int) return int; ++ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope"); ++ ++ function pthread_attr_getscope ++ (attr : access pthread_attr_t; ++ contentionscope : access int) return int; ++ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope"); ++ ++ function pthread_attr_setinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : int) return int; ++ pragma Import ++ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched"); ++ ++ function pthread_attr_getinheritsched ++ (attr : access pthread_attr_t; ++ inheritsched : access int) return int; ++ pragma Import ++ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched"); ++ ++ function pthread_attr_setschedpolicy ++ (attr : access pthread_attr_t; ++ policy : int) return int; ++ pragma Import (C, pthread_attr_setschedpolicy, ++ "pthread_attr_setschedpolicy"); ++ ++ function pthread_attr_getschedpolicy ++ (attr : access pthread_attr_t; ++ policy : access int) return int; ++ pragma Import (C, pthread_attr_getschedpolicy, ++ "pthread_attr_getschedpolicy"); ++ ++ function pthread_attr_setschedparam ++ (attr : access pthread_attr_t; ++ sched_param : int) return int; ++ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam"); ++ ++ function pthread_attr_getschedparam ++ (attr : access pthread_attr_t; ++ sched_param : access int) return int; ++ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam"); ++ ++ function sched_yield return int; ++ pragma Import (C, sched_yield, "pthread_yield"); ++ ++ -------------------------- ++ -- P1003.1c Section 16 -- ++ -------------------------- ++ ++ function pthread_attr_init (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_init, "pthread_attr_init"); ++ ++ function pthread_attr_destroy ++ (attributes : access pthread_attr_t) return int; ++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); ++ ++ function pthread_attr_setdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : int) return int; ++ pragma Import ++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); ++ ++ function pthread_attr_getdetachstate ++ (attr : access pthread_attr_t; ++ detachstate : access int) return int; ++ pragma Import ++ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate"); ++ ++ function pthread_attr_getstacksize ++ (attr : access pthread_attr_t; ++ stacksize : access size_t) return int; ++ pragma Import ++ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize"); ++ ++ function pthread_attr_setstacksize ++ (attr : access pthread_attr_t; ++ stacksize : size_t) return int; ++ pragma Import ++ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); ++ ++ function pthread_create ++ (thread : access pthread_t; ++ attributes : access pthread_attr_t; ++ start_routine : Thread_Body; ++ arg : System.Address) return int; ++ pragma Import (C, pthread_create, "pthread_create"); ++ ++ function pthread_detach (thread : pthread_t) return int; ++ pragma Import (C, pthread_detach, "pthread_detach"); ++ ++ procedure pthread_exit (status : System.Address); ++ pragma Import (C, pthread_exit, "pthread_exit"); ++ ++ function pthread_self return pthread_t; ++ pragma Import (C, pthread_self, "pthread_self"); ++ ++ -------------------------- ++ -- POSIX.1c Section 17 -- ++ -------------------------- ++ ++ function pthread_setspecific ++ (key : pthread_key_t; ++ value : System.Address) return int; ++ pragma Import (C, pthread_setspecific, "pthread_setspecific"); ++ ++ function pthread_getspecific (key : pthread_key_t) return System.Address; ++ pragma Import (C, pthread_getspecific, "pthread_getspecific"); ++ ++ type destructor_pointer is access procedure (arg : System.Address); ++ pragma Convention (C, destructor_pointer); ++ ++ function pthread_key_create ++ (key : access pthread_key_t; ++ destructor : destructor_pointer) return int; ++ pragma Import (C, pthread_key_create, "pthread_key_create"); ++ ++ ------------------------------------ ++ -- Non-portable Pthread Functions -- ++ ------------------------------------ ++ ++ function pthread_set_name_np ++ (thread : pthread_t; ++ name : System.Address) return int; ++ pragma Import (C, pthread_set_name_np, "pthread_set_name_np"); ++ ++private ++ ++ type sigset_t is array (1 .. 4) of unsigned; ++ ++ -- In OpenBSD the component sa_handler turns out to ++ -- be one a union type, and the selector is a macro: ++ -- #define sa_handler __sigaction_u._handler ++ -- #define sa_sigaction __sigaction_u._sigaction ++ ++ -- Should we add a signal_context type here ??? ++ -- How could it be done independent of the CPU architecture ??? ++ -- sigcontext type is opaque, so it is architecturally neutral. ++ -- It is always passed as an access type, so define it as an empty record ++ -- since the contents are not used anywhere. ++ ++ type struct_sigcontext is null record; ++ pragma Convention (C, struct_sigcontext); ++ ++ type pid_t is new int; ++ ++ type time_t is new int; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type pthread_t is new System.Address; ++ type pthread_attr_t is new System.Address; ++ type pthread_mutex_t is new System.Address; ++ type pthread_mutexattr_t is new System.Address; ++ type pthread_cond_t is new System.Address; ++ type pthread_condattr_t is new System.Address; ++ type pthread_key_t is new int; ++ ++end System.OS_Interface; +--- /dev/null ++++ gcc/ada/s-osprim-bsd32.adb +@@ -0,0 +1,186 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ P R I M I T I V E S -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1998-2009, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++-- Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> -- ++------------------------------------------------------------------------------ ++ ++-- This version is for BSD operating systems using 32-bit time types. ++ ++with Interfaces.C; ++ ++package body System.OS_Primitives is ++ ++ -- ??? These definitions are duplicated from System.OS_Interface ++ -- because we don't want to depend on any package. Consider removing ++ -- these declarations in System.OS_Interface and move these ones in ++ -- the spec. ++ ++ subtype int is Interfaces.C.int; ++ subtype long is Interfaces.C.long; ++ ++ type time_t is new int; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, timezone); ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "nanosleep"); ++ ++ ----------- ++ -- Clock -- ++ ----------- ++ ++ function Clock return Duration is ++ type timeval is array (1 .. 2) of Long_Integer; ++ tzresult : aliased timezone; ++ ++ procedure timeval_to_duration ++ (T : not null access timeval; ++ sec : not null access Long_Integer; ++ usec : not null access Long_Integer); ++ pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); ++ ++ Micro : constant := 10**6; ++ sec : aliased Long_Integer; ++ usec : aliased Long_Integer; ++ TV : aliased timeval; ++ Result : int; ++ ++ function gettimeofday ++ (Tv : access timeval; ++ Tz : access timezone) return int; ++ pragma Import (C, gettimeofday, "gettimeofday"); ++ ++ pragma Unreferenced (Result); ++ begin ++ -- The return codes for gettimeofday are as follows (from man pages): ++ -- EPERM settimeofday is called by someone other than the superuser ++ -- EINVAL Timezone (or something else) is invalid ++ -- EFAULT One of tv or tz pointed outside accessible address space ++ ++ -- None of these codes signal a potential clock skew, hence the return ++ -- value is never checked. ++ ++ Result := gettimeofday (TV'Access, tzresult'Access); ++ timeval_to_duration (TV'Access, sec'Access, usec'Access); ++ return Duration (sec) + Duration (usec) / Micro; ++ end Clock; ++ ++ --------------------- ++ -- Monotonic_Clock -- ++ --------------------- ++ ++ function Monotonic_Clock return Duration renames Clock; ++ ++ ----------------- ++ -- To_Timespec -- ++ ----------------- ++ ++ function To_Timespec (D : Duration) return timespec; ++ ++ function To_Timespec (D : Duration) return timespec is ++ S : time_t; ++ F : Duration; ++ ++ begin ++ S := time_t (Long_Long_Integer (D)); ++ F := D - Duration (S); ++ ++ -- If F has negative value due to a round-up, adjust for positive F ++ -- value. ++ ++ if F < 0.0 then ++ S := S - 1; ++ F := F + 1.0; ++ end if; ++ ++ return ++ timespec'(tv_sec => S, ++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); ++ end To_Timespec; ++ ++ ----------------- ++ -- Timed_Delay -- ++ ----------------- ++ ++ procedure Timed_Delay ++ (Time : Duration; ++ Mode : Integer) ++ is ++ Request : aliased timespec; ++ Remaind : aliased timespec; ++ Rel_Time : Duration; ++ Abs_Time : Duration; ++ Base_Time : constant Duration := Clock; ++ Check_Time : Duration := Base_Time; ++ ++ Result : int; ++ pragma Unreferenced (Result); ++ ++ begin ++ if Mode = Relative then ++ Rel_Time := Time; ++ Abs_Time := Time + Check_Time; ++ else ++ Rel_Time := Time - Check_Time; ++ Abs_Time := Time; ++ end if; ++ ++ if Rel_Time > 0.0 then ++ loop ++ Request := To_Timespec (Rel_Time); ++ Result := nanosleep (Request'Access, Remaind'Access); ++ Check_Time := Clock; ++ ++ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; ++ ++ Rel_Time := Abs_Time - Check_Time; ++ end loop; ++ end if; ++ end Timed_Delay; ++ ++ ---------------- ++ -- Initialize -- ++ ---------------- ++ ++ procedure Initialize is ++ begin ++ null; ++ end Initialize; ++ ++end System.OS_Primitives; +--- /dev/null ++++ gcc/ada/s-osprim-bsd64.adb +@@ -0,0 +1,192 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ P R I M I T I V E S -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1998-2009, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++-- Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> -- ++------------------------------------------------------------------------------ ++ ++-- This version is for BSD operating systems using 64-bit time types. ++ ++with Interfaces.C; ++ ++package body System.OS_Primitives is ++ ++ -- ??? These definitions are duplicated from System.OS_Interface ++ -- because we don't want to depend on any package. Consider removing ++ -- these declarations in System.OS_Interface and move these ones in ++ -- the spec. ++ ++ subtype int is Interfaces.C.int; ++ subtype long is Interfaces.C.long; ++ subtype int64_t is Interfaces.Integer_64; ++ ++ type time_t is new int64_t; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, timezone); ++ ++ type timeval is record ++ tv_sec : time_t; ++ tv_usec : long; -- Not for NetBSD! FreeBSD/DragonFly ++ end record; ++ pragma Convention (C, timeval); ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "nanosleep"); ++ ++ ----------- ++ -- Clock -- ++ ----------- ++ ++ function Clock return Duration is ++ ++ procedure timeval_to_duration ++ (T : not null access timeval; ++ sec : not null access Long_Integer; ++ usec : not null access Long_Integer); ++ pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); ++ ++ Micro : constant := 10**6; ++ sec : aliased Long_Integer; ++ usec : aliased Long_Integer; ++ TV : aliased timeval; ++ tzresult : aliased timezone; ++ Result : int; ++ ++ function gettimeofday ++ (Tv : access timeval; ++ Tz : access timezone) return int; ++ pragma Import (C, gettimeofday, "gettimeofday"); ++ ++ pragma Unreferenced (Result); ++ begin ++ -- The return codes for gettimeofday are as follows (from man pages): ++ -- EPERM settimeofday is called by someone other than the superuser ++ -- EINVAL Timezone (or something else) is invalid ++ -- EFAULT One of tv or tz pointed outside accessible address space ++ ++ -- None of these codes signal a potential clock skew, hence the return ++ -- value is never checked. ++ ++ Result := gettimeofday (TV'Access, tzresult'Access); ++ timeval_to_duration (TV'Access, sec'Access, usec'Access); ++ return Duration (sec) + Duration (usec) / Micro; ++ end Clock; ++ ++ --------------------- ++ -- Monotonic_Clock -- ++ --------------------- ++ ++ function Monotonic_Clock return Duration renames Clock; ++ ++ ----------------- ++ -- To_Timespec -- ++ ----------------- ++ ++ function To_Timespec (D : Duration) return timespec; ++ ++ function To_Timespec (D : Duration) return timespec is ++ S : time_t; ++ F : Duration; ++ ++ begin ++ S := time_t (Long_Long_Integer (D)); ++ F := D - Duration (S); ++ ++ -- If F has negative value due to a round-up, adjust for positive F ++ -- value. ++ ++ if F < 0.0 then ++ S := S - 1; ++ F := F + 1.0; ++ end if; ++ ++ return ++ timespec'(tv_sec => S, ++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); ++ end To_Timespec; ++ ++ ----------------- ++ -- Timed_Delay -- ++ ----------------- ++ ++ procedure Timed_Delay ++ (Time : Duration; ++ Mode : Integer) ++ is ++ Request : aliased timespec; ++ Remaind : aliased timespec; ++ Rel_Time : Duration; ++ Abs_Time : Duration; ++ Base_Time : constant Duration := Clock; ++ Check_Time : Duration := Base_Time; ++ ++ Result : int; ++ pragma Unreferenced (Result); ++ ++ begin ++ if Mode = Relative then ++ Rel_Time := Time; ++ Abs_Time := Time + Check_Time; ++ else ++ Rel_Time := Time - Check_Time; ++ Abs_Time := Time; ++ end if; ++ ++ if Rel_Time > 0.0 then ++ loop ++ Request := To_Timespec (Rel_Time); ++ Result := nanosleep (Request'Access, Remaind'Access); ++ Check_Time := Clock; ++ ++ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; ++ ++ Rel_Time := Abs_Time - Check_Time; ++ end loop; ++ end if; ++ end Timed_Delay; ++ ++ ---------------- ++ -- Initialize -- ++ ---------------- ++ ++ procedure Initialize is ++ begin ++ null; ++ end Initialize; ++ ++end System.OS_Primitives; +--- /dev/null ++++ gcc/ada/s-osprim-bsdn6.adb +@@ -0,0 +1,193 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- ++-- -- ++-- S Y S T E M . O S _ P R I M I T I V E S -- ++-- -- ++-- B o d y -- ++-- -- ++-- Copyright (C) 1998-2009, Free Software Foundation, Inc. -- ++-- -- ++-- GNARL is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNARL was developed by the GNARL team at Florida State University. -- ++-- Extensive contributions were provided by Ada Core Technologies, Inc. -- ++-- -- ++-- Copyright (C) 2010, 2011 John Marino <www.dragonlace.net> -- ++------------------------------------------------------------------------------ ++ ++-- This version is for NetBSD 6.0+ ++-- It switches time type to 64 bits and uses compatibility functions ++ ++with Interfaces.C; ++ ++package body System.OS_Primitives is ++ ++ -- ??? These definitions are duplicated from System.OS_Interface ++ -- because we don't want to depend on any package. Consider removing ++ -- these declarations in System.OS_Interface and move these ones in ++ -- the spec. ++ ++ subtype int is Interfaces.C.int; ++ subtype long is Interfaces.C.long; ++ subtype int64_t is Interfaces.Integer_64; ++ ++ type time_t is new int64_t; ++ ++ type timespec is record ++ tv_sec : time_t; ++ tv_nsec : long; ++ end record; ++ pragma Convention (C, timespec); ++ ++ type timezone is record ++ tz_minuteswest : int; ++ tz_dsttime : int; ++ end record; ++ pragma Convention (C, timezone); ++ ++ type timeval is record ++ tv_sec : time_t; ++ tv_usec : int; ++ end record; ++ pragma Convention (C, timeval); ++ ++ function nanosleep (rqtp, rmtp : access timespec) return int; ++ pragma Import (C, nanosleep, "__nanosleep50"); ++ ++ ----------- ++ -- Clock -- ++ ----------- ++ ++ function Clock return Duration is ++ ++ procedure timeval_to_duration ++ (T : not null access timeval; ++ sec : not null access Long_Integer; ++ usec : not null access Long_Integer); ++ pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); ++ ++ Micro : constant := 10**6; ++ sec : aliased Long_Integer; ++ usec : aliased Long_Integer; ++ TV : aliased timeval; ++ tzresult : aliased timezone; ++ Result : int; ++ ++ function gettimeofday ++ (Tv : access timeval; ++ Tz : access timezone) return int; ++ pragma Import (C, gettimeofday, "__gettimeofday50"); ++ ++ pragma Unreferenced (Result); ++ begin ++ -- The return codes for gettimeofday are as follows (from man pages): ++ -- EPERM settimeofday is called by someone other than the superuser ++ -- EINVAL Timezone (or something else) is invalid ++ -- EFAULT One of tv or tz pointed outside accessible address space ++ ++ -- None of these codes signal a potential clock skew, hence the return ++ -- value is never checked. ++ ++ Result := gettimeofday (TV'Access, tzresult'Access); ++ timeval_to_duration (TV'Access, sec'Access, usec'Access); ++ return Duration (sec) + Duration (usec) / Micro; ++ end Clock; ++ ++ --------------------- ++ -- Monotonic_Clock -- ++ --------------------- ++ ++ function Monotonic_Clock return Duration renames Clock; ++ ++ ----------------- ++ -- To_Timespec -- ++ ----------------- ++ ++ function To_Timespec (D : Duration) return timespec; ++ ++ function To_Timespec (D : Duration) return timespec is ++ S : time_t; ++ F : Duration; ++ ++ begin ++ S := time_t (Long_Long_Integer (D)); ++ F := D - Duration (S); ++ ++ -- If F has negative value due to a round-up, adjust for positive F ++ -- value. ++ ++ if F < 0.0 then ++ S := S - 1; ++ F := F + 1.0; ++ end if; ++ ++ return ++ timespec'(tv_sec => S, ++ tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); ++ end To_Timespec; ++ ++ ----------------- ++ -- Timed_Delay -- ++ ----------------- ++ ++ procedure Timed_Delay ++ (Time : Duration; ++ Mode : Integer) ++ is ++ Request : aliased timespec; ++ Remaind : aliased timespec; ++ Rel_Time : Duration; ++ Abs_Time : Duration; ++ Base_Time : constant Duration := Clock; ++ Check_Time : Duration := Base_Time; ++ ++ Result : int; ++ pragma Unreferenced (Result); ++ ++ begin ++ if Mode = Relative then ++ Rel_Time := Time; ++ Abs_Time := Time + Check_Time; ++ else ++ Rel_Time := Time - Check_Time; ++ Abs_Time := Time; ++ end if; ++ ++ if Rel_Time > 0.0 then ++ loop ++ Request := To_Timespec (Rel_Time); ++ Result := nanosleep (Request'Access, Remaind'Access); ++ Check_Time := Clock; ++ ++ exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; ++ ++ Rel_Time := Abs_Time - Check_Time; ++ end loop; ++ end if; ++ end Timed_Delay; ++ ++ ---------------- ++ -- Initialize -- ++ ---------------- ++ ++ procedure Initialize is ++ begin ++ null; ++ end Initialize; ++ ++end System.OS_Primitives; +--- gcc/ada/s-rannum.adb.orig ++++ gcc/ada/s-rannum.adb +@@ -290,7 +290,7 @@ + X : Real; -- Scaled mantissa + R : Unsigned_32; -- Supply of random bits + R_Bits : Natural; -- Number of bits left in R +- K : Bit_Count; -- Next decrement to exponent ++ K : Bit_Count := 0; -- Next decrement to exponent + + begin + Mantissa := Random (Gen) / 2**Extra_Bits; +--- /dev/null ++++ gcc/ada/signal_android.c +@@ -0,0 +1,77 @@ ++/* ++ * Copyright (C) 2008 The Android Open Source Project ++ * 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. ++ * ++ * 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 OWNER 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 <limits.h> /* For LONG_BIT */ ++#include <string.h> /* For memset() */ ++ ++typedef unsigned long sigset_t; ++ ++ ++int ++sigismember(sigset_t *set, int signum) ++{ ++ unsigned long *local_set = (unsigned long *)set; ++ signum--; ++ return (int)((local_set[signum/LONG_BIT] >> (signum%LONG_BIT)) & 1); ++} ++ ++ ++int ++sigaddset(sigset_t *set, int signum) ++{ ++ unsigned long *local_set = (unsigned long *)set; ++ signum--; ++ local_set[signum/LONG_BIT] |= 1UL << (signum%LONG_BIT); ++ return 0; ++} ++ ++ ++int ++sigdelset(sigset_t *set, int signum) ++{ ++ unsigned long *local_set = (unsigned long *)set; ++ signum--; ++ local_set[signum/LONG_BIT] &= ~(1UL << (signum%LONG_BIT)); ++ return 0; ++} ++ ++ ++int ++sigemptyset(sigset_t *set) ++{ ++ memset(set, 0, sizeof *set); ++ return 0; ++} ++ ++ ++int ++sigfillset(sigset_t *set) ++{ ++ memset(set, ~0, sizeof *set); ++ return 0; ++} ++ +--- gcc/ada/sysdep.c.orig ++++ gcc/ada/sysdep.c +@@ -256,6 +256,7 @@ + || defined (__MACHTEN__) || defined (__hpux__) || defined (_AIX) \ + || (defined (__svr4__) && defined (i386)) || defined (__Lynx__) \ + || defined (__CYGWIN__) || defined (__FreeBSD__) || defined (__OpenBSD__) \ ++ || defined (__DragonFly__) \ + || defined (__GLIBC__) || defined (__APPLE__) + + #ifdef __MINGW32__ +@@ -314,6 +315,7 @@ + || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \ + || defined (_AIX) || (defined (__svr4__) && defined (i386)) \ + || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \ ++ || defined (__DragonFly__) \ + || defined (__GLIBC__) || defined (__APPLE__) + char c; + int nread; +@@ -334,6 +336,7 @@ + || defined (__osf__) || defined (__MACHTEN__) || defined (__hpux__) \ + || defined (_AIX) || (defined (__svr4__) && defined (i386)) \ + || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \ ++ || defined (__DragonFly__) \ + || defined (__GLIBC__) || defined (__APPLE__) + eof_ch = termios_rec.c_cc[VEOF]; + +@@ -845,8 +848,12 @@ + /* Darwin, Free BSD, Linux, Tru64, where component tm_gmtoff is present in + struct tm */ + +-#elif defined (__APPLE__) || defined (__FreeBSD__) || defined (linux) ||\ +- (defined (__alpha__) && defined (__osf__)) || defined (__GLIBC__) ++#elif defined (__APPLE__) \ ++ || defined (__FreeBSD__) \ ++ || defined (__DragonFly__) \ ++ || defined (linux) \ ++ || (defined (__alpha__) && defined (__osf__)) \ ++ || defined (__GLIBC__) + { + localtime_r (timer, &tp); + *off = tp.tm_gmtoff; +--- /dev/null ++++ gcc/ada/system-dragonfly-x86.ads +@@ -0,0 +1,143 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME COMPONENTS -- ++-- -- ++-- S Y S T E M -- ++-- -- ++-- S p e c -- ++-- (DragonFly BSD/x86 Version) -- ++-- -- ++-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- -- ++-- This specification is derived from the Ada Reference Manual for use with -- ++-- GNAT. The copyright notice above, and the license provisions that follow -- ++-- apply solely to the contents of the part following the private keyword. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++package System is ++ pragma Pure; ++ -- Note that we take advantage of the implementation permission to make ++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada ++ -- 2005, this is Pure in any case (AI-362). ++ ++ type Name is (SYSTEM_NAME_GNAT); ++ System_Name : constant Name := SYSTEM_NAME_GNAT; ++ ++ -- System-Dependent Named Numbers ++ ++ Min_Int : constant := Long_Long_Integer'First; ++ Max_Int : constant := Long_Long_Integer'Last; ++ ++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; ++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; ++ ++ Max_Base_Digits : constant := Long_Long_Float'Digits; ++ Max_Digits : constant := Long_Long_Float'Digits; ++ ++ Max_Mantissa : constant := 63; ++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa); ++ ++ Tick : constant := 0.000_001; ++ ++ -- Storage-related Declarations ++ ++ type Address is private; ++ pragma Preelaborable_Initialization (Address); ++ Null_Address : constant Address; ++ ++ Storage_Unit : constant := 8; ++ Word_Size : constant := 32; ++ Memory_Size : constant := 2 ** 32; ++ ++ -- Address comparison ++ ++ function "<" (Left, Right : Address) return Boolean; ++ function "<=" (Left, Right : Address) return Boolean; ++ function ">" (Left, Right : Address) return Boolean; ++ function ">=" (Left, Right : Address) return Boolean; ++ function "=" (Left, Right : Address) return Boolean; ++ ++ pragma Import (Intrinsic, "<"); ++ pragma Import (Intrinsic, "<="); ++ pragma Import (Intrinsic, ">"); ++ pragma Import (Intrinsic, ">="); ++ pragma Import (Intrinsic, "="); ++ ++ -- Other System-Dependent Declarations ++ ++ type Bit_Order is (High_Order_First, Low_Order_First); ++ Default_Bit_Order : constant Bit_Order := Low_Order_First; ++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning ++ ++ -- Priority-related Declarations (RM D.1) ++ ++ Max_Priority : constant Positive := 30; ++ Max_Interrupt_Priority : constant Positive := 31; ++ ++ subtype Any_Priority is Integer range 0 .. 31; ++ subtype Priority is Any_Priority range 0 .. 30; ++ subtype Interrupt_Priority is Any_Priority range 31 .. 31; ++ ++ Default_Priority : constant Priority := 15; ++ ++private ++ ++ type Address is mod Memory_Size; ++ Null_Address : constant Address := 0; ++ ++ -------------------------------------- ++ -- System Implementation Parameters -- ++ -------------------------------------- ++ ++ -- These parameters provide information about the target that is used ++ -- by the compiler. They are in the private part of System, where they ++ -- can be accessed using the special circuitry in the Targparm unit ++ -- whose source should be consulted for more detailed descriptions ++ -- of the individual switch values. ++ ++ Backend_Divide_Checks : constant Boolean := False; ++ Backend_Overflow_Checks : constant Boolean := True; ++ Command_Line_Args : constant Boolean := True; ++ Configurable_Run_Time : constant Boolean := False; ++ Denorm : constant Boolean := True; ++ Duration_32_Bits : constant Boolean := False; ++ Exit_Status_Supported : constant Boolean := True; ++ Fractional_Fixed_Ops : constant Boolean := False; ++ Frontend_Layout : constant Boolean := False; ++ Machine_Overflows : constant Boolean := False; ++ Machine_Rounds : constant Boolean := True; ++ Preallocated_Stacks : constant Boolean := False; ++ Signed_Zeros : constant Boolean := True; ++ Stack_Check_Default : constant Boolean := False; ++ Stack_Check_Probes : constant Boolean := True; ++ Stack_Check_Limits : constant Boolean := False; ++ Support_Aggregates : constant Boolean := True; ++ Support_Composite_Assign : constant Boolean := True; ++ Support_Composite_Compare : constant Boolean := True; ++ Support_Long_Shifts : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := False; ++ Suppress_Standard_Library : constant Boolean := False; ++ Use_Ada_Main_Program_Name : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := True; ++ ++end System; +--- /dev/null ++++ gcc/ada/system-dragonfly-x86_64.ads +@@ -0,0 +1,143 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME COMPONENTS -- ++-- -- ++-- S Y S T E M -- ++-- -- ++-- S p e c -- ++-- (DragonFly BSD/x86_64 Version) -- ++-- -- ++-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- -- ++-- This specification is derived from the Ada Reference Manual for use with -- ++-- GNAT. The copyright notice above, and the license provisions that follow -- ++-- apply solely to the contents of the part following the private keyword. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++package System is ++ pragma Pure; ++ -- Note that we take advantage of the implementation permission to make ++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada ++ -- 2005, this is Pure in any case (AI-362). ++ ++ type Name is (SYSTEM_NAME_GNAT); ++ System_Name : constant Name := SYSTEM_NAME_GNAT; ++ ++ -- System-Dependent Named Numbers ++ ++ Min_Int : constant := Long_Long_Integer'First; ++ Max_Int : constant := Long_Long_Integer'Last; ++ ++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; ++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; ++ ++ Max_Base_Digits : constant := Long_Long_Float'Digits; ++ Max_Digits : constant := Long_Long_Float'Digits; ++ ++ Max_Mantissa : constant := 63; ++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa); ++ ++ Tick : constant := 0.000_001; ++ ++ -- Storage-related Declarations ++ ++ type Address is private; ++ pragma Preelaborable_Initialization (Address); ++ Null_Address : constant Address; ++ ++ Storage_Unit : constant := 8; ++ Word_Size : constant := 64; ++ Memory_Size : constant := 2 ** 64; ++ ++ -- Address comparison ++ ++ function "<" (Left, Right : Address) return Boolean; ++ function "<=" (Left, Right : Address) return Boolean; ++ function ">" (Left, Right : Address) return Boolean; ++ function ">=" (Left, Right : Address) return Boolean; ++ function "=" (Left, Right : Address) return Boolean; ++ ++ pragma Import (Intrinsic, "<"); ++ pragma Import (Intrinsic, "<="); ++ pragma Import (Intrinsic, ">"); ++ pragma Import (Intrinsic, ">="); ++ pragma Import (Intrinsic, "="); ++ ++ -- Other System-Dependent Declarations ++ ++ type Bit_Order is (High_Order_First, Low_Order_First); ++ Default_Bit_Order : constant Bit_Order := Low_Order_First; ++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning ++ ++ -- Priority-related Declarations (RM D.1) ++ ++ Max_Priority : constant Positive := 30; ++ Max_Interrupt_Priority : constant Positive := 31; ++ ++ subtype Any_Priority is Integer range 0 .. 31; ++ subtype Priority is Any_Priority range 0 .. 30; ++ subtype Interrupt_Priority is Any_Priority range 31 .. 31; ++ ++ Default_Priority : constant Priority := 15; ++ ++private ++ ++ type Address is mod Memory_Size; ++ Null_Address : constant Address := 0; ++ ++ -------------------------------------- ++ -- System Implementation Parameters -- ++ -------------------------------------- ++ ++ -- These parameters provide information about the target that is used ++ -- by the compiler. They are in the private part of System, where they ++ -- can be accessed using the special circuitry in the Targparm unit ++ -- whose source should be consulted for more detailed descriptions ++ -- of the individual switch values. ++ ++ Backend_Divide_Checks : constant Boolean := False; ++ Backend_Overflow_Checks : constant Boolean := True; ++ Command_Line_Args : constant Boolean := True; ++ Configurable_Run_Time : constant Boolean := False; ++ Denorm : constant Boolean := True; ++ Duration_32_Bits : constant Boolean := False; ++ Exit_Status_Supported : constant Boolean := True; ++ Fractional_Fixed_Ops : constant Boolean := False; ++ Frontend_Layout : constant Boolean := False; ++ Machine_Overflows : constant Boolean := False; ++ Machine_Rounds : constant Boolean := True; ++ Preallocated_Stacks : constant Boolean := False; ++ Signed_Zeros : constant Boolean := True; ++ Stack_Check_Default : constant Boolean := False; ++ Stack_Check_Probes : constant Boolean := True; ++ Stack_Check_Limits : constant Boolean := False; ++ Support_Aggregates : constant Boolean := True; ++ Support_Composite_Assign : constant Boolean := True; ++ Support_Composite_Compare : constant Boolean := True; ++ Support_Long_Shifts : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := False; ++ Suppress_Standard_Library : constant Boolean := False; ++ Use_Ada_Main_Program_Name : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := True; ++ ++end System; +--- /dev/null ++++ gcc/ada/system-netbsd-x86.ads +@@ -0,0 +1,143 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME COMPONENTS -- ++-- -- ++-- S Y S T E M -- ++-- -- ++-- S p e c -- ++-- (NetBSD/x86 Version) -- ++-- -- ++-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- -- ++-- This specification is derived from the Ada Reference Manual for use with -- ++-- GNAT. The copyright notice above, and the license provisions that follow -- ++-- apply solely to the contents of the part following the private keyword. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++package System is ++ pragma Pure; ++ -- Note that we take advantage of the implementation permission to make ++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada ++ -- 2005, this is Pure in any case (AI-362). ++ ++ type Name is (SYSTEM_NAME_GNAT); ++ System_Name : constant Name := SYSTEM_NAME_GNAT; ++ ++ -- System-Dependent Named Numbers ++ ++ Min_Int : constant := Long_Long_Integer'First; ++ Max_Int : constant := Long_Long_Integer'Last; ++ ++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; ++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; ++ ++ Max_Base_Digits : constant := Long_Long_Float'Digits; ++ Max_Digits : constant := Long_Long_Float'Digits; ++ ++ Max_Mantissa : constant := 63; ++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa); ++ ++ Tick : constant := 0.000_001; ++ ++ -- Storage-related Declarations ++ ++ type Address is private; ++ pragma Preelaborable_Initialization (Address); ++ Null_Address : constant Address; ++ ++ Storage_Unit : constant := 8; ++ Word_Size : constant := 32; ++ Memory_Size : constant := 2 ** 32; ++ ++ -- Address comparison ++ ++ function "<" (Left, Right : Address) return Boolean; ++ function "<=" (Left, Right : Address) return Boolean; ++ function ">" (Left, Right : Address) return Boolean; ++ function ">=" (Left, Right : Address) return Boolean; ++ function "=" (Left, Right : Address) return Boolean; ++ ++ pragma Import (Intrinsic, "<"); ++ pragma Import (Intrinsic, "<="); ++ pragma Import (Intrinsic, ">"); ++ pragma Import (Intrinsic, ">="); ++ pragma Import (Intrinsic, "="); ++ ++ -- Other System-Dependent Declarations ++ ++ type Bit_Order is (High_Order_First, Low_Order_First); ++ Default_Bit_Order : constant Bit_Order := Low_Order_First; ++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning ++ ++ -- Priority-related Declarations (RM D.1) ++ ++ Max_Priority : constant Positive := 30; ++ Max_Interrupt_Priority : constant Positive := 31; ++ ++ subtype Any_Priority is Integer range 0 .. 31; ++ subtype Priority is Any_Priority range 0 .. 30; ++ subtype Interrupt_Priority is Any_Priority range 31 .. 31; ++ ++ Default_Priority : constant Priority := 15; ++ ++private ++ ++ type Address is mod Memory_Size; ++ Null_Address : constant Address := 0; ++ ++ -------------------------------------- ++ -- System Implementation Parameters -- ++ -------------------------------------- ++ ++ -- These parameters provide information about the target that is used ++ -- by the compiler. They are in the private part of System, where they ++ -- can be accessed using the special circuitry in the Targparm unit ++ -- whose source should be consulted for more detailed descriptions ++ -- of the individual switch values. ++ ++ Backend_Divide_Checks : constant Boolean := False; ++ Backend_Overflow_Checks : constant Boolean := True; ++ Command_Line_Args : constant Boolean := True; ++ Configurable_Run_Time : constant Boolean := False; ++ Denorm : constant Boolean := True; ++ Duration_32_Bits : constant Boolean := False; ++ Exit_Status_Supported : constant Boolean := True; ++ Fractional_Fixed_Ops : constant Boolean := False; ++ Frontend_Layout : constant Boolean := False; ++ Machine_Overflows : constant Boolean := False; ++ Machine_Rounds : constant Boolean := True; ++ Preallocated_Stacks : constant Boolean := False; ++ Signed_Zeros : constant Boolean := True; ++ Stack_Check_Default : constant Boolean := False; ++ Stack_Check_Probes : constant Boolean := True; ++ Stack_Check_Limits : constant Boolean := False; ++ Support_Aggregates : constant Boolean := True; ++ Support_Composite_Assign : constant Boolean := True; ++ Support_Composite_Compare : constant Boolean := True; ++ Support_Long_Shifts : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := False; ++ Suppress_Standard_Library : constant Boolean := False; ++ Use_Ada_Main_Program_Name : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := True; ++ ++end System; +--- /dev/null ++++ gcc/ada/system-netbsd-x86_64.ads +@@ -0,0 +1,143 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME COMPONENTS -- ++-- -- ++-- S Y S T E M -- ++-- -- ++-- S p e c -- ++-- (NetBSD/x86_64 Version) -- ++-- -- ++-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- -- ++-- This specification is derived from the Ada Reference Manual for use with -- ++-- GNAT. The copyright notice above, and the license provisions that follow -- ++-- apply solely to the contents of the part following the private keyword. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++package System is ++ pragma Pure; ++ -- Note that we take advantage of the implementation permission to make ++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada ++ -- 2005, this is Pure in any case (AI-362). ++ ++ type Name is (SYSTEM_NAME_GNAT); ++ System_Name : constant Name := SYSTEM_NAME_GNAT; ++ ++ -- System-Dependent Named Numbers ++ ++ Min_Int : constant := Long_Long_Integer'First; ++ Max_Int : constant := Long_Long_Integer'Last; ++ ++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; ++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; ++ ++ Max_Base_Digits : constant := Long_Long_Float'Digits; ++ Max_Digits : constant := Long_Long_Float'Digits; ++ ++ Max_Mantissa : constant := 63; ++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa); ++ ++ Tick : constant := 0.000_001; ++ ++ -- Storage-related Declarations ++ ++ type Address is private; ++ pragma Preelaborable_Initialization (Address); ++ Null_Address : constant Address; ++ ++ Storage_Unit : constant := 8; ++ Word_Size : constant := 64; ++ Memory_Size : constant := 2 ** 64; ++ ++ -- Address comparison ++ ++ function "<" (Left, Right : Address) return Boolean; ++ function "<=" (Left, Right : Address) return Boolean; ++ function ">" (Left, Right : Address) return Boolean; ++ function ">=" (Left, Right : Address) return Boolean; ++ function "=" (Left, Right : Address) return Boolean; ++ ++ pragma Import (Intrinsic, "<"); ++ pragma Import (Intrinsic, "<="); ++ pragma Import (Intrinsic, ">"); ++ pragma Import (Intrinsic, ">="); ++ pragma Import (Intrinsic, "="); ++ ++ -- Other System-Dependent Declarations ++ ++ type Bit_Order is (High_Order_First, Low_Order_First); ++ Default_Bit_Order : constant Bit_Order := Low_Order_First; ++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning ++ ++ -- Priority-related Declarations (RM D.1) ++ ++ Max_Priority : constant Positive := 30; ++ Max_Interrupt_Priority : constant Positive := 31; ++ ++ subtype Any_Priority is Integer range 0 .. 31; ++ subtype Priority is Any_Priority range 0 .. 30; ++ subtype Interrupt_Priority is Any_Priority range 31 .. 31; ++ ++ Default_Priority : constant Priority := 15; ++ ++private ++ ++ type Address is mod Memory_Size; ++ Null_Address : constant Address := 0; ++ ++ -------------------------------------- ++ -- System Implementation Parameters -- ++ -------------------------------------- ++ ++ -- These parameters provide information about the target that is used ++ -- by the compiler. They are in the private part of System, where they ++ -- can be accessed using the special circuitry in the Targparm unit ++ -- whose source should be consulted for more detailed descriptions ++ -- of the individual switch values. ++ ++ Backend_Divide_Checks : constant Boolean := False; ++ Backend_Overflow_Checks : constant Boolean := True; ++ Command_Line_Args : constant Boolean := True; ++ Configurable_Run_Time : constant Boolean := False; ++ Denorm : constant Boolean := True; ++ Duration_32_Bits : constant Boolean := False; ++ Exit_Status_Supported : constant Boolean := True; ++ Fractional_Fixed_Ops : constant Boolean := False; ++ Frontend_Layout : constant Boolean := False; ++ Machine_Overflows : constant Boolean := False; ++ Machine_Rounds : constant Boolean := True; ++ Preallocated_Stacks : constant Boolean := False; ++ Signed_Zeros : constant Boolean := True; ++ Stack_Check_Default : constant Boolean := False; ++ Stack_Check_Probes : constant Boolean := True; ++ Stack_Check_Limits : constant Boolean := False; ++ Support_Aggregates : constant Boolean := True; ++ Support_Composite_Assign : constant Boolean := True; ++ Support_Composite_Compare : constant Boolean := True; ++ Support_Long_Shifts : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := False; ++ Suppress_Standard_Library : constant Boolean := False; ++ Use_Ada_Main_Program_Name : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := True; ++ ++end System; +--- /dev/null ++++ gcc/ada/system-openbsd-x86.ads +@@ -0,0 +1,143 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME COMPONENTS -- ++-- -- ++-- S Y S T E M -- ++-- -- ++-- S p e c -- ++-- (OpenBSD/x86 Version) -- ++-- -- ++-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- -- ++-- This specification is derived from the Ada Reference Manual for use with -- ++-- GNAT. The copyright notice above, and the license provisions that follow -- ++-- apply solely to the contents of the part following the private keyword. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++package System is ++ pragma Pure; ++ -- Note that we take advantage of the implementation permission to make ++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada ++ -- 2005, this is Pure in any case (AI-362). ++ ++ type Name is (SYSTEM_NAME_GNAT); ++ System_Name : constant Name := SYSTEM_NAME_GNAT; ++ ++ -- System-Dependent Named Numbers ++ ++ Min_Int : constant := Long_Long_Integer'First; ++ Max_Int : constant := Long_Long_Integer'Last; ++ ++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; ++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; ++ ++ Max_Base_Digits : constant := Long_Long_Float'Digits; ++ Max_Digits : constant := Long_Long_Float'Digits; ++ ++ Max_Mantissa : constant := 63; ++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa); ++ ++ Tick : constant := 0.000_001; ++ ++ -- Storage-related Declarations ++ ++ type Address is private; ++ pragma Preelaborable_Initialization (Address); ++ Null_Address : constant Address; ++ ++ Storage_Unit : constant := 8; ++ Word_Size : constant := 32; ++ Memory_Size : constant := 2 ** 32; ++ ++ -- Address comparison ++ ++ function "<" (Left, Right : Address) return Boolean; ++ function "<=" (Left, Right : Address) return Boolean; ++ function ">" (Left, Right : Address) return Boolean; ++ function ">=" (Left, Right : Address) return Boolean; ++ function "=" (Left, Right : Address) return Boolean; ++ ++ pragma Import (Intrinsic, "<"); ++ pragma Import (Intrinsic, "<="); ++ pragma Import (Intrinsic, ">"); ++ pragma Import (Intrinsic, ">="); ++ pragma Import (Intrinsic, "="); ++ ++ -- Other System-Dependent Declarations ++ ++ type Bit_Order is (High_Order_First, Low_Order_First); ++ Default_Bit_Order : constant Bit_Order := Low_Order_First; ++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning ++ ++ -- Priority-related Declarations (RM D.1) ++ ++ Max_Priority : constant Positive := 30; ++ Max_Interrupt_Priority : constant Positive := 31; ++ ++ subtype Any_Priority is Integer range 0 .. 31; ++ subtype Priority is Any_Priority range 0 .. 30; ++ subtype Interrupt_Priority is Any_Priority range 31 .. 31; ++ ++ Default_Priority : constant Priority := 15; ++ ++private ++ ++ type Address is mod Memory_Size; ++ Null_Address : constant Address := 0; ++ ++ -------------------------------------- ++ -- System Implementation Parameters -- ++ -------------------------------------- ++ ++ -- These parameters provide information about the target that is used ++ -- by the compiler. They are in the private part of System, where they ++ -- can be accessed using the special circuitry in the Targparm unit ++ -- whose source should be consulted for more detailed descriptions ++ -- of the individual switch values. ++ ++ Backend_Divide_Checks : constant Boolean := False; ++ Backend_Overflow_Checks : constant Boolean := True; ++ Command_Line_Args : constant Boolean := True; ++ Configurable_Run_Time : constant Boolean := False; ++ Denorm : constant Boolean := True; ++ Duration_32_Bits : constant Boolean := False; ++ Exit_Status_Supported : constant Boolean := True; ++ Fractional_Fixed_Ops : constant Boolean := False; ++ Frontend_Layout : constant Boolean := False; ++ Machine_Overflows : constant Boolean := False; ++ Machine_Rounds : constant Boolean := True; ++ Preallocated_Stacks : constant Boolean := False; ++ Signed_Zeros : constant Boolean := True; ++ Stack_Check_Default : constant Boolean := False; ++ Stack_Check_Probes : constant Boolean := True; ++ Stack_Check_Limits : constant Boolean := False; ++ Support_Aggregates : constant Boolean := True; ++ Support_Composite_Assign : constant Boolean := True; ++ Support_Composite_Compare : constant Boolean := True; ++ Support_Long_Shifts : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := True; ++ Suppress_Standard_Library : constant Boolean := False; ++ Use_Ada_Main_Program_Name : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := False; ++ ++end System; +--- /dev/null ++++ gcc/ada/system-openbsd-x86_64.ads +@@ -0,0 +1,143 @@ ++------------------------------------------------------------------------------ ++-- -- ++-- GNAT RUN-TIME COMPONENTS -- ++-- -- ++-- S Y S T E M -- ++-- -- ++-- S p e c -- ++-- (OpenBSD/x86_64 Version) -- ++-- -- ++-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- ++-- -- ++-- This specification is derived from the Ada Reference Manual for use with -- ++-- GNAT. The copyright notice above, and the license provisions that follow -- ++-- apply solely to the contents of the part following the private keyword. -- ++-- -- ++-- GNAT is free software; you can redistribute it and/or modify it under -- ++-- terms of the GNU General Public License as published by the Free Soft- -- ++-- ware Foundation; either version 3, or (at your option) any later ver- -- ++-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- ++-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- ++-- or FITNESS FOR A PARTICULAR PURPOSE. -- ++-- -- ++-- As a special exception under Section 7 of GPL version 3, you are granted -- ++-- additional permissions described in the GCC Runtime Library Exception, -- ++-- version 3.1, as published by the Free Software Foundation. -- ++-- -- ++-- You should have received a copy of the GNU General Public License and -- ++-- a copy of the GCC Runtime Library Exception along with this program; -- ++-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- ++-- <http://www.gnu.org/licenses/>. -- ++-- -- ++-- GNAT was originally developed by the GNAT team at New York University. -- ++-- Extensive contributions were provided by Ada Core Technologies Inc. -- ++-- -- ++------------------------------------------------------------------------------ ++ ++package System is ++ pragma Pure; ++ -- Note that we take advantage of the implementation permission to make ++ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada ++ -- 2005, this is Pure in any case (AI-362). ++ ++ type Name is (SYSTEM_NAME_GNAT); ++ System_Name : constant Name := SYSTEM_NAME_GNAT; ++ ++ -- System-Dependent Named Numbers ++ ++ Min_Int : constant := Long_Long_Integer'First; ++ Max_Int : constant := Long_Long_Integer'Last; ++ ++ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; ++ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; ++ ++ Max_Base_Digits : constant := Long_Long_Float'Digits; ++ Max_Digits : constant := Long_Long_Float'Digits; ++ ++ Max_Mantissa : constant := 63; ++ Fine_Delta : constant := 2.0 ** (-Max_Mantissa); ++ ++ Tick : constant := 0.000_001; ++ ++ -- Storage-related Declarations ++ ++ type Address is private; ++ pragma Preelaborable_Initialization (Address); ++ Null_Address : constant Address; ++ ++ Storage_Unit : constant := 8; ++ Word_Size : constant := 64; ++ Memory_Size : constant := 2 ** 64; ++ ++ -- Address comparison ++ ++ function "<" (Left, Right : Address) return Boolean; ++ function "<=" (Left, Right : Address) return Boolean; ++ function ">" (Left, Right : Address) return Boolean; ++ function ">=" (Left, Right : Address) return Boolean; ++ function "=" (Left, Right : Address) return Boolean; ++ ++ pragma Import (Intrinsic, "<"); ++ pragma Import (Intrinsic, "<="); ++ pragma Import (Intrinsic, ">"); ++ pragma Import (Intrinsic, ">="); ++ pragma Import (Intrinsic, "="); ++ ++ -- Other System-Dependent Declarations ++ ++ type Bit_Order is (High_Order_First, Low_Order_First); ++ Default_Bit_Order : constant Bit_Order := Low_Order_First; ++ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning ++ ++ -- Priority-related Declarations (RM D.1) ++ ++ Max_Priority : constant Positive := 30; ++ Max_Interrupt_Priority : constant Positive := 31; ++ ++ subtype Any_Priority is Integer range 0 .. 31; ++ subtype Priority is Any_Priority range 0 .. 30; ++ subtype Interrupt_Priority is Any_Priority range 31 .. 31; ++ ++ Default_Priority : constant Priority := 15; ++ ++private ++ ++ type Address is mod Memory_Size; ++ Null_Address : constant Address := 0; ++ ++ -------------------------------------- ++ -- System Implementation Parameters -- ++ -------------------------------------- ++ ++ -- These parameters provide information about the target that is used ++ -- by the compiler. They are in the private part of System, where they ++ -- can be accessed using the special circuitry in the Targparm unit ++ -- whose source should be consulted for more detailed descriptions ++ -- of the individual switch values. ++ ++ Backend_Divide_Checks : constant Boolean := False; ++ Backend_Overflow_Checks : constant Boolean := True; ++ Command_Line_Args : constant Boolean := True; ++ Configurable_Run_Time : constant Boolean := False; ++ Denorm : constant Boolean := True; ++ Duration_32_Bits : constant Boolean := False; ++ Exit_Status_Supported : constant Boolean := True; ++ Fractional_Fixed_Ops : constant Boolean := False; ++ Frontend_Layout : constant Boolean := False; ++ Machine_Overflows : constant Boolean := False; ++ Machine_Rounds : constant Boolean := True; ++ Preallocated_Stacks : constant Boolean := False; ++ Signed_Zeros : constant Boolean := True; ++ Stack_Check_Default : constant Boolean := False; ++ Stack_Check_Probes : constant Boolean := True; ++ Stack_Check_Limits : constant Boolean := False; ++ Support_Aggregates : constant Boolean := True; ++ Support_Composite_Assign : constant Boolean := True; ++ Support_Composite_Compare : constant Boolean := True; ++ Support_Long_Shifts : constant Boolean := True; ++ Always_Compatible_Rep : constant Boolean := True; ++ Suppress_Standard_Library : constant Boolean := False; ++ Use_Ada_Main_Program_Name : constant Boolean := False; ++ ZCX_By_Default : constant Boolean := False; ++ ++end System; +--- gcc/ada/tracebak.c.orig ++++ gcc/ada/tracebak.c +@@ -217,6 +217,23 @@ + #error Unhandled darwin architecture. + #endif + ++/*---------------------------- x86 *BSD --------------------------------*/ ++ ++#elif defined (__i386__) && \ ++ ( defined (__NetBSD__) \ ++ || defined (__FreeBSD__) \ ++ || defined (__OpenBSD__) \ ++ || defined (__DragonFly__) ) ++ ++#define USE_GCC_UNWINDER ++/* The generic unwinder is not used for this target because the default ++ implementation doesn't unwind on the BSD platforms. AMD64 targets use the ++ gcc unwinder for all platforms, so let's keep i386 consistent with that. ++*/ ++ ++#define PC_ADJUST -2 ++/* The minimum size of call instructions on this architecture is 2 bytes */ ++ + /*------------------------ PPC AIX/Older Darwin -------------------------*/ + #elif ((defined (_POWER) && defined (_AIX)) || \ + (defined (__ppc__) && defined (__APPLE__))) +--- gcc/ada/gcc-interface/Makefile.in.orig ++++ gcc/ada/gcc-interface/Makefile.in +@@ -1037,6 +1037,7 @@ + ifeq ($(strip $(filter-out %86 %x86_64 solaris2%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS_COMMON = \ + a-intnam.ads<a-intnam-solaris.ads \ ++ g-trasym.adb<g-trasym-bsd.adb \ + s-inmaop.adb<s-inmaop-posix.adb \ + s-intman.adb<s-intman-solaris.adb \ + s-mudido.adb<s-mudido-affinity.adb \ +@@ -1205,14 +1206,21 @@ + LIBRARY_VERSION := $(LIB_VERSION) + endif + ++ ++# FREEBSD i386 + ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS = \ ++ a-exetim.adb<a-exetim-posix.adb \ ++ a-exetim.ads<a-exetim-default.ads \ + a-intnam.ads<a-intnam-freebsd.ads \ ++ g-socthi.adb<g-socthi-bsd.adb \ ++ g-trasym.adb<g-trasym-bsd.adb \ + s-inmaop.adb<s-inmaop-posix.adb \ + s-intman.adb<s-intman-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ + s-osinte.adb<s-osinte-freebsd.adb \ +- s-osinte.ads<s-osinte-freebsd.ads \ +- s-osprim.adb<s-osprim-posix.adb \ ++ s-osinte.ads<s-osinte-freebsd32.ads \ ++ s-osprim.adb<s-osprim-bsd32.adb \ + s-taprop.adb<s-taprop-posix.adb \ + s-taspri.ads<s-taspri-posix.ads \ + s-tpopsp.adb<s-tpopsp-posix.adb \ +@@ -1220,10 +1228,11 @@ + $(X86_TARGET_PAIRS) \ + system.ads<system-freebsd-x86.ads + +- TOOLS_TARGET_PAIRS = \ +- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb + GNATLIB_SHARED = gnatlib-shared-dual + ++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o ++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o ++ + EH_MECHANISM=-gcc + THREADSLIB= -lpthread + GMEM_LIB = gmemlib +@@ -1231,26 +1240,101 @@ + MISCLIB = -lutil + endif + +-ifeq ($(strip $(filter-out %86_64 freebsd%,$(arch) $(osys))),) ++ ++# FREEBSD AMD64 ++ifeq ($(strip $(filter-out x86_64 freebsd%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS = \ ++ a-exetim.adb<a-exetim-posix.adb \ ++ a-exetim.ads<a-exetim-default.ads \ + a-intnam.ads<a-intnam-freebsd.ads \ ++ g-socthi.adb<g-socthi-bsd.adb \ ++ g-trasym.adb<g-trasym-bsd.adb \ + s-inmaop.adb<s-inmaop-posix.adb \ + s-intman.adb<s-intman-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ + s-osinte.adb<s-osinte-freebsd.adb \ +- s-osinte.ads<s-osinte-freebsd.ads \ +- s-osprim.adb<s-osprim-posix.adb \ ++ s-osinte.ads<s-osinte-freebsd64.ads \ ++ s-osprim.adb<s-osprim-bsd64.adb \ + s-taprop.adb<s-taprop-posix.adb \ + s-taspri.ads<s-taspri-posix.ads \ + s-tpopsp.adb<s-tpopsp-posix.adb \ +- g-trasym.adb<g-trasym-dwarf.adb \ + $(ATOMICS_TARGET_PAIRS) \ + $(X86_64_TARGET_PAIRS) \ + system.ads<system-freebsd-x86_64.ads + +- TOOLS_TARGET_PAIRS = \ +- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb + GNATLIB_SHARED = gnatlib-shared-dual + ++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o ++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o ++ ++ EH_MECHANISM=-gcc ++ THREADSLIB= -lpthread ++ GMEM_LIB = gmemlib ++ LIBRARY_VERSION := $(LIB_VERSION) ++ MISCLIB = -lutil ++endif ++ ++ ++# DRAGONFLY i386 ++ifeq ($(strip $(filter-out %86 dragonfly%,$(arch) $(osys))),) ++ LIBGNAT_TARGET_PAIRS = \ ++ a-exetim.adb<a-exetim-posix.adb \ ++ a-exetim.ads<a-exetim-default.ads \ ++ a-intnam.ads<a-intnam-dragonfly.ads \ ++ g-socthi.adb<g-socthi-bsd.adb \ ++ g-trasym.adb<g-trasym-bsd.adb \ ++ s-inmaop.adb<s-inmaop-posix.adb \ ++ s-intman.adb<s-intman-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ ++ s-osinte.adb<s-osinte-dragonfly.adb \ ++ s-osinte.ads<s-osinte-dragonfly.ads \ ++ s-osprim.adb<s-osprim-posix.adb \ ++ s-taprop.adb<s-taprop-posix.adb \ ++ s-taspri.ads<s-taspri-posix.ads \ ++ s-tpopsp.adb<s-tpopsp-posix.adb \ ++ $(ATOMICS_TARGET_PAIRS) \ ++ $(X86_TARGET_PAIRS) \ ++ system.ads<system-dragonfly-x86.ads ++ ++ GNATLIB_SHARED = gnatlib-shared-dual ++ ++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o ++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o ++ ++ EH_MECHANISM=-gcc ++ THREADSLIB= -lpthread ++ GMEM_LIB = gmemlib ++ LIBRARY_VERSION := $(LIB_VERSION) ++ MISCLIB = -lutil ++endif ++ ++ ++# DRAGONFLY AMD64 ++ifeq ($(strip $(filter-out x86_64 dragonfly%,$(arch) $(osys))),) ++ LIBGNAT_TARGET_PAIRS = \ ++ a-exetim.adb<a-exetim-posix.adb \ ++ a-exetim.ads<a-exetim-default.ads \ ++ a-intnam.ads<a-intnam-dragonfly.ads \ ++ g-socthi.adb<g-socthi-bsd.adb \ ++ g-trasym.adb<g-trasym-bsd.adb \ ++ s-inmaop.adb<s-inmaop-posix.adb \ ++ s-intman.adb<s-intman-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ ++ s-osinte.adb<s-osinte-dragonfly.adb \ ++ s-osinte.ads<s-osinte-dragonfly.ads \ ++ s-osprim.adb<s-osprim-posix.adb \ ++ s-taprop.adb<s-taprop-posix.adb \ ++ s-taspri.ads<s-taspri-posix.ads \ ++ s-tpopsp.adb<s-tpopsp-posix.adb \ ++ $(ATOMICS_TARGET_PAIRS) \ ++ $(X86_64_TARGET_PAIRS) \ ++ system.ads<system-dragonfly-x86_64.ads ++ ++ GNATLIB_SHARED = gnatlib-shared-dual ++ ++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o ++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o ++ + EH_MECHANISM=-gcc + THREADSLIB= -lpthread + GMEM_LIB = gmemlib +@@ -1258,6 +1342,200 @@ + MISCLIB = -lutil + endif + ++ ++# OPENBSD i386 ++ifeq ($(strip $(filter-out %86 openbsd%,$(arch) $(osys))),) ++ LIBGNAT_TARGET_PAIRS = \ ++ a-exetim.adb<a-exetim-posix.adb \ ++ a-exetim.ads<a-exetim-default.ads \ ++ a-intnam.ads<a-intnam-openbsd.ads \ ++ g-socthi.adb<g-socthi-bsd.adb \ ++ g-trasym.adb<g-trasym-bsd.adb \ ++ s-inmaop.adb<s-inmaop-posix.adb \ ++ s-intman.adb<s-intman-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ ++ s-osinte.adb<s-osinte-openbsd.adb \ ++ s-osinte.ads<s-osinte-openbsd.ads \ ++ s-osprim.adb<s-osprim-bsd32.adb \ ++ s-taprop.adb<s-taprop-posix.adb \ ++ s-taspri.ads<s-taspri-posix.ads \ ++ s-tpopsp.adb<s-tpopsp-posix.adb \ ++ $(ATOMICS_TARGET_PAIRS) \ ++ $(X86_TARGET_PAIRS) \ ++ system.ads<system-openbsd-x86.ads ++ ++ GNATLIB_SHARED = gnatlib-shared-dual ++ ++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o ++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o ++ ++ EH_MECHANISM= ++ THREADSLIB= -lpthread ++ GMEM_LIB = ++ LIBRARY_VERSION := $(LIB_VERSION) ++ MISCLIB = -lutil ++endif ++ ++ ++# OPENBSD AMD64 ++ifeq ($(strip $(filter-out x86_64 openbsd%,$(arch) $(osys))),) ++ LIBGNAT_TARGET_PAIRS = \ ++ a-exetim.adb<a-exetim-posix.adb \ ++ a-exetim.ads<a-exetim-default.ads \ ++ a-intnam.ads<a-intnam-openbsd.ads \ ++ g-socthi.adb<g-socthi-bsd.adb \ ++ g-trasym.adb<g-trasym-bsd.adb \ ++ s-inmaop.adb<s-inmaop-posix.adb \ ++ s-intman.adb<s-intman-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ ++ s-osinte.adb<s-osinte-openbsd.adb \ ++ s-osinte.ads<s-osinte-openbsd.ads \ ++ s-osprim.adb<s-osprim-bsd32.adb \ ++ s-taprop.adb<s-taprop-posix.adb \ ++ s-taspri.ads<s-taspri-posix.ads \ ++ s-tpopsp.adb<s-tpopsp-posix.adb \ ++ $(ATOMICS_TARGET_PAIRS) \ ++ $(X86_64_TARGET_PAIRS) \ ++ system.ads<system-openbsd-x86_64.ads ++ ++ GNATLIB_SHARED = gnatlib-shared-dual ++ ++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o ++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o ++ ++ EH_MECHANISM=-gcc ++ THREADSLIB= -lpthread ++ GMEM_LIB = gmemlib ++ LIBRARY_VERSION := $(LIB_VERSION) ++ MISCLIB = -lutil ++endif ++ ++ ++# NETBSD i386 (5+ only) ++ifeq ($(strip $(filter-out %86 netbsd%,$(arch) $(osys))),) ++ LIBGNAT_TARGET_PAIRS = \ ++ a-exetim.adb<a-exetim-posix.adb \ ++ a-exetim.ads<a-exetim-default.ads \ ++ a-intnam.ads<a-intnam-netbsd.ads \ ++ g-socthi.adb<g-socthi-netbsd.adb \ ++ g-trasym.adb<g-trasym-bsd.adb \ ++ s-inmaop.adb<s-inmaop-posix.adb \ ++ s-intman.adb<s-intman-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ ++ s-osinte.adb<s-osinte-netbsd.adb \ ++ s-taprop.adb<s-taprop-posix.adb \ ++ s-taspri.ads<s-taspri-posix.ads \ ++ s-tpopsp.adb<s-tpopsp-posix.adb \ ++ $(ATOMICS_TARGET_PAIRS) \ ++ $(X86_TARGET_PAIRS) \ ++ system.ads<system-netbsd-x86.ads ++ ++ ifeq ($(strip $(filter-out %86 netbsdelf5%,$(arch) $(osys))),) ++ LIBGNAT_TARGET_PAIRS+= \ ++ s-osinte.ads<s-osinte-netbsd.ads \ ++ s-osprim.adb<s-osprim-bsd32.adb ++ else ++ LIBGNAT_TARGET_PAIRS+= \ ++ g-socthi.ads<g-socthi-netbsd6.ads \ ++ s-osinte.ads<s-osinte-netbsd6.ads \ ++ s-osprim.adb<s-osprim-bsdn6.adb ++ endif ++ ++ GNATLIB_SHARED = gnatlib-shared-dual ++ ++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o ++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o ++ ++ EH_MECHANISM=-gcc ++ THREADSLIB= -lpthread ++ GMEM_LIB = gmemlib ++ LIBRARY_VERSION := $(LIB_VERSION) ++ MISCLIB = -lutil ++endif ++ ++ ++# NETBSD AMD64 (5+ only) ++ifeq ($(strip $(filter-out x86_64 netbsd%,$(arch) $(osys))),) ++ LIBGNAT_TARGET_PAIRS = \ ++ a-exetim.adb<a-exetim-posix.adb \ ++ a-exetim.ads<a-exetim-default.ads \ ++ a-intnam.ads<a-intnam-netbsd.ads \ ++ g-socthi.adb<g-socthi-netbsd.adb \ ++ g-trasym.adb<g-trasym-bsd.adb \ ++ s-inmaop.adb<s-inmaop-posix.adb \ ++ s-intman.adb<s-intman-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ ++ s-osinte.adb<s-osinte-netbsd.adb \ ++ s-taprop.adb<s-taprop-posix.adb \ ++ s-taspri.ads<s-taspri-posix.ads \ ++ s-tpopsp.adb<s-tpopsp-posix.adb \ ++ $(ATOMICS_TARGET_PAIRS) \ ++ $(X86_64_TARGET_PAIRS) \ ++ system.ads<system-netbsd-x86_64.ads ++ ++ ifeq ($(strip $(filter-out x86_64 netbsd5%,$(arch) $(osys))),) ++ LIBGNAT_TARGET_PAIRS+= \ ++ s-osinte.ads<s-osinte-netbsd.ads \ ++ s-osprim.adb<s-osprim-bsd32.adb ++ else ++ LIBGNAT_TARGET_PAIRS+= \ ++ g-socthi.ads<g-socthi-netbsd6.ads \ ++ s-osinte.ads<s-osinte-netbsd6.ads \ ++ s-osprim.adb<s-osprim-bsdn6.adb ++ endif ++ ++ GNATLIB_SHARED = gnatlib-shared-dual ++ ++ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o ++ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o ++ ++ EH_MECHANISM=-gcc ++ THREADSLIB= -lpthread ++ GMEM_LIB = gmemlib ++ LIBRARY_VERSION := $(LIB_VERSION) ++ MISCLIB = -lutil ++endif ++ ++ ++# ANDROID (ARM) ++ifeq ($(strip $(filter-out arm% android eabi,$(targ))),) ++ LIBGNAT_TARGET_PAIRS = \ ++ a-intnam.ads<a-intnam-linux.ads \ ++ g-trasym.ads<g-trasym-unimplemented.ads \ ++ g-trasym.adb<g-trasym-unimplemented.adb \ ++ s-inmaop.adb<s-inmaop-posix.adb \ ++ s-intman.adb<s-intman-posix.adb \ ++ s-linux.ads<s-linux.ads \ ++ s-osinte.adb<s-osinte-posix.adb \ ++ s-mudido.adb<s-mudido-affinity.adb \ ++ s-osinte.ads<s-osinte-android.ads \ ++ s-osprim.adb<s-osprim-posix.adb \ ++ s-taprop.adb<s-taprop-linux.adb \ ++ s-tasinf.ads<s-tasinf-linux.ads \ ++ s-tasinf.adb<s-tasinf-linux.adb \ ++ s-taspri.ads<s-taspri-posix-noaltstack.ads \ ++ s-tpopsp.adb<s-tpopsp-posix-foreign.adb ++ ++ ifeq ($(strip $(filter-out arm%b,$(arch))),) ++ LIBGNAT_TARGET_PAIRS += \ ++ system.ads<system-linux-armeb.ads ++ else ++ LIBGNAT_TARGET_PAIRS += \ ++ system.ads<system-linux-armel.ads ++ endif ++ ++ EXTRA_LIBGNAT_SRCS+= signal_android.c ++ EXTRA_LIBGNAT_OBJS+= signal_android.o ++ EXTRA_GNATRTL_TASKING_OBJS= s-linux.o ++ EH_MECHANISM= ++ THREADSLIB= ++ MISCLIB= ++ GNATLIB_SHARED= gnatlib-shared-dual ++ GMEM_LIB= gmemlib ++ LIBRARY_VERSION:= $(LIB_VERSION) ++endif ++ ++ + ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS_COMMON = \ + a-intnam.ads<a-intnam-linux.ads \ +@@ -2597,7 +2875,7 @@ + $(MAKE) $(FLAGS_TO_PASS) \ + GNATLIBFLAGS="$(GNATLIBFLAGS)" \ + GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \ +- GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \ ++ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET)" \ + MULTISUBDIR="$(MULTISUBDIR)" \ + THREAD_KIND="$(THREAD_KIND)" \ + gnatlib +--- gnattools/configure.orig ++++ gnattools/configure +@@ -2058,7 +2058,27 @@ + s390*-*-linux*) + TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb" + ;; +- *86-*-freebsd*) ++ *86-*-freebsd* | x86_64-*-freebsd*) ++ TOOLS_TARGET_PAIRS="\ ++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ ++ indepsw.adb<indepsw-gnu.adb" ++ ;; ++ *86-*-dragonfly* | x86_64-*-dragonfly*) ++ TOOLS_TARGET_PAIRS="\ ++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ ++ indepsw.adb<indepsw-gnu.adb" ++ ;; ++ *86-*-openbsd* | x86_64-*-openbsd*) ++ TOOLS_TARGET_PAIRS="\ ++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ ++ indepsw.adb<indepsw-gnu.adb" ++ ;; ++ *86-*-netbsdelf* | x86_64-*-netbsd*) ++ TOOLS_TARGET_PAIRS="\ ++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ ++ indepsw.adb<indepsw-gnu.adb" ++ ;; ++ arm*-android-eabi) + TOOLS_TARGET_PAIRS="\ + mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ + indepsw.adb<indepsw-gnu.adb" +--- gnattools/configure.ac.orig ++++ gnattools/configure.ac +@@ -98,11 +98,31 @@ + s390*-*-linux*) + TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb" + ;; +- *86-*-freebsd*) ++ *86-*-freebsd* | x86_64-*-freebsd*) + TOOLS_TARGET_PAIRS="\ + mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ + indepsw.adb<indepsw-gnu.adb" + ;; ++ *86-*-dragonfly* | x86_64-*-dragonfly*) ++ TOOLS_TARGET_PAIRS="\ ++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ ++ indepsw.adb<indepsw-gnu.adb" ++ ;; ++ *86-*-openbsd* | x86_64-*-openbsd*) ++ TOOLS_TARGET_PAIRS="\ ++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ ++ indepsw.adb<indepsw-gnu.adb" ++ ;; ++ *86-*-netbsdelf* | x86_64-*-netbsd*) ++ TOOLS_TARGET_PAIRS="\ ++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ ++ indepsw.adb<indepsw-gnu.adb" ++ ;; ++ arm*-android-eabi) ++ TOOLS_TARGET_PAIRS="\ ++ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ ++ indepsw.adb<indepsw-gnu.adb" ++ ;; + mips-sgi-irix*) + TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-irix.adb" + ;; diff --git a/lang/gcc-aux/files/diff-ada-testsuite b/lang/gcc-aux/files/diff-ada-testsuite new file mode 100644 index 00000000000..1ef31b75e77 --- /dev/null +++ b/lang/gcc-aux/files/diff-ada-testsuite @@ -0,0 +1,169 @@ +--- gcc/testsuite/ada/acats/run_acats.orig ++++ gcc/testsuite/ada/acats/run_acats +@@ -5,20 +5,6 @@ + exit 1 + fi + +-# Provide which replacement. +-# +-# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both +-# ksh93 and bash have it. +-# type output format differs between ksh88 and ksh93, so avoid it if +-# type -p is present. Unfortunately, HP-UX /bin/sh ignores -p with type. +-# Fall back to whence which ksh88 and ksh93 provide, but bash does not. +- +-which () { +- path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; } +- path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; } +- path=`whence $* 2>/dev/null` && { echo $path; return 0; } +- return 1 +-} + + # Set up environment to use the Ada compiler from the object tree + +--- gcc/testsuite/ada/acats/run_all.sh.orig ++++ gcc/testsuite/ada/acats/run_all.sh +@@ -35,6 +35,14 @@ + echo "$@" >> $dir/acats.log + } + ++inform () { ++ printf "%04d %7s" $1 $2 ++} ++ ++disinform () { ++ printf "\r" ++} ++ + dir=`${PWDCMD-pwd}` + + if [ "$testdir" = "" ]; then +@@ -197,6 +205,18 @@ + glob_countn=0 + glob_countok=0 + glob_countu=0 ++countdown=0 ++ ++for chapter in $chapters; do ++ if [ -d $dir/tests/$chapter ]; then ++ cd $dir/tests/$chapter ++ ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \ ++ cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \ ++ > $dir/tests/$chapter/${chapter}.lst ++ countn=`wc -l < $dir/tests/$chapter/${chapter}.lst` ++ countdown=`expr $countdown + $countn` ++ fi ++done + + for chapter in $chapters; do + display Running chapter $chapter ... +@@ -207,10 +227,6 @@ + continue + fi + +- cd $dir/tests/$chapter +- ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \ +- cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \ +- > $dir/tests/$chapter/${chapter}.lst + countn=`wc -l < $dir/tests/$chapter/${chapter}.lst` + glob_countn=`expr $glob_countn + $countn` + counti=0 +@@ -233,10 +249,13 @@ + if [ $? -eq 0 ]; then + extraflags="$extraflags -gnat95" + fi ++ inform $countdown $i ++ countdown=`expr $countdown - 1` + test=$dir/tests/$chapter/$i + mkdir $test && cd $test >> $dir/acats.log 2>&1 + + if [ $? -ne 0 ]; then ++ disinform + display "FAIL: $i" + failed="${failed}${i} " + clean_dir +@@ -257,8 +276,10 @@ + cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";; + ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;; + ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;; ++ cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc + esac + if [ "$main" = "" ]; then ++ disinform + display "FAIL: $i" + failed="${failed}${i} " + clean_dir +@@ -267,6 +288,7 @@ + + target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1 + if [ $? -ne 0 ]; then ++ disinform + display "FAIL: $i" + failed="${failed}${i} " + clean_dir +@@ -281,6 +303,7 @@ + target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1 + cd $dir/tests/$chapter/$i + cat ${i}.log >> $dir/acats.log ++ disinform + egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1 + if [ $? -ne 0 ]; then + grep 'tasking not implemented' ${i}.log > /dev/null 2>&1 +--- gcc/testsuite/gnat.dg/test_raise_from_pure.adb.orig ++++ gcc/testsuite/gnat.dg/test_raise_from_pure.adb +@@ -1,4 +1,4 @@ +--- { dg-do run { xfail arm*-*-* } } ++-- { dg-do run { xfail arm*-*-* *-*-openbsd* } } + -- { dg-options "-O2" } + + -- This is an optimization test and its failure is only a missed optimization. +--- gcc/testsuite/gnat.dg/unchecked_convert5.adb.orig ++++ gcc/testsuite/gnat.dg/unchecked_convert5.adb +@@ -1,22 +0,0 @@ +--- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } } +- +-with Unchecked_Conversion; +- +-procedure Unchecked_Convert5 is +- +- subtype c_1 is string(1..1); +- +- function int2c1 is -- { dg-warning "different sizes" } +- new unchecked_conversion (source => integer, target => c_1); +- +- c1 : c_1; +- +-begin +- +- c1 := int2c1(16#12#); +- +- if c1 (1) /= ASCII.Nul then +- raise Program_Error; +- end if; +- +-end; +--- gcc/testsuite/gnat.dg/unchecked_convert6.adb.orig ++++ gcc/testsuite/gnat.dg/unchecked_convert6.adb +@@ -1,22 +0,0 @@ +--- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } } +- +-with Unchecked_Conversion; +- +-procedure Unchecked_Convert6 is +- +- subtype c_5 is string(1..5); +- +- function int2c5 is -- { dg-warning "different sizes" } +- new unchecked_conversion (source => integer, target => c_5); +- +- c5 : c_5; +- +-begin +- +- c5 := int2c5(16#12#); +- +- if c5 (4) /= ASCII.DC2 then +- raise Program_Error; +- end if; +- +-end; diff --git a/lang/gcc-aux/files/diff-core b/lang/gcc-aux/files/diff-core new file mode 100644 index 00000000000..b9a97a809e1 --- /dev/null +++ b/lang/gcc-aux/files/diff-core @@ -0,0 +1,1486 @@ +--- gcc/DEV-PHASE.orig ++++ gcc/DEV-PHASE +@@ -0,0 +1 @@ ++release +--- gcc/config.gcc.orig ++++ gcc/config.gcc +@@ -573,6 +573,9 @@ + "" | yes | posix) + thread_file='posix' + ;; ++ gnat | single) ++ # Let these non-posix thread selections fall through if requested ++ ;; + *) + echo 'Unknown thread configuration for FreeBSD' + exit 1 +@@ -589,6 +592,26 @@ + # need_64bit_hwint=yes # system compiler has this for all arch! + use_gcc_stdint=wrap + ;; ++*-*-dragonfly*) ++ gas=yes ++ gnu_ld=yes ++ tmake_file="t-slibgcc" ++ case ${enable_threads} in ++ "" | yes | posix) ++ thread_file='posix' ++ ;; ++ no | gnat | single) ++ # Let these non-posix thread selections fall through if requested ++ ;; ++ *) ++ echo 'Unknown thread configuration for DragonFly BSD' ++ exit 1 ++ ;; ++ esac ++ extra_options="$extra_options rpath.opt dragonfly.opt" ++ default_use_cxa_atexit=yes ++ use_gcc_stdint=wrap ++ ;; + *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) + extra_options="$extra_options gnu-user.opt" + gas=yes +@@ -644,6 +667,7 @@ + esac + ;; + *-*-netbsd*) ++ use_gcc_stdint=wrap + tmake_file="t-slibgcc" + gas=yes + gnu_ld=yes +@@ -885,7 +909,32 @@ + tm_file="dbxelf.h elfos.h newlib-stdint.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/ecos-elf.h" + tmake_file="arm/t-arm arm/t-arm-elf" + ;; +-arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtemseabi*) ++arm*-android-eabi*) ++ gas=yes ++ gnu_ld=yes ++ case ${enable_threads} in ++ "" | yes | posix) thread_file='posix' ;; ++ esac ++ tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h" ++ tm_file="$tm_file arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/bpabi.h arm/linux-eabi.h" ++ tm_file="$tm_file ../../libgcc/config/arm/bpabi-lib.h arm/aout.h arm/arm.h" ++ ++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC ANDROID_DEFAULT=1" ++ case $target in ++ arm*b-*) ++ tm_defines="$tm_defines TARGET_BIG_ENDIAN_DEFAULT=1" ++ ;; ++ esac ++ extra_options="$extra_options linux.opt linux-android.opt" ++ default_use_cxa_atexit=yes ++ use_gcc_tgmath=no ++ use_gcc_stdint=wrap ++ ++ # The BPABI long long divmod functions return a 128-bit value in registers r0-r3. ++ # Correctly modeling that requires the use of TImode. ++ need_64bit_hwint=yes ++ ;; ++arm*-*-symbianelf* | arm*-*-rtemseabi*) + # The BPABI long long divmod functions return a 128-bit value in + # registers r0-r3. Correctly modeling that requires the use of + # TImode. +@@ -894,11 +943,6 @@ + tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h" + tmake_file="arm/t-arm arm/t-arm-elf" + case ${target} in +- arm*-*-eabi*) +- tm_file="$tm_file newlib-stdint.h" +- tmake_file="${tmake_file} arm/t-bpabi" +- use_gcc_stdint=wrap +- ;; + arm*-*-rtemseabi*) + tm_file="${tm_file} rtems.h arm/rtems-eabi.h newlib-stdint.h" + tmake_file="${tmake_file} arm/t-bpabi t-rtems arm/t-rtems-eabi" +@@ -1196,6 +1240,14 @@ + x86_64-*-elf*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h" + ;; ++i[34567]86-*-dragonfly*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h" ++ tmake_file="${tmake_file} i386/t-crtstuff" ++ ;; ++x86_64-*-dragonfly*) ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h" ++ tmake_file="${tmake_file} i386/t-crtstuff" ++ ;; + i[34567]86-*-freebsd*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h" + ;; +@@ -1203,12 +1255,14 @@ + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" + ;; + i[34567]86-*-netbsdelf*) +- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h netbsd-stdint.h" + extra_options="${extra_options} netbsd.opt netbsd-elf.opt" ++ tmake_file="${tmake_file} i386/t-crtstuff" + ;; + x86_64-*-netbsd*) +- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h" ++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h netbsd-stdint.h" + extra_options="${extra_options} netbsd.opt netbsd-elf.opt" ++ tmake_file="${tmake_file} i386/t-crtstuff" + ;; + i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123]) + tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h" +@@ -3530,6 +3584,8 @@ + ;; + i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*) + ;; ++ i[34567]86-*-dragonfly* | x86_64-*-dragonfly*) ++ ;; + i[34567]86-*-freebsd* | x86_64-*-freebsd*) + ;; + ia64*-*-linux*) +--- /dev/null ++++ gcc/config/dragonfly-stdint.h +@@ -0,0 +1,56 @@ ++/* Definitions for <stdint.h> types for DragonFly systems. ++ Copyright (C) 2009 Free Software Foundation, Inc. ++ Contributed by Gerald Pfeifer <gerald@pfeifer.com>. ++ ++This file is part of GCC. ++ ++GCC 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, or (at your option) ++any later version. ++ ++GCC 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. ++ ++Under Section 7 of GPL version 3, you are granted additional ++permissions described in the GCC Runtime Library Exception, version ++3.1, as published by the Free Software Foundation. ++ ++You should have received a copy of the GNU General Public License and ++a copy of the GCC Runtime Library Exception along with this program; ++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++<http://www.gnu.org/licenses/>. */ ++ ++#define SIG_ATOMIC_TYPE "int" ++ ++#define INT8_TYPE "signed char" ++#define INT16_TYPE "short int" ++#define INT32_TYPE "int" ++#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") ++#define UINT8_TYPE "unsigned char" ++#define UINT16_TYPE "short unsigned int" ++#define UINT32_TYPE "unsigned int" ++#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") ++ ++#define INT_LEAST8_TYPE INT8_TYPE ++#define INT_LEAST16_TYPE INT16_TYPE ++#define INT_LEAST32_TYPE INT32_TYPE ++#define INT_LEAST64_TYPE INT64_TYPE ++#define UINT_LEAST8_TYPE UINT8_TYPE ++#define UINT_LEAST16_TYPE UINT16_TYPE ++#define UINT_LEAST32_TYPE UINT32_TYPE ++#define UINT_LEAST64_TYPE UINT64_TYPE ++ ++#define INT_FAST8_TYPE INT32_TYPE ++#define INT_FAST16_TYPE INT32_TYPE ++#define INT_FAST32_TYPE INT32_TYPE ++#define INT_FAST64_TYPE INT64_TYPE ++#define UINT_FAST8_TYPE UINT32_TYPE ++#define UINT_FAST16_TYPE UINT32_TYPE ++#define UINT_FAST32_TYPE UINT32_TYPE ++#define UINT_FAST64_TYPE UINT64_TYPE ++ ++#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? INT64_TYPE : INT32_TYPE) ++#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? UINT64_TYPE : UINT32_TYPE) +--- /dev/null ++++ gcc/config/dragonfly.h +@@ -0,0 +1,135 @@ ++/* Base configuration file for all DragonFly targets. ++ Copyright (C) 1999, 2000, 2001, 2007, 2008 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC 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, or (at your option) ++any later version. ++ ++GCC 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 GCC; see the file COPYING3. If not see ++<http://www.gnu.org/licenses/>. */ ++ ++/* Common DragonFly configuration. ++ All DragonFly architectures should include this file, which will specify ++ their commonalities. ++ Adapted from gcc/config/i386/freebsd-elf.h by ++ David O'Brien <obrien@FreeBSD.org>. ++ Further work by David O'Brien <obrien@FreeBSD.org> and ++ Loren J. Rittle <ljrittle@acm.org>. */ ++ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define_std ("unix"); \ ++ builtin_define ("__DragonFly__"); \ ++ builtin_assert ("system=unix"); \ ++ builtin_assert ("system=bsd"); \ ++ builtin_assert ("system=DragonFly"); \ ++ } \ ++ while (0) ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "%(cpp_cpu) %(cpp_arch) %{posix:-D_POSIX_SOURCE}" ++ ++#undef STARTFILE_SPEC ++#define STARTFILE_SPEC \ ++ "%{!shared: \ ++ %{pg:gcrt1.o%s} \ ++ %{!pg: \ ++ %{p:gcrt1.o%s} \ ++ %{!p: \ ++ %{profile: gcrt1.o%s} \ ++ %{!profile: \ ++ %{pie: Scrt1.o%s;:crt1.o%s}}}}} \ ++ crti.o%s \ ++ %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}" ++ ++#undef ENDFILE_SPEC ++#define ENDFILE_SPEC \ ++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" ++ ++#undef LIB_SPEC ++#define LIB_SPEC \ ++ "%{pthread:-lpthread} -lc" ++ ++#if defined(HAVE_LD_EH_FRAME_HDR) ++#define LINK_EH_SPEC "--eh-frame-hdr" ++#endif ++ ++/* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support ++ for the special GCC options -static and -shared, which allow us to ++ link things in one of these three modes by applying the appropriate ++ combinations of options at link-time. ++ ++ When the -shared link option is used a final link is not being ++ done. */ ++ ++#define DFBSD_LINK_SPEC \ ++ "%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ ++ %{v:-V} \ ++ %{assert*} %{R*} %{rpath*} %{defsym*} \ ++ %{shared:-Bshareable %{h*} %{soname*}} \ ++ %{!shared: \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ -dynamic-linker %(dfbsd_dynamic_linker) \ ++ } \ ++ %{static:-Bstatic}} \ ++ %{!static:--hash-style=both} \ ++ %{symbolic:-Bsymbolic}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC DFBSD_LINK_SPEC ++ ++#define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2" ++ ++ ++/* Use --as-needed -lgcc_s for eh support. */ ++#ifdef HAVE_LD_AS_NEEDED ++#define USE_LD_AS_NEEDED 1 ++#endif ++ ++/************************[ Target stuff ]***********************************/ ++ ++/* All DragonFly Architectures support the ELF object file format. */ ++#undef OBJECT_FORMAT_ELF ++#define OBJECT_FORMAT_ELF ++ ++/* Don't assume anything about the header files. */ ++#undef NO_IMPLICIT_EXTERN_C ++#define NO_IMPLICIT_EXTERN_C 1 ++ ++/* Follow DragonFly's standard headers (<machine/stdint.h>, etc...). */ ++ ++#undef WCHAR_TYPE ++#define WCHAR_TYPE "int" ++ ++#undef WINT_TYPE ++#define WINT_TYPE "int" ++ ++/* ++ * Profile libraries are found at /usr/lib/profile with standard names ++ * #define MATH_LIBRARY_PROFILE "m_p" ++ */ ++ ++/* Code generation parameters. */ ++ ++/* Use periods rather than dollar signs in special g++ assembler names. ++ This ensures the configuration knows our system correctly so we can link ++ with libraries compiled with the native cc. */ ++#undef NO_DOLLAR_IN_LABEL ++ ++/* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW. ++ This enables the test coverage code to use file locking when exiting a ++ program, which avoids race conditions if the program has forked. */ ++#define TARGET_POSIX_IO +--- /dev/null ++++ gcc/config/dragonfly.opt +@@ -0,0 +1,65 @@ ++; DragonFlyBSD options. ++ ++; Copyright (C) 2010, 2011 ++; Free Software Foundation, Inc. ++; ++; This file is part of GCC. ++; ++; GCC 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, or (at your option) any later ++; version. ++; ++; GCC 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 GCC; see the file COPYING3. If not see ++; <http://www.gnu.org/licenses/>. ++ ++; See the GCC internals manual (options.texi) for a description of this file's format. ++ ++; Please try to keep this file in ASCII collating order. ++ ++assert ++Driver Separate ++ ++assert= ++Driver JoinedOrMissing ++ ++defsym ++Driver Separate ++ ++defsym= ++Driver JoinedOrMissing ++ ++posix ++Driver ++ ++profile ++Driver ++ ++pthread ++Driver ++ ++rdynamic ++Driver ++ ++rpath-link ++Driver Separate ++ ++rpath-link= ++Driver JoinedOrMissing ++ ++rpath= ++Driver JoinedOrMissing ++ ++soname ++Driver Separate ++ ++soname= ++Driver JoinedOrMissing ++ ++; This comment is to ensure we retain the blank line above. +--- /dev/null ++++ gcc/config/netbsd-stdint.h +@@ -0,0 +1,56 @@ ++/* Definitions for <stdint.h> types for NetBSD systems. ++ Copyright (C) 2009 Free Software Foundation, Inc. ++ Contributed by Gerald Pfeifer <gerald@pfeifer.com>. ++ ++This file is part of GCC. ++ ++GCC 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, or (at your option) ++any later version. ++ ++GCC 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. ++ ++Under Section 7 of GPL version 3, you are granted additional ++permissions described in the GCC Runtime Library Exception, version ++3.1, as published by the Free Software Foundation. ++ ++You should have received a copy of the GNU General Public License and ++a copy of the GCC Runtime Library Exception along with this program; ++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++<http://www.gnu.org/licenses/>. */ ++ ++#define SIG_ATOMIC_TYPE "int" ++ ++#define INT8_TYPE "signed char" ++#define INT16_TYPE "short int" ++#define INT32_TYPE "int" ++#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") ++#define UINT8_TYPE "unsigned char" ++#define UINT16_TYPE "short unsigned int" ++#define UINT32_TYPE "unsigned int" ++#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") ++ ++#define INT_LEAST8_TYPE "signed char" ++#define INT_LEAST16_TYPE "short int" ++#define INT_LEAST32_TYPE "int" ++#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") ++#define UINT_LEAST8_TYPE "unsigned char" ++#define UINT_LEAST16_TYPE "short unsigned int" ++#define UINT_LEAST32_TYPE "unsigned int" ++#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") ++ ++#define INT_FAST8_TYPE "int" ++#define INT_FAST16_TYPE "int" ++#define INT_FAST32_TYPE "int" ++#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") ++#define UINT_FAST8_TYPE "unsigned int" ++#define UINT_FAST16_TYPE "unsigned int" ++#define UINT_FAST32_TYPE "unsigned int" ++#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") ++ ++#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") ++#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") +--- /dev/null ++++ gcc/config/i386/dragonfly.h +@@ -0,0 +1,101 @@ ++/* Definitions for Intel 386 running DragonFly with ELF format ++ Copyright (C) 1996, 2000, 2002, 2004, 2007 Free Software Foundation, Inc. ++ Contributed by Eric Youngdale. ++ Modified for stabs-in-ELF by H.J. Lu. ++ Adapted from GNU/Linux version by John Polstra. ++ Continued development by David O'Brien <obrien@freebsd.org> ++ ++This file is part of GCC. ++ ++GCC 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, or (at your option) ++any later version. ++ ++GCC 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 GCC; see the file COPYING3. If not see ++<http://www.gnu.org/licenses/>. */ ++ ++ ++/* Override the default comment-starter of "/". */ ++#undef ASM_COMMENT_START ++#define ASM_COMMENT_START "#" ++ ++#undef ASM_APP_ON ++#define ASM_APP_ON "#APP\n" ++ ++#undef ASM_APP_OFF ++#define ASM_APP_OFF "#NO_APP\n" ++ ++#undef DBX_REGISTER_NUMBER ++#define DBX_REGISTER_NUMBER(n) \ ++ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) ++ ++#undef NO_PROFILE_COUNTERS ++#define NO_PROFILE_COUNTERS 1 ++ ++/* Tell final.c that we don't need a label passed to mcount. */ ++ ++#undef MCOUNT_NAME ++#define MCOUNT_NAME ".mcount" ++ ++/* Make gcc agree with <machine/ansi.h>. */ ++ ++#undef SIZE_TYPE ++#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int") ++ ++#undef PTRDIFF_TYPE ++#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") ++ ++#undef WCHAR_TYPE_SIZE ++#define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD) ++ ++#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */ ++#define SUBTARGET_EXTRA_SPECS \ ++ { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER } ++ ++ ++/* A C statement to output to the stdio stream FILE an assembler ++ command to advance the location counter to a multiple of 1<<LOG ++ bytes if it is within MAX_SKIP bytes. ++ ++ This is used to align code labels according to Intel recommendations. */ ++ ++#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN ++#undef ASM_OUTPUT_MAX_SKIP_ALIGN ++#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \ ++ if ((LOG) != 0) { \ ++ if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ ++ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ ++ } ++#endif ++ ++/* Don't default to pcc-struct-return, we want to retain compatibility with ++ older gcc versions AND pcc-struct-return is nonreentrant. ++ (even though the SVR4 ABI for the i386 says that records and unions are ++ returned in memory). */ ++ ++#undef DEFAULT_PCC_STRUCT_RETURN ++#define DEFAULT_PCC_STRUCT_RETURN 0 ++ ++/* DragonFly sets the rounding precision of the FPU to 53 bits, but GNAT ++ resets it to full precision. */ ++#undef TARGET_96_ROUND_53_LONG_DOUBLE ++#define TARGET_96_ROUND_53_LONG_DOUBLE 0 ++ ++/* Put all *tf routines in libgcc. */ ++#undef LIBGCC2_HAS_TF_MODE ++#define LIBGCC2_HAS_TF_MODE 1 ++#define LIBGCC2_TF_CEXT q ++#define TF_SIZE 113 ++ ++/* Static stack checking is supported by means of probes. */ ++#define STACK_CHECK_STATIC_BUILTIN 1 ++ ++/* Support for i386 has been removed from DragonFly for several releases */ ++#define SUBTARGET32_DEFAULT_CPU "i486" +--- gcc/config/i386/freebsd.h.orig ++++ gcc/config/i386/freebsd.h +@@ -127,10 +127,10 @@ + #undef DEFAULT_PCC_STRUCT_RETURN + #define DEFAULT_PCC_STRUCT_RETURN 0 + +-/* FreeBSD sets the rounding precision of the FPU to 53 bits. Let the +- compiler get the contents of <float.h> and std::numeric_limits correct. */ ++/* FreeBSD sets the rounding precision of the FPU to 53 bits, but GNAT ++ resets it to full precision. */ + #undef TARGET_96_ROUND_53_LONG_DOUBLE +-#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT) ++#define TARGET_96_ROUND_53_LONG_DOUBLE 0 + + /* Put all *tf routines in libgcc. */ + #undef LIBGCC2_HAS_TF_MODE +@@ -148,3 +148,35 @@ + + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack + ++/* Through FreeBSD 8.2 at least, stack is denied execution rights by libthr ++ This only affects AMD64 since i386 ignores the nx bit (non-PAE) ++ However, it's still included in i386 because it's possible an AMD64 ++ machine will be required to run a binary generated by i386 GNAT. ++ perms = PROT_READ | PROT_WRITE | PROT_EXEC; ++*/ ++#define ENABLE_EXECUTE_STACK \ ++extern void __enable_execute_stack (void *); \ ++void \ ++__enable_execute_stack (void *addr) \ ++{ \ ++ extern int getpagesize (void); \ ++ extern int mprotect (void *, size_t, int); \ ++ \ ++ static int size; \ ++ long mask; \ ++ char *page, *ends; \ ++ long page_addr = (long) addr; \ ++ long ends_addr = (long) (addr + TRAMPOLINE_SIZE); \ ++ int perms = 7; \ ++ \ ++ if (size == 0) \ ++ { \ ++ size = getpagesize(); \ ++ } \ ++ mask = ~((long) size - 1); \ ++ page = (char *) (page_addr & mask); \ ++ ends = (char *) ((ends_addr & mask) + size); \ ++ (void) mprotect (page, ends - page, perms); \ ++} ++ ++ +--- gcc/config/i386/netbsd-elf.h.orig ++++ gcc/config/i386/netbsd-elf.h +@@ -119,3 +119,9 @@ + #define DEFAULT_PCC_STRUCT_RETURN 1 + + #define HAVE_ENABLE_EXECUTE_STACK ++/* Define this to be nonzero if static stack checking is supported. */ ++#define STACK_CHECK_STATIC_BUILTIN 1 ++ ++#if defined(HAVE_LD_EH_FRAME_HDR) ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#endif +--- gcc/config/i386/netbsd64.h.orig ++++ gcc/config/i386/netbsd64.h +@@ -67,3 +67,10 @@ + } + + #define HAVE_ENABLE_EXECUTE_STACK ++ ++/* Define this to be nonzero if static stack checking is supported. */ ++#define STACK_CHECK_STATIC_BUILTIN 1 ++ ++#if defined(HAVE_LD_EH_FRAME_HDR) ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#endif +--- gcc/ginclude/stddef.h.orig ++++ gcc/ginclude/stddef.h +@@ -53,12 +53,21 @@ + one less case to deal with in the following. */ + #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) + #include <machine/ansi.h> ++#if !defined(_MACHINE_ANSI_H_) ++#if defined(_I386_ANSI_H_) || defined(_X86_64_ANSI_H_) ++#define _MACHINE_ANSI_H_ ++#endif ++#endif + #endif + /* On FreeBSD 5, machine/ansi.h does not exist anymore... */ + #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) + #include <sys/_types.h> + #endif + ++#if defined(__DragonFly__) ++#include <sys/types.h> ++#endif ++ + /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are + defined if the corresponding type is *not* defined. + FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. +@@ -136,6 +145,7 @@ + #ifndef _BSD_PTRDIFF_T_ + #ifndef ___int_ptrdiff_t_h + #ifndef _GCC_PTRDIFF_T ++#ifndef _PTRDIFF_T_DECLARED /* DragonFly */ + #define _PTRDIFF_T + #define _T_PTRDIFF_ + #define _T_PTRDIFF +@@ -144,10 +154,12 @@ + #define _BSD_PTRDIFF_T_ + #define ___int_ptrdiff_t_h + #define _GCC_PTRDIFF_T ++#define _PTRDIFF_T_DECLARED + #ifndef __PTRDIFF_TYPE__ + #define __PTRDIFF_TYPE__ long int + #endif + typedef __PTRDIFF_TYPE__ ptrdiff_t; ++#endif /* _PTRDIFF_T_DECLARED */ + #endif /* _GCC_PTRDIFF_T */ + #endif /* ___int_ptrdiff_t_h */ + #endif /* _BSD_PTRDIFF_T_ */ +@@ -201,6 +213,7 @@ + #define _GCC_SIZE_T + #define _SIZET_ + #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ ++ || defined(__DragonFly__) \ + || defined(__FreeBSD_kernel__) + /* __size_t is a typedef on FreeBSD 5, must not trash it. */ + #else +@@ -307,7 +320,7 @@ + /* FreeBSD 5 can't be handled well using "traditional" logic above + since it no longer defines _BSD_RUNE_T_ yet still desires to export + rune_t in some cases... */ +-#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) ++#if defined (__DragonFly__) || (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) + #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) + #if __BSD_VISIBLE + #ifndef _RUNE_T_DECLARED +--- include/libiberty.h.orig ++++ include/libiberty.h +@@ -106,7 +106,16 @@ + to find the declaration so provide a fully prototyped one. If it + is 1, we found it so don't provide any declaration at all. */ + #if !HAVE_DECL_BASENAME +-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME) ++#if defined (__GNU_LIBRARY__ ) \ ++ || defined (__linux__) \ ++ || defined (__DragonFly__) \ ++ || defined (__FreeBSD__) \ ++ || defined (__OpenBSD__) \ ++ || defined (__NetBSD__) \ ++ || defined (__CYGWIN__) \ ++ || defined (__CYGWIN32__) \ ++ || defined (__MINGW32__) \ ++ || defined (HAVE_DECL_BASENAME) + extern char *basename (const char *); + #else + /* Do not allow basename to be used if there is no prototype seen. We +--- libgcc/config.host.orig ++++ libgcc/config.host +@@ -174,6 +174,17 @@ + tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic t-slibgcc-darwin" + extra_parts="crt3.o crttms.o crttme.o" + ;; ++arm*-android-eabi*) ++ tmake_file="t-slibgcc-elf-ver t-linux arm/t-arm" ++ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" ++ tmake_file="$tmake_file arm/t-linux-androideabi arm/t-arm-softfp soft-fp/t-softfp" ++ extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" ++ ;; ++*-*-dragonfly*) ++ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip" ++ tmake_file="$tmake_file t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" ++ ;; + *-*-freebsd*) + # This is the generic ELF configuration of FreeBSD. Later + # machine-specific sections may refine and add to this +@@ -202,7 +213,8 @@ + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + ;; + *-*-netbsd*) +- tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" ++ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip" ++ tmake_file="$tmake_file t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" + # NetBSD 1.7 and later are set up to use GCC's crtstuff for + # ELF configurations. We will clear extra_parts in the + # a.out configurations. +@@ -267,6 +279,7 @@ + + case ${host} in + *-*-darwin* | *-*-freebsd* | *-*-netbsd* | *-*-openbsd* | *-*-solaris2* | \ ++ *-*-dragonfly* | \ + alpha*-dec-osf5.1*) + enable_execute_stack=enable-execute-stack-mprotect.c + ;; +@@ -354,11 +367,11 @@ + tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" + extra_parts="$extra_parts crti.o crtn.o" + ;; +-arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtemseabi*) ++arm*-*-symbianelf* | arm*-*-rtemseabi*) + tmake_file="${tmake_file} arm/t-arm arm/t-elf t-fixedpoint-gnu-prefix" + tm_file="$tm_file arm/bpabi-lib.h" + case ${host} in +- arm*-*-eabi* | arm*-*-rtemseabi*) ++ arm*-*-rtemseabi*) + tmake_file="${tmake_file} arm/t-bpabi" + extra_parts="crtbegin.o crtend.o crti.o crtn.o" + ;; +@@ -523,16 +536,29 @@ + x86_64-*-elf*) + tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic" + ;; ++i[34567]86-*-dragonfly*) ++ tmake_file="${tmake_file} i386/t-dragonfly i386/t-crtstuff" ++ md_unwind_header=i386/dragonfly-unwind.h ++ ;; ++x86_64-*-dragonfly*) ++ tmake_file="${tmake_file} i386/t-dragonfly i386/t-crtstuff" ++ md_unwind_header=i386/dragonfly-unwind.h ++ ;; + i[34567]86-*-freebsd*) + tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" ++ md_unwind_header=i386/freebsd-unwind.h + ;; + x86_64-*-freebsd*) + tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" ++ md_unwind_header=i386/freebsd-unwind.h + ;; + i[34567]86-*-netbsdelf*) ++ tmake_file="${tmake_file} i386/t-crtstuff" ++ md_unwind_header=i386/netbsd-unwind.h + ;; + x86_64-*-netbsd*) + tmake_file="${tmake_file} i386/t-crtstuff" ++ md_unwind_header=i386/netbsd-unwind.h + ;; + i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123]) + ;; +@@ -1160,6 +1186,7 @@ + i[34567]86-*-gnu* | \ + i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]* | \ + i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw* | \ ++ i[34567]86-*-dragonfly* | x86_64-*-dragonfly* | \ + i[34567]86-*-freebsd* | x86_64-*-freebsd*) + tmake_file="${tmake_file} t-softfp-tf" + if test "${host_address}" = 32; then +--- libgcc/crtstuff.c.orig ++++ libgcc/crtstuff.c +@@ -81,11 +81,19 @@ + } + #endif + ++#if defined(TARGET_DL_ITERATE_PHDR) && \ ++ ( defined(__FreeBSD__) \ ++ || defined(__OpenBSD__) \ ++ || defined(__NetBSD__) \ ++ || defined(__DragonFly__)) ++#define BSD_DL_ITERATE_PHDR_AVAILABLE ++#endif ++ + #if defined(OBJECT_FORMAT_ELF) \ + && !defined(OBJECT_FORMAT_FLAT) \ + && defined(HAVE_LD_EH_FRAME_HDR) \ + && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ +- && defined(__FreeBSD__) && __FreeBSD__ >= 7 ++ && defined(BSD_DL_ITERATE_PHDR_AVAILABLE) + #include <link.h> + # define USE_PT_GNU_EH_FRAME + #endif +--- libgcc/unwind-dw2-fde-dip.c.orig ++++ libgcc/unwind-dw2-fde-dip.c +@@ -54,11 +54,19 @@ + #endif + + #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ +- && defined(__FreeBSD__) && __FreeBSD__ >= 7 ++ && defined(TARGET_DL_ITERATE_PHDR) \ ++ && (defined(__FreeBSD__) || defined(__DragonFly__)) + # define ElfW __ElfN + # define USE_PT_GNU_EH_FRAME + #endif + ++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ ++ && defined(TARGET_DL_ITERATE_PHDR) \ ++ && (defined(__OpenBSD__) || defined(__NetBSD__)) ++# define ElfW(n) Elf_##n ++# define USE_PT_GNU_EH_FRAME ++#endif ++ + #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) \ + && defined(__sun__) && defined(__svr4__) +--- /dev/null ++++ libgcc/config/i386/dragonfly-unwind.h +@@ -0,0 +1,158 @@ ++/* DWARF2 EH unwinding support for DragonFly BSD: AMD x86-64 and x86. ++ Copyright (C) 2010 John Marino <draco@marino.st> */ ++ ++/* Do code reading to identify a signal frame, and set the frame ++ state data appropriately. See unwind-dw2.c for the structs. */ ++ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#include <signal.h> ++#include <sys/ucontext.h> ++#include <machine/sigframe.h> ++ ++ ++#define REG_NAME(reg) sf_uc.uc_mcontext.mc_## reg ++ ++#ifdef __x86_64__ ++#define MD_FALLBACK_FRAME_STATE_FOR x86_64_dragonfly_fallback_frame_state ++ ++ ++static void ++x86_64_sigtramp_range (unsigned char **start, unsigned char **end) ++{ ++ unsigned long ps_strings; ++ int mib[2]; ++ size_t len; ++ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PS_STRINGS; ++ len = sizeof (ps_strings); ++ sysctl (mib, 2, &ps_strings, &len, NULL, 0); ++ ++ *start = (unsigned char *)ps_strings - 32; ++ *end = (unsigned char *)ps_strings; ++} ++ ++ ++static _Unwind_Reason_Code ++x86_64_dragonfly_fallback_frame_state ++(struct _Unwind_Context *context, _Unwind_FrameState *fs) ++{ ++ unsigned char *pc = context->ra; ++ unsigned char *sigtramp_start, *sigtramp_end; ++ struct sigframe *sf; ++ long new_cfa; ++ ++ x86_64_sigtramp_range(&sigtramp_start, &sigtramp_end); ++ if (pc >= sigtramp_end || pc < sigtramp_start) ++ return _URC_END_OF_STACK; ++ ++ sf = (struct sigframe *) context->cfa; ++ new_cfa = sf->REG_NAME(rsp); ++ fs->regs.cfa_how = CFA_REG_OFFSET; ++ /* Register 7 is rsp */ ++ fs->regs.cfa_reg = 7; ++ fs->regs.cfa_offset = new_cfa - (long) context->cfa; ++ ++ /* The SVR4 register numbering macros aren't usable in libgcc. */ ++ fs->regs.reg[0].how = REG_SAVED_OFFSET; ++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(rax) - new_cfa; ++ fs->regs.reg[1].how = REG_SAVED_OFFSET; ++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(rdx) - new_cfa; ++ fs->regs.reg[2].how = REG_SAVED_OFFSET; ++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(rcx) - new_cfa; ++ fs->regs.reg[3].how = REG_SAVED_OFFSET; ++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(rbx) - new_cfa; ++ fs->regs.reg[4].how = REG_SAVED_OFFSET; ++ fs->regs.reg[4].loc.offset = (long)&sf->REG_NAME(rsi) - new_cfa; ++ fs->regs.reg[5].how = REG_SAVED_OFFSET; ++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(rdi) - new_cfa; ++ fs->regs.reg[6].how = REG_SAVED_OFFSET; ++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(rbp) - new_cfa; ++ fs->regs.reg[8].how = REG_SAVED_OFFSET; ++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(r8) - new_cfa; ++ fs->regs.reg[9].how = REG_SAVED_OFFSET; ++ fs->regs.reg[9].loc.offset = (long)&sf->REG_NAME(r9) - new_cfa; ++ fs->regs.reg[10].how = REG_SAVED_OFFSET; ++ fs->regs.reg[10].loc.offset = (long)&sf->REG_NAME(r10) - new_cfa; ++ fs->regs.reg[11].how = REG_SAVED_OFFSET; ++ fs->regs.reg[11].loc.offset = (long)&sf->REG_NAME(r11) - new_cfa; ++ fs->regs.reg[12].how = REG_SAVED_OFFSET; ++ fs->regs.reg[12].loc.offset = (long)&sf->REG_NAME(r12) - new_cfa; ++ fs->regs.reg[13].how = REG_SAVED_OFFSET; ++ fs->regs.reg[13].loc.offset = (long)&sf->REG_NAME(r13) - new_cfa; ++ fs->regs.reg[14].how = REG_SAVED_OFFSET; ++ fs->regs.reg[14].loc.offset = (long)&sf->REG_NAME(r14) - new_cfa; ++ fs->regs.reg[15].how = REG_SAVED_OFFSET; ++ fs->regs.reg[15].loc.offset = (long)&sf->REG_NAME(r15) - new_cfa; ++ fs->regs.reg[16].how = REG_SAVED_OFFSET; ++ fs->regs.reg[16].loc.offset = (long)&sf->REG_NAME(rip) - new_cfa; ++ fs->retaddr_column = 16; ++ fs->signal_frame = 1; ++ return _URC_NO_REASON; ++} ++ ++#else /* Next section is for i386 */ ++ ++#define MD_FALLBACK_FRAME_STATE_FOR x86_dragonfly_fallback_frame_state ++ ++ ++static void ++x86_sigtramp_range (unsigned char **start, unsigned char **end) ++{ ++ unsigned long ps_strings; ++ int mib[2]; ++ size_t len; ++ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PS_STRINGS; ++ len = sizeof (ps_strings); ++ sysctl (mib, 2, &ps_strings, &len, NULL, 0); ++ ++ *start = (unsigned char *)ps_strings - 128; ++ *end = (unsigned char *)ps_strings; ++} ++ ++ ++static _Unwind_Reason_Code ++x86_dragonfly_fallback_frame_state ++(struct _Unwind_Context *context, _Unwind_FrameState *fs) ++{ ++ unsigned char *pc = context->ra; ++ unsigned char *sigtramp_start, *sigtramp_end; ++ struct sigframe *sf; ++ long new_cfa; ++ ++ x86_sigtramp_range(&sigtramp_start, &sigtramp_end); ++ ++ if (pc >= sigtramp_end || pc < sigtramp_start) ++ return _URC_END_OF_STACK; ++ ++ sf = (struct sigframe *) context->cfa; ++ new_cfa = sf->REG_NAME(esp); ++ fs->regs.cfa_how = CFA_REG_OFFSET; ++ fs->regs.cfa_reg = 4; ++ fs->regs.cfa_offset = new_cfa - (long) context->cfa; ++ ++ /* The SVR4 register numbering macros aren't usable in libgcc. */ ++ fs->regs.reg[0].how = REG_SAVED_OFFSET; ++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(eax) - new_cfa; ++ fs->regs.reg[3].how = REG_SAVED_OFFSET; ++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(ebx) - new_cfa; ++ fs->regs.reg[1].how = REG_SAVED_OFFSET; ++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(ecx) - new_cfa; ++ fs->regs.reg[2].how = REG_SAVED_OFFSET; ++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(edx) - new_cfa; ++ fs->regs.reg[6].how = REG_SAVED_OFFSET; ++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(esi) - new_cfa; ++ fs->regs.reg[7].how = REG_SAVED_OFFSET; ++ fs->regs.reg[7].loc.offset = (long)&sf->REG_NAME(edi) - new_cfa; ++ fs->regs.reg[5].how = REG_SAVED_OFFSET; ++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(ebp) - new_cfa; ++ fs->regs.reg[8].how = REG_SAVED_OFFSET; ++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(eip) - new_cfa; ++ fs->retaddr_column = 8; ++ fs->signal_frame = 1; ++ return _URC_NO_REASON; ++} ++#endif /* ifdef __x86_64__ */ +--- /dev/null ++++ libgcc/config/i386/freebsd-unwind.h +@@ -0,0 +1,184 @@ ++/* DWARF2 EH unwinding support for FreeBSD: AMD x86-64 and x86. ++ Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. ++ Copyright (C) 2010 John Marino <draco@marino.st> ++ ++This file is part of GCC. ++ ++GCC 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, or (at your option) ++any later version. ++ ++In addition to the permissions in the GNU General Public License, the ++Free Software Foundation gives you unlimited permission to link the ++compiled version of this file with other programs, and to distribute ++those programs without any restriction coming from the use of this ++file. (The General Public License restrictions do apply in other ++respects; for example, they cover modification of the file, and ++distribution when not linked into another program.) ++ ++GCC 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 GCC; see the file COPYING. If not, write to ++the Free Software Foundation, 51 Franklin Street, Fifth Floor, ++Boston, MA 02110-1301, USA. */ ++ ++/* Do code reading to identify a signal frame, and set the frame ++ state data appropriately. See unwind-dw2.c for the structs. */ ++ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#include <signal.h> ++#include <sys/ucontext.h> ++#include <machine/sigframe.h> ++ ++ ++#define REG_NAME(reg) sf_uc.uc_mcontext.mc_## reg ++ ++#ifdef __x86_64__ ++#define MD_FALLBACK_FRAME_STATE_FOR x86_64_freebsd_fallback_frame_state ++ ++ ++static void ++x86_64_sigtramp_range (unsigned char **start, unsigned char **end) ++{ ++ unsigned long ps_strings; ++ int mib[2]; ++ size_t len; ++ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PS_STRINGS; ++ len = sizeof (ps_strings); ++ sysctl (mib, 2, &ps_strings, &len, NULL, 0); ++ ++ *start = (unsigned char *)ps_strings - 32; ++ *end = (unsigned char *)ps_strings; ++} ++ ++ ++static _Unwind_Reason_Code ++x86_64_freebsd_fallback_frame_state ++(struct _Unwind_Context *context, _Unwind_FrameState *fs) ++{ ++ unsigned char *pc = context->ra; ++ unsigned char *sigtramp_start, *sigtramp_end; ++ struct sigframe *sf; ++ long new_cfa; ++ ++ x86_64_sigtramp_range(&sigtramp_start, &sigtramp_end); ++ if (pc >= sigtramp_end || pc < sigtramp_start) ++ return _URC_END_OF_STACK; ++ ++ sf = (struct sigframe *) context->cfa; ++ new_cfa = sf->REG_NAME(rsp); ++ fs->regs.cfa_how = CFA_REG_OFFSET; ++ /* Register 7 is rsp */ ++ fs->regs.cfa_reg = 7; ++ fs->regs.cfa_offset = new_cfa - (long) context->cfa; ++ ++ /* The SVR4 register numbering macros aren't usable in libgcc. */ ++ fs->regs.reg[0].how = REG_SAVED_OFFSET; ++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(rax) - new_cfa; ++ fs->regs.reg[1].how = REG_SAVED_OFFSET; ++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(rdx) - new_cfa; ++ fs->regs.reg[2].how = REG_SAVED_OFFSET; ++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(rcx) - new_cfa; ++ fs->regs.reg[3].how = REG_SAVED_OFFSET; ++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(rbx) - new_cfa; ++ fs->regs.reg[4].how = REG_SAVED_OFFSET; ++ fs->regs.reg[4].loc.offset = (long)&sf->REG_NAME(rsi) - new_cfa; ++ fs->regs.reg[5].how = REG_SAVED_OFFSET; ++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(rdi) - new_cfa; ++ fs->regs.reg[6].how = REG_SAVED_OFFSET; ++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(rbp) - new_cfa; ++ fs->regs.reg[8].how = REG_SAVED_OFFSET; ++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(r8) - new_cfa; ++ fs->regs.reg[9].how = REG_SAVED_OFFSET; ++ fs->regs.reg[9].loc.offset = (long)&sf->REG_NAME(r9) - new_cfa; ++ fs->regs.reg[10].how = REG_SAVED_OFFSET; ++ fs->regs.reg[10].loc.offset = (long)&sf->REG_NAME(r10) - new_cfa; ++ fs->regs.reg[11].how = REG_SAVED_OFFSET; ++ fs->regs.reg[11].loc.offset = (long)&sf->REG_NAME(r11) - new_cfa; ++ fs->regs.reg[12].how = REG_SAVED_OFFSET; ++ fs->regs.reg[12].loc.offset = (long)&sf->REG_NAME(r12) - new_cfa; ++ fs->regs.reg[13].how = REG_SAVED_OFFSET; ++ fs->regs.reg[13].loc.offset = (long)&sf->REG_NAME(r13) - new_cfa; ++ fs->regs.reg[14].how = REG_SAVED_OFFSET; ++ fs->regs.reg[14].loc.offset = (long)&sf->REG_NAME(r14) - new_cfa; ++ fs->regs.reg[15].how = REG_SAVED_OFFSET; ++ fs->regs.reg[15].loc.offset = (long)&sf->REG_NAME(r15) - new_cfa; ++ fs->regs.reg[16].how = REG_SAVED_OFFSET; ++ fs->regs.reg[16].loc.offset = (long)&sf->REG_NAME(rip) - new_cfa; ++ fs->retaddr_column = 16; ++ fs->signal_frame = 1; ++ return _URC_NO_REASON; ++} ++ ++#else /* Next section is for i386 */ ++ ++#define MD_FALLBACK_FRAME_STATE_FOR x86_freebsd_fallback_frame_state ++ ++ ++static void ++x86_sigtramp_range (unsigned char **start, unsigned char **end) ++{ ++ unsigned long ps_strings; ++ int mib[2]; ++ size_t len; ++ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PS_STRINGS; ++ len = sizeof (ps_strings); ++ sysctl (mib, 2, &ps_strings, &len, NULL, 0); ++ ++ *start = (unsigned char *)ps_strings - 128; ++ *end = (unsigned char *)ps_strings; ++} ++ ++ ++static _Unwind_Reason_Code ++x86_freebsd_fallback_frame_state ++(struct _Unwind_Context *context, _Unwind_FrameState *fs) ++{ ++ unsigned char *pc = context->ra; ++ unsigned char *sigtramp_start, *sigtramp_end; ++ struct sigframe *sf; ++ long new_cfa; ++ ++ x86_sigtramp_range(&sigtramp_start, &sigtramp_end); ++ ++ if (pc >= sigtramp_end || pc < sigtramp_start) ++ return _URC_END_OF_STACK; ++ ++ sf = (struct sigframe *) context->cfa; ++ new_cfa = sf->REG_NAME(esp); ++ fs->regs.cfa_how = CFA_REG_OFFSET; ++ fs->regs.cfa_reg = 4; ++ fs->regs.cfa_offset = new_cfa - (long) context->cfa; ++ ++ /* The SVR4 register numbering macros aren't usable in libgcc. */ ++ fs->regs.reg[0].how = REG_SAVED_OFFSET; ++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(eax) - new_cfa; ++ fs->regs.reg[3].how = REG_SAVED_OFFSET; ++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(ebx) - new_cfa; ++ fs->regs.reg[1].how = REG_SAVED_OFFSET; ++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(ecx) - new_cfa; ++ fs->regs.reg[2].how = REG_SAVED_OFFSET; ++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(edx) - new_cfa; ++ fs->regs.reg[6].how = REG_SAVED_OFFSET; ++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(esi) - new_cfa; ++ fs->regs.reg[7].how = REG_SAVED_OFFSET; ++ fs->regs.reg[7].loc.offset = (long)&sf->REG_NAME(edi) - new_cfa; ++ fs->regs.reg[5].how = REG_SAVED_OFFSET; ++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(ebp) - new_cfa; ++ fs->regs.reg[8].how = REG_SAVED_OFFSET; ++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(eip) - new_cfa; ++ fs->retaddr_column = 8; ++ fs->signal_frame = 1; ++ return _URC_NO_REASON; ++} ++#endif /* ifdef __x86_64__ */ +--- /dev/null ++++ libgcc/config/i386/netbsd-unwind.h +@@ -0,0 +1,169 @@ ++/* DWARF2 EH unwinding support for x86 NetBSD ++ Copyright (C) 2010 John Marino (www.dragonlace.net) */ ++ ++/* Do code reading to identify a signal frame, and set the frame ++ state data appropriately. See unwind-dw2.c for the structs. */ ++ ++#include <sys/ucontext.h> ++#include <machine/frame.h> ++ ++#define REG_NAME(reg) sf_uc.uc_mcontext.__gregs[_REG_## reg] ++ ++#ifdef __x86_64__ ++ ++ ++ ++ ++#define MD_FALLBACK_FRAME_STATE_FOR x86_64_netbsd_fallback_frame_state ++ ++static _Unwind_Reason_Code ++x86_64_netbsd_fallback_frame_state ++(struct _Unwind_Context *context, _Unwind_FrameState *fs) ++{ ++ /* signal_frame is sigframe_siginfo minus sf_ra handler return address */ ++ struct signal_frame { ++ siginfo_t sf_si; /* actual saved siginfo */ ++ ucontext_t sf_uc; /* actual saved ucontext */ ++ }; ++ struct signal_frame *sf; ++ long new_cfa; ++ ++ /* We are looking for the following signal trampoline pattern. If we don't ++ find it, we are at the end of the stack and can't unwind. ++ ++ <__sigtramp_siginfo_2+12>: mov $0xffffffffffffffff,%rdi ++ <__sigtramp_siginfo_2+19>: mov $0x1,%rax ++ <__sigtramp_siginfo_2+26>: syscall ++ */ ++ ++ if ( *(unsigned int *) (context->ra + 12) == 0xffc7c748 ++ && *(unsigned int *) (context->ra + 16) == 0x48ffffff ++ && *(unsigned int *) (context->ra + 20) == 0x0001c0c7 ++ && *(unsigned int *) (context->ra + 24) == 0x050f0000 ) ++ { ++ sf = (struct signal_frame *) context->cfa; ++ new_cfa = sf->REG_NAME(RSP); ++ fs->regs.cfa_how = CFA_REG_OFFSET; ++ fs->regs.cfa_reg = 7; ++ fs->regs.cfa_offset = new_cfa - (long) context->cfa; ++ } ++ else ++ { ++ return _URC_END_OF_STACK; ++ } ++ ++ /* The SVR4 register numbering macros aren't usable in libgcc. */ ++ fs->regs.reg[ 0].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 0].loc.offset = (long)&sf->REG_NAME(RAX) - new_cfa; ++ fs->regs.reg[ 1].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 1].loc.offset = (long)&sf->REG_NAME(RDX) - new_cfa; ++ fs->regs.reg[ 2].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 2].loc.offset = (long)&sf->REG_NAME(RCX) - new_cfa; ++ fs->regs.reg[ 3].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 3].loc.offset = (long)&sf->REG_NAME(RBX) - new_cfa; ++ fs->regs.reg[ 4].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 4].loc.offset = (long)&sf->REG_NAME(RSI) - new_cfa; ++ fs->regs.reg[ 5].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 5].loc.offset = (long)&sf->REG_NAME(RDI) - new_cfa; ++ fs->regs.reg[ 6].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 6].loc.offset = (long)&sf->REG_NAME(RBP) - new_cfa; ++ fs->regs.reg[ 8].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 8].loc.offset = (long)&sf->REG_NAME(R8) - new_cfa; ++ fs->regs.reg[ 9].how = REG_SAVED_OFFSET; ++ fs->regs.reg[ 9].loc.offset = (long)&sf->REG_NAME(R9) - new_cfa; ++ fs->regs.reg[10].how = REG_SAVED_OFFSET; ++ fs->regs.reg[10].loc.offset = (long)&sf->REG_NAME(R10) - new_cfa; ++ fs->regs.reg[11].how = REG_SAVED_OFFSET; ++ fs->regs.reg[11].loc.offset = (long)&sf->REG_NAME(R11) - new_cfa; ++ fs->regs.reg[12].how = REG_SAVED_OFFSET; ++ fs->regs.reg[12].loc.offset = (long)&sf->REG_NAME(R12) - new_cfa; ++ fs->regs.reg[13].how = REG_SAVED_OFFSET; ++ fs->regs.reg[13].loc.offset = (long)&sf->REG_NAME(R13) - new_cfa; ++ fs->regs.reg[14].how = REG_SAVED_OFFSET; ++ fs->regs.reg[14].loc.offset = (long)&sf->REG_NAME(R14) - new_cfa; ++ fs->regs.reg[15].how = REG_SAVED_OFFSET; ++ fs->regs.reg[15].loc.offset = (long)&sf->REG_NAME(R15) - new_cfa; ++ fs->regs.reg[16].how = REG_SAVED_OFFSET; ++ fs->regs.reg[16].loc.offset = (long)&sf->REG_NAME(RIP) - new_cfa; ++ fs->retaddr_column = 16; ++ fs->signal_frame = 1; ++ return _URC_NO_REASON; ++} ++ ++ ++ ++ ++#else /* Next section is for i386 */ ++ ++ ++ ++ ++#define MD_FALLBACK_FRAME_STATE_FOR x86_netbsd_fallback_frame_state ++ ++static _Unwind_Reason_Code ++x86_netbsd_fallback_frame_state ++(struct _Unwind_Context *context, _Unwind_FrameState *fs) ++{ ++ /* signal_frame is sigframe_siginfo minus sf_ra handler return address */ ++ struct signal_frame { ++ int sf_signum; /* "signum" argument for handler" */ ++ siginfo_t *sf_sip; /* "sip" argument for handler" */ ++ ucontext_t *sf_ucp; /* "ucp" argument for handler" */ ++ siginfo_t sf_si; /* actual saved siginfo */ ++ ucontext_t sf_uc; /* actual saved ucontext */ ++ }; ++ struct signal_frame *sf; ++ long new_cfa; ++ ++ /* We are looking for the following signal trampoline pattern. If we don't ++ find it, we are at the end of the stack and can't unwind. ++ ++ <__sigtramp_siginfo_2+18>: movl $0xffffffff,0x4(%esp) ++ <__sigtramp_siginfo_2+26>: mov $0x1,%eax ++ <__sigtramp_siginfo_2+31>: int $0x80 ++ */ ++ ++ if ( *(unsigned int *) (context->ra + 18) == 0x042444c7 ++ && *(unsigned int *) (context->ra + 22) == 0xffffffff ++ && *(unsigned char *) (context->ra + 26) == 0xb8 ++ && *(unsigned int *) (context->ra + 27) == 0x00000001 ++ && *(unsigned short *) (context->ra + 31) == 0x80cd ) ++ { ++ sf = (struct signal_frame *) context->cfa; ++ new_cfa = sf->REG_NAME(ESP); ++ fs->regs.cfa_how = CFA_REG_OFFSET; ++ fs->regs.cfa_reg = 4; ++ fs->regs.cfa_offset = new_cfa - (long) context->cfa; ++ } ++ else ++ { ++ return _URC_END_OF_STACK; ++ } ++ ++ /* The SVR4 register numbering macros aren't usable in libgcc. */ ++ fs->regs.reg[0].how = REG_SAVED_OFFSET; ++ fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(EAX) - new_cfa; ++ fs->regs.reg[3].how = REG_SAVED_OFFSET; ++ fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(EBX) - new_cfa; ++ fs->regs.reg[1].how = REG_SAVED_OFFSET; ++ fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(ECX) - new_cfa; ++ fs->regs.reg[2].how = REG_SAVED_OFFSET; ++ fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(EDX) - new_cfa; ++ fs->regs.reg[6].how = REG_SAVED_OFFSET; ++ fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(ESI) - new_cfa; ++ fs->regs.reg[7].how = REG_SAVED_OFFSET; ++ fs->regs.reg[7].loc.offset = (long)&sf->REG_NAME(EDI) - new_cfa; ++ fs->regs.reg[5].how = REG_SAVED_OFFSET; ++ fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(EBP) - new_cfa; ++ fs->regs.reg[8].how = REG_SAVED_OFFSET; ++ fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(EIP) - new_cfa; ++ fs->retaddr_column = 8; ++ fs->signal_frame = 1; ++ return _URC_NO_REASON; ++} ++ ++ ++ ++ ++#endif /* ifdef __x86_64__ */ ++ +--- libiberty/getpagesize.c.orig ++++ libiberty/getpagesize.c +@@ -20,6 +20,7 @@ + + */ + ++#ifndef __ANDROID__ + #ifndef VMS + + #include "config.h" +@@ -88,3 +89,4 @@ + } + + #endif /* VMS */ ++#endif /* __ANDROID__ */ +--- libiberty/setproctitle.c.orig ++++ libiberty/setproctitle.c +@@ -40,9 +40,11 @@ + void + setproctitle (const char *name ATTRIBUTE_UNUSED, ...) + { ++#ifndef __ANDROID__ + #ifdef PR_SET_NAME + /* On GNU/Linux this sets the top visible "comm", but not + necessarily the name visible in ps. */ + prctl (PR_SET_NAME, name); + #endif ++#endif + } +--- gcc/configure.orig ++++ gcc/configure +@@ -26810,6 +26810,20 @@ + gcc_cv_target_dl_iterate_phdr=no + fi + ;; ++ *-*-dragonfly* | *-*-freebsd*) ++ if grep dl_iterate_phdr $target_header_dir/sys/link_elf.h > /dev/null 2>&1; then ++ gcc_cv_target_dl_iterate_phdr=yes ++ else ++ gcc_cv_target_dl_iterate_phdr=no ++ fi ++ ;; ++ *-*-netbsd*) ++ if grep dl_iterate_phdr $target_header_dir/link_elf.h > /dev/null 2>&1; then ++ gcc_cv_target_dl_iterate_phdr=yes ++ else ++ gcc_cv_target_dl_iterate_phdr=no ++ fi ++ ;; + esac + + if test x$gcc_cv_target_dl_iterate_phdr = xyes; then +--- gcc/Makefile.in.orig ++++ gcc/Makefile.in +@@ -4378,7 +4378,7 @@ + DESTDIR=$(@D) \ + $(SHELL) $(srcdir)/doc/install.texi2html + +-MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 doc/fsf-funding.7 ++MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 + + generated-manpages: man + +@@ -4530,7 +4530,7 @@ + # Install the driver last so that the window when things are + # broken is small. + install: install-common $(INSTALL_HEADERS) \ +- install-cpp install-man install-info install-@POSUB@ \ ++ install-cpp install-man install-@POSUB@ \ + install-driver install-lto-wrapper install-gcc-ar + + ifeq ($(enable_plugin),yes) +@@ -4655,6 +4655,9 @@ + -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext) + -( cd $(DESTDIR)$(bindir) && \ + $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) ) ++ -if [ -f gnat1$(exeext) ] ; then \ ++ ( cd $(DESTDIR)$(bindir) && $(LN) $(GCC_INSTALL_NAME)$(exeext) ada$(exeext) ) \ ++ fi + -if [ -f gcc-cross$(exeext) ] ; then \ + if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \ + rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \ +@@ -4728,10 +4731,7 @@ + install-man: lang.install-man \ + $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \ + $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \ +- $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \ +- $(DESTDIR)$(man7dir)/fsf-funding$(man7ext) \ +- $(DESTDIR)$(man7dir)/gfdl$(man7ext) \ +- $(DESTDIR)$(man7dir)/gpl$(man7ext) ++ $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) + + $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs + -rm -f $@ +--- configure.orig ++++ configure +@@ -14412,7 +14412,7 @@ + _ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; }; stage1_cflags="$stage1_cflags -fkeep-inline-functions" ++$as_echo "yes" >&6; }; + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } diff --git a/lang/gcc-aux/files/diff-cxx b/lang/gcc-aux/files/diff-cxx new file mode 100644 index 00000000000..8a0cd904a57 --- /dev/null +++ b/lang/gcc-aux/files/diff-cxx @@ -0,0 +1,920 @@ +--- libstdc++-v3/acinclude.m4.orig ++++ libstdc++-v3/acinclude.m4 +@@ -1903,7 +1903,7 @@ + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ + GLIBCXX_ENABLE(clocale,auto,[[[=MODEL]]], + [use MODEL for target locale package], +- [permit generic|gnu|ieee_1003.1-2001|newlib|yes|no|auto]) ++ [permit generic|gnu|ieee_1003.1-2001|newlib|darwin|dragonfly|yes|no|auto]) + + # Deal with gettext issues. Default to not using it (=no) until we detect + # support for it later. Let the user turn it off via --e/d, but let that +@@ -1930,6 +1930,9 @@ + darwin* | freebsd*) + enable_clocale_flag=darwin + ;; ++ dragonfly*) ++ enable_clocale_flag=dragonfly ++ ;; + *) + if test x"$with_newlib" = x"yes"; then + enable_clocale_flag=newlib +@@ -2018,7 +2021,22 @@ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ dragonfly) ++ AC_MSG_RESULT(dragonfly) + ++ CLOCALE_H=config/locale/generic/c_locale.h ++ CLOCALE_CC=config/locale/dragonfly/c_locale.cc ++ CCODECVT_CC=config/locale/generic/codecvt_members.cc ++ CCOLLATE_CC=config/locale/generic/collate_members.cc ++ CCTYPE_CC=config/locale/dragonfly/ctype_members.cc ++ CMESSAGES_H=config/locale/generic/messages_members.h ++ CMESSAGES_CC=config/locale/generic/messages_members.cc ++ CMONEY_CC=config/locale/generic/monetary_members.cc ++ CNUMERIC_CC=config/locale/generic/numeric_members.cc ++ CTIME_H=config/locale/generic/time_members.h ++ CTIME_CC=config/locale/generic/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h ++ ;; + gnu) + AC_MSG_RESULT(gnu) + +--- libstdc++-v3/configure.orig ++++ libstdc++-v3/configure +@@ -15704,7 +15704,7 @@ + if test "${enable_clocale+set}" = set; then : + enableval=$enable_clocale; + case "$enableval" in +- generic|gnu|ieee_1003.1-2001|newlib|yes|no|auto) ;; ++ generic|gnu|ieee_1003.1-2001|newlib|darwin|dragonfly|yes|no|auto) ;; + *) as_fn_error "Unknown argument to enable/disable clocale" "$LINENO" 5 ;; + esac + +@@ -15742,6 +15742,9 @@ + darwin* | freebsd*) + enable_clocale_flag=darwin + ;; ++ dragonfly*) ++ enable_clocale_flag=dragonfly ++ ;; + *) + if test x"$with_newlib" = x"yes"; then + enable_clocale_flag=newlib +@@ -15883,7 +15886,23 @@ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ dragonfly) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: dragonfly" >&5 ++$as_echo "dragonfly" >&6; } + ++ CLOCALE_H=config/locale/generic/c_locale.h ++ CLOCALE_CC=config/locale/dragonfly/c_locale.cc ++ CCODECVT_CC=config/locale/generic/codecvt_members.cc ++ CCOLLATE_CC=config/locale/generic/collate_members.cc ++ CCTYPE_CC=config/locale/dragonfly/ctype_members.cc ++ CMESSAGES_H=config/locale/generic/messages_members.h ++ CMESSAGES_CC=config/locale/generic/messages_members.cc ++ CMONEY_CC=config/locale/generic/monetary_members.cc ++ CNUMERIC_CC=config/locale/generic/numeric_members.cc ++ CTIME_H=config/locale/generic/time_members.h ++ CTIME_CC=config/locale/generic/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h ++ ;; + gnu) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: gnu" >&5 + $as_echo "gnu" >&6; } +--- libstdc++-v3/configure.host.orig ++++ libstdc++-v3/configure.host +@@ -239,6 +239,9 @@ + os_include_dir="os/djgpp" + error_constants_dir="os/djgpp" + ;; ++ dragonfly*) ++ os_include_dir="os/bsd/dragonfly" ++ ;; + freebsd*) + os_include_dir="os/bsd/freebsd" + ;; +--- /dev/null ++++ libstdc++-v3/config/locale/dragonfly/c_locale.cc +@@ -0,0 +1,300 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ++// Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// <http://www.gnu.org/licenses/>. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik <bkoz@redhat.com> ++ ++#include <cerrno> // For errno ++#include <cmath> // For isinf, finite, finitef, fabs ++#include <cstdlib> // For strof, strtold ++#include <cstring> ++#include <cstdio> ++#include <locale> ++#include <limits> ++ ++#ifdef _GLIBCXX_HAVE_IEEEFP_H ++#include <ieeefp.h> ++#endif ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, ++ const __c_locale&) throw() ++ { ++ // Assumes __s formatted for "C" locale. ++ char* __old = setlocale(LC_ALL, 0); ++ const size_t __len = strlen(__old) + 1; ++ char* __sav = new char[__len]; ++ memcpy(__sav, __old, __len); ++ setlocale(LC_ALL, "C"); ++ char* __sanity; ++ bool __overflow = false; ++ ++#if !__FLT_HAS_INFINITY__ ++ errno = 0; ++#endif ++ ++#ifdef _GLIBCXX_HAVE_STRTOF ++ __v = strtof(__s, &__sanity); ++#else ++ double __d = strtod(__s, &__sanity); ++ __v = static_cast<float>(__d); ++#ifdef _GLIBCXX_HAVE_FINITEF ++ if (!finitef (__v)) ++ __overflow = true; ++#elif defined (_GLIBCXX_HAVE_FINITE) ++ if (!finite (static_cast<double> (__v))) ++ __overflow = true; ++#elif defined (_GLIBCXX_HAVE_ISINF) ++ if (isinf (static_cast<double> (__v))) ++ __overflow = true; ++#else ++ if (fabs(__d) > numeric_limits<float>::max()) ++ __overflow = true; ++#endif ++#endif // _GLIBCXX_HAVE_STRTOF ++ ++ // _GLIBCXX_RESOLVE_LIB_DEFECTS ++ // 23. Num_get overflow result. ++ if (__sanity == __s || *__sanity != '\0') ++ { ++ __v = 0.0f; ++ __err = ios_base::failbit; ++ } ++ else if (__overflow ++#if __FLT_HAS_INFINITY__ ++ || __v == numeric_limits<float>::infinity() ++ || __v == -numeric_limits<float>::infinity() ++#else ++ || ((__v > 1.0f || __v < -1.0f) && errno == ERANGE) ++#endif ++ ) ++ { ++ if (__v > 0.0f) ++ __v = numeric_limits<float>::max(); ++ else ++ __v = -numeric_limits<float>::max(); ++ __err = ios_base::failbit; ++ } ++ ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, ++ const __c_locale&) throw() ++ { ++ // Assumes __s formatted for "C" locale. ++ char* __old = setlocale(LC_ALL, 0); ++ const size_t __len = strlen(__old) + 1; ++ char* __sav = new char[__len]; ++ memcpy(__sav, __old, __len); ++ setlocale(LC_ALL, "C"); ++ char* __sanity; ++ ++#if !__DBL_HAS_INFINITY__ ++ errno = 0; ++#endif ++ ++ __v = strtod(__s, &__sanity); ++ ++ // _GLIBCXX_RESOLVE_LIB_DEFECTS ++ // 23. Num_get overflow result. ++ if (__sanity == __s || *__sanity != '\0') ++ { ++ __v = 0.0; ++ __err = ios_base::failbit; ++ } ++ else if ( ++#if __DBL_HAS_INFINITY__ ++ __v == numeric_limits<double>::infinity() ++ || __v == -numeric_limits<double>::infinity()) ++#else ++ (__v > 1.0 || __v < -1.0) && errno == ERANGE) ++#endif ++ { ++ if (__v > 0.0) ++ __v = numeric_limits<double>::max(); ++ else ++ __v = -numeric_limits<double>::max(); ++ __err = ios_base::failbit; ++ } ++ ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, long double& __v, ++ ios_base::iostate& __err, const __c_locale&) throw() ++ { ++ // Assumes __s formatted for "C" locale. ++ char* __old = setlocale(LC_ALL, 0); ++ const size_t __len = strlen(__old) + 1; ++ char* __sav = new char[__len]; ++ memcpy(__sav, __old, __len); ++ setlocale(LC_ALL, "C"); ++ ++#if !__LDBL_HAS_INFINITY__ ++ errno = 0; ++#endif ++ ++#if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD) ++ char* __sanity; ++ __v = strtold(__s, &__sanity); ++ ++ // _GLIBCXX_RESOLVE_LIB_DEFECTS ++ // 23. Num_get overflow result. ++ if (__sanity == __s || *__sanity != '\0') ++#else ++ typedef char_traits<char>::int_type int_type; ++ int __p = sscanf(__s, "%Lf", &__v); ++ ++ if (!__p || static_cast<int_type>(__p) == char_traits<char>::eof()) ++#endif ++ { ++ __v = 0.0l; ++ __err = ios_base::failbit; ++ } ++ else if ( ++#if __LDBL_HAS_INFINITY__ ++ __v == numeric_limits<long double>::infinity() ++ || __v == -numeric_limits<long double>::infinity()) ++#else ++ (__v > 1.0l || __v < -1.0l) && errno == ERANGE) ++#endif ++ { ++ if (__v > 0.0l) ++ __v = numeric_limits<long double>::max(); ++ else ++ __v = -numeric_limits<long double>::max(); ++ __err = ios_base::failbit; ++ } ++ ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; ++ } ++ ++ ++ /* DragonFly's implementation of setlocale won't accept something like ++ "de_DE". According to nls manpage, the expected format is: ++ language[_territory][.codeset][@modifier], but it seems that both ++ the _territory and .codeset components are required. ++ ++ As an attempt to correct for this, we'll tack on ".UTF-8" if ++ a period is not detected in the locale string. ++ ++ There are no locales with modifiers on DragonFly so if found, they ++ will just be stripped off silently. e.g "de_DE@euro" will be reduced ++ to "de_DE". The UTF-8 default would be added after that. ++ */ ++ ++ void ++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, ++ __c_locale) ++ { ++ const size_t size__s = (__s == NULL) ? 1 : strlen (__s); ++ const char UTF8[] = ".UTF-8"; ++ char localspec[size__s + 6 + 1]; ++ ++ if (__s == NULL) { ++ localspec[0] = NULL; ++ } else { ++ strcpy (localspec, __s); ++ char * pch = strchr (localspec, '@'); ++ if (pch != NULL) ++ *pch = 0; ++ ++ if ( (strchr (__s, '.') == NULL) ++ && (strcmp (__s, "C") != 0) ++ && (strcmp (__s, "POSIX") != 0)) ++ strncat (localspec, UTF8, 6); ++ } ++ ++ const char * result = std::setlocale(LC_ALL, localspec); ++ ++ if ((strcmp(result, "C") != 0) && (strcmp (result, localspec) != 0)) ++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale " ++ "name not valid")); ++ __cloc = 0; ++ } ++ ++ void ++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc) ++ { __cloc = 0; } ++ ++ __c_locale ++ locale::facet::_S_clone_c_locale(__c_locale&) throw() ++ { return __c_locale(); } ++ ++ __c_locale ++ locale::facet::_S_lc_ctype_c_locale(__c_locale, const char*) ++ { return __c_locale(); } ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace ++ ++namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = ++ { ++ "LC_CTYPE", ++ "LC_NUMERIC", ++ "LC_TIME", ++ "LC_COLLATE", ++ "LC_MONETARY", ++ "LC_MESSAGES" ++ }; ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ const char* const* const locale::_S_categories = __gnu_cxx::category_names; ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace ++ ++// XXX GLIBCXX_ABI Deprecated ++#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT ++#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \ ++ extern "C" void ldbl (void) __attribute__ ((alias (#dbl))) ++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi); ++#endif // _GLIBCXX_LONG_DOUBLE_COMPAT +--- /dev/null ++++ libstdc++-v3/config/locale/dragonfly/ctype_members.cc +@@ -0,0 +1,174 @@ ++// std::ctype implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ++// Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// <http://www.gnu.org/licenses/>. ++ ++// ++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. ++// ++ ++// Written by Benjamin Kosnik <bkoz@redhat.com> ++ ++#include <locale> ++#include <bits/c++locale_internal.h> ++#include <cstdlib> ++#include <cstring> ++#include <cstdio> ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++ // NB: The other ctype<char> specializations are in src/locale.cc and ++ // various /config/os/* files. ++ ++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs) ++ : ctype<char>(0, false, __refs) ++ { ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_ctype); ++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s); ++ } ++ } ++ ++ ctype_byname<char>::~ctype_byname() ++ { } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ ctype<wchar_t>::__wmask_type ++ ctype<wchar_t>::_M_convert_to_wmask( ++ const mask __attribute__((__unused__)) __m) const throw() ++ { ++ // DragonFly uses the same codes for 'char' as 'wchar_t', so this routine ++ // never gets called. ++ return __wmask_type(); ++ }; ++ ++ wchar_t ++ ctype<wchar_t>::do_toupper(wchar_t __c) const ++ { return towupper(__c); } ++ ++ const wchar_t* ++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = towupper(*__lo); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ wchar_t ++ ctype<wchar_t>::do_tolower(wchar_t __c) const ++ { return towlower(__c); } ++ ++ const wchar_t* ++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = towlower(*__lo); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ wchar_t ++ ctype<wchar_t>:: ++ do_widen(char __c) const ++ { return _M_widen[static_cast<unsigned char>(__c)]; } ++ ++ const char* ++ ctype<wchar_t>:: ++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const ++ { ++ while (__lo < __hi) ++ { ++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)]; ++ ++__lo; ++ ++__dest; ++ } ++ return __hi; ++ } ++ ++ char ++ ctype<wchar_t>:: ++ do_narrow(wchar_t __wc, char __dfault) const ++ { ++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok) ++ return _M_narrow[__wc]; ++ const int __c = wctob(__wc); ++ return (__c == EOF ? __dfault : static_cast<char>(__c)); ++ } ++ ++ const wchar_t* ++ ctype<wchar_t>:: ++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, ++ char* __dest) const ++ { ++ if (_M_narrow_ok) ++ while (__lo < __hi) ++ { ++ if (*__lo >= 0 && *__lo < 128) ++ *__dest = _M_narrow[*__lo]; ++ else ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); ++ } ++ ++__lo; ++ ++__dest; ++ } ++ else ++ while (__lo < __hi) ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); ++ ++__lo; ++ ++__dest; ++ } ++ return __hi; ++ } ++ ++ void ++ ctype<wchar_t>::_M_initialize_ctype() throw() ++ { ++ wint_t __i; ++ for (__i = 0; __i < 128; ++__i) ++ { ++ const int __c = wctob(__i); ++ if (__c == EOF) ++ break; ++ else ++ _M_narrow[__i] = static_cast<char>(__c); ++ } ++ if (__i == 128) ++ _M_narrow_ok = true; ++ else ++ _M_narrow_ok = false; ++ for (size_t __i = 0; ++ __i < sizeof(_M_widen) / sizeof(wint_t); ++__i) ++ _M_widen[__i] = btowc(__i); ++ } ++#endif // _GLIBCXX_USE_WCHAR_T ++} +--- /dev/null ++++ libstdc++-v3/config/os/bsd/dragonfly/ctype_base.h +@@ -0,0 +1,60 @@ ++// Locale support -*- C++ -*- ++ ++// Copyright (C) 2000, 2003, 2009, 2010 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// <http://www.gnu.org/licenses/>. ++ ++// ++// ISO C++ 14882: 22.1 Locales ++// ++ ++// Information as gleaned from /usr/include/ctype.h on DragonFly. ++// Full details can be found from git repo at: ++// http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/ctype.h ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ /// @brief Base class for ctype. ++ struct ctype_base ++ { ++ // Non-standard typedefs. ++ typedef const unsigned char* __to_type; ++ ++ // NB: Offsets into ctype<char>::_M_table force a particular size ++ // on the mask type. Because of this, we don't use an enum. ++ typedef uint16_t mask; ++ static const mask upper = _CTYPEMASK_U; ++ static const mask lower = _CTYPEMASK_L; ++ static const mask alpha = _CTYPEMASK_A; ++ static const mask digit = _CTYPEMASK_D; ++ static const mask xdigit = _CTYPEMASK_X; ++ static const mask space = _CTYPEMASK_S; ++ static const mask print = _CTYPEMASK_R; ++ static const mask graph = _CTYPEMASK_G; ++ static const mask cntrl = _CTYPEMASK_C; ++ static const mask punct = _CTYPEMASK_P; ++ static const mask alnum = _CTYPEMASK_A | _CTYPEMASK_D; ++ }; ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +--- /dev/null ++++ libstdc++-v3/config/os/bsd/dragonfly/ctype_configure_char.cc +@@ -0,0 +1,99 @@ ++// Locale support -*- C++ -*- ++ ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// <http://www.gnu.org/licenses/>. ++ ++/** @file ctype_configure_char.cc */ ++ ++// ++// ISO C++ 14882: 22.1 Locales ++// ++ ++#include <locale> ++#include <cstdlib> ++#include <cstring> ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++// Information as gleaned from /usr/include/ctype.h ++ ++ const ctype_base::mask* ++ ctype<char>::classic_table() throw() ++ { return 0; } ++ ++ ctype<char>::ctype(__c_locale, const mask* __table, bool __del, ++ size_t __refs) ++ : facet(__refs), _M_del(__table != 0 && __del), ++ _M_toupper(NULL), _M_tolower(NULL), ++ _M_table(__table ? __table : classic_table()) ++ { ++ memset(_M_widen, 0, sizeof(_M_widen)); ++ _M_widen_ok = 0; ++ memset(_M_narrow, 0, sizeof(_M_narrow)); ++ _M_narrow_ok = 0; ++ } ++ ++ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) ++ : facet(__refs), _M_del(__table != 0 && __del), ++ _M_toupper(NULL), _M_tolower(NULL), ++ _M_table(__table ? __table : classic_table()) ++ { ++ memset(_M_widen, 0, sizeof(_M_widen)); ++ _M_widen_ok = 0; ++ memset(_M_narrow, 0, sizeof(_M_narrow)); ++ _M_narrow_ok = 0; ++ } ++ ++ char ++ ctype<char>::do_toupper(char __c) const ++ { return ::toupper((int) __c); } ++ ++ const char* ++ ctype<char>::do_toupper(char* __low, const char* __high) const ++ { ++ while (__low < __high) ++ { ++ *__low = ::toupper((int) *__low); ++ ++__low; ++ } ++ return __high; ++ } ++ ++ char ++ ctype<char>::do_tolower(char __c) const ++ { return ::tolower((int) __c); } ++ ++ const char* ++ ctype<char>::do_tolower(char* __low, const char* __high) const ++ { ++ while (__low < __high) ++ { ++ *__low = ::tolower((int) *__low); ++ ++__low; ++ } ++ return __high; ++ } ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +--- /dev/null ++++ libstdc++-v3/config/os/bsd/dragonfly/ctype_inline.h +@@ -0,0 +1,127 @@ ++// Locale support -*- C++ -*- ++ ++// Copyright (C) 2000, 2003, 2004, 2005, 2009, 2010 ++// Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// <http://www.gnu.org/licenses/>. ++ ++/** @file bits/ctype_inline.h ++ * This is an internal header file, included by other library headers. ++ * Do not attempt to use it directly. @headername{locale} ++ */ ++ ++// ++// ISO C++ 14882: 22.1 Locales ++// ++ ++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) ++// functions go in ctype.cc ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ bool ++ ctype<char>:: ++ is(mask __m, char __c) const ++ { return _M_table[(unsigned char)(__c)] & __m; } ++ ++ const char* ++ ctype<char>:: ++ is(const char* __low, const char* __high, mask* __vec) const ++ { ++ while (__low < __high) ++ *__vec++ = _M_table[*__low++]; ++ return __high; ++ } ++ ++ const char* ++ ctype<char>:: ++ scan_is(mask __m, const char* __low, const char* __high) const ++ { ++ while (__low < __high && !this->is(__m, *__low)) ++ ++__low; ++ return __low; ++ } ++ ++ const char* ++ ctype<char>:: ++ scan_not(mask __m, const char* __low, const char* __high) const ++ { ++ while (__low < __high && this->is(__m, *__low) != 0) ++ ++__low; ++ return __low; ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ inline bool ++ ctype<wchar_t>:: ++ do_is(mask __m, wchar_t __c) const ++ { ++ return __libc_ctype_ [__c + 1] & __m; ++ } ++ ++ inline const wchar_t* ++ ctype<wchar_t>:: ++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const ++ { ++ for (; __lo < __hi; ++__vec, ++__lo) ++ { ++ mask __m = 0; ++ if (isupper (*__lo)) __m |= _CTYPEMASK_U; ++ if (islower (*__lo)) __m |= _CTYPEMASK_L; ++ if (isdigit (*__lo)) __m |= _CTYPEMASK_D; ++ if (isspace (*__lo)) __m |= _CTYPEMASK_S; ++ if (ispunct (*__lo)) __m |= _CTYPEMASK_P; ++ if (isblank (*__lo)) __m |= _CTYPEMASK_B; ++ if (iscntrl (*__lo)) __m |= _CTYPEMASK_C; ++ if (isalpha (*__lo)) __m |= _CTYPEMASK_A; ++ if (isgraph (*__lo)) __m |= _CTYPEMASK_G; ++ if (isprint (*__lo)) __m |= _CTYPEMASK_R; ++ if (isxdigit(*__lo)) __m |= _CTYPEMASK_X; ++ /* alnum already covered = alpha | digit */ ++ ++ *__vec = __m; ++ } ++ return __hi; ++ } ++ ++ inline const wchar_t* ++ ctype<wchar_t>:: ++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi && !(__libc_ctype_ [*__lo + 1] & __m)) ++ ++__lo; ++ return __lo; ++ } ++ ++ inline const wchar_t* ++ ctype<wchar_t>:: ++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const ++ { ++ while (__lo < __hi && (__libc_ctype_ [*__lo + 1] & __m)) ++ ++__lo; ++ return __lo; ++ } ++#endif ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +--- /dev/null ++++ libstdc++-v3/config/os/bsd/dragonfly/os_defines.h +@@ -0,0 +1,41 @@ ++// Specific definitions for BSD -*- C++ -*- ++ ++// Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// <http://www.gnu.org/licenses/>. ++ ++ ++#ifndef _GLIBCXX_OS_DEFINES ++#define _GLIBCXX_OS_DEFINES 1 ++ ++// System-specific #define, typedefs, corrections, etc, go here. This ++// file will come before all others. ++ ++/* FreeBSD approach, likely a mistake for DragonFly. ++#define _GLIBCXX_USE_C99_CHECK 1 ++#define _GLIBCXX_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999)) ++#define _GLIBCXX_USE_C99_LONG_LONG_CHECK 1 ++#define _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC (_GLIBCXX_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED) ++#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_CHECK 1 ++#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC defined _XOPEN_SOURCE ++*/ ++ ++#endif diff --git a/lang/gcc-aux/files/diff-cxx-testsuite b/lang/gcc-aux/files/diff-cxx-testsuite new file mode 100644 index 00000000000..f1009504079 --- /dev/null +++ b/lang/gcc-aux/files/diff-cxx-testsuite @@ -0,0 +1,4536 @@ +--- gcc/testsuite/g++.dg/cdce3.C.orig ++++ gcc/testsuite/g++.dg/cdce3.C +@@ -1,4 +1,4 @@ +-/* { dg-do run } */ ++/* { dg-do run { target { ! "*-*-freebsd* *-*-dragonfly* *-*-netbsd*" } } } */ + /* { dg-require-effective-target c99_runtime } */ + /* { dg-skip-if "exp2* missing despite C99 runtime" { alpha*-dec-osf5* } } */ + /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ +--- gcc/testsuite/gcc.dg/builtins-config.h.orig ++++ gcc/testsuite/gcc.dg/builtins-config.h +@@ -16,8 +16,14 @@ + /* Interix6 doesn't have the entire C99 runtime. */ + #elif defined(__AVR__) + /* AVR doesn't have the entire C99 runtime. */ +-#elif defined(__FreeBSD__) && (__FreeBSD__ < 9) +-/* FreeBSD up to version 8 lacks support for cexp and friends. */ ++#elif defined(__FreeBSD__) && (__FreeBSD__ < 10) ++/* FreeBSD up to version 9 lacks support for cexp and friends. */ ++#elif defined(__DragonFly__) ++/* As of DragonFly 2.13, Full C99 support is not available. ++ It has the same libm functionality as FreeBSD, which is missing ++ several long-double functions. */ ++#elif defined(__NetBSD__) ++/* As of NetBSD 5.99, libm is nowhere close to supporting C99 */ + #elif defined(__vxworks) + /* VxWorks doesn't have a full C99 time. (cabs is missing, for example.) */ + #elif defined(_WIN32) && !defined(__CYGWIN__) +--- libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++.cc.orig ++++ libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++.cc +@@ -1,5 +1,5 @@ + // FreeBSD wants warning clean system headers: +-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* } } ++// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } + // { dg-do compile } + // 1999-05-12 bkoz + +--- libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_multiple_inclusion.cc.orig ++++ libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_multiple_inclusion.cc +@@ -1,5 +1,5 @@ + // FreeBSD wants warning clean system headers: +-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* } } ++// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } + // { dg-do compile } + // 1999-05-12 bkoz + +--- libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc.orig ++++ libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc +@@ -1,5 +1,5 @@ + // FreeBSD wants warning clean system headers: +-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* } } ++// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } + // { dg-options "-std=gnu++0x" } + // { dg-do compile } + +--- libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc.orig ++++ libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++_multiple_inclusion.cc +@@ -1,5 +1,5 @@ + // FreeBSD wants warning clean system headers: +-// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* } } ++// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } } + // { dg-options "-std=gnu++0x" } + // { dg-do compile } + +--- libstdc++-v3/testsuite/18_support/pthread_guard.cc.orig ++++ libstdc++-v3/testsuite/18_support/pthread_guard.cc +@@ -16,8 +16,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-darwin* alpha*-*-osf* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-darwin* alpha*-*-osf* } } + + #include <cstdlib> + #include <pthread.h> +--- libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc.orig ++++ libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc +@@ -17,8 +17,8 @@ + + // 20.6.6.2 Template class shared_ptr [util.smartptr.shared] + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread -std=gnu++0x" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread -std=gnu++0x" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads -std=gnu++0x" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + +--- libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc.orig ++++ libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc +@@ -17,8 +17,8 @@ + + // 20.6.6.2 Template class shared_ptr [util.smartptr.shared] + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + +--- libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc.orig ++++ libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc +@@ -16,8 +16,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <ext/new_allocator.h> +--- libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc.orig ++++ libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc +@@ -20,8 +20,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <string> +--- libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc.orig ++++ libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "fr_FR" } +--- libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "fr_FR" } +--- libstdc++-v3/testsuite/23_containers/list/pthread1.cc.orig ++++ libstdc++-v3/testsuite/23_containers/list/pthread1.cc +@@ -18,8 +18,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + // This multi-threading C++/STL/POSIX code adheres to rules outlined here: +--- libstdc++-v3/testsuite/23_containers/list/pthread5.cc.orig ++++ libstdc++-v3/testsuite/23_containers/list/pthread5.cc +@@ -20,8 +20,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <vector> +--- libstdc++-v3/testsuite/23_containers/map/pthread6.cc.orig ++++ libstdc++-v3/testsuite/23_containers/map/pthread6.cc +@@ -19,8 +19,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <string> +--- libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc.orig ++++ libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math_dynamic.cc.orig ++++ libstdc++-v3/testsuite/26_numerics/headers/cmath/c_math_dynamic.cc +@@ -19,7 +19,7 @@ + + + // { dg-do link } +-// { dg-options "-D_XOPEN_SOURCE" { target *-*-freebsd* } } ++// { dg-options "-D_XOPEN_SOURCE" { target *-*-freebsd* *-*-dragonfly* } } + + #include <cmath> + +--- libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_ofstream/pthread2.cc +@@ -19,8 +19,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <fstream> +--- libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_ostringstream/pthread3.cc +@@ -19,8 +19,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <sstream> +--- libstdc++-v3/testsuite/30_threads/async/42819.cc.orig ++++ libstdc++-v3/testsuite/30_threads/async/42819.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/async/any.cc.orig ++++ libstdc++-v3/testsuite/30_threads/async/any.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/async/async.cc.orig ++++ libstdc++-v3/testsuite/30_threads/async/async.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/async/sync.cc.orig ++++ libstdc++-v3/testsuite/30_threads/async/sync.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/call_once/39909.cc.orig ++++ libstdc++-v3/testsuite/30_threads/call_once/39909.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc.orig ++++ libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/future/cons/move.cc.orig ++++ libstdc++-v3/testsuite/30_threads/future/cons/move.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/future/members/45133.cc.orig ++++ libstdc++-v3/testsuite/30_threads/future/members/45133.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/future/members/get.cc.orig ++++ libstdc++-v3/testsuite/30_threads/future/members/get.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/future/members/get2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/future/members/get2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/future/members/valid.cc.orig ++++ libstdc++-v3/testsuite/30_threads/future/members/valid.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/future/members/wait.cc.orig ++++ libstdc++-v3/testsuite/30_threads/future/members/wait.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc.orig ++++ libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc.orig ++++ libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/lock/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/lock/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/lock/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/lock/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/lock/4.cc.orig ++++ libstdc++-v3/testsuite/30_threads/lock/4.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc.orig ++++ libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc.orig ++++ libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc.orig ++++ libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/cons/move.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/cons/move.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/promise/members/swap.cc.orig ++++ libstdc++-v3/testsuite/30_threads/promise/members/swap.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options "-std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options "-std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc.orig ++++ libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc.orig ++++ libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc.orig ++++ libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc.orig ++++ libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc.orig ++++ libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc.orig ++++ libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc.orig ++++ libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/this_thread/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/this_thread/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/this_thread/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/this_thread/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/this_thread/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/this_thread/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/this_thread/4.cc.orig ++++ libstdc++-v3/testsuite/30_threads/this_thread/4.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/4.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/4.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/5.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/5.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/6.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/6.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/7.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/7.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/8.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/8.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/9.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/9.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/members/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/members/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/members/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/members/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/members/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/members/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/members/4.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/members/4.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/members/5.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/members/5.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/thread/swap/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/thread/swap/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/try_lock/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/try_lock/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/try_lock/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/try_lock/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/try_lock/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/try_lock/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/try_lock/4.cc.orig ++++ libstdc++-v3/testsuite/30_threads/try_lock/4.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc.orig ++++ libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc +@@ -1,5 +1,5 @@ +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +--- libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc.orig ++++ libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc +@@ -18,8 +18,8 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <ext/rope> +--- libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc.orig ++++ libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc +@@ -17,8 +17,8 @@ + + // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <tr1/memory> +--- libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc.orig ++++ libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc +@@ -17,8 +17,8 @@ + + // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } + // { dg-options "-pthreads" { target *-*-solaris* } } + + #include <tr1/memory> +--- libstdc++-v3/testsuite/lib/libstdc++.exp.orig ++++ libstdc++-v3/testsuite/lib/libstdc++.exp +@@ -864,17 +864,18 @@ + set f [open $src "w"] + puts $f "#include <locale>" + puts $f "#include <cstdio>" +- puts $f "using namespace std;" ++ puts $f "using namespace std;" + puts $f "int main (int argc, char** argv)" + puts $f "{" ++ puts $f " const char* mlx = *(argv + 1);" + puts $f " try" + puts $f " {" +- puts $f " locale(*(argv + 1));" ++ puts $f " locale((char*)(mlx));" + puts $f " return 0;" + puts $f " }" + puts $f " catch(...)" + puts $f " {" +- puts $f " printf(\"locale '%s' not supported\\n\", *(argv + 1));" ++ puts $f " printf(\"locale '%s' not supported\\n\", mlx);" + puts $f " return 1;" + puts $f " }" + puts $f "}" +--- libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/deque> +--- libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/deque> +--- libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/deque> +--- libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/list> +--- libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/list> +--- libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/list> +--- libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/map> +--- libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/map> +--- libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/map> +--- libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/map> +--- libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/set> +--- libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/set> +--- libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/set> +--- libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/set> +--- libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-options "-std=gnu++0x" } + // { dg-do run { xfail *-*-* } } + +--- libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-options "-std=gnu++0x" } + // { dg-do run { xfail *-*-* } } + +--- libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-options "-std=gnu++0x" } + // { dg-do run { xfail *-*-* } } + +--- libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-options "-std=gnu++0x" } + // { dg-do run { xfail *-*-* } } + +--- libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-options "-std=gnu++0x" } + // { dg-do run { xfail *-*-* } } + +--- libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-options "-std=gnu++0x" } + // { dg-do run { xfail *-*-* } } + +--- libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-options "-std=gnu++0x" } + // { dg-do run { xfail *-*-* } } + +--- libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-options "-std=gnu++0x" } + // { dg-do run { xfail *-*-* } } + +--- libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/vector> +--- libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/vector> +--- libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc.orig ++++ libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc +@@ -15,6 +15,7 @@ + // with this library; see the file COPYING3. If not see + // <http://www.gnu.org/licenses/>. + // ++// { dg-require-debug-mode "" } + // { dg-do run { xfail *-*-* } } + + #include <debug/vector> +--- libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -27,14 +27,14 @@ + // Required instantiation + // codecvt<wchar_t, char, mbstate_t> + // +-// Baseline test in ISO-8859-1 locale ++// Baseline test in ISO8859-1 locale + void test02() + { + using namespace std; + bool test __attribute__((unused)) = true; + typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-15" } ++// { dg-require-namedlocale "en_US.ISO8859-15" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -27,14 +27,14 @@ + // Required instantiation + // codecvt<wchar_t, char, mbstate_t> + // +-// Baseline test in ISO-8859-15 locale ++// Baseline test in ISO8859-15 locale + void test03() + { + using namespace std; + bool test __attribute__((unused)) = true; + typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; + +- locale loc = locale("en_US.ISO-8859-15"); ++ locale loc = locale("en_US.ISO8859-15"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -27,19 +27,19 @@ + // Required instantiation + // codecvt<wchar_t, char, mbstate_t> + // +-// Test do_encoding with ISO-8859-1 locale. ++// Test do_encoding with ISO8859-1 locale. + void test02() + { + using namespace std; + typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; + bool test __attribute__((unused)) = true; + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + + int i = cvt->encoding(); +- VERIFY( i == 1 ); // ISO-8859-1 is a single-byte encoding ++ VERIFY( i == 1 ); // ISO8859-1 is a single-byte encoding + } + + int main () +--- libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-15" } ++// { dg-require-namedlocale "en_US.ISO8859-15" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -27,19 +27,19 @@ + // Required instantiation + // codecvt<wchar_t, char, mbstate_t> + // +-// Test do_encoding with ISO-8859-15 locale. ++// Test do_encoding with ISO8859-15 locale. + void test03() + { + using namespace std; + typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; + bool test __attribute__((unused)) = true; + +- locale loc = locale("en_US.ISO-8859-15"); ++ locale loc = locale("en_US.ISO8859-15"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + + int i = cvt->encoding(); +- VERIFY( i == 1 ); // ISO-8859-15 is a single-byte encoding ++ VERIFY( i == 1 ); // ISO8859-15 is a single-byte encoding + } + + int main () +--- libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -41,7 +41,7 @@ + // Required instantiation + // codecvt<wchar_t, char, mbstate_t> + // +-// Baseline test for ISO-8859-1. Converts entire charset. ++// Baseline test for ISO8859-1. Converts entire charset. + void test02() + { + using namespace std; +@@ -90,7 +90,7 @@ + wmemset(i_ref, 0xdeadbeef, size + 1); + int_type* ito_next; + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-15" } ++// { dg-require-namedlocale "en_US.ISO8859-15" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -41,7 +41,7 @@ + // Required instantiation + // codecvt<wchar_t, char, mbstate_t> + // +-// Baseline test for ISO-8859-15. Converts entire charset. ++// Baseline test for ISO8859-15. Converts entire charset. + void test03() + { + using namespace std; +@@ -104,7 +104,7 @@ + wmemset(i_ref, 0xdeadbeef, size + 1); + int_type* ito_next; + +- locale loc = locale("en_US.ISO-8859-15"); ++ locale loc = locale("en_US.ISO8859-15"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -63,7 +63,7 @@ + "\xff"; + int size = strlen(e_lit); + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-15" } ++// { dg-require-namedlocale "en_US.ISO8859-15" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -63,7 +63,7 @@ + "\xff"; + int size = strlen(e_lit); + +- locale loc = locale("en_US.ISO-8859-15"); ++ locale loc = locale("en_US.ISO8859-15"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -32,12 +32,12 @@ + bool test __attribute__((unused)) = true; + typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + + int k = cvt->max_length(); +- VERIFY( k == 1 ); // ISO-8859-1 is a single-byte encoding ++ VERIFY( k == 1 ); // ISO8859-1 is a single-byte encoding + } + + int main () +--- libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-15" } ++// { dg-require-namedlocale "en_US.ISO8859-15" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -32,12 +32,12 @@ + bool test __attribute__((unused)) = true; + typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; + +- locale loc = locale("en_US.ISO-8859-15"); ++ locale loc = locale("en_US.ISO8859-15"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + + int k = cvt->max_length(); +- VERIFY( k == 1 ); // ISO-8859-15 is a single-byte encoding ++ VERIFY( k == 1 ); // ISO8859-15 is a single-byte encoding + } + + int main () +--- libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -88,7 +88,7 @@ + memset(e_ref, 0xf0, size + 1); + ext_type* eto_next; + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-15" } ++// { dg-require-namedlocale "en_US.ISO8859-15" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -102,7 +102,7 @@ + memset(e_ref, 0xf0, size + 1); + ext_type* eto_next; + +- locale loc = locale("en_US.ISO-8859-15"); ++ locale loc = locale("en_US.ISO8859-15"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -60,7 +60,7 @@ + memset(e_ref, 0xf0, size + 1); + ext_type* eto_next; + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -73,7 +73,7 @@ + memset(e_ref, 0xf0, size + 1); + ext_type* eto_next; + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-15" } ++// { dg-require-namedlocale "en_US.ISO8859-15" } + + // 2003-02-06 Petur Runolfsson <peturr02@ru.is> + +@@ -87,7 +87,7 @@ + memset(e_ref, 0xf0, size + 1); + ext_type* eto_next; + +- locale loc = locale("en_US.ISO-8859-15"); ++ locale loc = locale("en_US.ISO8859-15"); + locale::global(loc); + const w_codecvt* cvt = &use_facet<w_codecvt>(loc); + +--- libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_US.ISO-8859-1" } ++// { dg-require-namedlocale "en_US.ISO8859-1" } + + // 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +@@ -31,7 +31,7 @@ + using namespace std; + bool test __attribute__((unused)) = true; + +- locale loc = locale("en_US.ISO-8859-1"); ++ locale loc = locale("en_US.ISO8859-1"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + char c = 0xff; +--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "de_DE.ISO-8859-15@euro" } ++// { dg-require-namedlocale "de_DE.ISO8859-15@euro" } + + // 2003-05-03 Petur Runolfsson <peturr02@ru.is> + +@@ -36,7 +36,7 @@ + putc(static_cast<unsigned char>(i), file); + fclose(file); + +- locale loc (locale("de_DE.ISO-8859-15@euro")); ++ locale loc (locale("de_DE.ISO8859-15@euro")); + wchar_t buf[1]; + wfilebuf fb; + fb.pubimbue(loc); +--- libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc.orig ++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "de_DE.ISO-8859-15@euro" } ++// { dg-require-namedlocale "de_DE.ISO8859-15@euro" } + + // 2003-04-30 Petur Runolfsson <peturr02@ru.is> + +@@ -35,7 +35,7 @@ + putc(static_cast<unsigned char>(i), file); + fclose(file); + +- locale loc (locale("de_DE.ISO-8859-15@euro")); ++ locale loc (locale("de_DE.ISO8859-15@euro")); + locale::global(loc); // Set locale for stdin + + VERIFY( freopen(name, "r", stdin) ); +--- libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "fr_FR" } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "de_DE" } +@@ -40,6 +40,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc +@@ -2,7 +2,7 @@ + // { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ + // { dg-options "-finput-charset=ISO8859-1" } + // { dg-require-iconv "ISO8859-1" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "fr_FR" } + // { dg-require-namedlocale "de_DE" } +@@ -44,6 +44,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc +@@ -1,7 +1,7 @@ + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "fr_FR" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -40,6 +40,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc +@@ -2,7 +2,7 @@ + // { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ + // { dg-options "-finput-charset=ISO8859-1" } + // { dg-require-iconv "ISO8859-1" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "fr_FR" } + // { dg-require-namedlocale "de_DE" } +@@ -44,6 +44,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "fr_FR" } + // { dg-require-namedlocale "de_DE" } +@@ -35,6 +35,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc +@@ -2,7 +2,7 @@ + // { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ + // { dg-options "-finput-charset=ISO8859-1" } + // { dg-require-iconv "ISO8859-1" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "fr_FR" } + // { dg-require-namedlocale "de_DE" } +@@ -39,6 +39,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -43,6 +43,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -38,6 +38,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -37,6 +37,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -37,6 +37,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/locale/cons/40184.cc.orig ++++ libstdc++-v3/testsuite/22_locale/locale/cons/40184.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // Copyright (C) 2009 Free Software Foundation + // +@@ -29,7 +29,7 @@ + using namespace std; + bool test __attribute__((unused)) = true; + +- locale locf(locale("C"), "ja_JP.eucjp", locale::monetary); ++ locale locf(locale("C"), "ja_JP.eucJP", locale::monetary); + + const moneypunct<wchar_t, false>& mpf = + use_facet<moneypunct<wchar_t, false> >(locf); +@@ -40,7 +40,7 @@ + + VERIFY( mpf.curr_symbol() == mpf_copy.curr_symbol() ); + +- locale loct(locale("C"), "ja_JP.eucjp", locale::monetary); ++ locale loct(locale("C"), "ja_JP.eucJP", locale::monetary); + + const moneypunct<wchar_t, true>& mpt = + use_facet<moneypunct<wchar_t, true> >(loct); +--- libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "fr_FR" } + // { dg-require-namedlocale "en_US" } +@@ -45,6 +45,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE@euro" } + // { dg-require-namedlocale "en_HK" } + +@@ -69,6 +69,6 @@ + two.push_back(&test06); + two.push_back(&test07); + two.push_back(&test08); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE@euro" } + // { dg-require-namedlocale "en_HK" } + +@@ -69,6 +69,6 @@ + two.push_back(&test06); + two.push_back(&test07); + two.push_back(&test08); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE@euro" } + // { dg-require-namedlocale "en_HK" } + +@@ -59,6 +59,6 @@ + two.push_back(&test04); + two.push_back(&test05); + two.push_back(&test06); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE@euro" } + // { dg-require-namedlocale "en_HK" } + +@@ -59,6 +59,6 @@ + two.push_back(&test04); + two.push_back(&test05); + two.push_back(&test06); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> +@@ -38,6 +38,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -38,6 +38,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -59,6 +59,6 @@ + two.push_back(&test04); + two.push_back(&test05); + two.push_back(&test06); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -59,6 +59,6 @@ + two.push_back(&test04); + two.push_back(&test05); + two.push_back(&test06); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + // { dg-require-namedlocale "es_ES" } +@@ -55,6 +55,6 @@ + two.push_back(&test03); + two.push_back(&test04); + two.push_back(&test05); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -54,6 +54,6 @@ + two.push_back(&test03); + two.push_back(&test04); + two.push_back(&test05); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "is_IS" } +@@ -40,6 +40,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_US" } + // { dg-require-namedlocale "is_IS" } +@@ -40,6 +40,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test02); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,6 +32,6 @@ + using namespace __gnu_test; + func_callback two; + two.push_back(&test01); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -44,6 +44,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -44,6 +44,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -44,6 +44,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -44,6 +44,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -44,6 +44,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -44,6 +44,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "en_HK" } + +@@ -44,6 +44,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "en_HK" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -44,6 +44,6 @@ + two.push_back(&test01); + two.push_back(&test02); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -37,6 +37,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -37,6 +37,6 @@ + func_callback two; + two.push_back(&test01); + two.push_back(&test03); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc +@@ -80,6 +80,6 @@ + two.push_back(&test08); + two.push_back(&test09); + two.push_back(&test10); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc +@@ -2,7 +2,7 @@ + // { dg-require-namedlocale "en_HK" } + // { dg-require-namedlocale "es_ES" } + // { dg-require-namedlocale "fr_FR@euro" } +-// { dg-require-namedlocale "ja_JP.eucjp" } ++// { dg-require-namedlocale "ja_JP.eucJP" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +@@ -81,6 +81,6 @@ + two.push_back(&test08); + two.push_back(&test09); + two.push_back(&test10); +- run_tests_wrapped_locale("ja_JP.eucjp", two); ++ run_tests_wrapped_locale("ja_JP.eucJP", two); + return 0; + } +--- libstdc++-v3/testsuite/22_locale/money_get/get/char/16.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/16.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2004-03-02 Paolo Carlini <pcarlini@suse.de> + +@@ -37,7 +37,7 @@ + // basic construction + locale loc_c = locale::classic(); + locale loc_de = locale("de_DE@euro"); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_hk != loc_de ); + VERIFY( loc_c != loc_hk ); + +--- libstdc++-v3/testsuite/22_locale/money_get/get/char/18.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/18.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2004-03-15 Paolo Carlini <pcarlini@suse.de> + +@@ -36,7 +36,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + iterator_type end, end01, end02; +--- libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com> + +@@ -35,7 +35,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // total EPA budget FY 2002 +@@ -80,7 +80,7 @@ + VERIFY( result11 == digits4 ); + VERIFY( err11 == ios_base::eofbit ); + +- // for the "en_HK" locale the parsing of the very same input streams must ++ // for the "zh_HK" locale the parsing of the very same input streams must + // be successful without showbase too, since the symbol field appears in + // the first positions in the format and the symbol, when present, must be + // consumed. +--- libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com> + +@@ -35,7 +35,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // input less than frac_digits +--- libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/16.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/16.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2004-03-02 Paolo Carlini <pcarlini@suse.de> + +@@ -37,7 +37,7 @@ + // basic construction + locale loc_c = locale::classic(); + locale loc_de = locale("de_DE@euro"); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_hk != loc_de ); + VERIFY( loc_c != loc_hk ); + +--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/18.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/18.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2004-03-15 Paolo Carlini <pcarlini@suse.de> + +@@ -36,7 +36,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + iterator_type end, end01, end02; +--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com> + +@@ -35,7 +35,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // total EPA budget FY 2002 +@@ -80,7 +80,7 @@ + VERIFY( result11 == digits4 ); + VERIFY( err11 == ios_base::eofbit ); + +- // for the "en_HK" locale the parsing of the very same input streams must ++ // for the "zh_HK" locale the parsing of the very same input streams must + // be successful without showbase too, since the symbol field appears in + // the first positions in the format and the symbol, when present, must be + // consumed. +--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com> + +@@ -35,7 +35,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // input less than frac_digits +--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-27 Benjamin Kosnik <bkoz@redhat.com> + +@@ -36,7 +36,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // sanity check the data is correct. +--- libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-27 Benjamin Kosnik <bkoz@redhat.com> + +@@ -36,7 +36,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // sanity check the data is correct. +--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE@euro" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-11-21 Benjamin Kosnik <bkoz@redhat.com> + +@@ -34,7 +34,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // sanity check the data is correct. +--- libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-11-21 Benjamin Kosnik <bkoz@redhat.com> + +@@ -34,7 +34,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // sanity check the data is correct. +--- libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-11-19 Benjamin Kosnik <bkoz@redhat.com> + +@@ -34,7 +34,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // sanity check the data is correct. +--- libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "es_ES" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> +--- libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "es_ES" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> +--- libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-11-19 Benjamin Kosnik <bkoz@redhat.com> + +@@ -34,7 +34,7 @@ + + // basic construction + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_c != loc_hk ); + + // sanity check the data is correct. +--- libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "de_DE" } + + // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> +@@ -36,7 +36,7 @@ + + // basic construction and sanity checks. + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + locale loc_de = locale("de_DE"); + VERIFY( loc_hk != loc_c ); + VERIFY( loc_hk != loc_de ); +@@ -76,7 +76,7 @@ + VERIFY( time10.tm_year == time_bday.tm_year ); + VERIFY( errorstate == ios_base::eofbit ); + +- // inspection of named locales, en_HK ++ // inspection of named locales, zh_HK + iss.imbue(loc_hk); + iss.str("Sunday, April 04, 1971"); + iterator_type is_it20(iss); +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "de_DE" } + + // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> +@@ -36,7 +36,7 @@ + + // basic construction and sanity checks. + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + locale loc_de = locale("de_DE"); + VERIFY( loc_hk != loc_c ); + VERIFY( loc_hk != loc_de ); +@@ -76,7 +76,7 @@ + VERIFY( time10.tm_year == time_bday.tm_year ); + VERIFY( errorstate == ios_base::eofbit ); + +- // inspection of named locales, en_HK ++ // inspection of named locales, zh_HK + iss.imbue(loc_hk); + iss.str(L"Sunday, April 04, 1971"); + iterator_type is_it20(iss); +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "de_DE" } + + // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> +@@ -35,7 +35,7 @@ + + // basic construction and sanity checks. + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + locale loc_de = locale("de_DE"); + VERIFY( loc_hk != loc_c ); + VERIFY( loc_hk != loc_de ); +@@ -63,7 +63,7 @@ + VERIFY( time10.tm_mon == time_bday.tm_mon ); + VERIFY( errorstate == ios_base::eofbit ); + +- // inspection of named locales, en_HK ++ // inspection of named locales, zh_HK + iss.imbue(loc_hk); + const time_get<char>& tim_get2 = use_facet<time_get<char> >(iss.getloc()); + iss.str("April"); +--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "de_DE" } + + // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> +@@ -36,7 +36,7 @@ + + // basic construction and sanity checks. + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + locale loc_de = locale("de_DE"); + VERIFY( loc_hk != loc_c ); + VERIFY( loc_hk != loc_de ); +@@ -64,7 +64,7 @@ + VERIFY( time10.tm_mon == time_bday.tm_mon ); + VERIFY( errorstate == ios_base::eofbit ); + +- // inspection of named locales, en_HK ++ // inspection of named locales, zh_HK + iss.imbue(loc_hk); + const time_get<wchar_t>& tim_get2 = use_facet<time_get<wchar_t> >(iss.getloc()); + iss.str(L"April"); +--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> + +@@ -35,7 +35,7 @@ + + // basic construction and sanity check + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_hk != loc_c ); + + const string empty; +@@ -48,7 +48,7 @@ + const ios_base::iostate good = ios_base::goodbit; + ios_base::iostate errorstate = good; + +- // inspection of named locales, en_HK ++ // inspection of named locales, zh_HK + iss.imbue(loc_hk); + iss.str("12:00:00 PST"); + // Hong Kong in California! Well, they have Paris in Vegas... this +--- libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> + +@@ -35,7 +35,7 @@ + + // basic construction and sanity check + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_hk != loc_c ); + + const wstring empty; +@@ -48,7 +48,7 @@ + const ios_base::iostate good = ios_base::goodbit; + ios_base::iostate errorstate = good; + +- // inspection of named locales, en_HK ++ // inspection of named locales, zh_HK + iss.imbue(loc_hk); + iss.str(L"12:00:00 PST"); + // Hong Kong in California! Well, they have Paris in Vegas... this +--- libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "de_DE" } + + // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> +@@ -36,7 +36,7 @@ + + // basic construction and sanity checks. + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + locale loc_de = locale("de_DE"); + VERIFY( loc_hk != loc_c ); + VERIFY( loc_hk != loc_de ); +@@ -65,7 +65,7 @@ + VERIFY( time10.tm_wday == time_bday.tm_wday ); + VERIFY( errorstate == ios_base::eofbit ); + +- // inspection of named locales, en_HK ++ // inspection of named locales, zh_HK + iss.imbue(loc_hk); + iss.str("Sunday"); + iterator_type is_it20(iss); +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc +@@ -1,6 +1,6 @@ + // { dg-require-namedlocale "ja_JP.eucjp" } + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> + +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "de_DE" } + + // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> +@@ -36,7 +36,7 @@ + + // basic construction and sanity checks. + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + locale loc_de = locale("de_DE"); + VERIFY( loc_hk != loc_c ); + VERIFY( loc_hk != loc_de ); +@@ -65,7 +65,7 @@ + VERIFY( time10.tm_wday == time_bday.tm_wday ); + VERIFY( errorstate == ios_base::eofbit ); + +- // inspection of named locales, en_HK ++ // inspection of named locales, zh_HK + iss.imbue(loc_hk); + iss.str(L"Sunday"); + iterator_type is_it20(iss); +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "de_DE" } + + // 2001-08-15 Benjamin Kosnik <bkoz@redhat.com> +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "ja_JP.eucjp" } + +--- libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> + +@@ -38,7 +38,7 @@ + + // basic construction and sanity check. + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_hk != loc_c ); + + // create an ostream-derived object, cache the time_put facet +--- libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> + +@@ -41,7 +41,7 @@ + + // basic construction and sanity check + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_hk != loc_c ); + + // create an ostream-derived object, cache the time_put facet +--- libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "es_ES" } + // { dg-require-namedlocale "fr_FR@euro" } + +--- libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "es_ES" } + // { dg-require-namedlocale "fr_FR@euro" } + +--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> + +@@ -38,7 +38,7 @@ + + // basic construction and sanity check + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_hk != loc_c ); + + // create an ostream-derived object, cache the time_put facet +--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + + // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> + +@@ -41,7 +41,7 @@ + + // basic construction and sanity check + locale loc_c = locale::classic(); +- locale loc_hk = locale("en_HK"); ++ locale loc_hk = locale("zh_HK"); + VERIFY( loc_hk != loc_c ); + + // create an ostream-derived object, cache the time_put facet +--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "es_ES" } + // { dg-require-namedlocale "fr_FR@euro" } + +--- libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc +@@ -1,5 +1,5 @@ + // { dg-require-namedlocale "de_DE" } +-// { dg-require-namedlocale "en_HK" } ++// { dg-require-namedlocale "zh_HK" } + // { dg-require-namedlocale "es_ES" } + // { dg-require-namedlocale "fr_FR@euro" } + // { dg-require-namedlocale "ja_JP.eucjp" } +--- libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +@@ -31,7 +31,7 @@ + using namespace std; + bool test __attribute__((unused)) = true; + +- locale loc = locale("se_NO.UTF-8"); ++ locale loc = locale("no_NO.UTF-8"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + const wchar_t* wstrlit = L"\x80"; +--- libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +@@ -31,7 +31,7 @@ + using namespace std; + bool test __attribute__((unused)) = true; + +- locale loc = locale("se_NO.UTF-8"); ++ locale loc = locale("no_NO.UTF-8"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + const char* strlit = "\xc2\x80"; +--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-08 Petur Runolfsson <peturr02@ru.is> + +@@ -91,7 +91,7 @@ + const size_t wlen = sizeof(wstr) / sizeof(wstr[0]); + + const int loops = 2 * BUFSIZ / wlen; +- locale loc = locale("se_NO.UTF-8"); ++ locale loc = locale("no_NO.UTF-8"); + + FILE* file = fopen(name, "w"); + for (int i = 0; i < loops; ++i) +--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-08 Petur Runolfsson <peturr02@ru.is> + +@@ -35,7 +35,7 @@ + bool test __attribute__((unused)) = true; + const char name[] = "tmp_seekoff-2.tst"; + +- locale loc = locale("se_NO.UTF-8"); ++ locale loc = locale("no_NO.UTF-8"); + + const size_t size = 10; + wchar_t buf[size]; +--- libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9874.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9874.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-10-07 Petur Runolfsson <peturr02@ru.is> + // +@@ -93,7 +93,7 @@ + const size_t wlen = sizeof(wstr) / sizeof(wstr[0]); + + const int loops = 2 * BUFSIZ / wlen; +- locale loc = locale("se_NO.UTF-8"); ++ locale loc = locale("no_NO.UTF-8"); + + FILE* file = fopen(name, "w"); + for (int i = 0; i < loops; ++i) +--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-04 Petur Runolfsson <peturr02@ru.is> + +@@ -86,7 +86,7 @@ + const size_t clen = sizeof(cstr) / sizeof(cstr[0]); + const size_t wlen = sizeof(wstr) / sizeof(wstr[0]); + +- locale loc = locale("se_NO.UTF-8"); ++ locale loc = locale("no_NO.UTF-8"); + + FILE* file = fopen(name, "w"); + fwrite(cstr, 1, clen, file); +--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-04 Petur Runolfsson <peturr02@ru.is> + +@@ -86,7 +86,7 @@ + const size_t clen = sizeof(cstr) / sizeof(cstr[0]); + const size_t wlen = sizeof(wstr) / sizeof(wstr[0]); + +- locale loc = locale("se_NO.UTF-8"); ++ locale loc = locale("no_NO.UTF-8"); + + FILE* file = fopen(name, "w"); + fwrite(cstr, 1, clen, file); +--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-04 Petur Runolfsson <peturr02@ru.is> + +@@ -87,7 +87,7 @@ + const size_t wlen = sizeof(wstr) / sizeof(wstr[0]); + + const int loops = 2 * BUFSIZ / wlen; +- locale loc = locale("se_NO.UTF-8"); ++ locale loc = locale("no_NO.UTF-8"); + + FILE* file = fopen(name, "w"); + for (int i = 0; i < loops; ++i) +--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-04 Petur Runolfsson <peturr02@ru.is> + // Adapted from 27_io/basic_filebuf/underflow/char/2.cc +@@ -31,7 +31,7 @@ + bool test __attribute__((unused)) = true; + using namespace std; + +- locale loc (locale("se_NO.UTF-8")); ++ locale loc (locale("no_NO.UTF-8")); + wfilebuf fb_out, fb_in_out; + fb_out.pubimbue(loc); + fb_in_out.pubimbue(loc); +--- libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc.orig ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-04 Petur Runolfsson <peturr02@ru.is> + +@@ -35,7 +35,7 @@ + + wfilebuf fb; + fb.pubsetbuf(0, 0); +- fb.pubimbue(locale("se_NO.UTF-8")); ++ fb.pubimbue(locale("no_NO.UTF-8")); + + FILE* file = fopen(name, "w"); + setvbuf(file, 0, _IONBF, 0); +--- libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc.orig ++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-05-01 Petur Runolfsson <peturr02@ru.is> + +@@ -33,7 +33,7 @@ + bool test __attribute__((unused)) = true; + const char* name = "tmp_10"; + +- locale loc(locale("se_NO.UTF-8")); ++ locale loc(locale("no_NO.UTF-8")); + locale::global(loc); + wcin.imbue(loc); + wcout.imbue(loc); +--- libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc.orig ++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-05-01 Petur Runolfsson <peturr02@ru.is> + +@@ -33,7 +33,7 @@ + bool test __attribute__((unused)) = true; + const char* name = "tmp_11"; + +- locale loc(locale("se_NO.UTF-8")); ++ locale loc(locale("no_NO.UTF-8")); + locale::global(loc); + wcin.imbue(loc); + wcout.imbue(loc); +--- libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc.orig ++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-04 Petur Runolfsson <peturr02@ru.is> + +@@ -38,7 +38,7 @@ + bool test __attribute__((unused)) = true; + const char* name = "tmp_12"; + +- locale loc(locale("se_NO.UTF-8")); ++ locale loc(locale("no_NO.UTF-8")); + locale::global(loc); + std::ios_base::sync_with_stdio(false); + wcout.imbue(loc); +--- libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc.orig ++++ libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "se_NO.UTF-8" } ++// { dg-require-namedlocale "no_NO.UTF-8" } + + // 2003-09-04 Petur Runolfsson <peturr02@ru.is> + +@@ -36,7 +36,7 @@ + bool test __attribute__((unused)) = true; + const char* name = "tmp_13"; + +- locale loc(locale("se_NO.UTF-8")); ++ locale loc(locale("no_NO.UTF-8")); + locale::global(loc); + std::ios_base::sync_with_stdio(false); + wcin.imbue(loc); +--- libstdc++-v3/testsuite/22_locale/facet/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/facet/2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "es_MX" } ++// { dg-require-namedlocale "es_ES" } + + // 2000-08-31 Benjamin Kosnik <bkoz@redhat.com> + +@@ -84,7 +84,7 @@ + // 4: Named locale should destroy facets when it goes out of scope. + // Not quite sure how to test for this w/o valgrind at the moment. + { +- locale loc03 = locale("es_MX"); ++ locale loc03 = locale("es_ES"); + } + } + +--- libstdc++-v3/testsuite/22_locale/locale/cons/5.cc.orig ++++ libstdc++-v3/testsuite/22_locale/locale/cons/5.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "en_PH" } ++// { dg-require-namedlocale "en_NZ" } + // { dg-require-namedlocale "de_DE" } + // { dg-require-namedlocale "it_IT" } + +@@ -76,21 +76,21 @@ + } + setenv("LC_ALL", "", 1); + +- // Check that a "en_PH" LC_ALL is equivalent to "en_PH". +- if (!setenv("LC_ALL", "en_PH", 1)) ++ // Check that a "en_NZ" LC_ALL is equivalent to "en_PH". ++ if (!setenv("LC_ALL", "en_NZ", 1)) + { + locale loc = locale(""); +- VERIFY( loc.name() == "en_PH" ); ++ VERIFY( loc.name() == "en_NZ" ); + } + setenv("LC_ALL", "", 1); + + // Explicit check that LC_ALL sets regardless of LC_* and LANG. +- if (!setenv("LANG", "es_MX", 1) && !setenv("LC_COLLATE", "de_DE", 1)) ++ if (!setenv("LANG", "es_ES", 1) && !setenv("LC_COLLATE", "de_DE", 1)) + { +- if (!setenv("LC_ALL", "en_PH", 1)) ++ if (!setenv("LC_ALL", "en_NZ", 1)) + { + locale loc = locale(""); +- VERIFY( loc.name() == "en_PH" ); ++ VERIFY( loc.name() == "en_NZ" ); + } + setenv("LC_ALL", "", 1); + setenv("LANG", LANG_orig ? LANG_orig : "", 1); +--- libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc +@@ -1,5 +1,5 @@ +-// { dg-require-namedlocale "en_PH" } +-// { dg-require-namedlocale "es_MX" } ++// { dg-require-namedlocale "en_NZ" } ++// { dg-require-namedlocale "es_ES" } + + // 2000-09-13 Benjamin Kosnik <bkoz@redhat.com> + +@@ -32,8 +32,8 @@ + using namespace std; + bool test __attribute__((unused)) = true; + +- const string ph("en_PH"); +- const string mx("es_MX"); ++ const string ph("en_NZ"); ++ const string mx("es_ES"); + const char* orig = setlocale(LC_ALL, 0); + const char* testph = setlocale(LC_ALL, ph.c_str()); + const char* testmx = setlocale(LC_ALL, mx.c_str()); +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ru_RU.ISO-8859-5" } ++// { dg-require-namedlocale "ru_RU.ISO8859-5" } + + // Copyright (C) 2010, 2011 Free Software Foundation + // +@@ -33,7 +33,7 @@ + typedef istreambuf_iterator<char> iterator_type; + + // basic construction +- locale loc("ru_RU.ISO-8859-5"); ++ locale loc("ru_RU.ISO8859-5"); + + // create an ostream-derived object, cache the time_get facet + iterator_type end; +--- libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc.orig ++++ libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc +@@ -1,4 +1,4 @@ +-// { dg-require-namedlocale "ru_RU.UTF8" } ++// { dg-require-namedlocale "ru_RU.UTF-8" } + + // 2010-01-05 Paolo Carlini <paolo.carlini@oracle.com> + +@@ -34,7 +34,7 @@ + typedef istreambuf_iterator<char> iterator_type; + + // basic construction +- locale loc("ru_RU.UTF8"); ++ locale loc("ru_RU.UTF-8"); + + // create an ostream-derived object, cache the time_get facet + iterator_type end; diff --git a/lang/gcc-aux/files/diff-fortran b/lang/gcc-aux/files/diff-fortran new file mode 100644 index 00000000000..83d9ea31bb4 --- /dev/null +++ b/lang/gcc-aux/files/diff-fortran @@ -0,0 +1,72 @@ +--- gcc/fortran/f95-lang.c.orig ++++ gcc/fortran/f95-lang.c +@@ -819,10 +819,17 @@ + + gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble, + BUILT_IN_CABSL, "cabsl", ATTR_CONST_NOTHROW_LEAF_LIST); ++#if defined(__NetBSD__) ++ gfc_define_builtin ("__builtin_cabs", func_cdouble_double, ++ BUILT_IN_CABS, "__c99_cabs", ATTR_CONST_NOTHROW_LEAF_LIST); ++ gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, ++ BUILT_IN_CABSF, "__c99_cabsf", ATTR_CONST_NOTHROW_LEAF_LIST); ++#else + gfc_define_builtin ("__builtin_cabs", func_cdouble_double, + BUILT_IN_CABS, "cabs", ATTR_CONST_NOTHROW_LEAF_LIST); + gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, + BUILT_IN_CABSF, "cabsf", ATTR_CONST_NOTHROW_LEAF_LIST); ++#endif + + gfc_define_builtin ("__builtin_copysignl", mfunc_longdouble[1], + BUILT_IN_COPYSIGNL, "copysignl", +--- libgfortran/acinclude.m4.orig ++++ libgfortran/acinclude.m4 +@@ -99,7 +99,7 @@ + [Define to 1 if the target supports #pragma weak]) + fi + case "$host" in +- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* ) ++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* | *-*-netbsd* ) + AC_DEFINE(GTHREAD_USE_WEAK, 0, + [Define to 0 if the target shouldn't use #pragma weak]) + ;; +--- libquadmath/Makefile.in.orig ++++ libquadmath/Makefile.in +@@ -388,15 +388,14 @@ + + # Subdir rules rely on $(FLAGS_TO_PASS) + @BUILD_LIBQUADMATH_TRUE@FLAGS_TO_PASS = $(AM_MAKEFLAGS) +-@BUILD_LIBQUADMATH_TRUE@MAKEOVERRIDES = +-@BUILD_LIBQUADMATH_TRUE@@GENINSRC_FALSE@STAMP_GENINSRC = ++@BUILD_LIBQUADMATH_TRUE@MAKEOVERRIDES = ++@BUILD_LIBQUADMATH_TRUE@@GENINSRC_FALSE@STAMP_GENINSRC = + + # AM_CONDITIONAL on configure option --generated-files-in-srcdir + @BUILD_LIBQUADMATH_TRUE@@GENINSRC_TRUE@STAMP_GENINSRC = stamp-geninsrc +-@BUILD_INFO_FALSE@@BUILD_LIBQUADMATH_TRUE@STAMP_BUILD_INFO = ++@BUILD_LIBQUADMATH_TRUE@STAMP_BUILD_INFO = + + # AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO]) +-@BUILD_INFO_TRUE@@BUILD_LIBQUADMATH_TRUE@STAMP_BUILD_INFO = stamp-build-info + @BUILD_LIBQUADMATH_TRUE@CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) libquadmath.info + @BUILD_LIBQUADMATH_TRUE@MAINTAINERCLEANFILES = $(srcdir)/libquadmath.info + +@@ -1247,7 +1246,7 @@ + + info-am: $(INFO_DEPS) + +-install-data-am: install-info-am install-nodist_libsubincludeHEADERS ++install-data-am: install-nodist_libsubincludeHEADERS + + install-dvi: install-dvi-am + +--- libgfortran/configure.orig ++++ libgfortran/configure +@@ -25564,7 +25564,7 @@ + + fi + case "$host" in +- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* ) ++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* | *-*-netbsd* ) + + $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h + diff --git a/lang/gcc-aux/files/diff-fortran-testsuite b/lang/gcc-aux/files/diff-fortran-testsuite new file mode 100644 index 00000000000..af58f3abe20 --- /dev/null +++ b/lang/gcc-aux/files/diff-fortran-testsuite @@ -0,0 +1,31 @@ +--- gcc/testsuite/gfortran.dg/large_real_kind_2.F90.orig ++++ gcc/testsuite/gfortran.dg/large_real_kind_2.F90 +@@ -1,6 +1,6 @@ + ! { dg-do run } + ! { dg-require-effective-target fortran_large_real } +-! { dg-xfail-if "" { "*-*-freebsd*" } { "*" } { "" } } ++! { dg-xfail-if "" { "*-*-freebsd*" *-*-dragonfly* *-*-netbsd* } { "*" } { "" } } + + ! Testing library calls on large real kinds (larger than kind=8) + implicit none +--- gcc/testsuite/gfortran.dg/large_real_kind_3.F90.orig ++++ gcc/testsuite/gfortran.dg/large_real_kind_3.F90 +@@ -1,6 +1,6 @@ + ! { dg-do run } + ! { dg-require-effective-target fortran_large_real } +-! { dg-xfail-if "" { "*-*-freebsd*" } { "*" } { "" } } ++! { dg-xfail-if "" { "*-*-freebsd*" *-*-dragonfly* *-*-netbsd* } { "*" } { "" } } + + ! Testing erf and erfc library calls on large real kinds (larger than kind=8) + implicit none +--- gcc/testsuite/gfortran.dg/open_errors.f90.orig ++++ gcc/testsuite/gfortran.dg/open_errors.f90 +@@ -22,7 +22,7 @@ + if (msg /= "File 'temptestfile' does not exist") call abort() + + open(77,file="./", iomsg=msg, iostat=i) +-if (msg /= "'./' is a directory" .and. msg /= "Invalid argument") call abort() ++if (msg /= "'./' is a directory" .and. msg /= "Invalid argument" .and. msg /= "File './' already exists") call abort() + + open(77,file=n,status="new") + i = chmod(n, "-w") diff --git a/lang/gcc-aux/files/diff-gcc-testsuite b/lang/gcc-aux/files/diff-gcc-testsuite new file mode 100644 index 00000000000..f371a02cd1c --- /dev/null +++ b/lang/gcc-aux/files/diff-gcc-testsuite @@ -0,0 +1,10 @@ +--- gcc/testsuite/gcc.dg/pch/pch.exp.orig ++++ gcc/testsuite/gcc.dg/pch/pch.exp +@@ -44,6 +44,7 @@ + set test "largefile.c" + set testh "largefile.hs" + set f [open $test w] ++puts $f "/* { dg-do run { target *-*-solaris* } } */" + puts $f "/* { dg-timeout-factor 4.0 } */" + set v 0 + for { set v 0 } { $v < 10000 } { incr v } { diff --git a/lang/gcc-aux/files/diff-static-version b/lang/gcc-aux/files/diff-static-version new file mode 100644 index 00000000000..a64e558e5c2 --- /dev/null +++ b/lang/gcc-aux/files/diff-static-version @@ -0,0 +1,16 @@ +--- gcc/Makefile.in.2 ++++ gcc/Makefile.in +@@ -320,11 +320,11 @@ + # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is + # -I../zlib, unless we were configured with --with-system-zlib, in which + # case both are empty. +-ZLIB = @zlibdir@ -lz ++ZLIB = -Wl,-Bstatic -lz -Wl,-Bdynamic + ZLIBINC = @zlibinc@ + + # How to find GMP +-GMPLIBS = @GMPLIBS@ ++GMPLIBS = -Wl,-Bstatic @GMPLIBS@ -Wl,-Bdynamic + GMPINC = @GMPINC@ + + # How to find PPL diff --git a/lang/gcc-aux/options.mk b/lang/gcc-aux/options.mk new file mode 100644 index 00000000000..7a4defd2bc2 --- /dev/null +++ b/lang/gcc-aux/options.mk @@ -0,0 +1,96 @@ +# $NetBSD: options.mk,v 1.1 2012/07/08 19:30:38 marino Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.gcc-aux +PKG_SUPPORTED_OPTIONS= ada cxx fortran objc testsuite nls static +PKG_SUGGESTED_OPTIONS= ada cxx fortran objc + +.if ${OPSYS} == "NetBSD" +PKG_SUGGESTED_OPTIONS+= static +.endif + +.include "../../mk/bsd.options.mk" + + +######################### +## ADD LANGUAGE: Ada ## +######################### + +.if !empty(PKG_OPTIONS:Mada) +LANGS+= ada +APPLY_DIFFS+= ada +.endif + + +######################### +## ADD LANGUAGE: C++ ## +######################### + +.if !empty(PKG_OPTIONS:Mcxx) +LANGS+= c++ +APPLY_DIFFS+= cxx +.endif + + +############################# +## ADD LANGUAGE: Fortran ## +############################# + +.if empty(PKG_OPTIONS:Mfortran) +EXTRA_CONFARGS+= --disable-libquadmath +.else +LANGS+= fortran +APPLY_DIFFS+= fortran +.if ${OPSYS} == "NetBSD" +EXTRA_CONFARGS+= --disable-libquadmath +.else +EXTRA_CONFARGS+= --enable-libquadmath +.endif +.endif + + +################################# +## ADD LANGUAGE: Objective-C ## +################################# + +.if !empty(PKG_OPTIONS:Mobjc) +LANGS+= objc +.endif + + +######################### +## TESTSUITE SUPPORT ## +######################### + +.if !empty(PKG_OPTIONS:Mtestsuite) +BUILD_DEPENDS+= dejagnu>=1.4:../../devel/dejagnu +APPLY_DIFFS+= ada-testsuite +APPLY_DIFFS+= cxx-testsuite +APPLY_DIFFS+= gcc-testsuite +APPLY_DIFFS+= fortran-testsuite +.endif + + +################################# +## NATIONAL LANGUAGE SUPPORT ## +################################# + +.if !empty(PKG_OPTIONS:Mnls) +USE_TOOLS+= msgfmt +EXTRA_CONFARGS+= --enable-nls +.include "../../devel/gettext-lib/buildlink3.mk" +.else +EXTRA_CONFARGS+= --disable-nls +.endif + + +############################### +## STATICALLY BUILT OPTION ## +############################### + +# NetBSD must be built statically to support dl_iterate_phdr +# error handling. The base compiler doesn't support despite it although +# NetBSD's realtime linker supports dl_iterate_phdr +# Setting the option by default on NetBSD is cosmetic; regardless of +# setting, NetBSD will always be built statically. +# +# The "static" option is handled in the post-extract phase. |