diff options
author | Yangyu Chen <cyy@cyyself.name> | 2024-10-30 14:33:57 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2024-10-30 14:33:57 +0000 |
commit | 875279ff3ee3b4135401286b8378087a24fd0f8d (patch) | |
tree | 1ab4a5646ee274914fd70cf78a701855e20f6116 /gcc/tree-vectorizer.h | |
parent | d7f2c1bff6993cba1e46fd6902776778612c290d (diff) | |
download | gcc-875279ff3ee3b4135401286b8378087a24fd0f8d.zip gcc-875279ff3ee3b4135401286b8378087a24fd0f8d.tar.gz gcc-875279ff3ee3b4135401286b8378087a24fd0f8d.tar.bz2 |
Fix function multiversioning dispatcher link error with LTO
We forgot to apply DECL_EXTERNAL to __init_cpu_features_resolver decl. When
building with LTO, the linker cannot find the
__init_cpu_features_resolver.lto_priv* symbol, causing the link error.
This patch gets this fixed by adding DECL_EXTERNAL to the decl. To avoid used
but never defined warning for this symbol, we also mark TREE_PUBLIC to the decl.
We should also mark the decl having hidden visibility. And fix the attribute in
the same way for __aarch64_cpu_features identifier.
Minimal steps to reproduce the bug:
echo '__attribute__((target_clones("default", "aes"))) void func1() { }' > 1.c
echo '__attribute__((target_clones("default", "aes"))) void func2() { }' > 2.c
echo 'void func1();void func2();int main(){func1();func2();return 0;}' > main.c
gcc -flto -c 1.c 2.c
gcc -flto main.c 1.o 2.o
Fixes: 0cfde688e213 ("[aarch64] Add function multiversioning support")
Signed-off-by: Yangyu Chen <cyy@cyyself.name>
gcc/ChangeLog:
* config/aarch64/aarch64.cc (dispatch_function_versions): Adding
DECL_EXTERNAL, TREE_PUBLIC and hidden DECL_VISIBILITY to
__init_cpu_features_resolver and __aarch64_cpu_features.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions