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:
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.
@@ -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 | + | |
1 | 10 | 2019-12-19 Tom Tromey <tromey@adacore.com> |
2 | 11 | |
3 | 12 | PR build/24572: |
@@ -930,6 +930,8 @@ print_idecode_issue_function_header (lf *file, | ||
930 | 930 | "INLINE_IDECODE", "\n"); |
931 | 931 | break; |
932 | 932 | case is_function_variable: |
933 | + if (lf_get_file_type (file) == lf_is_h) | |
934 | + lf_printf (file, "extern "); | |
933 | 935 | print_semantic_function_type (file); |
934 | 936 | lf_printf (file, " (*"); |
935 | 937 | break; |
@@ -86,6 +86,13 @@ lf_open (char *name, | ||
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | +lf_file_type | |
90 | +lf_get_file_type (const lf *file) | |
91 | +{ | |
92 | + return file->type; | |
93 | +} | |
94 | + | |
95 | + | |
89 | 96 | void |
90 | 97 | lf_close (lf *file) |
91 | 98 | { |
@@ -54,6 +54,8 @@ extern lf *lf_open | ||
54 | 54 | lf_file_references file_references, |
55 | 55 | lf_file_type type, const char *program); |
56 | 56 | |
57 | +extern lf_file_type lf_get_file_type (const lf *file); | |
58 | + | |
57 | 59 | extern void lf_close (lf *file); |
58 | 60 | |
59 | 61 |