[PATCH] __errno_location: fix static link with pthread

Baruch Siach baruch at tkos.co.il
Thu Oct 3 18:41:29 UTC 2013


Commit f418f527 (errno, h_errno: correct them for non-TLS) broke static link
with pthread because of duplicate definition of __errno_location and
__h_errno_location. Make these symbols weak to fix static link.

Signed-off-by: Baruch Siach <baruch at tkos.co.il>
---
 libc/misc/internals/__errno_location.c   | 2 +-
 libc/misc/internals/__h_errno_location.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/misc/internals/__errno_location.c b/libc/misc/internals/__errno_location.c
index dec913f..be7a909 100644
--- a/libc/misc/internals/__errno_location.c
+++ b/libc/misc/internals/__errno_location.c
@@ -16,4 +16,4 @@ int *__errno_location(void)
 {
     return &errno;
 }
-libc_hidden_def(__errno_location)
+libc_hidden_weak(__errno_location)
diff --git a/libc/misc/internals/__h_errno_location.c b/libc/misc/internals/__h_errno_location.c
index 41353d7..6653681 100644
--- a/libc/misc/internals/__h_errno_location.c
+++ b/libc/misc/internals/__h_errno_location.c
@@ -16,4 +16,4 @@ int *__h_errno_location(void)
 {
     return &h_errno;
 }
-libc_hidden_def(__h_errno_location)
+libc_hidden_weak(__h_errno_location)
-- 
1.8.4.rc3



More information about the uClibc mailing list