um: add __weak for exported functions
authorJohannes Berg <johannes.berg@intel.com>
Sun, 12 Feb 2023 19:32:04 +0000 (20:32 +0100)
committerRichard Weinberger <richard@nod.at>
Thu, 20 Apr 2023 20:57:00 +0000 (22:57 +0200)
If the exported glibc functions don't exist, we get link
failures. Avoid that by adding __weak so they're allowed
to not exist.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/os-Linux/user_syms.c

index fd575ecbcaece3628b5ede5353adbea11a42d1a3..54722c7f884f657aa6fbe0a4f62db21f4dc6d2ff 100644 (file)
@@ -39,7 +39,7 @@ EXPORT_SYMBOL(printf);
  * good; so the versions of these symbols will always match
  */
 #define EXPORT_SYMBOL_PROTO(sym)       \
-       int sym(void);                  \
+       int sym(void) __weak; \
        EXPORT_SYMBOL(sym);
 
 extern void readdir64(void) __attribute__((weak));