svn commit: r391778 - in head/lang/gcc-aux: . files
John Marino
marino at FreeBSD.org
Sun Jul 12 11:04:25 UTC 2015
Author: marino
Date: Sun Jul 12 11:04:22 2015
New Revision: 391778
URL: https://svnweb.freebsd.org/changeset/ports/391778
Log:
lang/gcc-aux: Upgrade version 20141023 => 20150626 (4.9.2 => 4.9.3)
All the NetBSD/OpenBSD changes were also stripped out, which greatly
reduced the diff patch sizes (among other changes to ada support)
Deleted:
head/lang/gcc-aux/files/diff-fortran
Modified:
head/lang/gcc-aux/Makefile
head/lang/gcc-aux/Makefile.version
head/lang/gcc-aux/distinfo
head/lang/gcc-aux/files/diff-ada
head/lang/gcc-aux/files/diff-core
head/lang/gcc-aux/files/diff-cxx
head/lang/gcc-aux/files/diff-cxx-testsuite
Modified: head/lang/gcc-aux/Makefile
==============================================================================
--- head/lang/gcc-aux/Makefile Sun Jul 12 10:54:03 2015 (r391777)
+++ head/lang/gcc-aux/Makefile Sun Jul 12 11:04:22 2015 (r391778)
@@ -116,7 +116,7 @@ DISTFILES= \
.if ${PORT_OPTIONS:MFORT} && !${PORT_OPTIONS:MBOOTSTRAP}
LANGS+= fortran
-APPLY_DIFFS+= fortran
+#APPLY_DIFFS+= fortran
EXTRA_CONFIG+= --enable-libquadmath
.else
EXTRA_CONFIG+= --disable-libquadmath
Modified: head/lang/gcc-aux/Makefile.version
==============================================================================
--- head/lang/gcc-aux/Makefile.version Sun Jul 12 10:54:03 2015 (r391777)
+++ head/lang/gcc-aux/Makefile.version Sun Jul 12 11:04:22 2015 (r391778)
@@ -1,11 +1,11 @@
# $FreeBSD$
GCC_BRANCH= 4.9
-GCC_POINT= 2
+GCC_POINT= 3
GCC_VERSION= ${GCC_BRANCH}.${GCC_POINT}
-SNAPSHOT= 20141023
-MAIN_PR= 1
-UTIL_PR= 2
+SNAPSHOT= 20150626
+MAIN_PR= 0
+UTIL_PR= 0
ARMV7_PR= 0
# Snapshot naming pattern
Modified: head/lang/gcc-aux/distinfo
==============================================================================
--- head/lang/gcc-aux/distinfo Sun Jul 12 10:54:03 2015 (r391777)
+++ head/lang/gcc-aux/distinfo Sun Jul 12 11:04:22 2015 (r391778)
@@ -1,5 +1,5 @@
-SHA256 (gcc-4.9.2.tar.bz2) = 2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd
-SIZE (gcc-4.9.2.tar.bz2) = 89939747
+SHA256 (gcc-4.9.3.tar.bz2) = 2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e
+SIZE (gcc-4.9.3.tar.bz2) = 90006707
SHA256 (ada-bootstrap.i386.dragonfly.36A.tar.bz2) = 6b1a6ff0fe0e3bf13c667db2fef177b811329cd998400a1303969a86911cb1c8
SIZE (ada-bootstrap.i386.dragonfly.36A.tar.bz2) = 39357314
SHA256 (ada-bootstrap.i386.freebsd.84.tar.bz2) = b410336cb0e71c8a29dd5f831a17b4b7282e7d590f452475a94c6a625cfc8846
Modified: head/lang/gcc-aux/files/diff-ada
==============================================================================
--- head/lang/gcc-aux/files/diff-ada Sun Jul 12 10:54:03 2015 (r391777)
+++ head/lang/gcc-aux/files/diff-ada Sun Jul 12 11:04:22 2015 (r391778)
@@ -1,28 +1,3 @@
---- gcc/ada/a-exetim-posix.adb.orig
-+++ gcc/ada/a-exetim-posix.adb
-@@ -105,11 +105,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
-@@ -117,7 +117,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 @@
@@ -162,366 +137,85 @@
+ 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. --
-+-- --
-+------------------------------------------------------------------------------
+--- gcc/ada/adaint.c.orig
++++ gcc/ada/adaint.c
+@@ -577,8 +577,8 @@
+ GNAT_STRUCT_STAT stat_result;
+ int fd;
+
+- sprintf (full_path, "%s%c%s", dir, DIR_SEPARATOR, file);
+- sprintf (temp_file, "%s%cTMP-%ld-%ld",
++ snprintf (full_path, 256, "%s%c%s", dir, DIR_SEPARATOR, file);
++ snprintf (temp_file, 256, "%s%cTMP-%ld-%ld",
+ dir, DIR_SEPARATOR, (long)getpid(), (long)getppid ());
+
+ /* Create the temporary file and write the process number. */
+@@ -745,7 +745,8 @@
+ strcpy (encoding, "encoding=utf8");
+ *e_length = strlen (encoding);
+ #else
+- strcpy (os_name, filename);
++ /* o_length is initialized with max os_name size (2x filename size) */
++ strncpy (os_name, filename, *o_length);
+ *o_length = strlen (filename);
+ *e_length = 0;
+ #endif
+@@ -1141,9 +1142,10 @@
+ int fd;
+ int o_fmode = O_BINARY;
+
+- strcpy (path, "GNAT-XXXXXX");
++ strncpy (path, "GNAT-XXXXXX", 12);
+
+ #if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
++ || defined (__DragonFly__) \
+ || defined (linux) || defined(__GLIBC__)) && !defined (__vxworks)
+ return mkstemp (path);
+ #elif defined (__Lynx__)
+@@ -1310,7 +1312,49 @@
+ free (pname);
+ }
+
++#elif defined (__ANDROID__)
+
-+-- This is the OpenBSD THREADS version of this package
++ /*
++ * 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.
++ */
+
-+with System.OS_Interface;
++ int testfd;
++ char *datadir = getenv ("ANDROID_DATA");
+
-+package Ada.Interrupts.Names is
++ if (datadir == NULL)
++ strncpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX", L_tmpnam);
++ else
++ snprintf (tmp_filename, L_tmpnam, "%s/local/tmp/gnat-XXXXXX", datadir);
+
-+ -- All identifiers in this unit are implementation defined
++ testfd = mkstemp (tmp_filename);
++ if (testfd != -1)
++ {
++ close (testfd);
++ return;
++ }
+
-+ pragma Implementation_Defined;
++ char *sdcard = getenv ("EXTERNAL_STORAGE");
+
-+ -- 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.
++ if (sdcard == NULL)
++ strncpy (tmp_filename, "/sdcard/gnat-XXXXXX", L_tmpnam);
++ else
++ snprintf (tmp_filename, L_tmpnam, "%s/gnat-XXXXXX", sdcard);
+
-+ SIGHUP : constant Interrupt_ID :=
-+ System.OS_Interface.SIGHUP; -- hangup
++ testfd = mkstemp (tmp_filename);
++ if (testfd != -1)
++ {
++ close (testfd);
++ return;
++ }
+
-+ 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
-@@ -577,8 +577,8 @@
- GNAT_STRUCT_STAT stat_result;
- int fd;
-
-- sprintf (full_path, "%s%c%s", dir, DIR_SEPARATOR, file);
-- sprintf (temp_file, "%s%cTMP-%ld-%ld",
-+ snprintf (full_path, 256, "%s%c%s", dir, DIR_SEPARATOR, file);
-+ snprintf (temp_file, 256, "%s%cTMP-%ld-%ld",
- dir, DIR_SEPARATOR, (long)getpid(), (long)getppid ());
-
- /* Create the temporary file and write the process number. */
-@@ -745,7 +745,8 @@
- strcpy (encoding, "encoding=utf8");
- *e_length = strlen (encoding);
- #else
-- strcpy (os_name, filename);
-+ /* o_length is initialized with max os_name size (2x filename size) */
-+ strncpy (os_name, filename, *o_length);
- *o_length = strlen (filename);
- *e_length = 0;
- #endif
-@@ -1141,9 +1142,10 @@
- int fd;
- int o_fmode = O_BINARY;
-
-- strcpy (path, "GNAT-XXXXXX");
-+ strncpy (path, "GNAT-XXXXXX", 12);
-
- #if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
-+ || defined (__DragonFly__) \
- || defined (linux) || defined(__GLIBC__)) && !defined (__vxworks)
- return mkstemp (path);
- #elif defined (__Lynx__)
-@@ -1310,7 +1312,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)
-+ strncpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX", L_tmpnam);
-+ else
-+ snprintf (tmp_filename, L_tmpnam, "%s/local/tmp/gnat-XXXXXX", datadir);
-+
-+ testfd = mkstemp (tmp_filename);
-+ if (testfd != -1)
-+ {
-+ close (testfd);
-+ return;
-+ }
-+
-+ char *sdcard = getenv ("EXTERNAL_STORAGE");
-+
-+ if (sdcard == NULL)
-+ strncpy (tmp_filename, "/sdcard/gnat-XXXXXX", L_tmpnam);
-+ else
-+ snprintf (tmp_filename, L_tmpnam, "%s/gnat-XXXXXX", sdcard);
-+
-+ testfd = mkstemp (tmp_filename);
-+ if (testfd != -1)
-+ {
-+ close (testfd);
-+ return;
-+ }
-+
-+ tmpnam (tmp_filename);
++ tmpnam (tmp_filename);
+
#elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) \
+ || defined (__DragonFly__) \
@@ -1045,5565 +739,404 @@
+
+end GNAT.Sockets.Thin;
--- /dev/null
-+++ gcc/ada/g-socthi-netbsd.adb
-@@ -0,0 +1,358 @@
++++ gcc/ada/g-trasym-bsd.adb
+@@ -0,0 +1,150 @@
+------------------------------------------------------------------------------
+-- --
-+-- GNAT COMPILER COMPONENTS --
++-- GNAT RUN-TIME COMPONENTS --
+-- --
-+-- G N A T . S O C K E T S . T H I N --
++-- 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) 2001-2013, AdaCore --
++-- 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 3, or (at your option) any later ver- --
++-- 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. --
-+-- --
-+-- 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. --
++-- 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. --
+-- --
-+-- 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/>. --
++-- 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. --
+-- --
+------------------------------------------------------------------------------
+
-+-- 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.
++-- 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>
+
-+-- 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 System.Soft_Links;
++with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
+
-+with GNAT.OS_Lib; use GNAT.OS_Lib;
++package body GNAT.Traceback.Symbolic is
+
-+with Interfaces.C; use Interfaces.C;
++ package TSL renames System.Soft_Links;
+
-+package body GNAT.Sockets.Thin is
++ -- 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.
+
-+ 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.
++ Exename : System.Address;
++ -- Pointer to the name of the executable file to be used on all
++ -- invocations of the libaddr2line symbolization service.
+
-+ 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.
++ 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.
+
-+ 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.
++ ------------------------
++ -- Symbolic_Traceback --
++ ------------------------
+
-+ 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
-+ R : constant C.int := Syscall_Accept (S, Addr, Addrlen);
-+ begin
-+
-+ Disable_SIGPIPE (R);
-+ return R;
-+ 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 : SOSC.IOCTL_Req_T;
-+ Arg : access C.int) return C.int
-+ is
-+ begin
-+ if Req = SOSC.FIONBIO then
-+ declare
-+ use Interfaces;
-+ flags : constant Unsigned_32 :=
-+ Unsigned_32 (C_Fcntl (S, SOSC.F_GETFL, 0));
-+ nonblock : constant Unsigned_32 := Unsigned_32 (SOSC.O_NDELAY);
-+ enabled : constant Boolean := Arg.all = 1;
-+ newval : C.int := C.int (flags);
-+ begin
-+ if enabled then
-+ newval := C.int (flags or nonblock);
-+ elsif (flags and nonblock) > 0 then
-+ newval := C.int (flags - nonblock);
-+ end if;
-+ return C_Fcntl (Fd => S, Cmd => SOSC.F_SETFL, Val => newval);
-+ end;
-+ end if;
-+
-+ return C_Ioctl (S, Req, Arg);
-+ 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
-+ R : constant C.int := Syscall_Socket (Domain, Typ, Protocol);
-+ begin
-+ Disable_SIGPIPE (R);
-+ return R;
-+ 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 String is separate;
-+
-+end GNAT.Sockets.Thin;
---- /dev/null
-+++ gcc/ada/g-socthi-netbsd6.ads
-@@ -0,0 +1,259 @@
-+------------------------------------------------------------------------------
-+-- --
-+-- 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-2013, 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;
-+
-+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 String;
-+ -- 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 String;
-+ -- 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;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-ports-all
mailing list