Get LIBC_TESTLIB building on AARCH64

This commit is contained in:
Justine Tunney 2023-05-11 19:56:33 -07:00
parent 95fab334e4
commit 5e2f7f7ced
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
46 changed files with 975 additions and 1174 deletions

View file

@ -40,8 +40,6 @@ getopt (BSD-3)\\n\
Copyright 1987, 1993, 1994 The Regents of the University of California\"");
asm(".include \"libc/disclaimer.inc\"");
STATIC_YOINK("_init_getopt");
#define BADCH (int)'?'
#define BADARG (int)':'
@ -75,8 +73,8 @@ int optreset;
*/
char *optarg;
_Hide char *getopt_place;
_Hide char kGetoptEmsg[1];
char *getopt_place;
static char kGetoptEmsg[1];
static void getopt_print_badch(const char *s) {
char b1[512];
@ -117,6 +115,13 @@ static void getopt_print_badch(const char *s) {
*/
int getopt(int nargc, char *const nargv[], const char *ostr) {
char *oli; /* option letter list index */
static bool once;
if (!once) {
opterr = 1;
optind = 1;
getopt_place = kGetoptEmsg;
once = true;
}
/*
* Some programs like cvs expect optind = 0 to trigger
* a reset of getopt.