aboutsummaryrefslogtreecommitdiff
path: root/libc/include
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2026-01-29 14:39:34 -0800
committerPeter Collingbourne <peter@pcc.me.uk>2026-01-29 14:39:34 -0800
commit7b3f189a1369f9348c007730ddea953b1e68acb1 (patch)
tree7db8969ee8a34a10b6c8ae033c939c9d653376f6 /libc/include
parentf3d6dae13ae710323a2ddbaf87af71b1abcbfada (diff)
parent0893b70ecfc4f4aca0a20a078476d191edc1e623 (diff)
downloadllvm-users/pcc/spr/codegen-introduce-machinefunctiongetpreferredalignment.zip
llvm-users/pcc/spr/codegen-introduce-machinefunctiongetpreferredalignment.tar.gz
llvm-users/pcc/spr/codegen-introduce-machinefunctiongetpreferredalignment.tar.bz2
Created using spr 1.3.6-beta.1
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/CMakeLists.txt3
-rw-r--r--libc/include/elf.yaml8
-rw-r--r--libc/include/llvm-libc-macros/link-macros.h1
-rw-r--r--libc/include/llvm-libc-macros/pthread-macros.h2
-rw-r--r--libc/include/llvm-libc-types/CMakeLists.txt1
-rw-r--r--libc/include/llvm-libc-types/Elf32_Xword.h (renamed from libc/include/pthread.h.def)13
-rw-r--r--libc/include/pthread.yaml184
7 files changed, 78 insertions, 134 deletions
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 1bc9c2c..c6254aa 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -497,6 +497,7 @@ add_header_macro(
.llvm-libc-types.Elf32_Verneed
.llvm-libc-types.Elf32_Versym
.llvm-libc-types.Elf32_Word
+ .llvm-libc-types.Elf32_Xword
.llvm-libc-types.Elf64_Addr
.llvm-libc-types.Elf64_Chdr
.llvm-libc-types.Elf64_Dyn
@@ -800,7 +801,7 @@ add_header_macro(
../libc/include/wctype.yaml
wctype.h
DEPENDS
- .llvm_libc_common_h
+ .llvm_libc_common_h
.llvm-libc-types.wint_t
)
diff --git a/libc/include/elf.yaml b/libc/include/elf.yaml
index 819bcda..6cb9122 100644
--- a/libc/include/elf.yaml
+++ b/libc/include/elf.yaml
@@ -267,6 +267,8 @@ macros:
macro_value: '0x70000000'
- macro_name: PT_HIPROC
macro_value: '0x7fffffff'
+ - macro_name: PT_GNU_PROPERTY
+ macro_value: '0x6474e553'
- macro_name: PF_X
macro_value: '0x1'
- macro_name: PF_W
@@ -433,6 +435,11 @@ macros:
macro_value: '0xff00'
- macro_name: VER_NDX_ELIMINATE
macro_value: '0xff01'
+ # Values used in the .note.gnu.property section.
+ - macro_name: GNU_PROPERTY_X86_FEATURE_1_AND
+ macro_value: '0xc0000002'
+ - macro_name: GNU_PROPERTY_X86_FEATURE_1_SHSTK
+ macro_value: '0x00000002'
types:
- type_name: Elf32_Addr
- type_name: Elf32_Chdr
@@ -454,6 +461,7 @@ types:
- type_name: Elf32_Verneed
- type_name: Elf32_Versym
- type_name: Elf32_Word
+ - type_name: Elf32_Xword
- type_name: Elf64_Addr
- type_name: Elf64_Chdr
- type_name: Elf64_Dyn
diff --git a/libc/include/llvm-libc-macros/link-macros.h b/libc/include/llvm-libc-macros/link-macros.h
index 1876a6d..7430e52 100644
--- a/libc/include/llvm-libc-macros/link-macros.h
+++ b/libc/include/llvm-libc-macros/link-macros.h
@@ -24,6 +24,7 @@
#include "../llvm-libc-types/Elf32_Sword.h"
#include "../llvm-libc-types/Elf32_Sym.h"
#include "../llvm-libc-types/Elf32_Word.h"
+#include "../llvm-libc-types/Elf32_Xword.h"
#include "../llvm-libc-types/Elf64_Addr.h"
#include "../llvm-libc-types/Elf64_Chdr.h"
#include "../llvm-libc-types/Elf64_Dyn.h"
diff --git a/libc/include/llvm-libc-macros/pthread-macros.h b/libc/include/llvm-libc-macros/pthread-macros.h
index ce467b7..bba3faa 100644
--- a/libc/include/llvm-libc-macros/pthread-macros.h
+++ b/libc/include/llvm-libc-macros/pthread-macros.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_MACROS_PTHREAD_MACRO_H
#define LLVM_LIBC_MACROS_PTHREAD_MACRO_H
-#include "null-macro.h"
+#define PTHREAD_NULL {0}
#define PTHREAD_CREATE_JOINABLE 0
#define PTHREAD_CREATE_DETACHED 1
diff --git a/libc/include/llvm-libc-types/CMakeLists.txt b/libc/include/llvm-libc-types/CMakeLists.txt
index 3124fdc..dc36dfe 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -194,6 +194,7 @@ add_header(Elf32_Lword HDR Elf32_Lword.h DEPENDS libc.include.llvm-libc-macros.s
add_header(Elf32_Off HDR Elf32_Off.h DEPENDS libc.include.llvm-libc-macros.stdint_macros)
add_header(Elf32_Sword HDR Elf32_Sword.h DEPENDS libc.include.llvm-libc-macros.stdint_macros)
add_header(Elf32_Word HDR Elf32_Word.h DEPENDS libc.include.llvm-libc-macros.stdint_macros)
+add_header(Elf32_Xword HDR Elf32_Xword.h DEPENDS libc.include.llvm-libc-macros.stdint_macros)
add_header(
Elf32_Chdr
HDR
diff --git a/libc/include/pthread.h.def b/libc/include/llvm-libc-types/Elf32_Xword.h
index aa1e998..9a48980 100644
--- a/libc/include/pthread.h.def
+++ b/libc/include/llvm-libc-types/Elf32_Xword.h
@@ -1,4 +1,4 @@
-//===-- POSIX header pthread.h --------------------------------------------===//
+//===-- Definition of Elf32_Xword type ------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,12 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_PTHREAD_H
-#define LLVM_LIBC_PTHREAD_H
+#ifndef LLVM_LIBC_TYPES_ELF32_XWORD_H
+#define LLVM_LIBC_TYPES_ELF32_XWORD_H
-#include "__llvm-libc-common.h"
-#include "llvm-libc-macros/pthread-macros.h"
+#include "../llvm-libc-macros/stdint-macros.h"
-%%public_api()
+typedef uint64_t Elf32_Xword;
-#endif // LLVM_LIBC_PTHREAD_H
+#endif // LLVM_LIBC_TYPES_ELF32_XWORD_H
diff --git a/libc/include/pthread.yaml b/libc/include/pthread.yaml
index df4c31c..cfbd726 100644
--- a/libc/include/pthread.yaml
+++ b/libc/include/pthread.yaml
@@ -1,6 +1,53 @@
header: pthread.h
-header_template: pthread.h.def
-macros: []
+standards:
+ - posix
+macros:
+ - macro_name: "PTHREAD_NULL"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_CREATE_JOINABLE"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_CREATE_DETACHED"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_MUTEX_NORMAL"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_MUTEX_ERRORCHECK"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_MUTEX_RECURSIVE"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_MUTEX_DEFAULT"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_MUTEX_STALLED"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_MUTEX_ROBUST"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_BARRIER_SERIAL_THREAD"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_ONCE_INIT"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_PROCESS_PRIVATE"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_PROCESS_SHARED"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_MUTEX_INITIALIZER"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_RWLOCK_INITIALIZER"
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_STACK_MIN"
+ standards:
+ - gnu
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_RWLOCK_PREFER_READER_NP"
+ standards:
+ - gnu
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_RWLOCK_PREFER_WRITER_NP"
+ standards:
+ - gnu
+ macro_header: pthread-macros.h
+ - macro_name: "PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP"
+ standards:
+ - gnu
+ macro_header: pthread-macros.h
types:
- type_name: pthread_t
- type_name: pthread_once_t
@@ -10,151 +57,106 @@ types:
- type_name: pthread_barrierattr_t
- type_name: pthread_key_t
- type_name: pthread_condattr_t
- - type_name: __pthread_tss_dtor_t
- type_name: pthread_rwlock_t
- type_name: pthread_rwlockattr_t
- type_name: pthread_attr_t
- - type_name: __pthread_start_t
- - type_name: __pthread_once_func_t
- - type_name: __atfork_callback_t
- type_name: pthread_spinlock_t
-enums: []
functions:
- name: pthread_atfork
- standards:
- - POSIX
return_type: int
arguments:
- type: __atfork_callback_t
- type: __atfork_callback_t
- type: __atfork_callback_t
- name: pthread_attr_destroy
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- name: pthread_attr_getdetachstate
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_attr_t *
- type: int *
- name: pthread_attr_getguardsize
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_attr_t *__restrict
- type: size_t *__restrict
- name: pthread_attr_getschedparam
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_attr_t *__restrict
- type: struct sched_param *__restrict
- name: pthread_attr_getstack
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_attr_t *__restrict
- type: void **__restrict
- type: size_t *__restrict
- name: pthread_attr_getstacksize
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_attr_t *__restrict
- type: size_t *__restrict
- name: pthread_attr_init
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- name: pthread_attr_setdetachstate
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- type: int
- name: pthread_attr_setguardsize
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- type: size_t
- name: pthread_attr_setschedparam
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_attr_t *__restrict
- type: const struct sched_param *__restrict
- name: pthread_attr_setstack
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- type: void *
- type: size_t
- name: pthread_attr_setstacksize
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- type: size_t
- name: pthread_condattr_destroy
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_condattr_t *
- name: pthread_condattr_getclock
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_condattr_t *__restrict
- type: clockid_t *__restrict
- name: pthread_condattr_getpshared
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_condattr_t *__restrict
- type: int *__restrict
- name: pthread_condattr_init
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_condattr_t *
- name: pthread_condattr_setclock
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_condattr_t *
- type: clockid_t
- name: pthread_condattr_setpshared
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_condattr_t *
- type: int
- name: pthread_create
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_t *__restrict
@@ -162,309 +164,241 @@ functions:
- type: __pthread_start_t
- type: void *
- name: pthread_detach
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_t
- name: pthread_equal
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_t
- type: pthread_t
- name: pthread_exit
- standards:
- - POSIX
return_type: _Noreturn void
arguments:
- type: void *
+ - name: pthread_getattr_np
+ standards: gnu
+ return_type: int
+ arguments:
+ - type: pthread_t
+ - type: pthread_attr_t *
- name: pthread_getname_np
standards:
- - GNUExtensions
+ - gnu
return_type: int
arguments:
- type: pthread_t
- type: char *
- type: size_t
- name: pthread_getspecific
- standards:
- - POSIX
return_type: void *
arguments:
- type: pthread_key_t
- name: pthread_join
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_t
- type: void **
- name: pthread_key_create
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_key_t *
- type: __pthread_tss_dtor_t
- name: pthread_key_delete
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_key_t
- name: pthread_mutex_destroy
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutex_t *
- name: pthread_mutex_init
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutex_t *__restrict
- type: const pthread_mutexattr_t *__restrict
- name: pthread_mutex_lock
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutex_t *
- name: pthread_mutex_unlock
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutex_t *
- name: pthread_mutexattr_destroy
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t *
- name: pthread_mutexattr_getpshared
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_mutexattr_t *__restrict
- type: int *__restrict
- name: pthread_mutexattr_getrobust
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_mutexattr_t *__restrict
- type: int *__restrict
- name: pthread_mutexattr_gettype
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_mutexattr_t *__restrict
- type: int *__restrict
- name: pthread_mutexattr_init
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t *
- name: pthread_mutexattr_setpshared
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t *__restrict
- type: int
- name: pthread_mutexattr_setrobust
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t *__restrict
- type: int
- name: pthread_mutexattr_settype
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t *__restrict
- type: int
- name: pthread_barrier_init
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_barrier_t *__restrict
- type: const pthread_barrierattr_t *__restrict
- type: int
- name: pthread_barrier_wait
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_barrier_t *
- name: pthread_barrier_destroy
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_barrier_t *
- name: pthread_once
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_once_t *
- type: __pthread_once_func_t
- name: pthread_rwlock_clockrdlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *__restrict
- type: clockid_t
- type: const struct timespec *__restrict
- name: pthread_rwlock_clockwrlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *__restrict
- type: clockid_t
- type: const struct timespec *__restrict
- name: pthread_rwlock_destroy
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *
- name: pthread_rwlock_init
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *
- type: const pthread_rwlockattr_t *__restrict
- name: pthread_rwlock_rdlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *
- name: pthread_rwlock_timedrdlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *__restrict
- type: const struct timespec *__restrict
- name: pthread_rwlock_timedwrlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *__restrict
- type: const struct timespec *__restrict
- name: pthread_rwlock_tryrdlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *
- name: pthread_rwlock_trywrlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *
- name: pthread_rwlock_unlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *
- name: pthread_rwlock_wrlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_rwlock_t *
- name: pthread_rwlockattr_destroy
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- name: pthread_rwlockattr_getkind_np
standards:
- - POSIX
+ - gnu
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- type: int *
- name: pthread_rwlockattr_getpshared
- standards:
- - POSIX
return_type: int
arguments:
- type: const pthread_rwlockattr_t *
- type: int *
- name: pthread_rwlockattr_init
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- name: pthread_rwlockattr_setkind_np
standards:
- - POSIX
+ - gnu
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- type: int
- name: pthread_rwlockattr_setpshared
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- type: int
- name: pthread_self
- standards:
- - POSIX
return_type: pthread_t
arguments:
- type: void
- name: pthread_setname_np
standards:
- - GNUExtensions
+ - gnu
return_type: int
arguments:
- type: pthread_t
- type: const char *
- name: pthread_setspecific
- standards:
- - POSIX
return_type: int
arguments:
- type: pthread_key_t
- type: const void *
- name: pthread_spin_destroy
- standards: POSIX
return_type: int
arguments:
- type: pthread_spinlock_t *
- name: pthread_spin_init
- standards: POSIX
return_type: int
arguments:
- type: pthread_spinlock_t *
- type: int
- name: pthread_spin_lock
- standards: POSIX
return_type: int
arguments:
- type: pthread_spinlock_t *
- name: pthread_spin_trylock
- standards: POSIX
return_type: int
arguments:
- type: pthread_spinlock_t *
- name: pthread_spin_unlock
- standards: POSIX
return_type: int
arguments:
- type: pthread_spinlock_t *