summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndreas Fried <andreas.fried@kit.edu>2020-06-16 15:19:24 +0200
committerAndreas Fried <andreas.fried@kit.edu>2020-06-16 15:19:24 +0200
commit69d5d7888e07ef965007cfb4615eff7dd8e41218 (patch)
treeb97d712e3401f356916bb5e3fa5e192e99df4ede
parentb7f2ed734453a3185d07738016119544da27b9e8 (diff)
Always prefix variables in generated headers with "extern".
Since GCC 10, the linker no longer accepts multiple definitions of the same variable. We therefore always need to mark the ones in nodes.h as extern.
-rw-r--r--scripts/templates/nodes.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/templates/nodes.h b/scripts/templates/nodes.h
index af18910..f01c83c 100644
--- a/scripts/templates/nodes.h
+++ b/scripts/templates/nodes.h
@@ -7,10 +7,12 @@
#endif
{% if spec.external %}
-{% set FIRM_API="" %}
+{% set FIRM_API=""-%}
+{% set FIRM_API_VARIABLE="extern "-%}
#include <libfirm/firm_types.h>
{% else %}
{% set FIRM_API="FIRM_API "-%}
+{% set FIRM_API_VARIABLE="FIRM_API "-%}
{% endif %}
/** The opcodes of the libFirm predefined operations.
@@ -145,7 +147,7 @@ ir_node **get_{{node.name}}_{{node.input_name}}_arr(ir_node *node);
{% endfor -%}
/** {{node.name}} opcode */
-{{FIRM_API}} ir_op *op_{{node.name}};
+{{FIRM_API_VARIABLE}} ir_op *op_{{node.name}};
/** Returns opcode for {{node.name}} nodes. */
{{FIRM_API}} ir_op *get_op_{{node.name}}(void);