From owner-svn-ports-all@freebsd.org Fri Jun 29 07:48:44 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 808871033FF5; Fri, 29 Jun 2018 07:48:44 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 329F6806C8; Fri, 29 Jun 2018 07:48:44 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 137401E018; Fri, 29 Jun 2018 07:48:44 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5T7mhve082440; Fri, 29 Jun 2018 07:48:43 GMT (envelope-from linimon@FreeBSD.org) Received: (from linimon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5T7mgnK082434; Fri, 29 Jun 2018 07:48:42 GMT (envelope-from linimon@FreeBSD.org) Message-Id: <201806290748.w5T7mgnK082434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: linimon set sender to linimon@FreeBSD.org using -f From: Mark Linimon Date: Fri, 29 Jun 2018 07:48:42 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r473531 - in head/devel/libunwind: . files X-SVN-Group: ports-head X-SVN-Commit-Author: linimon X-SVN-Commit-Paths: in head/devel/libunwind: . files X-SVN-Commit-Revision: 473531 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2018 07:48:44 -0000 Author: linimon Date: Fri Jun 29 07:48:42 2018 New Revision: 473531 URL: https://svnweb.freebsd.org/changeset/ports/473531 Log: Port to aarch64. Tested for no-harm on amd64. While here, pet portlint. PR: 229057 Submitted by: greg at unrelenting.technology Approved by: portmgr (tier-2 blanket) Added: head/devel/libunwind/files/patch-include_libunwind-aarch64.h (contents, props changed) head/devel/libunwind/files/patch-include_libunwind__i.h (contents, props changed) head/devel/libunwind/files/patch-src_aarch64_Ginit.c (contents, props changed) head/devel/libunwind/files/patch-src_coredump___UCD__access__reg__freebsd.c (contents, props changed) head/devel/libunwind/files/patch-src_ptrace___UPT__access__fpreg.c (contents, props changed) Modified: head/devel/libunwind/Makefile Modified: head/devel/libunwind/Makefile ============================================================================== --- head/devel/libunwind/Makefile Fri Jun 29 07:36:14 2018 (r473530) +++ head/devel/libunwind/Makefile Fri Jun 29 07:48:42 2018 (r473531) @@ -13,17 +13,17 @@ COMMENT= Generic stack unwinding library LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING +ONLY_FOR_ARCHS= aarch64 amd64 i386 + OPTIONS_DEFINE= DOCS OPTIONS_SUB= yes DOCS_CONFIGURE_ON= ac_cv_path_LATEX2MAN=${TRUE} DOCS_CONFIGURE_OFF= --disable-documentation -ONLY_FOR_ARCHS= i386 amd64 - +USES= libtool pathfix pkgconfig +USE_LDCONFIG= yes GNU_CONFIGURE= yes INSTALL_TARGET= install-strip -USE_LDCONFIG= yes -USES= libtool pathfix pkgconfig LLD_UNSAFE= yes PLIST_SUB= ARCH=${ARCH:S|i386|x86|:S|amd64|x86_64|} Added: head/devel/libunwind/files/patch-include_libunwind-aarch64.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libunwind/files/patch-include_libunwind-aarch64.h Fri Jun 29 07:48:42 2018 (r473531) @@ -0,0 +1,11 @@ +--- include/libunwind-aarch64.h.orig 2018-06-15 23:58:09 UTC ++++ include/libunwind-aarch64.h +@@ -177,7 +177,7 @@ typedef ucontext_t unw_tdep_context_t; + + #define unw_tdep_getcontext(uc) (({ \ + unw_tdep_context_t *unw_ctx = (uc); \ +- register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs; \ ++ register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.mc_gpregs.gp_x; \ + __asm__ __volatile__ ( \ + "stp x0, x1, [%[base], #0]\n" \ + "stp x2, x3, [%[base], #16]\n" \ Added: head/devel/libunwind/files/patch-include_libunwind__i.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libunwind/files/patch-include_libunwind__i.h Fri Jun 29 07:48:42 2018 (r473531) @@ -0,0 +1,14 @@ +--- include/libunwind_i.h.orig 2018-06-15 23:58:15 UTC ++++ include/libunwind_i.h +@@ -86,6 +86,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + # error Host has unknown byte-order. + # endif + #endif ++#ifdef __FreeBSD__ ++#define __BYTE_ORDER BYTE_ORDER ++#define __LITTLE_ENDIAN LITTLE_ENDIAN ++#define __BIG_ENDIAN BIG_ENDIAN ++#endif + + #if defined(HAVE__BUILTIN_UNREACHABLE) + # define unreachable() __builtin_unreachable() Added: head/devel/libunwind/files/patch-src_aarch64_Ginit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libunwind/files/patch-src_aarch64_Ginit.c Fri Jun 29 07:48:42 2018 (r473531) @@ -0,0 +1,11 @@ +--- src/aarch64/Ginit.c.orig 2018-06-15 23:58:20 UTC ++++ src/aarch64/Ginit.c +@@ -44,7 +44,7 @@ static inline void * + uc_addr (ucontext_t *uc, int reg) + { + if (reg >= UNW_AARCH64_X0 && reg <= UNW_AARCH64_V31) +- return &uc->uc_mcontext.regs[reg]; ++ return &uc->uc_mcontext.mc_gpregs.gp_x[reg]; + else + return NULL; + } Added: head/devel/libunwind/files/patch-src_coredump___UCD__access__reg__freebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libunwind/files/patch-src_coredump___UCD__access__reg__freebsd.c Fri Jun 29 07:48:42 2018 (r473531) @@ -0,0 +1,13 @@ +--- src/coredump/_UCD_access_reg_freebsd.c.orig 2018-06-16 00:05:10 UTC ++++ src/coredump/_UCD_access_reg_freebsd.c +@@ -110,6 +110,10 @@ _UCD_access_reg (unw_addr_space_t as, + Debug(0, "bad regnum:%d\n", regnum); + return -UNW_EINVAL; + }; ++#elif defined(UNW_TARGET_AARCH64) ++ if (regnum < 0 || regnum >= UNW_AARCH64_FPCR) ++ return -UNW_EINVAL; ++ *valp = ui->prstatus->pr_reg.x[regnum]; + #else + #error Port me + #endif Added: head/devel/libunwind/files/patch-src_ptrace___UPT__access__fpreg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libunwind/files/patch-src_ptrace___UPT__access__fpreg.c Fri Jun 29 07:48:42 2018 (r473531) @@ -0,0 +1,20 @@ +--- src/ptrace/_UPT_access_fpreg.c.orig 2018-06-15 23:58:03 UTC ++++ src/ptrace/_UPT_access_fpreg.c +@@ -85,6 +85,8 @@ _UPT_access_fpreg (unw_addr_space_t as, unw_regnum_t r + memcpy(&fpreg.fpr_xacc[reg], val, sizeof(unw_fpreg_t)); + #elif defined(__i386__) + memcpy(&fpreg.fpr_acc[reg], val, sizeof(unw_fpreg_t)); ++#elif defined(__aarch64__) ++ memcpy(&fpreg.fp_q[reg], val, sizeof(unw_fpreg_t)); + #else + #error Fix me + #endif +@@ -95,6 +97,8 @@ _UPT_access_fpreg (unw_addr_space_t as, unw_regnum_t r + memcpy(val, &fpreg.fpr_xacc[reg], sizeof(unw_fpreg_t)); + #elif defined(__i386__) + memcpy(val, &fpreg.fpr_acc[reg], sizeof(unw_fpreg_t)); ++#elif defined(__aarch64__) ++ memcpy(val, &fpreg.fp_q[reg], sizeof(unw_fpreg_t)); + #else + #error Fix me + #endif