• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisão74b93e4d32633fc896ec61ca73b79f7d4725e2a3 (tree)
Hora2021-08-25 21:14:02
AutorYann Sionneau <ysionneau@kalr...>
CommiterWaldemar Brodkorb

Mensagem de Log

Fix warnings due to missing attributes for EI_ prefixed symbols

With new compiler (gcc >= 9 ?) building uClibc-ng now gives this sort of warnings:

./include/libc-symbols.h:426:25: warning: 'EI_localeconv' specifies less restrictive attribute than its target 'localeconv': 'nothrow' [-Wmissing-attributes]

426 | extern typeof (name) EI_##name attribute((alias (hidden_asmname1 (,#local))))
|

./include/libc-symbols.h:429:29: note: in expansion of macro 'hidden_ver1'

429 | # define hidden_def(name) hidden_ver1(GI_##name, name, name);
|

./include/libc-symbols.h:497:32: note: in expansion of macro 'hidden_def'

497 | # define libc_hidden_def(name) hidden_def (name)
| ~

libc/misc/locale/locale.c:306:1: note: in expansion of macro 'libc_hidden_def'

306 | libc_hidden_def(localeconv)
|

In file included from libc/misc/locale/localeconv.c:8:
libc/misc/locale/locale.c:261:15: note: 'EI_localeconv' target declared here

261 | struct lconv *localeconv(void)
| ~

The fix is mostly being backported/adapted from glibc.

Mudança Sumário

Diff

--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -156,6 +156,11 @@
156156 # define ASM_LINE_SEP ;
157157 #endif
158158
159+#ifndef __attribute_copy__
160+/* Provide an empty definition when cdefs.h is not included. */
161+# define __attribute_copy__(arg)
162+#endif
163+
159164 #ifndef __ASSEMBLER__
160165 /* GCC understands weak symbols and aliases; use its interface where
161166 possible, instead of embedded assembly language. */
@@ -163,13 +168,13 @@
163168 /* Define ALIASNAME as a strong alias for NAME. */
164169 # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
165170 # define _strong_alias(name, aliasname) \
166- extern __typeof (name) aliasname __attribute__ ((alias (#name)));
171+ extern __typeof (name) aliasname __attribute__ ((alias (#name))) __attribute_copy__ (name);
167172 /* Same, but does not check for type match. Use sparingly.
168173 Example: strong_alias(stat,stat64) may fail, this one works: */
169174 # define strong_alias_untyped(name, aliasname) \
170175 _strong_alias_untyped(name, aliasname)
171176 # define _strong_alias_untyped(name, aliasname) \
172- extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
177+ extern __typeof (aliasname) aliasname __attribute__ ((alias (#name))) __attribute_copy__ (name);
173178
174179 # ifdef HAVE_WEAK_SYMBOLS
175180
@@ -182,7 +187,7 @@
182187 If weak aliases are not available, this defines a strong alias. */
183188 # define weak_alias(name, aliasname) _weak_alias (name, aliasname)
184189 # define _weak_alias(name, aliasname) \
185- extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
190+ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) __attribute_copy__ (name);
186191
187192 /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
188193 # define weak_extern(symbol) _weak_extern (weak symbol)
@@ -423,7 +428,8 @@ FIXME! - ?
423428 # define __hidden_asmname2(prefix, name) #prefix name
424429 # define __hidden_ver1(local, internal, name) \
425430 extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
426- extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
431+ extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local)))) \
432+ __attribute_copy__ (name)
427433 # define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
428434 # define hidden_data_ver(local, name) hidden_ver(local, name)
429435 # define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -330,6 +330,17 @@
330330 # endif
331331 #endif
332332
333+/* Undefine (also defined in libc-symbols.h). */
334+#undef __attribute_copy__
335+#if __GNUC_PREREQ (9, 0)
336+/* Copies attributes from the declaration or type referenced by
337+ the argument. */
338+# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg)))
339+#else
340+# define __attribute_copy__(arg)
341+#endif
342+
343+
333344 /* GCC 4.3 and above allow passing all anonymous arguments of an
334345 __extern_always_inline function to some other vararg function. */
335346 #if __GNUC_PREREQ (4,3)