From 921cc86ce64037493a526736ff7c49b3f8475486 Mon Sep 17 00:00:00 2001 From: Jeremiah Orians Date: Sat, 2 Jan 2021 22:00:02 -0500 Subject: [PATCH] First generation implemention of typedef --- cc.c | 6 ++++ cc.h | 2 +- cc_core.c | 12 ++++++++ cc_globals.c | 3 ++ cc_globals.h | 3 ++ cc_reader.c | 2 +- cc_strings.c | 4 +-- cc_types.c | 46 ++++++++++++++++++++++------ functions/string.c | 12 ++++---- test/test.answers | 30 +++++++++--------- test/test0014/hello-aarch64.sh | 1 + test/test0014/hello-amd64.sh | 1 + test/test0014/hello-armv7l.sh | 1 + test/test0014/hello-knight-posix.sh | 1 + test/test0014/hello-x86.sh | 1 + test/test0015/hello-aarch64.sh | 1 + test/test0015/hello-amd64.sh | 1 + test/test0015/hello-armv7l.sh | 1 + test/test0015/hello-knight-posix.sh | 1 + test/test0015/hello-x86.sh | 1 + test/test0016/hello-aarch64.sh | 1 + test/test0016/hello-amd64.sh | 1 + test/test0016/hello-armv7l.sh | 1 + test/test0016/hello-knight-posix.sh | 1 + test/test0016/hello-x86.sh | 1 + test/test0018/hello-aarch64.sh | 1 + test/test0018/hello-amd64.sh | 1 + test/test0018/hello-armv7l.sh | 1 + test/test0018/hello-knight-native.sh | 1 + test/test0018/hello-knight-posix.sh | 1 + test/test0018/hello-x86.sh | 1 + test/test0019/hello-aarch64.sh | 1 + test/test0019/hello-amd64.sh | 1 + test/test0019/hello-armv7l.sh | 1 + test/test0019/hello-knight-posix.sh | 1 + test/test0019/hello-x86.sh | 1 + test/test0021/chdir.c | 12 +++++++- test/test0021/hello-aarch64.sh | 2 +- test/test0021/hello-amd64.sh | 2 +- test/test0021/hello-armv7l.sh | 2 +- test/test0021/hello-knight-posix.sh | 2 +- test/test0021/hello-x86.sh | 2 +- test/test0022/hello-aarch64.sh | 1 + test/test0022/hello-amd64.sh | 1 + test/test0022/hello-armv7l.sh | 1 + test/test0022/hello-knight-posix.sh | 1 + test/test0022/hello-x86.sh | 1 + test/test0023/hello-aarch64.sh | 1 + test/test0023/hello-amd64.sh | 1 + test/test0023/hello-armv7l.sh | 1 + test/test0023/hello-knight-posix.sh | 1 + test/test0023/hello-x86.sh | 1 + test/test0100/hello-aarch64.sh | 1 + test/test0100/hello-amd64.sh | 1 + test/test0100/hello-armv7l.sh | 1 + test/test0100/hello-knight-posix.sh | 1 + test/test0100/hello-x86.sh | 1 + test/test0101/hello-aarch64.sh | 1 + test/test0101/hello-amd64.sh | 1 + test/test0101/hello-armv7l.sh | 1 + test/test0101/hello-knight-posix.sh | 1 + test/test0101/hello-x86.sh | 1 + test/test0102/hello-aarch64.sh | 1 + test/test0102/hello-amd64.sh | 1 + test/test0102/hello-armv7l.sh | 1 + test/test0102/hello-knight-posix.sh | 1 + test/test0102/hello-x86.sh | 1 + test/test0103/hello-aarch64.sh | 1 + test/test0103/hello-amd64.sh | 1 + test/test0103/hello-armv7l.sh | 1 + test/test0103/hello-knight-posix.sh | 1 + test/test0103/hello-x86.sh | 1 + test/test0104/hello-aarch64.sh | 1 + test/test0104/hello-amd64.sh | 1 + test/test0104/hello-armv7l.sh | 1 + test/test0104/hello-x86.sh | 1 + test/test0105/hello-aarch64.sh | 1 + test/test0105/hello-amd64.sh | 1 + test/test0105/hello-armv7l.sh | 1 + test/test0105/hello-x86.sh | 1 + test/test1000/hello-aarch64.sh | 2 ++ test/test1000/hello-amd64.sh | 2 ++ test/test1000/hello-armv7l.sh | 2 ++ test/test1000/hello-knight-posix.sh | 2 ++ test/test1000/hello-x86.sh | 2 ++ test/test1000/proof.answer | 2 +- 86 files changed, 177 insertions(+), 41 deletions(-) diff --git a/cc.c b/cc.c index 0e3ae8f..fca5f6c 100644 --- a/cc.c +++ b/cc.c @@ -31,6 +31,7 @@ int numerate_string(char *a); int main(int argc, char** argv) { MAX_STRING = 4096; + BOOTSTRAP_MODE = FALSE; int DEBUG = FALSE; FILE* in = stdin; FILE* destination_file = stdout; @@ -102,6 +103,11 @@ int main(int argc, char** argv) require(0 < MAX_STRING, "Not a valid string size\nAbort and fix your --max-string\n"); i = i + 2; } + else if(match(argv[i], "--bootstrap-mode")) + { + BOOTSTRAP_MODE = TRUE; + i = i + 1; + } else if(match(argv[i], "-g") || match(argv[i], "--debug")) { DEBUG = TRUE; diff --git a/cc.h b/cc.h index da5a685..3361dc1 100644 --- a/cc.h +++ b/cc.h @@ -39,7 +39,7 @@ #define AARCH64 5 -char* copy_string(char* target, char* source); +void copy_string(char* target, char* source, int max); int in_set(int c, char* s); int match(char* a, char* b); void file_print(char* s, FILE* f); diff --git a/cc_core.c b/cc_core.c index 3cb4230..9a841c9 100644 --- a/cc_core.c +++ b/cc_core.c @@ -47,6 +47,8 @@ int escape_lookup(char* c); int numerate_string(char *a); void require(int bool, char* error); struct token_list* reverse_list(struct token_list* head); +struct type* mirror_type(struct type* source, char* name); +struct type* add_primitive(struct type* a); /* Host touchy function will need custom on 64bit systems*/ int fixup_int32(int a); @@ -1831,6 +1833,16 @@ new_type: global_token = global_token->next->next; } } + else if(match("typedef", global_token->s)) + { + /* typedef $TYPE $NAME; */ + global_token = global_token->next; + type_size = type_name(); + type_size = mirror_type(type_size, global_token->s); + add_primitive(type_size); + global_token = global_token->next; + require_match("ERROR in typedef statement\nMissing ;\n", ";"); + } else { type_size = type_name(); diff --git a/cc_globals.c b/cc_globals.c index cb928ce..ee74fa4 100644 --- a/cc_globals.c +++ b/cc_globals.c @@ -38,3 +38,6 @@ int register_size; int MAX_STRING; struct type* integer; + +/* enable bootstrap-mode */ +int BOOTSTRAP_MODE; diff --git a/cc_globals.h b/cc_globals.h index c4705cf..87f520a 100644 --- a/cc_globals.h +++ b/cc_globals.h @@ -41,3 +41,6 @@ extern int MAX_STRING; /* make default type integer */ extern struct type* integer; + +/* enable bootstrap-mode */ +extern int BOOTSTRAP_MODE; diff --git a/cc_reader.c b/cc_reader.c index 986e44e..0b9b9e4 100644 --- a/cc_reader.c +++ b/cc_reader.c @@ -171,7 +171,7 @@ reset: /* More efficiently allocate memory for string */ current->s = calloc(string_index + 2, sizeof(char)); require(NULL != current->s, "Exhusted memory while trying to copy a token\n"); - copy_string(current->s, hold_string); + copy_string(current->s, hold_string, MAX_STRING); current->prev = token; current->next = token; diff --git a/cc_strings.c b/cc_strings.c index 0a7205c..15498d6 100644 --- a/cc_strings.c +++ b/cc_strings.c @@ -127,7 +127,7 @@ collect_regular_string_reset: hold_string[string_index + 1] = '\n'; char* message = calloc(string_index + 3, sizeof(char)); require(NULL != message, "Exhusted memory while storing regular string\n"); - copy_string(message, hold_string); + copy_string(message, hold_string, string_index + 2); reset_hold_string(); return message; } @@ -165,7 +165,7 @@ collect_weird_string_reset: char* hold = calloc(string_index + 6, sizeof(char)); require(NULL != hold, "Exhusted available memory while attempting to collect a weird string\n"); - copy_string(hold, hold_string); + copy_string(hold, hold_string, string_index + 5); reset_hold_string(); return hold; } diff --git a/cc_types.c b/cc_types.c index 43da8ba..f94191b 100644 --- a/cc_types.c +++ b/cc_types.c @@ -98,20 +98,23 @@ void initialize_types() hold = new_primitive("char", "char*", "char**", 1, TRUE); prim_types = add_primitive(hold); - /* Define FILE */ - hold = new_primitive("FILE", "FILE*", "FILE**", register_size, TRUE); - prim_types = add_primitive(hold); - /* Define FUNCTION */ hold = new_primitive("FUNCTION", "FUNCTION*", "FUNCTION**", register_size, FALSE); prim_types = add_primitive(hold); - /* Primitives mes.c wanted */ - hold = new_primitive("size_t", "size_t*", "size_t**", register_size, FALSE); - prim_types = add_primitive(hold); + if(BOOTSTRAP_MODE) + { + /* Define FILE */ + hold = new_primitive("FILE", "FILE*", "FILE**", register_size, TRUE); + prim_types = add_primitive(hold); - hold = new_primitive("ssize_t", "ssize_t*", "ssize_t**", register_size, FALSE); - prim_types = add_primitive(hold); + /* Primitives mes.c wanted */ + hold = new_primitive("size_t", "size_t*", "size_t**", register_size, FALSE); + prim_types = add_primitive(hold); + + hold = new_primitive("ssize_t", "ssize_t*", "ssize_t**", register_size, FALSE); + prim_types = add_primitive(hold); + } global_types = prim_types; } @@ -300,3 +303,28 @@ struct type* type_name() return ret; } + +struct type* mirror_type(struct type* source, char* name) +{ + struct type* head = calloc(1, sizeof(struct type)); + require(NULL != head, "Exhusted memory while creating a struct\n"); + struct type* i = calloc(1, sizeof(struct type)); + require(NULL != i, "Exhusted memory while creating a struct indirection\n"); + + head->name = name; + i->name = name; + head->size = source->size; + i->size = source->indirect->size; + head->offset = source->offset; + i->offset = source->indirect->offset; + head->is_signed = source->is_signed; + i->is_signed = source->indirect->is_signed; + head->indirect = i; + i->indirect = head; + head->members = source->members; + i->members = source->indirect->members; + head->type = head; + i->type = i; + + return head; +} diff --git a/functions/string.c b/functions/string.c index 35ef529..edd441c 100644 --- a/functions/string.c +++ b/functions/string.c @@ -18,15 +18,15 @@ #include #include -char* copy_string(char* target, char* source) +void copy_string(char* target, char* source, int max) { - while(0 != source[0]) + int i = 0; + while(0 != source[i]) { - target[0] = source[0]; - target = target + 1; - source = source + 1; + target[i] = source[i]; + i = i + 1; + if(i == max) break; } - return target; } int string_length(char* a) diff --git a/test/test.answers b/test/test.answers index 32f5901..eaad767 100644 --- a/test/test.answers +++ b/test/test.answers @@ -120,11 +120,11 @@ b29aca7f0b63659915fe431e290f821cf17071983613021aacb8985d376bb206 test/results/t f1795d82f5d39e5d2995882a627c74fa972bc749675d4a294732f9285a5ae3c2 test/results/test0020-knight-native-binary d2e5a7672854bf190dd6e2f08081a5dbea22c08d77b4a62f76af68db033aea14 test/results/test0020-knight-posix-binary 1183247a4f714b9d1b0ec78b40f49631df3769ae95b0303fa9996208193c4ec9 test/results/test0020-x86-binary -baa510d2b782c31d1c9edd402271e2ddf00542aefd6f4780b6975db5a1665e0c test/results/test0021-aarch64-binary -f10d5378c91d716270ca8e876ed1acb0eb68b48a6e04d5d5e39b22dd4e3bf98c test/results/test0021-amd64-binary -a9c09864fd326b9b42bc5a32dc32d248dbfcfa87ccdd97cfd21ee95af39a3db9 test/results/test0021-armv7l-binary -0715ba9a1b0d6bb862fbd6ff11526455d2a7e85f4c38b7a021598701e3cf14f1 test/results/test0021-knight-posix-binary -fde9fb7fd3a1a19a8b1f4451cbdb98901adb6de468cd65bda2beb11408233b86 test/results/test0021-x86-binary +33f953a466ccf0e32a4d6fef6f3ad304a2c28c6195c68224def30198813b6d78 test/results/test0021-aarch64-binary +ad3cdef5615e8322c1785db33f19291491b4a23d5abffb436e8dd32fa01d86a5 test/results/test0021-amd64-binary +bde72b7ec387c8c001ac8ad0ea4ad07800867ec2057cedfc50aef6434122ccd9 test/results/test0021-armv7l-binary +b598bb72387459874a458b203eb6883e5360de9fcf60124c7dea8caef6a3d472 test/results/test0021-knight-posix-binary +77231592a7933196a9899f5d6d910aaacdcd02be83419b14f622c1034b136811 test/results/test0021-x86-binary 14b9a108bdee811c0e9ff3f1be1299767a0d8b49319efbfd9b5f269bf5a057ec test/results/test0022-aarch64-binary 4233f5b48b96e98bd83d30e63ce22420d6fe82dbebe9ac261c28760515efdfe8 test/results/test0022-amd64-binary 2d63c3a5a2c5b5ae2ea2e93c430027b4b418e229a963c66b9a3bc34307a55eba test/results/test0022-armv7l-binary @@ -145,11 +145,11 @@ cce24980c8557906660d6d404d6882e5a690c178afe9f097ba653facc254fdf5 test/results/t 252237eaaa9940b65aaf82a3667e8c59ccb78222c58e0b66b9a1dff6ee2e72e8 test/results/test0101-armv7l-binary d120df140cc77037e3d16d1aee7482d270f55660a594c19be91cddc66de687f7 test/results/test0101-knight-posix-binary cc36cf1c0a0ba6fb9e6578763266b1d3ef6580df3b2b3dad2ac03f0c98145e8b test/results/test0101-x86-binary -bdd6707d00c4798e9ff9ccd8cc30c8d747972c902f2df566463cfb8e1a248c8e test/results/test0102-aarch64-binary -6c7947fab2ea85f5d5f566cc2e0393daba64c84c7b2779041bffe20c311a777b test/results/test0102-amd64-binary -9b3e49b90e387c5f66160558b0bcce3cb0ce077ab4b35848a1b0809118b0d1b4 test/results/test0102-armv7l-binary -bf72fdc0514c83b93bf15f383a20b04f8ffd8c8b6c59b79c2963311b0657c6e9 test/results/test0102-knight-posix-binary -8d2cb0a0fb29b9852d18d1064d40a1af02b268fa81dc06ebcc58b00a7beae374 test/results/test0102-x86-binary +d6188080ebb725d5e2fa4061181ad00b02384db8d1d013fb80d2b3946d6d9f3c test/results/test0102-aarch64-binary +ff2c20511abe644022288d665f84282d66aa411545129cfa7d9a6603a796071d test/results/test0102-amd64-binary +1fdfff755396b9b6fd69b0e745d7625f058ff844319dff7940640f4de3593bde test/results/test0102-armv7l-binary +b7d9cbb37965dcd24fd69c06037c3f46e4c7a0338729224925275082d687a33e test/results/test0102-knight-posix-binary +310cfcef1f41ba6f9703bedbb076c528448b1523958b980aacb2e1aa6109b2a1 test/results/test0102-x86-binary 603fd4fe17f8ef9eac12116003941702849b720021da23dc32582ca41192a792 test/results/test0103-aarch64-binary f2114b5217c12952a85d580ad5914dd679888d93d176ee132ace9e8773916b3b test/results/test0103-amd64-binary 79cbb69a747b07d729db736bc177b52b344106387831a0210ff18fce92edf1cc test/results/test0103-armv7l-binary @@ -169,8 +169,8 @@ a2a83f42119e646b389b98647cf6cf2aa9597185997c9453db746178c8c4c0bf test/results/t 698853b79efb30865a663c4863c050639eb21c7400008f7840830503928973d4 test/results/test0106-knight-native-binary 45c2ba61dc209d7ffa39de9ff0f0a7f8f3ea4d7e38598c72f982fcaf9a05c84a test/results/test0106-knight-posix-binary 944580ff4aae38aafac139faf6eed5bfe4ff68b01a7a3adfa346de8803101182 test/results/test0106-x86-binary -958fffb06538d20e51adefdd84f07f782caa032e4a5932e74632b34d940f86a5 test/results/test1000-aarch64-binary -e54038ac37bda078caa0ac74d5676e889976e37990ffc83f210d4ea476b8fc69 test/results/test1000-amd64-binary -a6c6d02d38b847f4d3209b6c92a8947ec7eeadfb9e358db0148d2036fe8f002b test/results/test1000-armv7l-binary -2818e781dae33eff98852ecc60b2135cd6b02bb6c1664493b79aa0493f76faf0 test/results/test1000-knight-posix-binary -d132b51923e78da58abdf5db157e3a4497fc26b74355be669b5b2b0a838b7b7e test/results/test1000-x86-binary +b20b981b871539b73ebb5034a12ddbc6da478ccc1e66f3d607f1f6133a6d8bd0 test/results/test1000-aarch64-binary +5307ff61ac4adb237d8ff403647283bb127b7226f61e07e68161bd3a8f8fec13 test/results/test1000-amd64-binary +b35fae63b64e85cf7e70f867f6eb0c38a7b70b616fc66b9dc900b2a04c2807fa test/results/test1000-armv7l-binary +3ce668b5d32a36198be73deccc9a4c3fefdb431c13e3f7adc2603241b92f717d test/results/test1000-knight-posix-binary +744b64abdeb09f2e8963e3189bfde1174a21943818853d2759b3d8a9ba34f7d1 test/results/test1000-x86-binary diff --git a/test/test0014/hello-aarch64.sh b/test/test0014/hello-aarch64.sh index b36c406..76e634c 100755 --- a/test/test0014/hello-aarch64.sh +++ b/test/test0014/hello-aarch64.sh @@ -21,6 +21,7 @@ set -ex bin/M2-Planet --architecture aarch64 \ -f test/common_aarch64/functions/putchar.c \ -f test/test0014/basic_args.c \ + --bootstrap-mode \ -o test/test0014/basic_args.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0014/hello-amd64.sh b/test/test0014/hello-amd64.sh index 53888aa..5825c89 100755 --- a/test/test0014/hello-amd64.sh +++ b/test/test0014/hello-amd64.sh @@ -19,6 +19,7 @@ set -ex # Build the test bin/M2-Planet --architecture amd64 -f test/common_amd64/functions/putchar.c \ -f test/test0014/basic_args.c \ + --bootstrap-mode \ -o test/test0014/basic_args.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0014/hello-armv7l.sh b/test/test0014/hello-armv7l.sh index bf71a66..99b273c 100755 --- a/test/test0014/hello-armv7l.sh +++ b/test/test0014/hello-armv7l.sh @@ -19,6 +19,7 @@ set -ex # Build the test bin/M2-Planet --architecture armv7l -f test/common_armv7l/functions/putchar.c \ -f test/test0014/basic_args.c \ + --bootstrap-mode \ -o test/test0014/basic_args.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0014/hello-knight-posix.sh b/test/test0014/hello-knight-posix.sh index 3951d3d..7712b12 100755 --- a/test/test0014/hello-knight-posix.sh +++ b/test/test0014/hello-knight-posix.sh @@ -19,6 +19,7 @@ set -ex # Build the test bin/M2-Planet --architecture knight-posix -f test/common_knight/functions/putchar.c \ -f test/test0014/basic_args.c \ + --bootstrap-mode \ -o test/test0014/basic_args.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0014/hello-x86.sh b/test/test0014/hello-x86.sh index 3a6da75..2f4357f 100755 --- a/test/test0014/hello-x86.sh +++ b/test/test0014/hello-x86.sh @@ -19,6 +19,7 @@ set -ex # Build the test bin/M2-Planet --architecture x86 -f test/common_x86/functions/putchar.c \ -f test/test0014/basic_args.c \ + --bootstrap-mode \ -o test/test0014/basic_args.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0015/hello-aarch64.sh b/test/test0015/hello-aarch64.sh index 29dd0a0..633c70e 100755 --- a/test/test0015/hello-aarch64.sh +++ b/test/test0015/hello-aarch64.sh @@ -22,6 +22,7 @@ bin/M2-Planet --architecture aarch64 \ -f test/common_aarch64/functions/file.c \ -f test/common_aarch64/functions/putchar.c \ -f test/test0015/file_read.c \ + --bootstrap-mode \ -o test/test0015/file_read.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0015/hello-amd64.sh b/test/test0015/hello-amd64.sh index df0872d..f69c420 100755 --- a/test/test0015/hello-amd64.sh +++ b/test/test0015/hello-amd64.sh @@ -20,6 +20,7 @@ set -ex bin/M2-Planet --architecture amd64 -f test/common_amd64/functions/file.c \ -f test/common_amd64/functions/putchar.c \ -f test/test0015/file_read.c \ + --bootstrap-mode \ -o test/test0015/file_read.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0015/hello-armv7l.sh b/test/test0015/hello-armv7l.sh index cf2ce3f..54a62f6 100755 --- a/test/test0015/hello-armv7l.sh +++ b/test/test0015/hello-armv7l.sh @@ -20,6 +20,7 @@ set -ex bin/M2-Planet --architecture armv7l -f test/common_armv7l/functions/file.c \ -f test/common_armv7l/functions/putchar.c \ -f test/test0015/file_read.c \ + --bootstrap-mode \ -o test/test0015/file_read.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0015/hello-knight-posix.sh b/test/test0015/hello-knight-posix.sh index 560b324..ed58a62 100755 --- a/test/test0015/hello-knight-posix.sh +++ b/test/test0015/hello-knight-posix.sh @@ -20,6 +20,7 @@ set -ex bin/M2-Planet --architecture knight-posix -f test/common_knight/functions/file.c \ -f test/common_knight/functions/putchar.c \ -f test/test0015/file_read.c \ + --bootstrap-mode \ -o test/test0015/file_read.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0015/hello-x86.sh b/test/test0015/hello-x86.sh index 013d429..e7db788 100755 --- a/test/test0015/hello-x86.sh +++ b/test/test0015/hello-x86.sh @@ -20,6 +20,7 @@ set -ex bin/M2-Planet --architecture x86 -f test/common_x86/functions/file.c \ -f test/common_x86/functions/putchar.c \ -f test/test0015/file_read.c \ + --bootstrap-mode \ -o test/test0015/file_read.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0016/hello-aarch64.sh b/test/test0016/hello-aarch64.sh index a134b20..f4292ab 100755 --- a/test/test0016/hello-aarch64.sh +++ b/test/test0016/hello-aarch64.sh @@ -22,6 +22,7 @@ bin/M2-Planet --architecture aarch64 \ -f test/common_aarch64/functions/file.c \ -f test/common_aarch64/functions/putchar.c \ -f test/test0016/file_write.c \ + --bootstrap-mode \ -o test/test0016/file_write.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0016/hello-amd64.sh b/test/test0016/hello-amd64.sh index 6ec5b79..9ad1e53 100755 --- a/test/test0016/hello-amd64.sh +++ b/test/test0016/hello-amd64.sh @@ -20,6 +20,7 @@ set -ex bin/M2-Planet --architecture amd64 -f test/common_amd64/functions/file.c \ -f test/common_amd64/functions/putchar.c \ -f test/test0016/file_write.c \ + --bootstrap-mode \ -o test/test0016/file_write.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0016/hello-armv7l.sh b/test/test0016/hello-armv7l.sh index 0e3ce3c..6a321b2 100755 --- a/test/test0016/hello-armv7l.sh +++ b/test/test0016/hello-armv7l.sh @@ -20,6 +20,7 @@ set -ex bin/M2-Planet --architecture armv7l -f test/common_armv7l/functions/file.c \ -f test/common_armv7l/functions/putchar.c \ -f test/test0016/file_write.c \ + --bootstrap-mode \ -o test/test0016/file_write.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0016/hello-knight-posix.sh b/test/test0016/hello-knight-posix.sh index de72cff..393cdc3 100755 --- a/test/test0016/hello-knight-posix.sh +++ b/test/test0016/hello-knight-posix.sh @@ -20,6 +20,7 @@ set -ex bin/M2-Planet --architecture knight-posix -f test/common_knight/functions/file.c \ -f test/common_knight/functions/putchar.c \ -f test/test0016/file_write.c \ + --bootstrap-mode \ -o test/test0016/file_write.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0016/hello-x86.sh b/test/test0016/hello-x86.sh index bd47881..2255b48 100755 --- a/test/test0016/hello-x86.sh +++ b/test/test0016/hello-x86.sh @@ -20,6 +20,7 @@ set -ex bin/M2-Planet --architecture x86 -f test/common_x86/functions/file.c \ -f test/common_x86/functions/putchar.c \ -f test/test0016/file_write.c \ + --bootstrap-mode \ -o test/test0016/file_write.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0018/hello-aarch64.sh b/test/test0018/hello-aarch64.sh index 5a7eca9..d228f9c 100755 --- a/test/test0018/hello-aarch64.sh +++ b/test/test0018/hello-aarch64.sh @@ -23,6 +23,7 @@ bin/M2-Planet --architecture aarch64 \ -f test/common_aarch64/functions/malloc.c \ -f functions/calloc.c \ -f test/test0018/math.c \ + --bootstrap-mode \ -o test/test0018/math.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0018/hello-amd64.sh b/test/test0018/hello-amd64.sh index 4a39644..b50f7ae 100755 --- a/test/test0018/hello-amd64.sh +++ b/test/test0018/hello-amd64.sh @@ -21,6 +21,7 @@ bin/M2-Planet --architecture amd64 -f test/common_amd64/functions/file.c \ -f test/common_amd64/functions/malloc.c \ -f functions/calloc.c \ -f test/test0018/math.c \ + --bootstrap-mode \ -o test/test0018/math.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0018/hello-armv7l.sh b/test/test0018/hello-armv7l.sh index 86eab1f..4886d39 100755 --- a/test/test0018/hello-armv7l.sh +++ b/test/test0018/hello-armv7l.sh @@ -21,6 +21,7 @@ bin/M2-Planet --architecture armv7l -f test/common_armv7l/functions/file.c \ -f test/common_armv7l/functions/malloc.c \ -f functions/calloc.c \ -f test/test0018/math.c \ + --bootstrap-mode \ -o test/test0018/math.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0018/hello-knight-native.sh b/test/test0018/hello-knight-native.sh index 6cd7170..1ec7602 100755 --- a/test/test0018/hello-knight-native.sh +++ b/test/test0018/hello-knight-native.sh @@ -22,6 +22,7 @@ bin/M2-Planet --architecture knight-native -f test/common_knight/functions/file- -f functions/calloc.c \ -f functions/match.c \ -f test/test0018/math.c \ + --bootstrap-mode \ -o test/test0018/math.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0018/hello-knight-posix.sh b/test/test0018/hello-knight-posix.sh index 8d67757..a4ba544 100755 --- a/test/test0018/hello-knight-posix.sh +++ b/test/test0018/hello-knight-posix.sh @@ -21,6 +21,7 @@ bin/M2-Planet --architecture knight-posix -f test/common_knight/functions/file.c -f test/common_knight/functions/malloc.c \ -f functions/calloc.c \ -f test/test0018/math.c \ + --bootstrap-mode \ -o test/test0018/math.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0018/hello-x86.sh b/test/test0018/hello-x86.sh index 7aa74e0..5def030 100755 --- a/test/test0018/hello-x86.sh +++ b/test/test0018/hello-x86.sh @@ -21,6 +21,7 @@ bin/M2-Planet --architecture x86 -f test/common_x86/functions/file.c \ -f test/common_x86/functions/malloc.c \ -f functions/calloc.c \ -f test/test0018/math.c \ + --bootstrap-mode \ -o test/test0018/math.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0019/hello-aarch64.sh b/test/test0019/hello-aarch64.sh index b5085b4..5119acd 100755 --- a/test/test0019/hello-aarch64.sh +++ b/test/test0019/hello-aarch64.sh @@ -28,6 +28,7 @@ bin/M2-Planet --architecture aarch64 \ -f functions/numerate_number.c \ -f functions/file_print.c \ -f test/test0019/getopt.c \ + --bootstrap-mode \ -o test/test0019/getopt.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0019/hello-amd64.sh b/test/test0019/hello-amd64.sh index c1ed7ae..1f8790f 100755 --- a/test/test0019/hello-amd64.sh +++ b/test/test0019/hello-amd64.sh @@ -26,6 +26,7 @@ bin/M2-Planet --architecture amd64 -f test/common_amd64/functions/file.c \ -f functions/numerate_number.c \ -f functions/file_print.c \ -f test/test0019/getopt.c \ + --bootstrap-mode \ -o test/test0019/getopt.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0019/hello-armv7l.sh b/test/test0019/hello-armv7l.sh index 8c76c9a..a8b3e01 100755 --- a/test/test0019/hello-armv7l.sh +++ b/test/test0019/hello-armv7l.sh @@ -26,6 +26,7 @@ bin/M2-Planet --architecture armv7l -f test/common_armv7l/functions/file.c \ -f functions/numerate_number.c \ -f functions/file_print.c \ -f test/test0019/getopt.c \ + --bootstrap-mode \ -o test/test0019/getopt.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0019/hello-knight-posix.sh b/test/test0019/hello-knight-posix.sh index 57e260d..93b9e9e 100755 --- a/test/test0019/hello-knight-posix.sh +++ b/test/test0019/hello-knight-posix.sh @@ -26,6 +26,7 @@ bin/M2-Planet --architecture knight-posix -f test/common_knight/functions/file.c -f functions/numerate_number.c \ -f functions/file_print.c \ -f test/test0019/getopt.c \ + --bootstrap-mode \ -o test/test0019/getopt.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0019/hello-x86.sh b/test/test0019/hello-x86.sh index 53a8444..125ef3a 100755 --- a/test/test0019/hello-x86.sh +++ b/test/test0019/hello-x86.sh @@ -26,6 +26,7 @@ bin/M2-Planet --architecture x86 -f test/common_x86/functions/file.c \ -f functions/numerate_number.c \ -f functions/file_print.c \ -f test/test0019/getopt.c \ + --bootstrap-mode \ -o test/test0019/getopt.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0021/chdir.c b/test/test0021/chdir.c index fa2fffe..b8d9a16 100644 --- a/test/test0021/chdir.c +++ b/test/test0021/chdir.c @@ -25,9 +25,19 @@ int match(char* a, char* b); char* get_current_dir_name(); -char* copy_string(char* target, char* source); void file_print(char* s, FILE* f); +char* copy_string(char* target, char* source) +{ + while(0 != source[0]) + { + target[0] = source[0]; + target = target + 1; + source = source + 1; + } + return target; +} + char* prepend_string(char* add, char* base) { char* ret = calloc(MAX_STRING, sizeof(char)); diff --git a/test/test0021/hello-aarch64.sh b/test/test0021/hello-aarch64.sh index c53ff47..da3c3bf 100755 --- a/test/test0021/hello-aarch64.sh +++ b/test/test0021/hello-aarch64.sh @@ -24,11 +24,11 @@ bin/M2-Planet --architecture aarch64 \ -f test/common_aarch64/functions/exit.c \ -f test/common_aarch64/functions/file.c \ -f functions/calloc.c \ - -f functions/string.c \ -f functions/match.c \ -f functions/file_print.c \ -f test/test0021/chdir.c \ --debug \ + --bootstrap-mode \ -o test/test0021/chdir.M1 || exit 1 # Build debug footer diff --git a/test/test0021/hello-amd64.sh b/test/test0021/hello-amd64.sh index f3c0fa0..a3c9c07 100755 --- a/test/test0021/hello-amd64.sh +++ b/test/test0021/hello-amd64.sh @@ -24,11 +24,11 @@ bin/M2-Planet --architecture amd64 \ -f test/common_amd64/functions/exit.c \ -f test/common_amd64/functions/file.c \ -f functions/calloc.c \ - -f functions/string.c \ -f functions/match.c \ -f functions/file_print.c \ -f test/test0021/chdir.c \ --debug \ + --bootstrap-mode \ -o test/test0021/chdir.M1 || exit 1 # Build debug footer diff --git a/test/test0021/hello-armv7l.sh b/test/test0021/hello-armv7l.sh index 52ef80b..d6ad08a 100755 --- a/test/test0021/hello-armv7l.sh +++ b/test/test0021/hello-armv7l.sh @@ -24,11 +24,11 @@ bin/M2-Planet --architecture armv7l \ -f test/common_armv7l/functions/exit.c \ -f test/common_armv7l/functions/file.c \ -f functions/calloc.c \ - -f functions/string.c \ -f functions/match.c \ -f functions/file_print.c \ -f test/test0021/chdir.c \ --debug \ + --bootstrap-mode \ -o test/test0021/chdir.M1 || exit 1 # Build debug footer diff --git a/test/test0021/hello-knight-posix.sh b/test/test0021/hello-knight-posix.sh index d9b325b..837b1ff 100755 --- a/test/test0021/hello-knight-posix.sh +++ b/test/test0021/hello-knight-posix.sh @@ -24,11 +24,11 @@ bin/M2-Planet --architecture knight-posix \ -f test/common_knight/functions/exit.c \ -f test/common_knight/functions/file.c \ -f functions/calloc.c \ - -f functions/string.c \ -f functions/match.c \ -f functions/file_print.c \ -f test/test0021/chdir.c \ --debug \ + --bootstrap-mode \ -o test/test0021/chdir.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0021/hello-x86.sh b/test/test0021/hello-x86.sh index b7513e5..29b7cdb 100755 --- a/test/test0021/hello-x86.sh +++ b/test/test0021/hello-x86.sh @@ -26,11 +26,11 @@ bin/M2-Planet --architecture x86 \ -f test/common_x86/functions/exit.c \ -f test/common_x86/functions/file.c \ -f functions/calloc.c \ - -f functions/string.c \ -f functions/match.c \ -f functions/file_print.c \ -f test/test0021/chdir.c \ --debug \ + --bootstrap-mode \ -o test/test0021/chdir.M1 || exit 1 # Build debug footer diff --git a/test/test0022/hello-aarch64.sh b/test/test0022/hello-aarch64.sh index 10d2f10..bf9c6e5 100755 --- a/test/test0022/hello-aarch64.sh +++ b/test/test0022/hello-aarch64.sh @@ -27,6 +27,7 @@ bin/M2-Planet --architecture aarch64 \ -f functions/file_print.c \ -f test/test0022/continue.c \ --debug \ + --bootstrap-mode \ -o test/test0022/continue.M1 || exit 1 # Build debug footer diff --git a/test/test0022/hello-amd64.sh b/test/test0022/hello-amd64.sh index 665f556..b7bd886 100755 --- a/test/test0022/hello-amd64.sh +++ b/test/test0022/hello-amd64.sh @@ -27,6 +27,7 @@ bin/M2-Planet --architecture amd64 \ -f functions/file_print.c \ -f test/test0022/continue.c \ --debug \ + --bootstrap-mode \ -o test/test0022/continue.M1 || exit 1 # Build debug footer diff --git a/test/test0022/hello-armv7l.sh b/test/test0022/hello-armv7l.sh index af378fd..c376baa 100755 --- a/test/test0022/hello-armv7l.sh +++ b/test/test0022/hello-armv7l.sh @@ -27,6 +27,7 @@ bin/M2-Planet --architecture armv7l \ -f functions/file_print.c \ -f test/test0022/continue.c \ --debug \ + --bootstrap-mode \ -o test/test0022/continue.M1 || exit 1 # Build debug footer diff --git a/test/test0022/hello-knight-posix.sh b/test/test0022/hello-knight-posix.sh index 2456925..452955d 100755 --- a/test/test0022/hello-knight-posix.sh +++ b/test/test0022/hello-knight-posix.sh @@ -26,6 +26,7 @@ bin/M2-Planet --architecture knight-posix \ -f functions/calloc.c \ -f functions/file_print.c \ -f test/test0022/continue.c \ + --bootstrap-mode \ -o test/test0022/continue.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0022/hello-x86.sh b/test/test0022/hello-x86.sh index f3f87c2..50a9889 100755 --- a/test/test0022/hello-x86.sh +++ b/test/test0022/hello-x86.sh @@ -27,6 +27,7 @@ bin/M2-Planet --architecture x86 \ -f functions/file_print.c \ -f test/test0022/continue.c \ --debug \ + --bootstrap-mode \ -o test/test0022/continue.M1 || exit 1 # Build debug footer diff --git a/test/test0023/hello-aarch64.sh b/test/test0023/hello-aarch64.sh index a1d64b7..0c0bcf3 100755 --- a/test/test0023/hello-aarch64.sh +++ b/test/test0023/hello-aarch64.sh @@ -21,6 +21,7 @@ bin/M2-Planet --architecture aarch64 \ -f test/common_aarch64/functions/file.c \ -f test/test0023/fseek.c \ --debug \ + --bootstrap-mode \ -o test/test0023/fseek.M1 || exit 1 # Build debug footer diff --git a/test/test0023/hello-amd64.sh b/test/test0023/hello-amd64.sh index f55023d..80857ca 100755 --- a/test/test0023/hello-amd64.sh +++ b/test/test0023/hello-amd64.sh @@ -21,6 +21,7 @@ bin/M2-Planet --architecture amd64 \ -f test/common_amd64/functions/file.c \ -f test/test0023/fseek.c \ --debug \ + --bootstrap-mode \ -o test/test0023/fseek.M1 || exit 1 # Build debug footer diff --git a/test/test0023/hello-armv7l.sh b/test/test0023/hello-armv7l.sh index a4c9686..0f1fdb9 100755 --- a/test/test0023/hello-armv7l.sh +++ b/test/test0023/hello-armv7l.sh @@ -21,6 +21,7 @@ bin/M2-Planet --architecture armv7l \ -f test/common_armv7l/functions/file.c \ -f test/test0023/fseek.c \ --debug \ + --bootstrap-mode \ -o test/test0023/fseek.M1 || exit 1 # Build debug footer diff --git a/test/test0023/hello-knight-posix.sh b/test/test0023/hello-knight-posix.sh index bf54be2..95c402c 100755 --- a/test/test0023/hello-knight-posix.sh +++ b/test/test0023/hello-knight-posix.sh @@ -20,6 +20,7 @@ set -x bin/M2-Planet --architecture knight-posix \ -f test/common_knight/functions/file.c \ -f test/test0023/fseek.c \ + --bootstrap-mode \ -o test/test0023/fseek.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0023/hello-x86.sh b/test/test0023/hello-x86.sh index e22c9f6..258801b 100755 --- a/test/test0023/hello-x86.sh +++ b/test/test0023/hello-x86.sh @@ -21,6 +21,7 @@ bin/M2-Planet --architecture x86 \ -f test/common_x86/functions/file.c \ -f test/test0023/fseek.c \ --debug \ + --bootstrap-mode \ -o test/test0023/fseek.M1 || exit 1 # Build debug footer diff --git a/test/test0100/hello-aarch64.sh b/test/test0100/hello-aarch64.sh index 8523a72..0a0ceb6 100755 --- a/test/test0100/hello-aarch64.sh +++ b/test/test0100/hello-aarch64.sh @@ -27,6 +27,7 @@ set -x -f functions/match.c \ -f test/test0100/blood-elf.c \ --debug \ + --bootstrap-mode \ -o test/test0100/blood-elf.M1 || exit 1 # Build debug footer diff --git a/test/test0100/hello-amd64.sh b/test/test0100/hello-amd64.sh index 05bc5a7..9436266 100755 --- a/test/test0100/hello-amd64.sh +++ b/test/test0100/hello-amd64.sh @@ -25,6 +25,7 @@ set -x -f functions/match.c \ -f test/test0100/blood-elf.c \ --debug \ + --bootstrap-mode \ -o test/test0100/blood-elf.M1 || exit 1 # Build debug footer diff --git a/test/test0100/hello-armv7l.sh b/test/test0100/hello-armv7l.sh index 1728289..c4a13d6 100755 --- a/test/test0100/hello-armv7l.sh +++ b/test/test0100/hello-armv7l.sh @@ -25,6 +25,7 @@ set -x -f functions/match.c \ -f test/test0100/blood-elf.c \ --debug \ + --bootstrap-mode \ -o test/test0100/blood-elf.M1 || exit 1 # Build debug footer diff --git a/test/test0100/hello-knight-posix.sh b/test/test0100/hello-knight-posix.sh index 5a3d6e2..25b4dcb 100755 --- a/test/test0100/hello-knight-posix.sh +++ b/test/test0100/hello-knight-posix.sh @@ -25,6 +25,7 @@ set -x -f functions/calloc.c \ -f functions/match.c \ -f test/test0100/blood-elf.c \ + --bootstrap-mode \ -o test/test0100/blood-elf.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0100/hello-x86.sh b/test/test0100/hello-x86.sh index a1f3dfb..88f8bab 100755 --- a/test/test0100/hello-x86.sh +++ b/test/test0100/hello-x86.sh @@ -25,6 +25,7 @@ set -x -f functions/match.c \ -f test/test0100/blood-elf.c \ --debug \ + --bootstrap-mode \ -o test/test0100/blood-elf.M1 || exit 1 # Build debug footer diff --git a/test/test0101/hello-aarch64.sh b/test/test0101/hello-aarch64.sh index b928166..6d82bcf 100755 --- a/test/test0101/hello-aarch64.sh +++ b/test/test0101/hello-aarch64.sh @@ -30,6 +30,7 @@ set -x -f test/common_aarch64/functions/stat.c \ -f test/test0101/hex2_linker.c \ --debug \ + --bootstrap-mode \ -o test/test0101/hex2_linker.M1 || exit 1 # Build debug footer diff --git a/test/test0101/hello-amd64.sh b/test/test0101/hello-amd64.sh index 513701d..d478044 100755 --- a/test/test0101/hello-amd64.sh +++ b/test/test0101/hello-amd64.sh @@ -28,6 +28,7 @@ set -x -f test/common_amd64/functions/stat.c \ -f test/test0101/hex2_linker.c \ --debug \ + --bootstrap-mode \ -o test/test0101/hex2_linker.M1 || exit 1 # Build debug footer diff --git a/test/test0101/hello-armv7l.sh b/test/test0101/hello-armv7l.sh index dd7d59f..12a6c7f 100755 --- a/test/test0101/hello-armv7l.sh +++ b/test/test0101/hello-armv7l.sh @@ -28,6 +28,7 @@ set -x -f test/common_armv7l/functions/stat.c \ -f test/test0101/hex2_linker.c \ --debug \ + --bootstrap-mode \ -o test/test0101/hex2_linker.M1 || exit 1 # Build debug footer diff --git a/test/test0101/hello-knight-posix.sh b/test/test0101/hello-knight-posix.sh index 7f897c5..f010686 100755 --- a/test/test0101/hello-knight-posix.sh +++ b/test/test0101/hello-knight-posix.sh @@ -27,6 +27,7 @@ set -x -f functions/numerate_number.c \ -f test/common_knight/functions/stat.c \ -f test/test0101/hex2_linker.c \ + --bootstrap-mode \ -o test/test0101/hex2_linker.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0101/hello-x86.sh b/test/test0101/hello-x86.sh index 9269cde..9b6fbce 100755 --- a/test/test0101/hello-x86.sh +++ b/test/test0101/hello-x86.sh @@ -28,6 +28,7 @@ set -x -f test/common_x86/functions/stat.c \ -f test/test0101/hex2_linker.c \ --debug \ + --bootstrap-mode \ -o test/test0101/hex2_linker.M1 || exit 1 # Build debug footer diff --git a/test/test0102/hello-aarch64.sh b/test/test0102/hello-aarch64.sh index 8a43cd6..89e91f1 100755 --- a/test/test0102/hello-aarch64.sh +++ b/test/test0102/hello-aarch64.sh @@ -31,6 +31,7 @@ set -x -f functions/require.c \ -f test/test0102/M1-macro.c \ --debug \ + --bootstrap-mode \ -o test/test0102/M1-macro.M1 || exit 1 # Build debug footer diff --git a/test/test0102/hello-amd64.sh b/test/test0102/hello-amd64.sh index 8219170..0b6813b 100755 --- a/test/test0102/hello-amd64.sh +++ b/test/test0102/hello-amd64.sh @@ -29,6 +29,7 @@ set -x -f functions/require.c \ -f test/test0102/M1-macro.c \ --debug \ + --bootstrap-mode \ -o test/test0102/M1-macro.M1 || exit 1 # Build debug footer diff --git a/test/test0102/hello-armv7l.sh b/test/test0102/hello-armv7l.sh index 77bb1f5..4e4b482 100755 --- a/test/test0102/hello-armv7l.sh +++ b/test/test0102/hello-armv7l.sh @@ -29,6 +29,7 @@ set -x -f functions/require.c \ -f test/test0102/M1-macro.c \ --debug \ + --bootstrap-mode \ -o test/test0102/M1-macro.M1 || exit 1 # Build debug footer diff --git a/test/test0102/hello-knight-posix.sh b/test/test0102/hello-knight-posix.sh index f47d4bd..976c01f 100755 --- a/test/test0102/hello-knight-posix.sh +++ b/test/test0102/hello-knight-posix.sh @@ -28,6 +28,7 @@ set -x -f functions/string.c \ -f functions/require.c \ -f test/test0102/M1-macro.c \ + --bootstrap-mode \ -o test/test0102/M1-macro.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0102/hello-x86.sh b/test/test0102/hello-x86.sh index a3e9187..907bca9 100755 --- a/test/test0102/hello-x86.sh +++ b/test/test0102/hello-x86.sh @@ -29,6 +29,7 @@ set -x -f functions/require.c \ -f test/test0102/M1-macro.c \ --debug \ + --bootstrap-mode \ -o test/test0102/M1-macro.M1 || exit 1 # Build debug footer diff --git a/test/test0103/hello-aarch64.sh b/test/test0103/hello-aarch64.sh index 6b50308..421e649 100755 --- a/test/test0103/hello-aarch64.sh +++ b/test/test0103/hello-aarch64.sh @@ -28,6 +28,7 @@ set -x -f functions/match.c \ -f test/test0103/get_machine.c \ --debug \ + --bootstrap-mode \ -o test/test0103/get_machine.M1 || exit 1 # Build debug footer diff --git a/test/test0103/hello-amd64.sh b/test/test0103/hello-amd64.sh index ca90620..52b8243 100755 --- a/test/test0103/hello-amd64.sh +++ b/test/test0103/hello-amd64.sh @@ -26,6 +26,7 @@ set -x -f functions/match.c \ -f test/test0103/get_machine.c \ --debug \ + --bootstrap-mode \ -o test/test0103/get_machine.M1 || exit 1 # Build debug footer diff --git a/test/test0103/hello-armv7l.sh b/test/test0103/hello-armv7l.sh index 49a0dfd..4ec4b47 100755 --- a/test/test0103/hello-armv7l.sh +++ b/test/test0103/hello-armv7l.sh @@ -26,6 +26,7 @@ set -x -f functions/match.c \ -f test/test0103/get_machine.c \ --debug \ + --bootstrap-mode \ -o test/test0103/get_machine.M1 || exit 1 # Build debug footer diff --git a/test/test0103/hello-knight-posix.sh b/test/test0103/hello-knight-posix.sh index 404e776..225f4ee 100755 --- a/test/test0103/hello-knight-posix.sh +++ b/test/test0103/hello-knight-posix.sh @@ -25,6 +25,7 @@ set -x -f test/common_knight/functions/uname.c \ -f functions/match.c \ -f test/test0103/get_machine.c \ + --bootstrap-mode \ -o test/test0103/get_machine.M1 || exit 1 # Macro assemble with libc written in M1-Macro diff --git a/test/test0103/hello-x86.sh b/test/test0103/hello-x86.sh index a2fb3b9..bb34721 100755 --- a/test/test0103/hello-x86.sh +++ b/test/test0103/hello-x86.sh @@ -26,6 +26,7 @@ set -x -f functions/match.c \ -f test/test0103/get_machine.c \ --debug \ + --bootstrap-mode \ -o test/test0103/get_machine.M1 || exit 1 # Build debug footer diff --git a/test/test0104/hello-aarch64.sh b/test/test0104/hello-aarch64.sh index ab5a7cc..441446a 100755 --- a/test/test0104/hello-aarch64.sh +++ b/test/test0104/hello-aarch64.sh @@ -31,6 +31,7 @@ set -x -f test/common_aarch64/functions/execve.c \ -f test/test0104/kaem.c \ --debug \ + --bootstrap-mode \ -o test/test0104/kaem.M1 || exit 1 # Build debug footer diff --git a/test/test0104/hello-amd64.sh b/test/test0104/hello-amd64.sh index 20c72f4..802fca3 100755 --- a/test/test0104/hello-amd64.sh +++ b/test/test0104/hello-amd64.sh @@ -29,6 +29,7 @@ set -x -f test/common_amd64/functions/execve.c \ -f test/test0104/kaem.c \ --debug \ + --bootstrap-mode \ -o test/test0104/kaem.M1 || exit 1 # Build debug footer diff --git a/test/test0104/hello-armv7l.sh b/test/test0104/hello-armv7l.sh index 93cc1c3..c52fac5 100755 --- a/test/test0104/hello-armv7l.sh +++ b/test/test0104/hello-armv7l.sh @@ -29,6 +29,7 @@ set -x -f test/common_armv7l/functions/execve.c \ -f test/test0104/kaem.c \ --debug \ + --bootstrap-mode \ -o test/test0104/kaem.M1 || exit 1 # Build debug footer diff --git a/test/test0104/hello-x86.sh b/test/test0104/hello-x86.sh index 7c792aa..4be3240 100755 --- a/test/test0104/hello-x86.sh +++ b/test/test0104/hello-x86.sh @@ -29,6 +29,7 @@ set -x -f test/common_x86/functions/execve.c \ -f test/test0104/kaem.c \ --debug \ + --bootstrap-mode \ -o test/test0104/kaem.M1 || exit 1 # Build debug footer diff --git a/test/test0105/hello-aarch64.sh b/test/test0105/hello-aarch64.sh index 09bc119..0da9e9d 100755 --- a/test/test0105/hello-aarch64.sh +++ b/test/test0105/hello-aarch64.sh @@ -33,6 +33,7 @@ set -x -f test/test0105/lisp_print.c \ -f test/test0105/lisp_read.c \ --debug \ + --bootstrap-mode \ -o test/test0105/lisp.M1 || exit 1 # Build debug footer diff --git a/test/test0105/hello-amd64.sh b/test/test0105/hello-amd64.sh index 3f114b5..ba13ea9 100755 --- a/test/test0105/hello-amd64.sh +++ b/test/test0105/hello-amd64.sh @@ -32,6 +32,7 @@ set -x -f test/test0105/lisp_print.c \ -f test/test0105/lisp_read.c \ --debug \ + --bootstrap-mode \ -o test/test0105/lisp.M1 || exit 1 # Build debug footer diff --git a/test/test0105/hello-armv7l.sh b/test/test0105/hello-armv7l.sh index 1f7e8f8..31da9b0 100755 --- a/test/test0105/hello-armv7l.sh +++ b/test/test0105/hello-armv7l.sh @@ -32,6 +32,7 @@ set -x -f test/test0105/lisp_print.c \ -f test/test0105/lisp_read.c \ --debug \ + --bootstrap-mode \ -o test/test0105/lisp.M1 || exit 1 # Build debug footer diff --git a/test/test0105/hello-x86.sh b/test/test0105/hello-x86.sh index 707a347..92bd592 100755 --- a/test/test0105/hello-x86.sh +++ b/test/test0105/hello-x86.sh @@ -32,6 +32,7 @@ set -x -f test/test0105/lisp_print.c \ -f test/test0105/lisp_read.c \ --debug \ + --bootstrap-mode \ -o test/test0105/lisp.M1 || exit 1 # Build debug footer diff --git a/test/test1000/hello-aarch64.sh b/test/test1000/hello-aarch64.sh index e9b9671..d1007b8 100755 --- a/test/test1000/hello-aarch64.sh +++ b/test/test1000/hello-aarch64.sh @@ -39,6 +39,7 @@ set -ex -f cc_core.c \ -f cc.c \ --debug \ + --bootstrap-mode \ -o test/test1000/cc.M1 || exit 1 # Build debug footer @@ -86,6 +87,7 @@ then -f cc_types.c \ -f cc_core.c \ -f cc.c \ + --bootstrap-mode \ -o test/test1000/proof || exit 5 . ./sha256.sh diff --git a/test/test1000/hello-amd64.sh b/test/test1000/hello-amd64.sh index 391a051..86247f3 100755 --- a/test/test1000/hello-amd64.sh +++ b/test/test1000/hello-amd64.sh @@ -38,6 +38,7 @@ set -ex -f cc_core.c \ -f cc.c \ --debug \ + --bootstrap-mode \ -o test/test1000/cc.M1 || exit 1 # Build debug footer @@ -85,6 +86,7 @@ then -f cc_types.c \ -f cc_core.c \ -f cc.c \ + --bootstrap-mode \ -o test/test1000/proof || exit 5 . ./sha256.sh diff --git a/test/test1000/hello-armv7l.sh b/test/test1000/hello-armv7l.sh index df4d626..842d547 100755 --- a/test/test1000/hello-armv7l.sh +++ b/test/test1000/hello-armv7l.sh @@ -38,6 +38,7 @@ set -ex -f cc_core.c \ -f cc.c \ --debug \ + --bootstrap-mode \ -o test/test1000/cc.M1 || exit 1 # Build debug footer @@ -85,6 +86,7 @@ then -f cc_types.c \ -f cc_core.c \ -f cc.c \ + --bootstrap-mode \ -o test/test1000/proof || exit 5 . ./sha256.sh diff --git a/test/test1000/hello-knight-posix.sh b/test/test1000/hello-knight-posix.sh index 14ffb5c..e69603b 100755 --- a/test/test1000/hello-knight-posix.sh +++ b/test/test1000/hello-knight-posix.sh @@ -38,6 +38,7 @@ set -ex -f cc_core.c \ -f cc.c \ --debug \ + --bootstrap-mode \ -o test/test1000/cc.M1 || exit 1 # Macro assemble with libc written in M1-Macro @@ -79,6 +80,7 @@ then -f cc_types.c \ -f cc_core.c \ -f cc.c \ + --bootstrap-mode \ -o test/test1000/proof || exit 4 . ./sha256.sh diff --git a/test/test1000/hello-x86.sh b/test/test1000/hello-x86.sh index f7c00da..751c62d 100755 --- a/test/test1000/hello-x86.sh +++ b/test/test1000/hello-x86.sh @@ -38,6 +38,7 @@ set -ex -f cc_core.c \ -f cc.c \ --debug \ + --bootstrap-mode \ -o test/test1000/cc.M1 || exit 1 # Build debug footer @@ -85,6 +86,7 @@ then -f cc_types.c \ -f cc_core.c \ -f cc.c \ + --bootstrap-mode \ -o test/test1000/proof || exit 5 . ./sha256.sh diff --git a/test/test1000/proof.answer b/test/test1000/proof.answer index 619306f..6e02134 100644 --- a/test/test1000/proof.answer +++ b/test/test1000/proof.answer @@ -1 +1 @@ -6e53436ce495370f6c8b3a114f3505f9787607bb42654d8e492a7eb533f749e3 test/test1000/proof +7d38cf1d5cd25d976cc39dcef8b46f95bb7ea4eefd15e97e3d8c3e66fa06281c test/test1000/proof