diff options
author | Florian Weimer <fweimer@redhat.com> | 2020-02-17 11:08:15 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2020-02-17 11:12:03 +0100 |
commit | fe49a73316ed82f57bccb60c9e8e51c59e940835 (patch) | |
tree | fb871e3a4faab73e4b8d458a0ba7eccedc0bea51 | |
parent | f1bdee617975bfd962a7940b76ec75c8b1d768d7 (diff) | |
download | glibc-fe49a73316ed82f57bccb60c9e8e51c59e940835.zip glibc-fe49a73316ed82f57bccb60c9e8e51c59e940835.tar.gz glibc-fe49a73316ed82f57bccb60c9e8e51c59e940835.tar.bz2 |
x86: Avoid single-argument _Static_assert in <tls.h>
Older GCC versions do not support this extension. Fixes commit f1bdee61797
("x86 tls: Use _Static_assert for TLS access size assertion").
-rw-r--r-- | sysdeps/i386/nptl/tls.h | 20 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/tls.h | 20 | ||||
-rw-r--r-- | sysdeps/x86_64/nptl/tls.h | 20 |
3 files changed, 36 insertions, 24 deletions
diff --git a/sysdeps/i386/nptl/tls.h b/sysdeps/i386/nptl/tls.h index 28053a7..ec03fc1 100644 --- a/sysdeps/i386/nptl/tls.h +++ b/sysdeps/i386/nptl/tls.h @@ -256,8 +256,9 @@ tls_fill_user_desc (union user_desc_init *desc, # define THREAD_GETMEM(descr, member) \ ({ __typeof (descr->member) __value; \ _Static_assert (sizeof (__value) == 1 \ - || sizeof (__value) == 4 \ - || sizeof (__value) == 8); \ + || sizeof (__value) == 4 \ + || sizeof (__value) == 8, \ + "size of per-thread data"); \ if (sizeof (__value) == 1) \ asm volatile ("movb %%gs:%P2,%b0" \ : "=q" (__value) \ @@ -281,8 +282,9 @@ tls_fill_user_desc (union user_desc_init *desc, # define THREAD_GETMEM_NC(descr, member, idx) \ ({ __typeof (descr->member[0]) __value; \ _Static_assert (sizeof (__value) == 1 \ - || sizeof (__value) == 4 \ - || sizeof (__value) == 8); \ + || sizeof (__value) == 4 \ + || sizeof (__value) == 8, \ + "size of per-thread data"); \ if (sizeof (__value) == 1) \ asm volatile ("movb %%gs:%P2(%3),%b0" \ : "=q" (__value) \ @@ -309,8 +311,9 @@ tls_fill_user_desc (union user_desc_init *desc, # define THREAD_SETMEM(descr, member, value) \ ({ \ _Static_assert (sizeof (descr->member) == 1 \ - || sizeof (descr->member) == 4 \ - || sizeof (descr->member) == 8); \ + || sizeof (descr->member) == 4 \ + || sizeof (descr->member) == 8, \ + "size of per-thread data"); \ if (sizeof (descr->member) == 1) \ asm volatile ("movb %b0,%%gs:%P1" : \ : "iq" (value), \ @@ -333,8 +336,9 @@ tls_fill_user_desc (union user_desc_init *desc, # define THREAD_SETMEM_NC(descr, member, idx, value) \ ({ \ _Static_assert (sizeof (descr->member[0]) == 1 \ - || sizeof (descr->member[0]) == 4 \ - || sizeof (descr->member[0]) == 8); \ + || sizeof (descr->member[0]) == 4 \ + || sizeof (descr->member[0]) == 8, \ + "size of per-thread data"); \ if (sizeof (descr->member[0]) == 1) \ asm volatile ("movb %b0,%%gs:%P1(%2)" : \ : "iq" (value), \ diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h index ed3d8fd..0c2de05 100644 --- a/sysdeps/mach/hurd/i386/tls.h +++ b/sysdeps/mach/hurd/i386/tls.h @@ -167,8 +167,9 @@ out: # define THREAD_GETMEM(descr, member) \ ({ __typeof (descr->member) __value; \ _Static_assert (sizeof (__value) == 1 \ - || sizeof (__value) == 4 \ - || sizeof (__value) == 8); \ + || sizeof (__value) == 4 \ + || sizeof (__value) == 8, \ + "size of per-thread data"); \ if (sizeof (__value) == 1) \ asm volatile ("movb %%gs:%P2,%b0" \ : "=q" (__value) \ @@ -192,8 +193,9 @@ out: # define THREAD_GETMEM_NC(descr, member, idx) \ ({ __typeof (descr->member[0]) __value; \ _Static_assert (sizeof (__value) == 1 \ - || sizeof (__value) == 4 \ - || sizeof (__value) == 8); \ + || sizeof (__value) == 4 \ + || sizeof (__value) == 8, \ + "size of per-thread data"); \ if (sizeof (__value) == 1) \ asm volatile ("movb %%gs:%P2(%3),%b0" \ : "=q" (__value) \ @@ -220,8 +222,9 @@ out: # define THREAD_SETMEM(descr, member, value) \ ({ \ _Static_assert (sizeof (descr->member) == 1 \ - || sizeof (descr->member) == 4 \ - || sizeof (descr->member) == 8); \ + || sizeof (descr->member) == 4 \ + || sizeof (descr->member) == 8, \ + "size of per-thread data"); \ if (sizeof (descr->member) == 1) \ asm volatile ("movb %b0,%%gs:%P1" : \ : "iq" (value), \ @@ -244,8 +247,9 @@ out: # define THREAD_SETMEM_NC(descr, member, idx, value) \ ({ \ _Static_assert (sizeof (descr->member[0]) == 1 \ - || sizeof (descr->member[0]) == 4 \ - || sizeof (descr->member[0]) == 8); \ + || sizeof (descr->member[0]) == 4 \ + || sizeof (descr->member[0]) == 8, \ + "size of per-thread data"); \ if (sizeof (descr->member[0]) == 1) \ asm volatile ("movb %b0,%%gs:%P1(%2)" : \ : "iq" (value), \ diff --git a/sysdeps/x86_64/nptl/tls.h b/sysdeps/x86_64/nptl/tls.h index 5255ff8..cb60ed4 100644 --- a/sysdeps/x86_64/nptl/tls.h +++ b/sysdeps/x86_64/nptl/tls.h @@ -200,8 +200,9 @@ _Static_assert (offsetof (tcbhead_t, __glibc_unused2) == 0x80, # define THREAD_GETMEM(descr, member) \ ({ __typeof (descr->member) __value; \ _Static_assert (sizeof (__value) == 1 \ - || sizeof (__value) == 4 \ - || sizeof (__value) == 8); \ + || sizeof (__value) == 4 \ + || sizeof (__value) == 8, \ + "size of per-thread data"); \ if (sizeof (__value) == 1) \ asm volatile ("movb %%fs:%P2,%b0" \ : "=q" (__value) \ @@ -223,8 +224,9 @@ _Static_assert (offsetof (tcbhead_t, __glibc_unused2) == 0x80, # define THREAD_GETMEM_NC(descr, member, idx) \ ({ __typeof (descr->member[0]) __value; \ _Static_assert (sizeof (__value) == 1 \ - || sizeof (__value) == 4 \ - || sizeof (__value) == 8); \ + || sizeof (__value) == 4 \ + || sizeof (__value) == 8, \ + "size of per-thread data"); \ if (sizeof (__value) == 1) \ asm volatile ("movb %%fs:%P2(%q3),%b0" \ : "=q" (__value) \ @@ -257,8 +259,9 @@ _Static_assert (offsetof (tcbhead_t, __glibc_unused2) == 0x80, # define THREAD_SETMEM(descr, member, value) \ ({ \ _Static_assert (sizeof (descr->member) == 1 \ - || sizeof (descr->member) == 4 \ - || sizeof (descr->member) == 8); \ + || sizeof (descr->member) == 4 \ + || sizeof (descr->member) == 8, \ + "size of per-thread data"); \ if (sizeof (descr->member) == 1) \ asm volatile ("movb %b0,%%fs:%P1" : \ : "iq" (value), \ @@ -279,8 +282,9 @@ _Static_assert (offsetof (tcbhead_t, __glibc_unused2) == 0x80, # define THREAD_SETMEM_NC(descr, member, idx, value) \ ({ \ _Static_assert (sizeof (descr->member[0]) == 1 \ - || sizeof (descr->member[0]) == 4 \ - || sizeof (descr->member[0]) == 8); \ + || sizeof (descr->member[0]) == 4 \ + || sizeof (descr->member[0]) == 8, \ + "size of per-thread data"); \ if (sizeof (descr->member[0]) == 1) \ asm volatile ("movb %b0,%%fs:%P1(%q2)" : \ : "iq" (value), \ |