Bug 169951 - [NEW PORT] lang/gcc-aux, gcc-4.7 compiler (Ada, Fortran, C, C++, Objc)
Summary: [NEW PORT] lang/gcc-aux, gcc-4.7 compiler (Ada, Fortran, C, C++, Objc)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Frederic Culot
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-17 23:00 UTC by John Marino
Modified: 2012-07-31 18:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino 2012-07-17 23:00:30 UTC
This port is the successor to the gcc-4.6-based lang/gnat-aux.
Originally it was planned for lang/gnat-aux to upgrade to version 4.7, then 4.8, etc.  However, some cross-compilers are based on it and there are some significant differences between gcc 4.6 and 4.7.  lang/gnat-aux also installs with a ${LOCALBASE} of /usr/local which has a high potential of file conflicts with other lang/ compilers.  Another reason for keeping them separate is just about every Ada program will need to be patched for it due to new binding interpretations stemming from Ada-2012 work.  Simplying updating gnat-aux would break them all instantly.

lang/gcc-aux has already been successfully ported to pkgsrc <http://pkgsrc.se/lang/gcc-aux>
It has also been integrated into pkgsrc's gcc makefile, enabling the directive USE_LANGUAGES+= Ada. All the Ada packages in pkgsrc such as XML/Ada, GTK/Ada, GPS, AWS, Florist, etc, no longer require a specific compiler.

It is envisioned to modify FreeBSD's bsd.gcc.mk file to introduce the USE_ADA= directive similar to USE_FORTRAN= directive.  That will be a separate effort, and it will be accompanied with maintenance of all Ada ports.

Due to an ASSERTion in FreeBSD's thread library starting with version 9.0, all Ada tasking is broken on FreeBSD.  Currently it would require removing the check that emits, "thread exits with resources held!" and recompiling libpthread to fix.  Adacore was alerted to the problem with lang/gnat-aux, but they wanted to see if it still existed on gcc-4.7.  It does, and getting this port into the system is the first step to encouraging Adacore to fix this issue that affects all POSIX platforms but only FreeBSD has detected the issue.

Other than the tasking failures, gnat-aux passes all other languages with very high marks. Additionally, it features full precision on long doubles for C and C++ simultaneously with full precision for the GNAT Ada compiler.  Until now, one had to choose which language had good precision and which one was broken.  It's the only version of GNAT/C++ that does this (that I know of at least).

lang/gcc-aux will install at /usr/local/gcc-aux.  It doesn't conflict with any other compiler or port.
lang/gcc-aux can be built statically (other than libc), which is another improvement over lang/gnat-aux
lang/gcc-aux offers Native Language Support (option off by default) which appears to be the only compiler in the tree that does.

Fix: 

Like lang/gnat-aux, lang/gcc-aux has large diff files in the files directory.  It is more convenient to download the entire port as a tarball:
http://leaf.dragonflybsd.org/~marino/misc/port_lang_gcc-aux.tar.bz2

MD5 (port_lang_gcc-aux.tar.bz2) = fc06c52b23663d72b3cf5f0e88c5e336
Comment 1 John Marino 2012-07-19 19:05:56 UTC
During the process of troubleshooting the known issue between FreeBSD 
9.0 thread library and gcc-4.6/4.7 GNAT tasking, it was discovered the 
enable-stack-executable function was broken on FreeBSD in two places. 
It was broken out of the box, GCC must not have tested it on x86.

1) The gcc/config/i386/freebsd.h header did not have 
HAVE_ENABLE_EXECUTE_STACK macro defined, so the functionality was disabled.

2) The enable-execute-stack-mprotect.c file, which was designed 
specifically with FreeBSD in mind (it uses the kern.stackprot sysctl) 
didn't work.  The sysctl always returns 7 (stack is WRX) even when it 
can't be executed on, so the __enable_execute_stack function is 
effectively turned off anyway.

Rather than patch that file, I created a new version called 
enable-execute-stack-freebsd.c.  NetBSD, OpenBSD, and DragonFlyBSD also 
refer to it and skip the whole static variable "need_enable_exec_stack" 
business.  On FreeBSD 8.2, the testsuite completely passes now as it did 
with gnat-aux.  Ironically, the number of failures on FreeBSD 9.0 
increased by 6, but now also matches lang/gnat-aux on FreeBSD 9.0

The new tarball is here:
<http://leaf.dragonflybsd.org/~marino/misc/port_lang_gcc-aux.v2.tar.bz2>
MD5 (port_lang_gcc-aux.v2.tar.bz2) = fbd7aba289b12fc39004647bbb1b846f

The former one has been removed to avoid confusion.
Comment 2 Frederic Culot freebsd_committer freebsd_triage 2012-07-22 09:46:22 UTC
Responsible Changed
From-To: freebsd-ports-bugs->culot

I'll take it.
Comment 3 John Marino 2012-07-26 20:02:44 UTC
The issue with Ada tasking on FreeBSD 9.0 has been discovered.  It was a 
bug in threading library that has since been fixed.  The Ada tasking 
will work on the 9.1 RC and release.

During the troubleshooting of the tasking problem, it was discovered 
that on AMD64 *only*, the stack-check and point deref tests were all 
failing.  The cause of this is the signal trampoline frame on AMD64 
moved from immediately prior to the PS_STRINGS to a shared page for 
FreeBSD 9.  GNAT could no longer determine if it was pointing at a 
sigtramp frame and just indicated the end of the stack was reached 
before it really was.

The FreeBSD-specific unwind code was modified to handle the x86_64 / 
FreeBSD >= 9 case, and now with a patched libpthread, it passes all 
tests on FreeBSD 9.0.  The i386 version continues to pass all tests as well.

The updated port tarball is here:
http://leaf.dragonflybsd.org/~marino/misc/port_lang_gcc-aux.v3.tar.bz2
MD5 (port_lang_gcc-aux.v3.tar.bz2) = f9299538da27b92afe42f18f5adc4e58

This was previously discussed with Frederic Culot.
The Makefile and file/diff-core files changed wrt the previous version.

John
Comment 4 Frederic Culot freebsd_committer freebsd_triage 2012-07-29 09:40:09 UTC
Hi John,

thanks for your work on gcc-aux, this is greatly appreciated.
I was about to commit your new port when I realized the options are
still in the old format. Would it be possible that you update your
submission to fit the new OptionsNG framework as described in the
handbook here:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-options.html

This would be nice!

Thanks,
Frederic
Comment 5 dfilter service freebsd_committer freebsd_triage 2012-07-31 18:35:44 UTC
Author: culot
Date: Tue Jul 31 17:35:29 2012
New Revision: 301801
URL: http://svn.freebsd.org/changeset/ports/301801

Log:
  gcc-aux is the successor to the gcc-4.6-based lang/gnat-aux.  Originally it
  was planned for lang/gnat-aux to upgrade to version 4.7, then 4.8, etc.
  However, some cross-compilers are based on it and there are some significant
  differences between gcc 4.6 and 4.7. lang/gnat-aux also installs with a
  ${LOCALBASE} of /usr/local which has a high potential of file conflicts with
  other lang/ compilers. Another reason for keeping them separate is just about
  every Ada program will need to be patched for it due to new binding
  interpretations stemming from Ada-2012 work. Simply updating gnat-aux would
  break them all instantly.
  
  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 implements the full Ada-83, Ada-95, Ada-2005 standard and
  provides a partial implementation of Ada-2012.
  
  WWW: http://www.dragonlace.net/
  
  PR:		ports/169951
  Submitted by:	John Marino <draco@marino.st>

Added:
  head/lang/gcc-aux/
  head/lang/gcc-aux/Makefile   (contents, props changed)
  head/lang/gcc-aux/Makefile.common   (contents, props changed)
  head/lang/gcc-aux/distinfo   (contents, props changed)
  head/lang/gcc-aux/files/
  head/lang/gcc-aux/files/diff-ada   (contents, props changed)
  head/lang/gcc-aux/files/diff-ada-testsuite   (contents, props changed)
  head/lang/gcc-aux/files/diff-core   (contents, props changed)
  head/lang/gcc-aux/files/diff-cxx   (contents, props changed)
  head/lang/gcc-aux/files/diff-cxx-testsuite   (contents, props changed)
  head/lang/gcc-aux/files/diff-fortran   (contents, props changed)
  head/lang/gcc-aux/files/diff-fortran-testsuite   (contents, props changed)
  head/lang/gcc-aux/files/diff-gcc-testsuite   (contents, props changed)
  head/lang/gcc-aux/files/diff-static-version   (contents, props changed)
  head/lang/gcc-aux/pkg-descr   (contents, props changed)
  head/lang/gcc-aux/pkg-plist   (contents, props changed)
Modified:
  head/lang/Makefile

Modified: head/lang/Makefile
==============================================================================
--- head/lang/Makefile	Tue Jul 31 17:07:10 2012	(r301800)
+++ head/lang/Makefile	Tue Jul 31 17:35:29 2012	(r301801)
@@ -82,6 +82,7 @@
     SUBDIR += gauche
     SUBDIR += gawk
     SUBDIR += gcc
+    SUBDIR += gcc-aux
     SUBDIR += gcc34
     SUBDIR += gcc42
     SUBDIR += gcc44

Added: head/lang/gcc-aux/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc-aux/Makefile	Tue Jul 31 17:35:29 2012	(r301801)
@@ -0,0 +1,301 @@
+# New ports collection makefile for:  gcc-aux
+# Date created:                       2012-07-15
+# Whom:                               John Marino <draco@marino.st>
+#
+# $FreeBSD$
+#
+
+PORTNAME=	gcc-aux
+PORTVERSION=	${SNAPSHOT}
+CATEGORIES=	lang
+MASTER_SITES=	http://downloads.dragonlace.net/src/:boot \
+		http://dragonlace.mirrors.ada.cx/src/:boot \
+		${MASTER_SITE_GCC}
+MASTER_SITE_SUBDIR=	releases/gcc-${GCC_VERSION}
+DISTFILES=	gcc-${GCC_VERSION}.tar.bz2
+
+MAINTAINER=	draco@marino.st
+COMMENT=	Version of GCC ${GCC_BRANCH} with full Ada support
+
+.include "${.CURDIR}/Makefile.common"
+
+LANGS=			c
+APPLY_DIFFS=		core
+INTENDED_COMPILER=	NATIVE
+BOOTSTRAP_COMPILER=	NOT_REQUIRED
+BOOTSTRAP_TRIPLET=	NOT_SET
+FULL_GNATGCC=		NOT_SET
+
+OPTIONS=	ADA        "Build Ada language" on
+OPTIONS+=	CXX        "Build C++ language" on
+OPTIONS+=	FORT       "Build Fortran language" on
+OPTIONS+=	OBJC       "Build Objective-C language" on
+OPTIONS+=	STATIC     "Build with no shared libraries other than libc" off
+OPTIONS+=	TESTSUITE  "Activate test support" off
+OPTIONS+=	NLS        "Native Language Support" off
+
+.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
+
+.if ${ARCH} == "amd64"
+BLD_TARGET=		x86_64-aux-freebsd${OSREL}
+OS_LABEL4VERS=		[FreeBSD64]
+BOOTSTRAP_TRIPLET=	x86_64-bootstrap-freebsd8.1/4.6.0
+BOOTSTRAP_COMPILER=	gnat-bootstrap.x86_64.freebsd.tar.bz2
+.else
+BLD_TARGET=		i386-aux-freebsd${OSREL}
+OS_LABEL4VERS=		[FreeBSD]
+BOOTSTRAP_TRIPLET=	i386-bootstrap-freebsd8.0/4.6.0
+BOOTSTRAP_COMPILER=	gnat-bootstrap.i386.freebsd.tar.bz2
+.endif
+
+WRKSRC=			${WRKDIR}/gcc-${GCC_VERSION}
+BUILDDIR=		${WRKDIR}/build
+CFG_SCRIPT=		${WRKSRC}/configure
+REVFILE=		${WRKSRC}/gcc/REVISION
+BOOTSTRAP_PREFIX=	${WRKDIR}/bootstrap
+DESTINY=		${WRKDIR}/destdir
+PKG_PREFIX=		${PREFIX}/${PORTNAME}
+STICONV=		${PREFIX}/lib/libiconv.a
+STINTL=			\$${top_builddir}/../intl/libintl.a
+USE_LDCONFIG=		${PREFIX}/${PORTNAME}/lib ${PREFIX}/${PORTNAME}/lib/gcc
+MAN1=			cpp.1 gcc.1 gcov.1
+MAN1PREFIX=		${PREFIX}/${PORTNAME}/share
+MAN7PREFIX=		${PREFIX}/${PORTNAME}/share
+NO_MANCOMPRESS=		yes
+
+# If we find gnatmake and friends in a standard location, then we'll use this
+# compiler instead of downloading the bootstrap.
+.if exists (${PREFIX}/${PORTNAME}/bin/ada)
+.if exists (${PREFIX}/${PORTNAME}/bin/gnatbind)
+.if exists (${PREFIX}/${PORTNAME}/bin/gnatlink)
+.if exists (${PREFIX}/${PORTNAME}/bin/gnatmake)
+FULL_GNATGCC=${PREFIX}/${PORTNAME}/bin/ada
+FULL_PATH=/sbin:/bin:/usr/sbin:/usr/bin:${PREFIX}/${PORTNAME}/bin:${PREFIX}/bin
+.endif
+.endif
+.endif
+.endif
+
+# If FULL_GNATGCC is not set, we'll request the bootstrap compiler
+.if ${FULL_GNATGCC} == "NOT_SET"
+INTENDED_COMPILER=BOOTSTRAP
+FULL_GNATGCC=${BOOTSTRAP_PREFIX}/bin/gnatgcc
+FULL_PATH=${BOOTSTRAP_PREFIX}/bin:/sbin:/bin:/usr/sbin:/usr/bin:${PREFIX}/bin
+DISTFILES+=	${BOOTSTRAP_COMPILER}:boot
+.endif
+
+# for port maintenance, invoke "make makesum PLUS_BOOTSTRAPS=1"
+.if defined(PLUS_BOOTSTRAPS)
+DISTFILES=gcc-${GCC_VERSION}.tar.bz2 \
+   gnat-bootstrap.i386.freebsd.tar.bz2:boot \
+   gnat-bootstrap.x86_64.freebsd.tar.bz2:boot
+.endif
+
+###########
+##  Ada  ##
+###########
+
+.if defined(WITH_ADA)
+LANGS+=		ada
+APPLY_DIFFS+=	ada
+.endif
+
+###########
+##  C++  ##
+###########
+
+.if defined(WITH_CXX)
+LANGS+=		c++
+APPLY_DIFFS+=	cxx
+MAN1+=		g++.1
+.endif
+
+###############
+##  Fortran  ##
+###############
+
+.if defined(WITH_FORT)
+LANGS+=		fortran
+APPLY_DIFFS+=	fortran
+MAN1+=		gfortran.1
+EXTRA_CONFIG+=	--enable-libquadmath
+.else
+EXTRA_CONFIG+=	--disable-libquadmath
+.endif
+
+###################
+##  Objective-C  ##
+###################
+
+.if defined(WITH_OBJC)
+LANGS+=		objc
+.endif
+
+#########################
+##  Testsuite Support  ##
+#########################
+
+.if defined(WITH_TESTSUITE)
+BUILD_DEPENDS=	dejagnu>=1.4:${PORTSDIR}/misc/dejagnu
+APPLY_DIFFS+=	ada-testsuite
+APPLY_DIFFS+=	fortran-testsuite
+APPLY_DIFFS+=	cxx-testsuite
+APPLY_DIFFS+=	gcc-testsuite
+.endif
+
+#################################
+##  NATIONAL LANGUAGE SUPPORT  ##
+#################################
+
+.if defined(WITH_NLS)
+BUILD_DEPENDS=	gettext>=0.18:${PORTSDIR}/devel/gettext
+EXTRA_CONFIG+=	--enable-nls
+.else
+EXTRA_CONFIG+=	--disable-nls
+.endif
+
+###############################
+##  STATICALLY BUILT OPTION  ##
+###############################
+#
+# The "static" option is handled in the post-extract phase.
+
+# Establish Ada-aware compiler for use
+ADA_CONFIGURE_ENV=	CC=${FULL_GNATGCC}
+ADA_CONFIGURE_ENV+=	PATH=${FULL_PATH}
+ADA_MAKE_ENV=		PATH=${FULL_PATH}
+ADA_MAKE_ENV+=		ICONVPREFIX=${PREFIX}
+ADA_MAKE_ENV+=		LD_LIBRARY_PATH=${BUILDDIR}/gcc
+
+# The standard configuration options
+ADA_CONFIG_ARGS=	--enable-languages=${LANGS:Q}
+ADA_CONFIG_ARGS+=	--build=${BLD_TARGET}
+ADA_CONFIG_ARGS+=	--prefix=${PKG_PREFIX:Q}
+ADA_CONFIG_ARGS+=	--with-system-zlib
+ADA_CONFIG_ARGS+=	--with-gmp=${PREFIX}
+ADA_CONFIG_ARGS+=	--with-mpfr=${PREFIX}
+ADA_CONFIG_ARGS+=	--with-mpc=${PREFIX}
+ADA_CONFIG_ARGS+=	--with-libiconv-prefix=${PREFIX}
+ADA_CONFIG_ARGS+=	--enable-shared
+ADA_CONFIG_ARGS+=	--enable-threads=posix
+ADA_CONFIG_ARGS+=	--disable-bootstrap
+ADA_CONFIG_ARGS+=	--disable-libmudflap
+ADA_CONFIG_ARGS+=	--disable-libgomp
+ADA_CONFIG_ARGS+=	--disable-libssp
+ADA_CONFIG_ARGS+=	${EXTRA_CONFIG}
+
+post-extract:
+	# Personalize GNAT for each different machine
+	@${ECHO} "-=> GNAT AUX ${OS_LABEL4VERS}" > ${REVFILE}
+
+	# Create new directories in preparation of applying diff files
+.if defined(WITH_CXX)
+	${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 defined(WITH_STATIC)
+	@${ECHO} "Reconfiguring GCC Makefile to build compiler statically"
+	@${PATCH} -d ${WRKSRC} -s -E < ${FILESDIR}/diff-static-version
+.if defined(WITH_NLS)
+	@${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
+.else
+	@${PERL} -pi -e 's;\@LIBICONV\@;${STICONV};' \
+	  ${WRKSRC}/gcc/Makefile.in \
+	  ${WRKSRC}/libcpp/Makefile.in \
+	  ${WRKSRC}/gcc/ada/gcc-interface/Makefile.in
+.endif
+.endif
+
+.if ${INTENDED_COMPILER} == "BOOTSTRAP"
+	${MKDIR} ${BOOTSTRAP_PREFIX}
+	${MV} ${BOOTSTRAP_PREFIX}/../bin ${BOOTSTRAP_PREFIX}
+	${MV} ${BOOTSTRAP_PREFIX}/../lib ${BOOTSTRAP_PREFIX}
+	${MV} ${BOOTSTRAP_PREFIX}/../libexec ${BOOTSTRAP_PREFIX}
+
+	# 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.
+
+.if ${OSVERSION} > 900000
+	# Since June 7, bootstrap compiler's include-fixed headers have been
+	# incompatible with FreeBSD 9.0-CURRENT
+	${RM} -rf ${BOOTSTRAP_PREFIX}/lib/gcc/${BOOTSTRAP_TRIPLET}/include-fixed
+.endif
+.endif
+
+do-configure:
+	${MKDIR} ${BUILDDIR}
+	cd ${BUILDDIR} && ${SETENV} ${ADA_CONFIGURE_ENV} \
+	${CFG_SCRIPT} ${ADA_CONFIG_ARGS}
+
+do-build:
+	cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} ${_MAKE_JOBS} all
+
+test: build test-ada test-fortran test-objc test-cxx test-c
+
+test-ada:
+.if defined(WITH_ADA) && defined(WITH_TESTSUITE)
+	cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-ada
+.endif
+
+test-fortran:
+.if defined(WITH_FORT) && defined(WITH_TESTSUITE)
+	cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-fortran
+.endif
+
+test-objc:
+.if defined(WITH_OBJC) && defined(WITH_TESTSUITE)
+	cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-objc
+.endif
+
+test-cxx:
+.if defined(WITH_CXX) && defined(WITH_TESTSUITE)
+	# libstdc++ testsuite will break every time, TRUE used to force continuation
+	cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-c++ || true
+.endif
+
+test-c:
+.if defined(WITH_TESTSUITE)
+	cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} -sk check-c
+.endif
+
+do-install:
+	cd ${BUILDDIR} && ${SETENV} ${ADA_MAKE_ENV} ${GMAKE} install-strip DESTDIR=${DESTINY}
+	${CP} -pr ${DESTINY}${PREFIX}/ ${PREFIX}/
+
+post-install:
+	${RM} -f ${WRKDIR}/PLIST.all
+	${RM} -rf ${DESTINY}/man
+	${MV} ${DESTINY}${PREFIX}/${PORTNAME}/share/man ${DESTINY}/
+	cd ${DESTINY}; ${FIND} man -type d \
+	   -exec ${MKDIR} ${DESTINY}${PREFIX}/${PORTNAME}/share/{} \;
+	cd ${DESTINY}${PREFIX}; ${FIND} ${PORTNAME} \( -type f -or -type l \) | \
+	   ${SORT} >> ${WRKDIR}/PLIST.all
+	cd ${DESTINY}${PREFIX}; ${FIND} ${PORTNAME}  -type d | ${SORT} -r | \
+	   ${SED} -e 's/^/@dirrm /g' >> ${WRKDIR}/PLIST.all
+
+	cd ${WRKDIR}; ${SED} -i -e "/PLIST.all/ r PLIST.all" ${TMPPLIST}
+.if ${OSVERSION} > 900000 && ${OSVERSION} < 900507
+	@${ECHO_MSG} "===================================================================="
+	@${ECHO_MSG} " NOTICE REGARDING ADA TASKING ON FREEBSD 9.0:"
+	@${ECHO_MSG} " Due to a bug in the FreeBSD 9.0 threading library, an exiting task"
+	@${ECHO_MSG} " panics with the message: 'thread exits with resources held!'."
+	@${ECHO_MSG} " This behavior breaks Ada tasking.  These are two solutions:"
+	@${ECHO_MSG} " 1) Upgrade to FreeBSD 9.1 or higher"
+	@${ECHO_MSG} " 2) Patch and rebuild thread library as described in"
+	@${ECHO_MSG} "    http://www.dragonlace.net/posts/F9_Fix/"
+	@${ECHO_MSG} "===================================================================="
+.endif
+
+.include <bsd.port.post.mk>

Added: head/lang/gcc-aux/Makefile.common
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc-aux/Makefile.common	Tue Jul 31 17:35:29 2012	(r301801)
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+LIB_DEPENDS=		gmp.10:${PORTSDIR}/math/gmp
+LIB_DEPENDS+=		mpfr.4:${PORTSDIR}/math/mpfr
+LIB_DEPENDS+=		mpc.2:${PORTSDIR}/math/mpc
+
+ONLY_FOR_ARCHS= 	i386 amd64
+
+GNU_CONFIGURE=		yes
+USE_GMAKE=		yes
+USE_BZIP2=		yes
+USE_ICONV=		yes
+USE_PERL5_BUILD=	yes
+ALL_TARGET=		default
+MAKE_JOBS_SAFE= 	yes
+
+SNAPSHOT=		20120614
+GCC_BRANCH=		4.7
+GCC_POINT=		1
+GCC_VERSION=		${GCC_BRANCH}.${GCC_POINT}
+

Added: head/lang/gcc-aux/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc-aux/distinfo	Tue Jul 31 17:35:29 2012	(r301801)
@@ -0,0 +1,6 @@
+SHA256 (gcc-4.7.1.tar.bz2) = 16093f6fa01732adf378d97fe338f113c933bdf56da22bf87c76beff13da406f
+SIZE (gcc-4.7.1.tar.bz2) = 82639660
+SHA256 (gnat-bootstrap.i386.freebsd.tar.bz2) = c38e1c960f651c3f248c1ef540b1df724058fa71c1d046af93ce975483abb645
+SIZE (gnat-bootstrap.i386.freebsd.tar.bz2) = 27973176
+SHA256 (gnat-bootstrap.x86_64.freebsd.tar.bz2) = c4abd6af1281785d47d99352e28e41b2a1455e25ff347eca0de5791cdede9ed8
+SIZE (gnat-bootstrap.x86_64.freebsd.tar.bz2) = 31565201

Added: head/lang/gcc-aux/files/diff-ada
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc-aux/files/diff-ada	Tue Jul 31 17:35:29 2012	(r301801)
@@ -0,0 +1,9368 @@
+--- 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;
++  }

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Frederic Culot freebsd_committer freebsd_triage 2012-07-31 18:42:28 UTC
State Changed
From-To: open->closed

Committed, thanks John!