mirror of
https://github.com/ziglang/zig.git
synced 2024-12-04 19:09:32 +00:00
19ca2415f2
This commit introduces tools/update_glibc.zig to update the start files for next time. Some notable changes in recent glibc: * abi-note.S has been changed to abi-note.c but we resist the change to keep it easier to compile the start files. * elf-init.c has been deleted upstream. Further testing should be done to verify that binaries against glibc omitting elf-init.c still run properly on oldel glibc linux systems. Closes #4926
46 lines
1.1 KiB
C
Vendored
46 lines
1.1 KiB
C
Vendored
#ifndef _ERRNO_H
|
|
#include <stdlib/errno.h>
|
|
#if !defined _ISOMAC && !defined __ASSEMBLER__
|
|
|
|
# if IS_IN (rtld)
|
|
# include <dl-sysdep.h>
|
|
# ifndef RTLD_PRIVATE_ERRNO
|
|
# error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!"
|
|
# endif
|
|
# else
|
|
# define RTLD_PRIVATE_ERRNO 0
|
|
# endif
|
|
|
|
# if RTLD_PRIVATE_ERRNO
|
|
/* The dynamic linker uses its own private errno variable.
|
|
All access to errno inside the dynamic linker is serialized,
|
|
so a single (hidden) global variable is all it needs. */
|
|
|
|
# undef errno
|
|
# define errno rtld_errno
|
|
extern int rtld_errno attribute_hidden;
|
|
|
|
# elif IS_IN_LIB && !IS_IN (rtld)
|
|
|
|
# undef errno
|
|
# if IS_IN (libc)
|
|
# define errno __libc_errno
|
|
# else
|
|
# define errno errno /* For #ifndef errno tests. */
|
|
# endif
|
|
extern __thread int errno attribute_tls_model_ie;
|
|
|
|
# endif /* IS_IN_LIB */
|
|
|
|
# define __set_errno(val) (errno = (val))
|
|
|
|
extern int *__errno_location (void) __THROW __attribute_const__
|
|
# if RTLD_PRIVATE_ERRNO
|
|
attribute_hidden
|
|
# endif
|
|
;
|
|
libc_hidden_proto (__errno_location)
|
|
|
|
#endif /* !_ISOMAC && !__ASSEMBLER__ */
|
|
#endif /* !_ERRNO_H */
|