Skip to content

Conversation

@P-E-P
Copy link
Member

@P-E-P P-E-P commented Jan 15, 2026

Fixes #4386
Add export_name attribute on functions and lower it to gimple. Does not perform validity check.

P-E-P added 2 commits January 15, 2026 16:06
The rust language requires the export_name attribute to change the name
of a symbol within the assembly whilst keeping a different name at the
language level. This is used multiple times within rust-for-linux.

gcc/rust/ChangeLog:

	* backend/rust-compile-base.cc: Change the assembly name on functions
	with the export_name attribute. Do not mangle the name.
	* util/rust-attribute-values.h: Add export_name attribute value.
	* util/rust-attributes.cc: Add export_name attribute to builtin
	attribute list.

gcc/testsuite/ChangeLog:

	* rust/compile/export_name.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ChangeLog:

	* util/rust-attributes.cc (AttributeChecker::visit): Use const
	variable.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
@P-E-P P-E-P changed the title Export name attr Handle export_name attribute on functions Jan 15, 2026
@P-E-P P-E-P enabled auto-merge January 15, 2026 15:10
@P-E-P P-E-P added this pull request to the merge queue Jan 15, 2026
Merged via the queue into Rust-GCC:master with commit 49d6814 Jan 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add export_name attribute and lower it to GIMPLE

1 participant