• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


コミットメタ情報

リビジョンc4df5bbeb87a445dbc84b9ed677b2c721e5051b5 (tree)
日時2020-07-04 04:03:47
作者Sebastian Huber <sebastian.huber@embe...>
コミッターSebastian Huber

ログメッセージ

sim/igen: Fix linker error with -fno-common

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.

変更サマリ

差分

--- a/sim/igen/ChangeLog
+++ b/sim/igen/ChangeLog
@@ -1,3 +1,12 @@
1+2020-07-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
2+
3+ PR sim/26194
4+ * lf.h (lf_get_file_type): Declare.
5+ * lf.c (lf_get_file_type): Define.
6+ * gen-idecode.c (print_idecode_issue_function_header): Use
7+ lf_get_file_type() to issue an extern variable declaration in
8+ case of header files.
9+
110 2019-12-19 Tom Tromey <tromey@adacore.com>
211
312 PR build/24572:
--- a/sim/igen/gen-idecode.c
+++ b/sim/igen/gen-idecode.c
@@ -930,6 +930,8 @@ print_idecode_issue_function_header (lf *file,
930930 "INLINE_IDECODE", "\n");
931931 break;
932932 case is_function_variable:
933+ if (lf_get_file_type (file) == lf_is_h)
934+ lf_printf (file, "extern ");
933935 print_semantic_function_type (file);
934936 lf_printf (file, " (*");
935937 break;
--- a/sim/igen/lf.c
+++ b/sim/igen/lf.c
@@ -86,6 +86,13 @@ lf_open (char *name,
8686 }
8787
8888
89+lf_file_type
90+lf_get_file_type (const lf *file)
91+{
92+ return file->type;
93+}
94+
95+
8996 void
9097 lf_close (lf *file)
9198 {
--- a/sim/igen/lf.h
+++ b/sim/igen/lf.h
@@ -54,6 +54,8 @@ extern lf *lf_open
5454 lf_file_references file_references,
5555 lf_file_type type, const char *program);
5656
57+extern lf_file_type lf_get_file_type (const lf *file);
58+
5759 extern void lf_close (lf *file);
5860
5961