Blob Blame History Raw
From 83cab9b08889c66988afaa56e6b138d13f65cf97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 14 Jul 2020 16:38:01 +0200
Subject: [PATCH] Fix multiple definitions in asco
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since GCC 10:

gcc  -O2 -fexceptions -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection  -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -s -o alter auxfunc_alter.o alter.o auxfunc.o  -lm
/usr/bin/ld: alter.o:(.bss+0x4): multiple definition of `spice'; auxfunc_alter.o:(.bss+0x4): first defined here
/usr/bin/ld: alter.o:(.bss+0x0): multiple definition of `MPI_EXXIT'; auxfunc_alter.o:(.bss+0x0): first defined here
/usr/bin/ld: alter.o:(.bss+0x20): multiple definition of `lkk'; auxfunc_alter.o:(.bss+0x20): first defined here
/usr/bin/ld: auxfunc.o:(.bss+0x4): multiple definition of `spice'; auxfunc_alter.o:(.bss+0x4): first defined here
/usr/bin/ld: auxfunc.o:(.bss+0x0): multiple definition of `MPI_EXXIT'; auxfunc_alter.o:(.bss+0x0): first defined here
/usr/bin/ld: auxfunc.o:(.bss+0x20): multiple definition of `lkk'; auxfunc_alter.o:(.bss+0x20): first defined here

This patch fixes it.

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 asco/auxfunc.c                            |  3 +++
 asco/auxfunc.h                            |  6 +++---
 asco/auxfunc_measurefromlis.c             |  1 +
 asco/auxfunc_measurefromlis.h             |  2 +-
 asco/errfunc.c                            |  1 +
 asco/errfunc.h                            |  2 +-
 asco/initialize.c                         | 14 ++++++++++++++
 asco/initialize.h                         | 12 ++++++------
 asco/tools/alter/auxfunc.h                |  6 +++---
 asco/tools/auxfunc/auxfunc.c              |  3 +++
 asco/tools/auxfunc/auxfunc.h              |  6 +++---
 asco/tools/log/auxfunc.c                  |  2 ++
 asco/tools/log/auxfunc.h                  |  4 ++--
 asco/tools/monte/auxfunc.h                |  6 +++---
 asco/tools/postp/auxfunc.h                |  6 +++---
 asco/tools/postp/auxfunc_measurefromlis.c |  1 +
 asco/tools/postp/auxfunc_measurefromlis.h |  2 +-
 asco/tools/postp/auxfunc_updatelis.c      |  1 +
 asco/tools/postp/auxfunc_updatelis.h      |  2 +-
 19 files changed, 53 insertions(+), 27 deletions(-)

diff --git a/asco/auxfunc.c b/asco/auxfunc.c
index 061457f..592998b 100644
--- a/asco/auxfunc.c
+++ b/asco/auxfunc.c
@@ -34,6 +34,9 @@
 #include "auxfunc.h"
 
 
+char lkk[LONGSTRINGSIZE];
+int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
+int MPI_EXXIT; /* exits MPI if set to 1*/
 
 
 /*Check if at end of file, using Pascal "eof" semantics.  End-of-file for
diff --git a/asco/auxfunc.h b/asco/auxfunc.h
index 5882c1c..2a019d1 100644
--- a/asco/auxfunc.h
+++ b/asco/auxfunc.h
@@ -40,6 +40,6 @@ int P_eof(FILE *f);
 
 
 
-char lkk[LONGSTRINGSIZE];
-int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
-int MPI_EXXIT; /* exits MPI if set to 1*/
+extern char lkk[LONGSTRINGSIZE];
+extern int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
+extern int MPI_EXXIT; /* exits MPI if set to 1*/
diff --git a/asco/auxfunc_measurefromlis.c b/asco/auxfunc_measurefromlis.c
index 8ea1d22..9f8eded 100644
--- a/asco/auxfunc_measurefromlis.c
+++ b/asco/auxfunc_measurefromlis.c
@@ -14,6 +14,7 @@
 #include "auxfunc_measurefromlis.h"
 #include "auxfunc.h"
 
+measure_line measure[MAXMEAS];
 
 #ifdef ASCO
 extern void WriteToMem(int num_measures);
diff --git a/asco/auxfunc_measurefromlis.h b/asco/auxfunc_measurefromlis.h
index f712d42..04abab8 100644
--- a/asco/auxfunc_measurefromlis.h
+++ b/asco/auxfunc_measurefromlis.h
@@ -57,4 +57,4 @@ void DoMath(int num_measures);
 
 
 
-measure_line measure[MAXMEAS];
+extern measure_line measure[MAXMEAS];
diff --git a/asco/errfunc.c b/asco/errfunc.c
index 5baafac..4f9cd08 100644
--- a/asco/errfunc.c
+++ b/asco/errfunc.c
@@ -35,6 +35,7 @@
 
 
 
+double maxcost;
 
 
 
diff --git a/asco/errfunc.h b/asco/errfunc.h
index 027e0af..8b8e452 100644
--- a/asco/errfunc.h
+++ b/asco/errfunc.h
@@ -21,4 +21,4 @@ double errfunc(char *filename, double *x);
 /* double CostFunction(); */
 /* int AllConstraintsMet(); */
 
-double maxcost;
+extern double maxcost;
diff --git a/asco/initialize.c b/asco/initialize.c
index e0a18bd..3bfd3f9 100644
--- a/asco/initialize.c
+++ b/asco/initialize.c
@@ -27,6 +27,20 @@
 #include "rfmodule.h"
 
 
+parameters_line parameters[MAXPARAMETERS];       /**/
+measurements_line measurements[MAXMEASUREMENTS]; /**/
+/*
+ * to know if an ALTER and/or MC simulation is to be performed
+ * 0  0 (0) => nothing
+ * 0  1 (1) => MC
+ * 1  0 (2) => ALTER
+ * 1  1 (3) => ALTER + MC
+ */
+int AlterMC;           /* execute AlterMC simulation? yes, no */
+double AlterMCcost;    /* execute AlterMC simulation if the last cost is smaller than this value. */
+double Wobj, Wcon;     /* weights for the cost due to the objectives and constraints */
+int ExecuteRF; /* add parasitics using the RF module? yes, no */
+/*Think on merging the above variables*/
 
 
 /*
diff --git a/asco/initialize.h b/asco/initialize.h
index ceb276c..19fc9ee 100644
--- a/asco/initialize.h
+++ b/asco/initialize.h
@@ -68,8 +68,8 @@ double scaleto(double value, double ina, double inb, double outa, double outb, i
 
 
 
-parameters_line parameters[MAXPARAMETERS];       /**/
-measurements_line measurements[MAXMEASUREMENTS]; /**/
+extern parameters_line parameters[MAXPARAMETERS];       /**/
+extern measurements_line measurements[MAXMEASUREMENTS]; /**/
 /*
  * to know if an ALTER and/or MC simulation is to be performed
  * 0  0 (0) => nothing
@@ -77,8 +77,8 @@ measurements_line measurements[MAXMEASUREMENTS]; /**/
  * 1  0 (2) => ALTER
  * 1  1 (3) => ALTER + MC
  */
-int AlterMC;           /* execute AlterMC simulation? yes, no */
-double AlterMCcost;    /* execute AlterMC simulation if the last cost is smaller than this value. */
-double Wobj, Wcon;     /* weights for the cost due to the objectives and constraints */
-int ExecuteRF; /* add parasitics using the RF module? yes, no */
+extern int AlterMC;           /* execute AlterMC simulation? yes, no */
+extern double AlterMCcost;    /* execute AlterMC simulation if the last cost is smaller than this value. */
+extern double Wobj, Wcon;     /* weights for the cost due to the objectives and constraints */
+extern int ExecuteRF; /* add parasitics using the RF module? yes, no */
 /*Think on merging the above variables*/
diff --git a/asco/tools/alter/auxfunc.h b/asco/tools/alter/auxfunc.h
index 5882c1c..2a019d1 100644
--- a/asco/tools/alter/auxfunc.h
+++ b/asco/tools/alter/auxfunc.h
@@ -40,6 +40,6 @@ int P_eof(FILE *f);
 
 
 
-char lkk[LONGSTRINGSIZE];
-int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
-int MPI_EXXIT; /* exits MPI if set to 1*/
+extern char lkk[LONGSTRINGSIZE];
+extern int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
+extern int MPI_EXXIT; /* exits MPI if set to 1*/
diff --git a/asco/tools/auxfunc/auxfunc.c b/asco/tools/auxfunc/auxfunc.c
index 061457f..592998b 100644
--- a/asco/tools/auxfunc/auxfunc.c
+++ b/asco/tools/auxfunc/auxfunc.c
@@ -34,6 +34,9 @@
 #include "auxfunc.h"
 
 
+char lkk[LONGSTRINGSIZE];
+int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
+int MPI_EXXIT; /* exits MPI if set to 1*/
 
 
 /*Check if at end of file, using Pascal "eof" semantics.  End-of-file for
diff --git a/asco/tools/auxfunc/auxfunc.h b/asco/tools/auxfunc/auxfunc.h
index 5882c1c..2a019d1 100644
--- a/asco/tools/auxfunc/auxfunc.h
+++ b/asco/tools/auxfunc/auxfunc.h
@@ -40,6 +40,6 @@ int P_eof(FILE *f);
 
 
 
-char lkk[LONGSTRINGSIZE];
-int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
-int MPI_EXXIT; /* exits MPI if set to 1*/
+extern char lkk[LONGSTRINGSIZE];
+extern int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
+extern int MPI_EXXIT; /* exits MPI if set to 1*/
diff --git a/asco/tools/log/auxfunc.c b/asco/tools/log/auxfunc.c
index 061457f..f7dc371 100644
--- a/asco/tools/log/auxfunc.c
+++ b/asco/tools/log/auxfunc.c
@@ -34,6 +34,8 @@
 #include "auxfunc.h"
 
 
+char lkk[LONGSTRINGSIZE];
+int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice */
 
 
 /*Check if at end of file, using Pascal "eof" semantics.  End-of-file for
diff --git a/asco/tools/log/auxfunc.h b/asco/tools/log/auxfunc.h
index b51cd56..ce9ab9e 100644
--- a/asco/tools/log/auxfunc.h
+++ b/asco/tools/log/auxfunc.h
@@ -38,5 +38,5 @@ int P_eof(FILE *f);
 
 
 
-char lkk[LONGSTRINGSIZE];
-int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice */
+extern char lkk[LONGSTRINGSIZE];
+extern int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice */
diff --git a/asco/tools/monte/auxfunc.h b/asco/tools/monte/auxfunc.h
index 5882c1c..2a019d1 100644
--- a/asco/tools/monte/auxfunc.h
+++ b/asco/tools/monte/auxfunc.h
@@ -40,6 +40,6 @@ int P_eof(FILE *f);
 
 
 
-char lkk[LONGSTRINGSIZE];
-int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
-int MPI_EXXIT; /* exits MPI if set to 1*/
+extern char lkk[LONGSTRINGSIZE];
+extern int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
+extern int MPI_EXXIT; /* exits MPI if set to 1*/
diff --git a/asco/tools/postp/auxfunc.h b/asco/tools/postp/auxfunc.h
index 5882c1c..2a019d1 100644
--- a/asco/tools/postp/auxfunc.h
+++ b/asco/tools/postp/auxfunc.h
@@ -40,6 +40,6 @@ int P_eof(FILE *f);
 
 
 
-char lkk[LONGSTRINGSIZE];
-int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
-int MPI_EXXIT; /* exits MPI if set to 1*/
+extern char lkk[LONGSTRINGSIZE];
+extern int spice; /* 1:Eldo, 2:HPSPICE, 3:LTspice, 4:Spectre, 50:Qucs */
+extern int MPI_EXXIT; /* exits MPI if set to 1*/
diff --git a/asco/tools/postp/auxfunc_measurefromlis.c b/asco/tools/postp/auxfunc_measurefromlis.c
index 8ea1d22..9f8eded 100644
--- a/asco/tools/postp/auxfunc_measurefromlis.c
+++ b/asco/tools/postp/auxfunc_measurefromlis.c
@@ -14,6 +14,7 @@
 #include "auxfunc_measurefromlis.h"
 #include "auxfunc.h"
 
+measure_line measure[MAXMEAS];
 
 #ifdef ASCO
 extern void WriteToMem(int num_measures);
diff --git a/asco/tools/postp/auxfunc_measurefromlis.h b/asco/tools/postp/auxfunc_measurefromlis.h
index f712d42..04abab8 100644
--- a/asco/tools/postp/auxfunc_measurefromlis.h
+++ b/asco/tools/postp/auxfunc_measurefromlis.h
@@ -57,4 +57,4 @@ void DoMath(int num_measures);
 
 
 
-measure_line measure[MAXMEAS];
+extern measure_line measure[MAXMEAS];
diff --git a/asco/tools/postp/auxfunc_updatelis.c b/asco/tools/postp/auxfunc_updatelis.c
index 125616c..abfe3e0 100644
--- a/asco/tools/postp/auxfunc_updatelis.c
+++ b/asco/tools/postp/auxfunc_updatelis.c
@@ -14,6 +14,7 @@
 #include "auxfunc.h"
 
 
+char skip[SKIPTRAN][SHORTSTRINGSIZE]; /*100 transistor to skip*/
 
 
 /***************************************************************/
diff --git a/asco/tools/postp/auxfunc_updatelis.h b/asco/tools/postp/auxfunc_updatelis.h
index a6c14bc..80f98e2 100644
--- a/asco/tools/postp/auxfunc_updatelis.h
+++ b/asco/tools/postp/auxfunc_updatelis.h
@@ -35,4 +35,4 @@ void UpdateLIS(char *ConfigFile,char *InputFile);
 
 
 
-char skip[SKIPTRAN][SHORTSTRINGSIZE]; /*100 transistor to skip*/
+extern char skip[SKIPTRAN][SHORTSTRINGSIZE]; /*100 transistor to skip*/
-- 
2.25.4