public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] WIP: Fix the build on clang
@ 2022-03-11 17:25 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2022-03-11 17:25 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=98f714004199a6bf2339dcab39cb4d4eec19439a

commit 98f714004199a6bf2339dcab39cb4d4eec19439a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Mar 11 14:10:41 2022 -0300

    WIP: Fix the build on clang
    
    This patch is not fully right, it just comments out the parts clang
    complains.
    
    Although the build finished, make check does not.  Bootstrap is also
    broken (so loader does not work).

Diff:
---
 include/alloc_buffer.h            | 2 ++
 include/allocate_once.h           | 2 ++
 include/ctype.h                   | 2 ++
 include/stdio.h                   | 8 ++++++++
 include/stdlib.h                  | 4 ++++
 include/string.h                  | 2 ++
 include/sys/socket.h              | 2 ++
 libio/libio.h                     | 2 ++
 nptl/pthread_create.c             | 2 ++
 sysdeps/x86_64/multiarch/strstr.c | 2 ++
 10 files changed, 28 insertions(+)

diff --git a/include/alloc_buffer.h b/include/alloc_buffer.h
index be33e8b68c..7a4925c54b 100644
--- a/include/alloc_buffer.h
+++ b/include/alloc_buffer.h
@@ -377,6 +377,7 @@ alloc_buffer_copy_string (struct alloc_buffer *buf, const char *src)
   return result;
 }
 
+#ifndef __clang__
 #ifndef _ISOMAC
 libc_hidden_proto (__libc_alloc_buffer_alloc_array)
 libc_hidden_proto (__libc_alloc_buffer_allocate)
@@ -384,5 +385,6 @@ libc_hidden_proto (__libc_alloc_buffer_copy_bytes)
 libc_hidden_proto (__libc_alloc_buffer_copy_string)
 libc_hidden_proto (__libc_alloc_buffer_create_failure)
 #endif
+#endif
 
 #endif /* _ALLOC_BUFFER_H */
diff --git a/include/allocate_once.h b/include/allocate_once.h
index a487d641d5..6c707b1161 100644
--- a/include/allocate_once.h
+++ b/include/allocate_once.h
@@ -88,8 +88,10 @@ allocate_once (void **__place, void *(*__allocate) (void *__closure),
                                       __closure);
 }
 
+#ifndef __clang__
 #ifndef _ISOMAC
 libc_hidden_proto (__libc_allocate_once_slow)
 #endif
+#endif
 
 #endif /* _ALLOCATE_ONCE_H */
diff --git a/include/ctype.h b/include/ctype.h
index 493a6f80ce..b8e5dfc7dd 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -11,8 +11,10 @@ libc_hidden_proto (__ctype_init)
    So defeat macro expansion with parens for this declaration.  */
 extern int (__isctype) (int __c, int __mask);
 
+#ifndef __clang__
 libc_hidden_proto (tolower)
 libc_hidden_proto (toupper)
+#endif
 
 # if IS_IN (libc)
 
diff --git a/include/stdio.h b/include/stdio.h
index a645a1bf99..31a8e95a56 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -211,7 +211,9 @@ stdio_hidden_ldbl_proto (fprintf);
 stdio_hidden_ldbl_proto (vfprintf);
 stdio_hidden_ldbl_proto (sprintf);
 libc_hidden_proto (ungetc)
+#ifndef __clang__
 libc_hidden_proto (__getdelim)
+#endif
 libc_hidden_proto (fwrite)
 libc_hidden_proto (perror)
 libc_hidden_proto (remove)
@@ -240,13 +242,19 @@ libc_hidden_proto (__fgets_unlocked)
 libc_hidden_proto (fputs_unlocked)
 extern __typeof (fputs_unlocked) __fputs_unlocked;
 libc_hidden_proto (__fputs_unlocked)
+#ifndef __clang__
 libc_hidden_proto (feof_unlocked)
+#endif
 extern __typeof (feof_unlocked) __feof_unlocked attribute_hidden;
+#ifndef __clang__
 libc_hidden_proto (ferror_unlocked)
+#endif
 extern __typeof (ferror_unlocked) __ferror_unlocked attribute_hidden;
+#ifndef __clang__
 libc_hidden_proto (getc_unlocked)
 libc_hidden_proto (fputc_unlocked)
 libc_hidden_proto (putc_unlocked)
+#endif
 extern __typeof (putc_unlocked) __putc_unlocked attribute_hidden;
 libc_hidden_proto (fmemopen)
 /* The prototype needs repeating instead of using __typeof to use
diff --git a/include/stdlib.h b/include/stdlib.h
index f1f313b15f..587ec25047 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -40,7 +40,9 @@ libc_hidden_proto (abort)
 libc_hidden_proto (getenv)
 extern __typeof (secure_getenv) __libc_secure_getenv;
 libc_hidden_proto (__libc_secure_getenv)
+#ifndef __clang__
 libc_hidden_proto (bsearch)
+#endif
 libc_hidden_proto (qsort)
 extern __typeof (qsort_r) __qsort_r;
 libc_hidden_proto (__qsort_r)
@@ -238,7 +240,9 @@ libc_hidden_proto (__strtoul)
 extern __typeof (strtoull) __strtoull;
 libc_hidden_proto (__strtoull)
 
+#ifndef __clang__
 libc_hidden_proto (atoi)
+#endif
 
 extern float __strtof_nan (const char *, char **, char);
 extern double __strtod_nan (const char *, char **, char);
diff --git a/include/string.h b/include/string.h
index 21f641a413..b9b670da1d 100644
--- a/include/string.h
+++ b/include/string.h
@@ -172,6 +172,7 @@ extern __typeof (strnlen) strnlen attribute_hidden;
 extern __typeof (strsep) strsep attribute_hidden;
 #endif
 
+#ifndef __clang__
 #if (!IS_IN (libc) || !defined SHARED) \
   && !defined NO_MEMPCPY_STPCPY_REDIRECT
 /* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call
@@ -179,6 +180,7 @@ extern __typeof (strsep) strsep attribute_hidden;
 extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy");
 extern __typeof (stpcpy) stpcpy __asm__ ("__stpcpy");
 #endif
+#endif
 
 extern void *__memcpy_chk (void *__restrict __dest,
 			   const void *__restrict __src, size_t __len,
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 6e4cf5077f..9e15d44c44 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -169,7 +169,9 @@ libc_hidden_proto (__libc_sa_len)
 # define SA_LEN(_x)      __libc_sa_len((_x)->sa_family)
 #endif
 
+#ifndef __clang__
 libc_hidden_proto (__cmsg_nxthdr)
+#endif
 
 #ifndef __ASSUME_TIME64_SYSCALLS
 extern void __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize)
diff --git a/libio/libio.h b/libio/libio.h
index b0c1c8c3a8..df680e7593 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -262,6 +262,7 @@ extern int __REDIRECT_LDBL_COMPAT (_IO_vfscanf, (FILE * __restrict,
 						 __gnuc_va_list, int *__restrict));
 #endif
 
+#ifndef __clang__
 libc_hidden_proto (__overflow)
 libc_hidden_proto (__underflow)
 libc_hidden_proto (__uflow)
@@ -273,6 +274,7 @@ libc_hidden_proto (_IO_free_wbackup_area)
 libc_hidden_proto (_IO_padn)
 libc_hidden_proto (_IO_putc)
 libc_hidden_proto (_IO_sgetn)
+#endif
 
 #ifdef _IO_MTSAFE_IO
 # undef _IO_peekc
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index e7a099acb7..8c5679821c 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -47,7 +47,9 @@
 /* Globally enabled events.  */
 td_thr_events_t __nptl_threads_events;
 libc_hidden_proto (__nptl_threads_events)
+#ifndef __clang__
 libc_hidden_data_def (__nptl_threads_events)
+#endif
 
 /* Pointer to descriptor with the last event.  */
 struct pthread *__nptl_last_event;
diff --git a/sysdeps/x86_64/multiarch/strstr.c b/sysdeps/x86_64/multiarch/strstr.c
index 95600a9de5..e152619eed 100644
--- a/sysdeps/x86_64/multiarch/strstr.c
+++ b/sysdeps/x86_64/multiarch/strstr.c
@@ -34,7 +34,9 @@
 #include "string/strstr.c"
 
 extern __typeof (__redirect_strstr) __strstr_sse2_unaligned attribute_hidden;
+#ifndef __clang__
 extern __typeof (__redirect_strstr) __strstr_sse2 attribute_hidden;
+#endif
 
 #include "init-arch.h"


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-11 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11 17:25 [glibc/azanella/clang] WIP: Fix the build on clang Adhemerval Zanella

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).