Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 2015 05:37:27 +0000 (UTC)
From:      Andreas Tobler <andreast@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r378044 - in head/lang/gcc5: . files
Message-ID:  <201501280537.t0S5bRtS012642@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andreast (src committer)
Date: Wed Jan 28 05:37:26 2015
New Revision: 378044
URL: https://svnweb.freebsd.org/changeset/ports/378044
QAT: https://qat.redports.org/buildarchive/r378044/

Log:
  Allow to build gcc for armv6(hf).
  
  Approved by:	gerald	(maintainer)

Added:
  head/lang/gcc5/files/patch-arm-unwind-cxx-support   (contents, props changed)
Modified:
  head/lang/gcc5/Makefile

Modified: head/lang/gcc5/Makefile
==============================================================================
--- head/lang/gcc5/Makefile	Wed Jan 28 04:56:45 2015	(r378043)
+++ head/lang/gcc5/Makefile	Wed Jan 28 05:37:26 2015	(r378044)
@@ -31,7 +31,7 @@ BUILD_DEPENDS+=	runtest:${PORTSDIR}/misc
 DISTVERSION=	${PORTVERSION:C/([0-9]+).*\.s([0-9]+)/\1-\2/}
 GCC_VERSION=	${PORTVERSION:C/(.+)\.s[0-9]{8}/\1.0/}
 SUFFIX=		${PORTVERSION:C/([0-9]+).*/\1/}
-ONLY_FOR_ARCHS=	amd64 i386 powerpc powerpc64 sparc64
+ONLY_FOR_ARCHS=	amd64 i386 powerpc powerpc64 sparc64 arm armv6 armv6hf
 USES=		gmake iconv libtool makeinfo perl5 tar:bzip2
 USE_BINUTILS=	yes
 USE_PERL5=	build
@@ -65,6 +65,16 @@ CONFIGURE_TARGET=	${ARCH}-portbld-${OPSY
 CONFIGURE_ENV+=	UNAME_m="powerpc64"
 .endif
 
+.if ${ARCH} == "armv6" || ${ARCH} == "armv6hf"
+. if ${COMPILER_TYPE} == clang
+.  if empty(PORT_OPTIONS:MBOOTSTRAP)
+MAKE_ARGS+=CXXFLAGS=-fbracket-depth=512
+.  else
+MAKE_ARGS+=STAGE1_CXXFLAGS=-fbracket-depth=512
+.  endif
+. endif
+.endif
+
 LANGUAGES:=	c,c++,objc,fortran
 SRCDIR=		${WRKDIR}/gcc-${DISTVERSION}
 WRKSRC=		${WRKDIR}/build

Added: head/lang/gcc5/files/patch-arm-unwind-cxx-support
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc5/files/patch-arm-unwind-cxx-support	Wed Jan 28 05:37:26 2015	(r378044)
@@ -0,0 +1,105 @@
+Index: gcc/ginclude/unwind-arm-common.h
+===================================================================
+--- gcc/ginclude/unwind-arm-common.h	(revision 219113)
++++ gcc/ginclude/unwind-arm-common.h	(working copy)
+@@ -82,7 +82,11 @@
+ 
+   struct _Unwind_Control_Block
+     {
++#ifdef __FreeBSD__
++      unsigned exception_class __attribute__((__mode__(__DI__)));
++#else
+       char exception_class[8];
++#endif
+       void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
+       /* Unwinder cache, private fields for the unwinder's use */
+       struct
+@@ -181,7 +185,11 @@
+ 
+   /* Support functions for the PR.  */
+ #define _Unwind_Exception _Unwind_Control_Block
++#ifdef __FreeBSD__
++  typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
++#else
+   typedef char _Unwind_Exception_Class[8];
++#endif
+ 
+   void * _Unwind_GetLanguageSpecificData (_Unwind_Context *);
+   _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
+Index: libstdc++-v3/libsupc++/unwind-cxx.h
+===================================================================
+--- libstdc++-v3/libsupc++/unwind-cxx.h	(revision 219147)
++++ libstdc++-v3/libsupc++/unwind-cxx.h	(working copy)
+@@ -235,7 +235,7 @@
+   return reinterpret_cast<__cxa_dependent_exception *>(exc + 1) - 1;
+ }
+ 
+-#ifdef __ARM_EABI_UNWINDER__
++#if defined(__ARM_EABI_UNWINDER__) && !defined(__FreeBSD__)
+ static inline bool
+ __is_gxx_exception_class(_Unwind_Exception_Class c)
+ {
+@@ -309,13 +309,7 @@
+   c[6] = 'R';
+   c[7] = '\0';
+ }
+-
+-static inline void*
+-__gxx_caught_object(_Unwind_Exception* eo)
+-{
+-  return (void*)eo->barrier_cache.bitpattern[0];
+-}
+-#else // !__ARM_EABI_UNWINDER__
++#else // !__ARM_EABI_UNWINDER__ || __FreeBSD__
+ // This is the primary exception class we report -- "GNUCC++\0".
+ const _Unwind_Exception_Class __gxx_primary_exception_class
+ = ((((((((_Unwind_Exception_Class) 'G' 
+@@ -339,6 +333,16 @@
+     << 8 | (_Unwind_Exception_Class) '+')
+    << 8 | (_Unwind_Exception_Class) '\x01');
+ 
++const _Unwind_Exception_Class __gxx_forced_unwind_class
++= ((((((((_Unwind_Exception_Class) 'G'
++        << 8 | (_Unwind_Exception_Class) 'N')
++       << 8 | (_Unwind_Exception_Class) 'U')
++      << 8 | (_Unwind_Exception_Class) 'C')
++     << 8 | (_Unwind_Exception_Class) 'F')
++    << 8 | (_Unwind_Exception_Class) 'O')
++   << 8 | (_Unwind_Exception_Class) 'R')
++  << 8 | (_Unwind_Exception_Class) '\0');
++
+ static inline bool
+ __is_gxx_exception_class(_Unwind_Exception_Class c)
+ {
+@@ -346,6 +350,12 @@
+       || c == __gxx_dependent_exception_class;
+ }
+ 
++static inline bool
++__is_gxx_forced_unwind_class(_Unwind_Exception_Class c)
++{
++  return c ==  __gxx_forced_unwind_class;
++}
++
+ // Only checks for primary or dependent, but not that it is a C++ exception at
+ // all.
+ static inline bool
+@@ -357,7 +367,18 @@
+ #define __GXX_INIT_PRIMARY_EXCEPTION_CLASS(c) c = __gxx_primary_exception_class
+ #define __GXX_INIT_DEPENDENT_EXCEPTION_CLASS(c) \
+   c = __gxx_dependent_exception_class
++#define __GXX_INIT_FORCED_UNWIND_CLASS(c) c = __gxx_forced_unwind_class 
++#endif // __ARM_EABI_UNWINDER__ && !__FreeBSD__
+ 
++#ifdef __ARM_EABI_UNWINDER__
++static inline void*
++__gxx_caught_object(_Unwind_Exception* eo)
++{
++    return (void*)eo->barrier_cache.bitpattern[0];
++}
++
++#else // !__ARM_EABI_UNWINDER__
++
+ // GNU C++ personality routine, Version 0.
+ extern "C" _Unwind_Reason_Code __gxx_personality_v0
+      (int, _Unwind_Action, _Unwind_Exception_Class,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501280537.t0S5bRtS012642>