From df44f9d02b68de45ba8c3984f47ecf1a523306ec Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 15 Oct 2017 07:23:41 -0700 Subject: x32: Verify that NPTL structures are correct [BZ #22298] Add a build-time check to verify that NPTL structures are correct. * sysdeps/x86_64/x32/nptl/Makefile: New file. * sysdeps/x86_64/x32/nptl/nptl-check.sym: Likewise. --- sysdeps/x86_64/x32/nptl/Makefile | 4 ++++ sysdeps/x86_64/x32/nptl/nptl-check.sym | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 sysdeps/x86_64/x32/nptl/Makefile create mode 100644 sysdeps/x86_64/x32/nptl/nptl-check.sym diff --git a/sysdeps/x86_64/x32/nptl/Makefile b/sysdeps/x86_64/x32/nptl/Makefile new file mode 100644 index 0000000..e780bea --- /dev/null +++ b/sysdeps/x86_64/x32/nptl/Makefile @@ -0,0 +1,4 @@ +ifeq ($(subdir),csu) +# Verify that NPTL structures are correct. +gen-as-const-headers += nptl-check.sym +endif diff --git a/sysdeps/x86_64/x32/nptl/nptl-check.sym b/sysdeps/x86_64/x32/nptl/nptl-check.sym new file mode 100644 index 0000000..8573250 --- /dev/null +++ b/sysdeps/x86_64/x32/nptl/nptl-check.sym @@ -0,0 +1,9 @@ +#include +#include + +PREV offsetof (struct __pthread_internal_list, __prev) +NEXT offsetof (struct __pthread_internal_list, __next) + +#if __PTHREAD_MUTEX_HAVE_PREV != 1 +#error __PTHREAD_MUTEX_HAVE_PREV must be 1 +#endif -- cgit v1.1