Patchwork __errno_location: fix static link with pthread

login
register
mail settings
Submitter Baruch Siach
Date Oct. 3, 2013, 6:41 p.m.
Message ID <92a24895c8bd0aa466642a1b28d9b21d39846a74.1380825653.git.baruch@tkos.co.il>
Download mbox | patch
Permalink /patch/280399/
State Superseded, archived
Headers show

Comments

Baruch Siach - Oct. 3, 2013, 6:41 p.m.
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@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(-)

Patch

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)