diff --git a/cad/nvc/Makefile b/cad/nvc/Makefile index 586bb2a20971..614134eb577c 100644 --- a/cad/nvc/Makefile +++ b/cad/nvc/Makefile @@ -1,51 +1,57 @@ PORTNAME= nvc DISTVERSIONPREFIX= r DISTVERSION= 1.7.0 CATEGORIES= cad MAINTAINER= yuri@FreeBSD.org COMMENT= VHDL compiler and simulator LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/COPYING BROKEN_i386= compilation fails: Please port fill_cpu_state to this OS/CPU combination, see https://github.com/nickg/nvc/issues/501 BUILD_DEPENDS= llvm-config${LLVM_VERSION}:devel/llvm${LLVM_VERSION} RUN_DEPENDS= llvm${LLVM_VERSION}>0:devel/llvm${LLVM_VERSION} \ bash:shells/bash TEST_DEPENDS= check>0:devel/check .if !exists(/usr/include/unwind.h) LIB_DEPENDS= libunwind.so:devel/libunwind .endif USES= autoreconf compiler:c++14-lang localbase pkgconfig shebangfix USE_GITHUB= yes GH_ACCOUNT= nickg SHEBANG_FILES= contrib/functions.sh GNU_CONFIGURE= yes LDFLAGS+= -lexecinfo CONFIGURE_ARGS= --with-llvm=${LOCALBASE}/bin/llvm-config${LLVM_VERSION} TEST_TARGET= check # one test fails MAKE_ARGS= CFLAGS="${CFLAGS}" # only for tests LLVM_VERSION= ${LLVM_DEFAULT} # outsource build is required by the project BUILD_DIR= ${WRKSRC}/.build BUILD_WRKSRC= ${BUILD_DIR} CONFIGURE_WRKSRC= ${BUILD_DIR} INSTALL_WRKSRC= ${BUILD_DIR} CONFIGURE_CMD= ${WRKSRC}/configure +.include + +.if ${ARCH} == powerpc64 +CONFIGURE_ARGS+= --enable-lto=no +.endif + post-install: @${FIND} ${STAGEDIR}${PREFIX} -name "*.so" | ${XARGS} ${STRIP_CMD} .include diff --git a/cad/nvc/files/patch-thirdparty_cpustate.c b/cad/nvc/files/patch-thirdparty_cpustate.c new file mode 100644 index 000000000000..074770c7d712 --- /dev/null +++ b/cad/nvc/files/patch-thirdparty_cpustate.c @@ -0,0 +1,16 @@ +--- thirdparty/cpustate.c.orig 2022-08-10 16:48:11 UTC ++++ thirdparty/cpustate.c +@@ -103,6 +103,13 @@ void fill_cpu_state(struct cpu_state *cpu, ucontext_t + + for (int i = 0; i < 16; i++) + cpu->regs[i] = uc->uc_mcontext._gregs[i]; ++ ++#elif defined __FreeBSD__ && defined __powerpc__ ++ cpu->pc = uc->uc_mcontext.mc_srr0; ++ cpu->sp = uc->uc_mcontext.mc_gpr[1]; ++ ++ for (int i = 0; i < 31; i++) ++ cpu->regs[i] = uc->uc_mcontext.mc_gpr[i]; + #elif defined __OpenBSD__ && defined __x86_64__ + cpu->pc = uc->sc_rip; + cpu->sp = uc->sc_rsp;