From fe207966d72198259756227bac227f604df85dde Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Wed, 6 May 2020 01:15:53 +0900 Subject: [PATCH] Fix compilation with gcc10 wrt multiple definitions issue gcc10 now defaults to -fno-common (ref: https://gcc.gnu.org/gcc-10/changes.html ). Now with compiled with gcc10, multiple definitions are found which causes linker error as: * --with-tcl: ``` /usr/bin/ld: table/table3D/cfunc.o:/builddir/build/BUILD/ngspice-32/ngspice/tclspice/src/xspice/icm/../../../src/include/../xspice/icm/dlmain.h:8: multiple definition of `coreitf'; table/dlmain.o:/builddir/build/BUILD/ngspice-32/ngspice/tclspice/src/xspice/icm/dlmain.c:45: first defined here ``` * --enable-oldapps ``` /bin/ld: frontend/com_history.o:(.data+0x4): multiple definition of `cp_maxhistlength'; ngsconvert.o:(.bss+0xa4): first defined here collect2: error: ld returned 1 exit status ``` This commit fixes these issues. --- src/ngsconvert.c | 1 - src/xspice/icm/dlmain.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ngsconvert.c b/src/ngsconvert.c index f8a7a5176..6e09b9033 100644 --- a/src/ngsconvert.c +++ b/src/ngsconvert.c @@ -24,7 +24,6 @@ FILE *cp_err = NULL; FILE *cp_curin = NULL; FILE *cp_curout = NULL; FILE *cp_curerr = NULL; -int cp_maxhistlength; bool cp_debug = FALSE; char cp_chars[128]; bool cp_nocc = TRUE; diff --git a/src/xspice/icm/dlmain.h b/src/xspice/icm/dlmain.h index c442f1a14..ff08083fc 100644 --- a/src/xspice/icm/dlmain.h +++ b/src/xspice/icm/dlmain.h @@ -5,6 +5,6 @@ #include "ngspice/mifproto.h" #include "ngspice/dllitf.h" -struct coreInfo_t *coreitf; +extern struct coreInfo_t *coreitf; #endif /* dlmain.h */