From 3553aa7d2d581c04957f0bf294a07bec41018d61 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Fri, 22 May 2020 22:59:14 +0000 Subject: [PATCH] Avoid duplicate "code_lines" symbols, which fails to link when building tools with gcc 10.1.1 / ld 2.34-2.fc32. --- external/bsd/byacc/dist/defs.h | 4 ++-- external/bsd/byacc/dist/output.c | 6 ++++-- external/bsd/byacc/dist/reader.c | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/external/bsd/byacc/dist/defs.h b/external/bsd/byacc/dist/defs.h index 02fed45cc9c1..b6306ae2b222 100644 --- a/external/bsd/byacc/dist/defs.h +++ b/external/bsd/byacc/dist/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.17 2019/10/15 15:58:46 christos Exp $ */ +/* $NetBSD: defs.h,v 1.18 2020/05/22 22:59:14 jmcneill Exp $ */ /* Id: defs.h,v 1.61 2019/06/16 15:07:51 tom Exp */ @@ -590,7 +590,7 @@ extern void reader(void); struct code_lines { char *lines; size_t num; -} code_lines[CODE_MAX]; +}; /* skeleton.c (generated by skel2c) */ extern void write_section(FILE * fp, const char *const section[]); diff --git a/external/bsd/byacc/dist/output.c b/external/bsd/byacc/dist/output.c index 4de1f7eb721d..92f92c0c28f1 100644 --- a/external/bsd/byacc/dist/output.c +++ b/external/bsd/byacc/dist/output.c @@ -1,11 +1,11 @@ -/* $NetBSD: output.c,v 1.21 2019/10/15 15:58:46 christos Exp $ */ +/* $NetBSD: output.c,v 1.22 2020/05/22 22:59:14 jmcneill Exp $ */ /* Id: output.c,v 1.87 2018/05/10 09:08:46 tom Exp */ #include "defs.h" #include -__RCSID("$NetBSD: output.c,v 1.21 2019/10/15 15:58:46 christos Exp $"); +__RCSID("$NetBSD: output.c,v 1.22 2020/05/22 22:59:14 jmcneill Exp $"); #define StaticOrR (rflag ? "" : "static ") #define CountLine(fp) (!rflag || ((fp) == code_file)) @@ -36,6 +36,8 @@ static Value_t *check; static int lowzero; static long high; +struct code_lines code_lines[CODE_MAX]; + static void output_code_lines(FILE *fp, int cl) { diff --git a/external/bsd/byacc/dist/reader.c b/external/bsd/byacc/dist/reader.c index a1f198140543..49bbae065d78 100644 --- a/external/bsd/byacc/dist/reader.c +++ b/external/bsd/byacc/dist/reader.c @@ -1,11 +1,11 @@ -/* $NetBSD: reader.c,v 1.17 2019/10/15 15:58:46 christos Exp $ */ +/* $NetBSD: reader.c,v 1.18 2020/05/22 22:59:14 jmcneill Exp $ */ /* Id: reader.c,v 1.74 2017/12/04 17:50:02 tom Exp */ #include "defs.h" #include -__RCSID("$NetBSD: reader.c,v 1.17 2019/10/15 15:58:46 christos Exp $"); +__RCSID("$NetBSD: reader.c,v 1.18 2020/05/22 22:59:14 jmcneill Exp $"); /* The line size must be a positive integer. One hundred was chosen */ /* because few lines in Yacc input grammars exceed 100 characters. */ @@ -71,7 +71,7 @@ static const char *code_keys[] = { "", "requires", "provides", "top", "imports", }; -struct code_lines code_lines[CODE_MAX]; +extern struct code_lines code_lines[CODE_MAX]; #if defined(YYBTYACC) int destructor = 0; /* =1 if at least one %destructor */