GCC 10 enables -fno-common by default. This resulted in multiple
definition linker errors since a global variable was declared and
defined in a header file:
ld: libsim.a(idecode.o):sim/v850/idecode.h:71: multiple definition of
`idecode_issue'; libsim.a(irun.o):sim/v850/idecode.h:71: first defined
here
ld: libsim.a(engine.o):sim/v850/idecode.h:71: multiple definition of
`idecode_issue'; libsim.a(irun.o):sim/v850/idecode.h:71: first defined
here
ld: libsim.a(support.o):sim/v850/idecode.h:71: multiple definition of
`idecode_issue'; libsim.a(irun.o):sim/v850/idecode.h:71: first defined
here
ld: libsim.a(semantics.o):sim/v850/idecode.h:71: multiple definition
of `idecode_issue'; libsim.a(irun.o):sim/v850/idecode.h:71: first
defined here
sim/igen
PR sim/26194
* lf.h (lf_get_file_type): Declare.
* lf.c (lf_get_file_type): Define.
* gen-idecode.c (print_idecode_issue_function_header): Use
lf_get_file_type() to issue an extern variable declaration in
case of header files.
+2020-07-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ PR sim/26194
+ * lf.h (lf_get_file_type): Declare.
+ * lf.c (lf_get_file_type): Define.
+ * gen-idecode.c (print_idecode_issue_function_header): Use
+ lf_get_file_type() to issue an extern variable declaration in
+ case of header files.
+
2019-12-19 Tom Tromey <tromey@adacore.com>
PR build/24572:
"INLINE_IDECODE", "\n");
break;
case is_function_variable:
+ if (lf_get_file_type (file) == lf_is_h)
+ lf_printf (file, "extern ");
print_semantic_function_type (file);
lf_printf (file, " (*");
break;
}
+lf_file_type
+lf_get_file_type (const lf *file)
+{
+ return file->type;
+}
+
+
void
lf_close (lf *file)
{
lf_file_references file_references,
lf_file_type type, const char *program);
+extern lf_file_type lf_get_file_type (const lf *file);
+
extern void lf_close (lf *file);