sci-electronics/iverilog: fix 10.3 gcc-10 build problem
authorHuang Rui <vowstar@gmail.com>
Thu, 30 Jan 2020 07:32:15 +0000 (15:32 +0800)
committerSergei Trofimovich <slyfox@gentoo.org>
Mon, 17 Feb 2020 07:23:23 +0000 (07:23 +0000)
gcc-10 and above flipped a default from -fcommon to -fno-common:
https://gcc.gnu.org/PR85678
Usually all it takes is to add a few 'extern' declarations and
move definitions from header files to modules. I've port iverilog
to gcc-10.

Closes: https://bugs.gentoo.org/706366
Package-Manager: Portage-2.3.85, Repoman-2.3.20
Signed-off-by: Huang Rui <vowstar@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/14619
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
sci-electronics/iverilog/files/iverilog-10.3-fno-common.patch [new file with mode: 0644]
sci-electronics/iverilog/iverilog-10.3.ebuild

diff --git a/sci-electronics/iverilog/files/iverilog-10.3-fno-common.patch b/sci-electronics/iverilog/files/iverilog-10.3-fno-common.patch
new file mode 100644 (file)
index 0000000..3bb06c6
--- /dev/null
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/706366
+--- a/driver/cflexor.lex
++++ b/driver/cflexor.lex
+@@ -27,6 +27,8 @@
+ # include  "globals.h"
+ # include  <string.h>
++char *current_file = NULL;
++
+ static int comment_enter;
+ static char* trim_trailing_white(char*txt, int trim);
+--- a/driver/cfparse_misc.h
++++ b/driver/cfparse_misc.h
+@@ -39,6 +39,6 @@ int cferror(const char *);
+ int cfparse(void);
+ void switch_to_command_file(const char *);
+ void destroy_lexor(void);
+-char *current_file;
++extern char *current_file;
+ #endif /* IVL_cfparse_misc_H */
+--- a/libveriuser/priv.h
++++ b/libveriuser/priv.h
+@@ -31,6 +31,6 @@ extern char* __acc_newstring(const char*txt);
+ /*
+  * Trace file for logging ACC and TF calls.
+  */
+-FILE* pli_trace;
++extern FILE* pli_trace;
+ #endif /* IVL_priv_H */
+
index ae61d822ad4f378122e6a3ea4a7ed17be9d559d2..b5e65f56c2ebe6a75238970e149ea6340273e69c 100644 (file)
@@ -40,6 +40,7 @@ DEPEND="
 
 PATCHES=(
        "${FILESDIR}"/${PN}-10.3-file-missing.patch #705412
+       "${FILESDIR}"/${PN}-10.3-fno-common.patch #706366
 )
 
 src_prepare() {