mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Get LIBC_MEM and LIBC_STDIO building with aarch64
This commit is contained in:
parent
ae0ee59614
commit
d04430f4ef
81 changed files with 440 additions and 1064 deletions
|
@ -16,20 +16,27 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/stdio/internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
||||
STATIC_YOINK("_init_stderr");
|
||||
#include "libc/sysv/consts/fileno.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/thread/thread.h"
|
||||
|
||||
/**
|
||||
* Pointer to standard error stream.
|
||||
*/
|
||||
FILE *stderr;
|
||||
|
||||
_Hide FILE __stderr;
|
||||
static FILE __stderr;
|
||||
|
||||
static textstartup void __stderr_init() {
|
||||
__attribute__((__constructor__)) static void __stderr_init(void) {
|
||||
stderr = &__stderr;
|
||||
stderr->fd = STDERR_FILENO;
|
||||
stderr->bufmode = _IOLBF;
|
||||
stderr->iomode = O_WRONLY;
|
||||
stderr->buf = stderr->mem;
|
||||
stderr->size = sizeof(stderr->mem);
|
||||
((pthread_mutex_t *)stderr->lock)->_type = PTHREAD_MUTEX_RECURSIVE;
|
||||
__fflush_register(stderr);
|
||||
}
|
||||
|
||||
const void *const __stderr_ctor[] initarray = {__stderr_init};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue