public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Gabriel F.T.Gomes <gftg@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/gabriel/powerpc-ieee128-printscan] Do not redirect calls to __GI_* symbols, when redirecting to *ieee128 Date: Fri, 09 Aug 2019 18:37:00 -0000 [thread overview] Message-ID: <20190809183726.102864.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e9ec75dba7df41ad82f5e8b4efe63f673f142128 commit e9ec75dba7df41ad82f5e8b4efe63f673f142128 Author: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> Date: Tue Jul 24 16:06:23 2018 -0300 Do not redirect calls to __GI_* symbols, when redirecting to *ieee128 On platforms where long double has IEEE binary128 format as a third option (initially, only powerpc64le), many exported functions are redirected to their __*ieee128 equivalents. This redirection is provided by installed headers such as stdio-ldbl.h, and is supposed to work correctly with user code. However, during the build of glibc, similar redirections are employed, in internal headers such as include/stdio.h, in order to avoid extra PLT entries. These redirections conflict with the redirections to __*ieee128, and must be avoided during the build. This patch protects the second redirections with a test for __LONG_DOUBLE_USES_FLOAT128. * include/err.h: Protect the redirection of warn, warnx, vwarn, vwarnx, verr, and verrx) * include/stdio.h: Likewise for __asprintf, fprintf, vfprintf, sprintf, __snprintf, and sscanf. * include/sys/syslog.h: Likewise for syslog and vsyslog. * include/wchar.h: Likewise for vswscanf. Diff: --- include/err.h | 3 +++ include/stdio.h | 14 ++++++++++++-- include/sys/syslog.h | 5 +++++ include/wchar.h | 3 +++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/err.h b/include/err.h index 7c05cd1..4bfd0f1 100644 --- a/include/err.h +++ b/include/err.h @@ -12,12 +12,15 @@ __vwarn_internal (const char *format, __gnuc_va_list ap, # ifndef _ISOMAC +#if !defined __LONG_DOUBLE_USES_FLOAT128 \ + || (defined __LONG_DOUBLE_USES_FLOAT128 && __LONG_DOUBLE_USES_FLOAT128 == 0) libc_hidden_proto (warn) libc_hidden_proto (warnx) libc_hidden_proto (vwarn) libc_hidden_proto (vwarnx) libc_hidden_proto (verr) libc_hidden_proto (verrx) +# endif # endif /* !_ISOMAC */ #endif /* err.h */ diff --git a/include/stdio.h b/include/stdio.h index 5302e61..43895a7 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -13,7 +13,10 @@ extern int __fcloseall (void) attribute_hidden; extern int __snprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); +# if !defined __LONG_DOUBLE_USES_FLOAT128 \ + || (defined __LONG_DOUBLE_USES_FLOAT128 && __LONG_DOUBLE_USES_FLOAT128 == 0) libc_hidden_proto (__snprintf) +# endif extern int __vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) @@ -72,7 +75,8 @@ libc_hidden_proto (__isoc99_vfscanf) Unfortunately, symbol redirection is not transitive, so the __REDIRECT in the public header does not link up with the above libc_hidden_proto. Bridge the gap with a macro. */ -# if !__GLIBC_USE (DEPRECATED_SCANF) +# if !__GLIBC_USE (DEPRECATED_SCANF) \ + && __LONG_DOUBLE_USES_FLOAT128 == 0 # undef sscanf # define sscanf __isoc99_sscanf # endif @@ -154,7 +158,10 @@ libc_hidden_proto (__libc_readline_unlocked); extern const char *const _sys_errlist_internal[] attribute_hidden; extern int _sys_nerr_internal attribute_hidden; +#if !defined __LONG_DOUBLE_USES_FLOAT128 \ + || (defined __LONG_DOUBLE_USES_FLOAT128 && __LONG_DOUBLE_USES_FLOAT128 == 0) libc_hidden_proto (__asprintf) +#endif # if IS_IN (libc) extern FILE *_IO_new_fopen (const char*, const char*); # define fopen(fname, mode) _IO_new_fopen (fname, mode) @@ -175,13 +182,16 @@ extern int _IO_new_fgetpos (FILE *, __fpos_t *); # define fgetpos(fp, posp) _IO_new_fgetpos (fp, posp) # endif -libc_hidden_proto (dprintf) extern __typeof (dprintf) __dprintf __attribute__ ((__format__ (__printf__, 2, 3))); libc_hidden_proto (__dprintf) +#if !defined __LONG_DOUBLE_USES_FLOAT128 \ + || (defined __LONG_DOUBLE_USES_FLOAT128 && __LONG_DOUBLE_USES_FLOAT128 == 0) +libc_hidden_proto (dprintf) libc_hidden_proto (fprintf) libc_hidden_proto (vfprintf) libc_hidden_proto (sprintf) +#endif libc_hidden_proto (fwrite) libc_hidden_proto (perror) libc_hidden_proto (remove) diff --git a/include/sys/syslog.h b/include/sys/syslog.h index 89d3479..e10c58f 100644 --- a/include/sys/syslog.h +++ b/include/sys/syslog.h @@ -3,7 +3,12 @@ #include <misc/sys/syslog.h> #ifndef _ISOMAC +#include <bits/floatn.h> + +#if !defined __LONG_DOUBLE_USES_FLOAT128 \ + || (defined __LONG_DOUBLE_USES_FLOAT128 && __LONG_DOUBLE_USES_FLOAT128 == 0) libc_hidden_proto (syslog) +#endif /* __vsyslog_internal uses the same mode_flags bits as __v*printf_internal; see libio/libioP.h. */ diff --git a/include/wchar.h b/include/wchar.h index 2cb4495..4875c9e 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -114,7 +114,10 @@ libc_hidden_proto (fputws_unlocked) libc_hidden_proto (putwc_unlocked) libc_hidden_proto (putwc) +#if !defined __LONG_DOUBLE_USES_FLOAT128 \ + || (defined __LONG_DOUBLE_USES_FLOAT128 && __LONG_DOUBLE_USES_FLOAT128 == 0) libc_hidden_proto (vswscanf) +#endif libc_hidden_proto (mbrtowc) libc_hidden_proto (wcrtomb)
next reply other threads:[~2019-08-09 18:37 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-09 18:37 Gabriel F.T.Gomes [this message] 2019-10-15 19:04 Gabriel F.T.Gomes 2019-10-25 15:34 Gabriel F.T.Gomes 2019-12-03 17:03 Gabriel F.T.Gomes 2019-12-13 22:28 Gabriel F.T.Gomes
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190809183726.102864.qmail@sourceware.org \ --to=gftg@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).