Tuesday, February 02, 2021

Re: Update lang/iverilog to 11.0 (fixes no-common)

Christian Weisgerber <naddy@mips.inka.de> writes:

> Greg Steuck:
>
>> iverilog still starts.
>
> But the regression tests fail:
>
> driver/iverilog -B. -BMvpi -BPivlpp -tcheck -ocheck.vvp ./examples/hello.vl
> Cannot locate IVL modules : couldn't get command path from OS.
> gmake: *** [Makefile:141: check] Error 1

I have plausible deniability: the test passes if the package is
installed. Truth is, I didn't check `make test`.

Please see the updated patch which includes an upstream fix that gets
`make test` to pass (tested on amd64).

From 7c13fbb65ca242d1832e21b332f695614fe713a9 Mon Sep 17 00:00:00 2001
From: Greg Steuck <greg@nest.cx>
Date: Mon, 1 Feb 2021 20:15:52 -0800
Subject: [PATCH] Update lang/iverilog to 11.0

This allows it to build with CXXFLAGS=-fno-common

Added a patch from upstream to work around a case of "all-world-is-Linux"ism.
---
lang/iverilog/Makefile | 4 ++--
lang/iverilog/distinfo | 4 ++--
lang/iverilog/patches/patch-driver_main_c | 25 +++++++++++++++++++++++
3 files changed, 29 insertions(+), 4 deletions(-)
create mode 100644 lang/iverilog/patches/patch-driver_main_c

diff --git lang/iverilog/Makefile lang/iverilog/Makefile
index bbe47233bf8..544c327e9bc 100644
--- lang/iverilog/Makefile
+++ lang/iverilog/Makefile
@@ -2,7 +2,7 @@

COMMENT= Verilog simulation and synthesis tool

-V= 10.3
+V= 11.0
DISTNAME= verilog-$V
PKGNAME= iverilog-$V
CATEGORIES= lang devel
@@ -12,7 +12,7 @@ HOMEPAGE= http://iverilog.icarus.com/
# GPLv2+
PERMIT_PACKAGE= Yes

-MASTER_SITES= ftp://ftp.icarus.com/pub/eda/verilog/v10/
+MASTER_SITES= ftp://ftp.icarus.com/pub/eda/verilog/v11/

WANTLIB += ${COMPILER_LIBCXX} bz2 c curses m readline z

diff --git lang/iverilog/distinfo lang/iverilog/distinfo
index c8b46d726a4..fc16e0e27b1 100644
--- lang/iverilog/distinfo
+++ lang/iverilog/distinfo
@@ -1,2 +1,2 @@
-SHA256 (verilog-10.3.tar.gz) = hr1F5+EtG8h3LDzdOU5oqf7MsqbRSq99rgdztydDaO8=
-SIZE (verilog-10.3.tar.gz) = 1698889
+SHA256 (verilog-11.0.tar.gz) = 1UeFYWtj/mc5lI6ZZ0mWJPKd7VSttX4eAOuJdWemVdU=
+SIZE (verilog-11.0.tar.gz) = 1784307
diff --git lang/iverilog/patches/patch-driver_main_c lang/iverilog/patches/patch-driver_main_c
new file mode 100644
index 00000000000..08795fd5522
--- /dev/null
+++ lang/iverilog/patches/patch-driver_main_c
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+Don't exit when ivl_root not found - the user may have supplied it.
+
+When running 'make check' without having an installed copy, find_ivl_root()
+will fail on Unix systems that don't provide /proc/self/exe (e.g. MacOS).
+
+https://github.com/steveicarus/iverilog/commit/56d2d798ecd97c09539e7748997013eddd37ab42
+
+Index: driver/main.c
+--- driver/main.c.orig
++++ driver/main.c
+@@ -1061,7 +1061,11 @@ static void find_ivl_root(void)
+ find_ivl_root_failed("command path exceeds size of string buffer.");
+ }
+ if (len <= 0) {
+- find_ivl_root_failed("couldn't get command path from OS.");
++ // We've failed, but we may yet find a -B option on the command line.
++ // Use the built-in path so the user sees a sensible error message.
++ assert(strlen(IVL_ROOT) < sizeof ivl_root);
++ strcpy(ivl_root, IVL_ROOT);
++ return;
+ }
+ s = strrchr(ivl_root, sep);
+ if (s == 0) {
--
2.30.0

No comments:

Post a Comment