Update M2libc and clear out some unneeded globals
This commit is contained in:
parent
d6d869f2c0
commit
892a40aa1a
2
M2libc
2
M2libc
|
@ -1 +1 @@
|
||||||
Subproject commit 818fcfb333d73fbe0293b97b769718f0945e22dc
|
Subproject commit daec5ae864c80535dac5d53f83c8718e677b9e2d
|
20
cc.h
20
cc.h
|
@ -20,25 +20,9 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// CONSTANT FALSE 0
|
|
||||||
#define FALSE 0
|
|
||||||
// CONSTANT TRUE 1
|
|
||||||
#define TRUE 1
|
|
||||||
|
|
||||||
// CONSTANT KNIGHT_NATIVE 0
|
#define FALSE 0
|
||||||
#define KNIGHT_NATIVE 0
|
#define TRUE 1
|
||||||
// CONSTANT KNIGHT_POSIX 1
|
|
||||||
#define KNIGHT_POSIX 1
|
|
||||||
// CONSTANT X86 2
|
|
||||||
#define X86 2
|
|
||||||
// CONSTANT AMD64 3
|
|
||||||
#define AMD64 3
|
|
||||||
// CONSTANT ARMV7L 4
|
|
||||||
#define ARMV7L 4
|
|
||||||
// CONSTANT AARCH64 5
|
|
||||||
#define AARCH64 5
|
|
||||||
// CONSTANT RISCV64 6
|
|
||||||
#define RISCV64 6
|
|
||||||
|
|
||||||
|
|
||||||
int in_set(int c, char* s);
|
int in_set(int c, char* s);
|
||||||
|
|
9
cc_env.c
9
cc_env.c
|
@ -41,31 +41,24 @@ void setup_env()
|
||||||
if(NULL != hold) ARCH = hold;
|
if(NULL != hold) ARCH = hold;
|
||||||
|
|
||||||
/* Set desired architecture */
|
/* Set desired architecture */
|
||||||
if(match("knight-native", ARCH)) Architecture = KNIGHT_NATIVE;
|
if(match("x86", ARCH))
|
||||||
else if(match("knight-posix", ARCH)) Architecture = KNIGHT_POSIX;
|
|
||||||
else if(match("x86", ARCH))
|
|
||||||
{
|
{
|
||||||
Architecture = X86;
|
|
||||||
init_macro_env("__i386__", "1", "--architecture", 0);
|
init_macro_env("__i386__", "1", "--architecture", 0);
|
||||||
}
|
}
|
||||||
else if(match("amd64", ARCH))
|
else if(match("amd64", ARCH))
|
||||||
{
|
{
|
||||||
Architecture = AMD64;
|
|
||||||
init_macro_env("__x86_64__", "1", "--architecture", 0);
|
init_macro_env("__x86_64__", "1", "--architecture", 0);
|
||||||
}
|
}
|
||||||
else if(match("armv7l", ARCH))
|
else if(match("armv7l", ARCH))
|
||||||
{
|
{
|
||||||
Architecture = ARMV7L;
|
|
||||||
init_macro_env("__arm__", "1", "--architecture", 0);
|
init_macro_env("__arm__", "1", "--architecture", 0);
|
||||||
}
|
}
|
||||||
else if(match("aarch64", ARCH))
|
else if(match("aarch64", ARCH))
|
||||||
{
|
{
|
||||||
Architecture = AARCH64;
|
|
||||||
init_macro_env("__aarch64__", "1", "--architecture", 0);
|
init_macro_env("__aarch64__", "1", "--architecture", 0);
|
||||||
}
|
}
|
||||||
else if(match("riscv64", ARCH))
|
else if(match("riscv64", ARCH))
|
||||||
{
|
{
|
||||||
Architecture = RISCV64;
|
|
||||||
init_macro_env("__riscv", "1", "--architecture", 0);
|
init_macro_env("__riscv", "1", "--architecture", 0);
|
||||||
init_macro_env("__riscv_xlen", "64", "--architecture", 1);
|
init_macro_env("__riscv_xlen", "64", "--architecture", 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,15 +32,7 @@ struct token_list* globals_list;
|
||||||
char* hold_string;
|
char* hold_string;
|
||||||
int string_index;
|
int string_index;
|
||||||
|
|
||||||
/* Our Target Architecture */
|
|
||||||
int Architecture;
|
|
||||||
int register_size;
|
|
||||||
|
|
||||||
int MAX_STRING;
|
int MAX_STRING;
|
||||||
struct type* integer;
|
|
||||||
|
|
||||||
/* enable bootstrap-mode */
|
|
||||||
int BOOTSTRAP_MODE;
|
|
||||||
|
|
||||||
/* enable preprocessor-only mode */
|
/* enable preprocessor-only mode */
|
||||||
int PREPROCESSOR_MODE;
|
int PREPROCESSOR_MODE;
|
||||||
|
|
10
cc_globals.h
10
cc_globals.h
|
@ -32,19 +32,9 @@ extern struct token_list* globals_list;
|
||||||
extern char* hold_string;
|
extern char* hold_string;
|
||||||
extern int string_index;
|
extern int string_index;
|
||||||
|
|
||||||
/* Our Target Architecture */
|
|
||||||
extern int Architecture;
|
|
||||||
extern int register_size;
|
|
||||||
|
|
||||||
/* Allow us to have a single settable max string */
|
/* Allow us to have a single settable max string */
|
||||||
extern int MAX_STRING;
|
extern int MAX_STRING;
|
||||||
|
|
||||||
/* make default type integer */
|
|
||||||
extern struct type* integer;
|
|
||||||
|
|
||||||
/* enable bootstrap-mode */
|
|
||||||
extern int BOOTSTRAP_MODE;
|
|
||||||
|
|
||||||
/* enable preprocessor-only mode */
|
/* enable preprocessor-only mode */
|
||||||
extern int PREPROCESSOR_MODE;
|
extern int PREPROCESSOR_MODE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue