From 5747e0c0e1bce0df39ab7ac342162ecdc6e1343d Mon Sep 17 00:00:00 2001 From: Xiong Hu Luo Date: Wed, 14 Aug 2019 02:18:33 +0000 Subject: Enable math functions linking with static library for LTO In LTO mode, if static library and dynamic library contains same function and both libraries are passed as arguments, linker will link the function in dynamic library no matter the sequence. This patch will output LTO symbol node as UNDEF if BUILT_IN_NORMAL function FNDECL is a math function, then the function in static library will be linked first if its sequence is ahead of the dynamic library. gcc/ChangeLog 2019-08-14 Xiong Hu Luo PR lto/91287 * builtins.c (builtin_with_linkage_p): New function. * builtins.h (builtin_with_linkage_p): New function. * symtab.c (write_symbol): Remove redundant assert. * lto-streamer-out.c (symtab_node::output_to_lto_symbol_table_p): Remove FIXME and use builtin_with_linkage_p. From-SVN: r274411 --- gcc/builtins.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/builtins.h') diff --git a/gcc/builtins.h b/gcc/builtins.h index 1ffb491..66c9295 100644 --- a/gcc/builtins.h +++ b/gcc/builtins.h @@ -150,5 +150,6 @@ extern internal_fn replacement_internal_fn (gcall *); extern void warn_string_no_nul (location_t, const char *, tree, tree); extern tree unterminated_array (tree, tree * = NULL, bool * = NULL); +extern bool builtin_with_linkage_p (tree); #endif /* GCC_BUILTINS_H */ -- cgit v1.1