assignments/mini-libc
: checker does not work on Mac with M1
#220
Labels
area/assignment
Update to homework assignments
question
Further information is requested
student-submission
Issue submitted by a student
When running
make -i
some test scripts are not generated. This was my output on Docker:make -C ../libc make[1]: Entering directory '/home/student/operating-systems/assignments/mini-libc/libc' cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o syscall.o syscall.c In file included from syscall.c:3: include/internal/arch/x86_64/syscall_arch.h: In function '__syscall': include/internal/arch/x86_64/syscall_arch.h:24:2: error: unknown register name 'rcx' in 'asm' 24 | __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2), | ^~~~~~~ include/internal/arch/x86_64/syscall_arch.h:24:2: warning: asm operand 3 probably doesn't match constraints make[1]: [<builtin>: syscall.o] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o process/exit.o process/exit.c cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o mm/malloc.o mm/malloc.c mm/malloc.c: In function 'malloc': mm/malloc.c:10:21: warning: unused parameter 'size' [-Wunused-parameter] 10 | void *malloc(size_t size) | ~~~~~~~^~~~ mm/malloc.c: In function 'calloc': mm/malloc.c:16:21: warning: unused parameter 'nmemb' [-Wunused-parameter] 16 | void *calloc(size_t nmemb, size_t size) | ~~~~~~~^~~~~ mm/malloc.c:16:35: warning: unused parameter 'size' [-Wunused-parameter] 16 | void *calloc(size_t nmemb, size_t size) | ~~~~~~~^~~~ mm/malloc.c: In function 'free': mm/malloc.c:22:17: warning: unused parameter 'ptr' [-Wunused-parameter] 22 | void free(void *ptr) | ~~~~~~^~~ mm/malloc.c: In function 'realloc': mm/malloc.c:27:21: warning: unused parameter 'ptr' [-Wunused-parameter] 27 | void *realloc(void *ptr, size_t size) | ~~~~~~^~~ mm/malloc.c:27:33: warning: unused parameter 'size' [-Wunused-parameter] 27 | void *realloc(void *ptr, size_t size) | ~~~~~~~^~~~ mm/malloc.c: In function 'reallocarray': mm/malloc.c:33:26: warning: unused parameter 'ptr' [-Wunused-parameter] 33 | void *reallocarray(void *ptr, size_t nmemb, size_t size) | ~~~~~~^~~ mm/malloc.c:33:38: warning: unused parameter 'nmemb' [-Wunused-parameter] 33 | void *reallocarray(void *ptr, size_t nmemb, size_t size) | ~~~~~~~^~~~~ mm/malloc.c:33:52: warning: unused parameter 'size' [-Wunused-parameter] 33 | void *reallocarray(void *ptr, size_t nmemb, size_t size) | ~~~~~~~^~~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o mm/mmap.o mm/mmap.c mm/mmap.c: In function 'mmap': mm/mmap.c:7:18: warning: unused parameter 'addr' [-Wunused-parameter] 7 | void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) | ~~~~~~^~~~ mm/mmap.c:7:31: warning: unused parameter 'length' [-Wunused-parameter] 7 | void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) | ~~~~~~~^~~~~~ mm/mmap.c:7:43: warning: unused parameter 'prot' [-Wunused-parameter] 7 | void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) | ~~~~^~~~ mm/mmap.c:7:53: warning: unused parameter 'flags' [-Wunused-parameter] 7 | void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) | ~~~~^~~~~ mm/mmap.c:7:64: warning: unused parameter 'fd' [-Wunused-parameter] 7 | void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) | ~~~~^~ mm/mmap.c:7:74: warning: unused parameter 'offset' [-Wunused-parameter] 7 | void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) | ~~~~~~^~~~~~ mm/mmap.c: In function 'mremap': mm/mmap.c:13:20: warning: unused parameter 'old_address' [-Wunused-parameter] 13 | void *mremap(void *old_address, size_t old_size, size_t new_size, int flags) | ~~~~~~^~~~~~~~~~~ mm/mmap.c:13:40: warning: unused parameter 'old_size' [-Wunused-parameter] 13 | void *mremap(void *old_address, size_t old_size, size_t new_size, int flags) | ~~~~~~~^~~~~~~~ mm/mmap.c:13:57: warning: unused parameter 'new_size' [-Wunused-parameter] 13 | void *mremap(void *old_address, size_t old_size, size_t new_size, int flags) | ~~~~~~~^~~~~~~~ mm/mmap.c:13:71: warning: unused parameter 'flags' [-Wunused-parameter] 13 | void *mremap(void *old_address, size_t old_size, size_t new_size, int flags) | ~~~~^~~~~ mm/mmap.c: In function 'munmap': mm/mmap.c:19:18: warning: unused parameter 'addr' [-Wunused-parameter] 19 | int munmap(void *addr, size_t length) | ~~~~~~^~~~ mm/mmap.c:19:31: warning: unused parameter 'length' [-Wunused-parameter] 19 | int munmap(void *addr, size_t length) | ~~~~~~~^~~~~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o mm/mem_list.o mm/mem_list.c cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o string/string.o string/string.c string/string.c: In function 'strcpy': string/string.c:5:45: warning: unused parameter 'source' [-Wunused-parameter] 5 | char *strcpy(char *destination, const char *source) | ~~~~~~~~~~~~^~~~~~ string/string.c: In function 'strncpy': string/string.c:12:46: warning: unused parameter 'source' [-Wunused-parameter] 12 | char *strncpy(char *destination, const char *source, size_t len) | ~~~~~~~~~~~~^~~~~~ string/string.c:12:61: warning: unused parameter 'len' [-Wunused-parameter] 12 | char *strncpy(char *destination, const char *source, size_t len) | ~~~~~~~^~~ string/string.c: In function 'strcat': string/string.c:19:45: warning: unused parameter 'source' [-Wunused-parameter] 19 | char *strcat(char *destination, const char *source) | ~~~~~~~~~~~~^~~~~~ string/string.c: In function 'strncat': string/string.c:26:46: warning: unused parameter 'source' [-Wunused-parameter] 26 | char *strncat(char *destination, const char *source, size_t len) | ~~~~~~~~~~~~^~~~~~ string/string.c:26:61: warning: unused parameter 'len' [-Wunused-parameter] 26 | char *strncat(char *destination, const char *source, size_t len) | ~~~~~~~^~~ string/string.c: In function 'strcmp': string/string.c:33:24: warning: unused parameter 'str1' [-Wunused-parameter] 33 | int strcmp(const char *str1, const char *str2) | ~~~~~~~~~~~~^~~~ string/string.c:33:42: warning: unused parameter 'str2' [-Wunused-parameter] 33 | int strcmp(const char *str1, const char *str2) | ~~~~~~~~~~~~^~~~ string/string.c: In function 'strncmp': string/string.c:39:25: warning: unused parameter 'str1' [-Wunused-parameter] 39 | int strncmp(const char *str1, const char *str2, size_t len) | ~~~~~~~~~~~~^~~~ string/string.c:39:43: warning: unused parameter 'str2' [-Wunused-parameter] 39 | int strncmp(const char *str1, const char *str2, size_t len) | ~~~~~~~~~~~~^~~~ string/string.c:39:56: warning: unused parameter 'len' [-Wunused-parameter] 39 | int strncmp(const char *str1, const char *str2, size_t len) | ~~~~~~~^~~ string/string.c: In function 'strchr': string/string.c:55:26: warning: unused parameter 'str' [-Wunused-parameter] 55 | char *strchr(const char *str, int c) | ~~~~~~~~~~~~^~~ string/string.c:55:35: warning: unused parameter 'c' [-Wunused-parameter] 55 | char *strchr(const char *str, int c) | ~~~~^ string/string.c: In function 'strrchr': string/string.c:62:27: warning: unused parameter 'str' [-Wunused-parameter] 62 | char *strrchr(const char *str, int c) | ~~~~~~~~~~~~^~~ string/string.c:62:36: warning: unused parameter 'c' [-Wunused-parameter] 62 | char *strrchr(const char *str, int c) | ~~~~^ string/string.c: In function 'strstr': string/string.c:69:26: warning: unused parameter 'str1' [-Wunused-parameter] 69 | char *strstr(const char *str1, const char *str2) | ~~~~~~~~~~~~^~~~ string/string.c:69:44: warning: unused parameter 'str2' [-Wunused-parameter] 69 | char *strstr(const char *str1, const char *str2) | ~~~~~~~~~~~~^~~~ string/string.c: In function 'strrstr': string/string.c:75:27: warning: unused parameter 'str1' [-Wunused-parameter] 75 | char *strrstr(const char *str1, const char *str2) | ~~~~~~~~~~~~^~~~ string/string.c:75:45: warning: unused parameter 'str2' [-Wunused-parameter] 75 | char *strrstr(const char *str1, const char *str2) | ~~~~~~~~~~~~^~~~ string/string.c: In function 'memcpy': string/string.c:81:45: warning: unused parameter 'source' [-Wunused-parameter] 81 | void *memcpy(void *destination, const void *source, size_t num) | ~~~~~~~~~~~~^~~~~~ string/string.c:81:60: warning: unused parameter 'num' [-Wunused-parameter] 81 | void *memcpy(void *destination, const void *source, size_t num) | ~~~~~~~^~~ string/string.c: In function 'memmove': string/string.c:88:46: warning: unused parameter 'source' [-Wunused-parameter] 88 | void *memmove(void *destination, const void *source, size_t num) | ~~~~~~~~~~~~^~~~~~ string/string.c:88:61: warning: unused parameter 'num' [-Wunused-parameter] 88 | void *memmove(void *destination, const void *source, size_t num) | ~~~~~~~^~~ string/string.c: In function 'memcmp': string/string.c:95:24: warning: unused parameter 'ptr1' [-Wunused-parameter] 95 | int memcmp(const void *ptr1, const void *ptr2, size_t num) | ~~~~~~~~~~~~^~~~ string/string.c:95:42: warning: unused parameter 'ptr2' [-Wunused-parameter] 95 | int memcmp(const void *ptr1, const void *ptr2, size_t num) | ~~~~~~~~~~~~^~~~ string/string.c:95:55: warning: unused parameter 'num' [-Wunused-parameter] 95 | int memcmp(const void *ptr1, const void *ptr2, size_t num) | ~~~~~~~^~~ string/string.c: In function 'memset': string/string.c:101:32: warning: unused parameter 'value' [-Wunused-parameter] 101 | void *memset(void *source, int value, size_t num) | ~~~~^~~~~ string/string.c:101:46: warning: unused parameter 'num' [-Wunused-parameter] 101 | void *memset(void *source, int value, size_t num) | ~~~~~~~^~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o stat/fstatat.o stat/fstatat.c stat/fstatat.c: In function 'fstatat_statx': stat/fstatat.c:43:23: warning: unused parameter 'fd' [-Wunused-parameter] 43 | int fstatat_statx(int fd, const char *restrict path, struct stat *restrict st, int flag) | ~~~~^~ stat/fstatat.c:43:48: warning: unused parameter 'path' [-Wunused-parameter] 43 | int fstatat_statx(int fd, const char *restrict path, struct stat *restrict st, int flag) | ~~~~~~~~~~~~~~~~~~~~~^~~~ stat/fstatat.c:43:76: warning: unused parameter 'st' [-Wunused-parameter] 43 | int fstatat_statx(int fd, const char *restrict path, struct stat *restrict st, int flag) | ~~~~~~~~~~~~~~~~~~~~~~^~ stat/fstatat.c:43:84: warning: unused parameter 'flag' [-Wunused-parameter] 43 | int fstatat_statx(int fd, const char *restrict path, struct stat *restrict st, int flag) | ~~~~^~~~ stat/fstatat.c: In function 'fstatat': stat/fstatat.c:49:17: warning: unused parameter 'fd' [-Wunused-parameter] 49 | int fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag) | ~~~~^~ stat/fstatat.c:49:42: warning: unused parameter 'path' [-Wunused-parameter] 49 | int fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag) | ~~~~~~~~~~~~~~~~~~~~~^~~~ stat/fstatat.c:49:70: warning: unused parameter 'st' [-Wunused-parameter] 49 | int fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag) | ~~~~~~~~~~~~~~~~~~~~~~^~ stat/fstatat.c:49:78: warning: unused parameter 'flag' [-Wunused-parameter] 49 | int fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag) | ~~~~^~~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o stat/fstat.o stat/fstat.c stat/fstat.c: In function 'fstat': stat/fstat.c:6:15: warning: unused parameter 'fd' [-Wunused-parameter] 6 | int fstat(int fd, struct stat *st) | ~~~~^~ stat/fstat.c:6:32: warning: unused parameter 'st' [-Wunused-parameter] 6 | int fstat(int fd, struct stat *st) | ~~~~~~~~~~~~~^~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o stat/stat.o stat/stat.c stat/stat.c: In function 'stat': stat/stat.c:7:31: warning: unused parameter 'path' [-Wunused-parameter] 7 | int stat(const char *restrict path, struct stat *restrict buf) | ~~~~~~~~~~~~~~~~~~~~~^~~~ stat/stat.c:7:59: warning: unused parameter 'buf' [-Wunused-parameter] 7 | int stat(const char *restrict path, struct stat *restrict buf) | ~~~~~~~~~~~~~~~~~~~~~~^~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o io/open.o io/open.c io/open.c: In function 'open': io/open.c:8:22: warning: unused parameter 'filename' [-Wunused-parameter] 8 | int open(const char *filename, int flags, ...) | ~~~~~~~~~~~~^~~~~~~~ io/open.c:8:36: warning: unused parameter 'flags' [-Wunused-parameter] 8 | int open(const char *filename, int flags, ...) | ~~~~^~~~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o io/close.o io/close.c io/close.c: In function 'close': io/close.c:8:15: warning: unused parameter 'fd' [-Wunused-parameter] 8 | int close(int fd) | ~~~~^~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o io/read_write.o io/read_write.c cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o io/lseek.o io/lseek.c io/lseek.c: In function 'lseek': io/lseek.c:7:17: warning: unused parameter 'fd' [-Wunused-parameter] 7 | off_t lseek(int fd, off_t offset, int whence) | ~~~~^~ io/lseek.c:7:27: warning: unused parameter 'offset' [-Wunused-parameter] 7 | off_t lseek(int fd, off_t offset, int whence) | ~~~~~~^~~~~~ io/lseek.c:7:39: warning: unused parameter 'whence' [-Wunused-parameter] 7 | off_t lseek(int fd, off_t offset, int whence) | ~~~~^~~~~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o io/truncate.o io/truncate.c io/truncate.c: In function 'truncate': io/truncate.c:7:26: warning: unused parameter 'path' [-Wunused-parameter] 7 | int truncate(const char *path, off_t length) | ~~~~~~~~~~~~^~~~ io/truncate.c:7:38: warning: unused parameter 'length' [-Wunused-parameter] 7 | int truncate(const char *path, off_t length) | ~~~~~~^~~~~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o io/ftruncate.o io/ftruncate.c io/ftruncate.c: In function 'ftruncate': io/ftruncate.c:7:19: warning: unused parameter 'fd' [-Wunused-parameter] 7 | int ftruncate(int fd, off_t length) | ~~~~^~ io/ftruncate.c:7:29: warning: unused parameter 'length' [-Wunused-parameter] 7 | int ftruncate(int fd, off_t length) | ~~~~~~^~~~~~ cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o errno.o errno.c cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o crt/__libc_start_main.o crt/__libc_start_main.c nasm -f elf64 -o crt/start.o crt/start.asm ar -rc libc.a syscall.o process/exit.o mm/malloc.o mm/mmap.o mm/mem_list.o string/string.o stat/fstatat.o stat/fstat.o stat/stat.o io/open.o io/close.o io/read_write.o io/lseek.o io/truncate.o io/ftruncate.o errno.o crt/__libc_start_main.o crt/start.o ar: syscall.o: No such file or directory make[1]: [Makefile:24: libc.a] Error 1 (ignored) make[1]: Leaving directory '/home/student/operating-systems/assignments/mini-libc/libc' make -C io LIBC_PATH=../../libc make[1]: Entering directory '/home/student/operating-systems/assignments/mini-libc/tests/io' cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o stat.o stat.c make -C ../../libc make[2]: Entering directory '/home/student/operating-systems/assignments/mini-libc/libc' cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o syscall.o syscall.c In file included from syscall.c:3: include/internal/arch/x86_64/syscall_arch.h: In function '__syscall': include/internal/arch/x86_64/syscall_arch.h:24:2: error: unknown register name 'rcx' in 'asm' 24 | __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2), | ^~~~~~~ include/internal/arch/x86_64/syscall_arch.h:24:2: warning: asm operand 3 probably doesn't match constraints make[2]: [<builtin>: syscall.o] Error 1 (ignored) ar -rc libc.a syscall.o process/exit.o mm/malloc.o mm/mmap.o mm/mem_list.o string/string.o stat/fstatat.o stat/fstat.o stat/stat.o io/open.o io/close.o io/read_write.o io/lseek.o io/truncate.o io/ftruncate.o errno.o crt/__libc_start_main.o crt/start.o ar: syscall.o: No such file or directory make[2]: [Makefile:24: libc.a] Error 1 (ignored) make[2]: Leaving directory '/home/student/operating-systems/assignments/mini-libc/libc' cc -nostdlib -no-pie -L../../libc -o stat stat.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: stat] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o open_close_create_file.o open_close_create_file.c cc -nostdlib -no-pie -L../../libc -o open_close_create_file open_close_create_file.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: open_close_create_file] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o puts.o puts.c puts.c: In function 'main': puts.c:7:2: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 7 | puts("Hello, World!"); | ^~~~ cc -nostdlib -no-pie -L../../libc -o puts puts.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: puts] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o open_invalid_access.o open_invalid_access.c cc -nostdlib -no-pie -L../../libc -o open_invalid_access open_invalid_access.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: open_invalid_access] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o open_non_existent_file.o open_non_existent_file.c cc -nostdlib -no-pie -L../../libc -o open_non_existent_file open_non_existent_file.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: open_non_existent_file] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o open_close_read_byte.o open_close_read_byte.c cc -nostdlib -no-pie -L../../libc -o open_close_read_byte open_close_read_byte.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: open_close_read_byte] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o lseek.o lseek.c cc -nostdlib -no-pie -L../../libc -o lseek lseek.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: lseek] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o fstat.o fstat.c cc -nostdlib -no-pie -L../../libc -o fstat fstat.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: fstat] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o truncate.o truncate.c cc -nostdlib -no-pie -L../../libc -o truncate truncate.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: truncate] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o open_close_existent_file.o open_close_existent_file.c cc -nostdlib -no-pie -L../../libc -o open_close_existent_file open_close_existent_file.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: open_close_existent_file] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o ftruncate.o ftruncate.c cc -nostdlib -no-pie -L../../libc -o ftruncate ftruncate.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: ftruncate] Error 1 (ignored) make[1]: Leaving directory '/home/student/operating-systems/assignments/mini-libc/tests/io' make -C memory LIBC_PATH=../../libc make[1]: Entering directory '/home/student/operating-systems/assignments/mini-libc/tests/memory' cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o multiple_malloc.o multiple_malloc.c make -C ../../libc make[2]: Entering directory '/home/student/operating-systems/assignments/mini-libc/libc' cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o syscall.o syscall.c In file included from syscall.c:3: include/internal/arch/x86_64/syscall_arch.h: In function '__syscall': include/internal/arch/x86_64/syscall_arch.h:24:2: error: unknown register name 'rcx' in 'asm' 24 | __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2), | ^~~~~~~ include/internal/arch/x86_64/syscall_arch.h:24:2: warning: asm operand 3 probably doesn't match constraints make[2]: [<builtin>: syscall.o] Error 1 (ignored) ar -rc libc.a syscall.o process/exit.o mm/malloc.o mm/mmap.o mm/mem_list.o string/string.o stat/fstatat.o stat/fstat.o stat/stat.o io/open.o io/close.o io/read_write.o io/lseek.o io/truncate.o io/ftruncate.o errno.o crt/__libc_start_main.o crt/start.o ar: syscall.o: No such file or directory make[2]: [Makefile:24: libc.a] Error 1 (ignored) make[2]: Leaving directory '/home/student/operating-systems/assignments/mini-libc/libc' cc -nostdlib -no-pie -L../../libc -o multiple_malloc multiple_malloc.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: multiple_malloc] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o mmap_munmap.o mmap_munmap.c cc -nostdlib -no-pie -L../../libc -o mmap_munmap mmap_munmap.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: mmap_munmap] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o malloc_free.o malloc_free.c cc -nostdlib -no-pie -L../../libc -o malloc_free malloc_free.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: malloc_free] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o mmap_perm_none.o mmap_perm_none.c mmap_perm_none.c: In function 'main': mmap_perm_none.c:13:7: warning: variable 'value' set but not used [-Wunused-but-set-variable] 13 | char value; | ^~~~~ cc -nostdlib -no-pie -L../../libc -o mmap_perm_none mmap_perm_none.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: mmap_perm_none] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o mmap_perm_notok.o mmap_perm_notok.c cc -nostdlib -no-pie -L../../libc -o mmap_perm_notok mmap_perm_notok.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: mmap_perm_notok] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o multiple_malloc_free.o multiple_malloc_free.c cc -nostdlib -no-pie -L../../libc -o multiple_malloc_free multiple_malloc_free.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: multiple_malloc_free] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o malloc.o malloc.c cc -nostdlib -no-pie -L../../libc -o malloc malloc.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: malloc] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o malloc_perm_ok.o malloc_perm_ok.c cc -nostdlib -no-pie -L../../libc -o malloc_perm_ok malloc_perm_ok.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: malloc_perm_ok] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o malloc_free_sequence.o malloc_free_sequence.c cc -nostdlib -no-pie -L../../libc -o malloc_free_sequence malloc_free_sequence.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: malloc_free_sequence] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o mmap.o mmap.c cc -nostdlib -no-pie -L../../libc -o mmap mmap.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: mmap] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o malloc_perm_notok.o malloc_perm_notok.c cc -nostdlib -no-pie -L../../libc -o malloc_perm_notok malloc_perm_notok.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: malloc_perm_notok] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o mmap_perm_ok.o mmap_perm_ok.c cc -nostdlib -no-pie -L../../libc -o mmap_perm_ok mmap_perm_ok.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: mmap_perm_ok] Error 1 (ignored) make[1]: Leaving directory '/home/student/operating-systems/assignments/mini-libc/tests/memory' make -C process LIBC_PATH=../../libc make[1]: Entering directory '/home/student/operating-systems/assignments/mini-libc/tests/process' cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o sleep.o sleep.c make -C ../../libc make[2]: Entering directory '/home/student/operating-systems/assignments/mini-libc/libc' cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -Iinclude -c -o syscall.o syscall.c In file included from syscall.c:3: include/internal/arch/x86_64/syscall_arch.h: In function '__syscall': include/internal/arch/x86_64/syscall_arch.h:24:2: error: unknown register name 'rcx' in 'asm' 24 | __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2), | ^~~~~~~ include/internal/arch/x86_64/syscall_arch.h:24:2: warning: asm operand 3 probably doesn't match constraints make[2]: [<builtin>: syscall.o] Error 1 (ignored) ar -rc libc.a syscall.o process/exit.o mm/malloc.o mm/mmap.o mm/mem_list.o string/string.o stat/fstatat.o stat/fstat.o stat/stat.o io/open.o io/close.o io/read_write.o io/lseek.o io/truncate.o io/ftruncate.o errno.o crt/__libc_start_main.o crt/start.o ar: syscall.o: No such file or directory make[2]: [Makefile:24: libc.a] Error 1 (ignored) make[2]: Leaving directory '/home/student/operating-systems/assignments/mini-libc/libc' cc -nostdlib -no-pie -L../../libc -o sleep sleep.o -lc /usr/bin/ld: ../../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make[1]: [Makefile:17: sleep] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../../libc/include -c -o nanosleep.o nanosleep.c nanosleep.c:3:10: fatal error: time.h: No such file or directory 3 | #include <time.h> | ^~~~~~~~ compilation terminated. make[1]: [<builtin>: nanosleep.o] Error 1 (ignored) cc -nostdlib -no-pie -L../../libc -o nanosleep nanosleep.o -lc cc: error: nanosleep.o: No such file or directory make[1]: [Makefile:17: nanosleep] Error 1 (ignored) make[1]: Leaving directory '/home/student/operating-systems/assignments/mini-libc/tests/process' cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../libc/include -c -o test_io.o test_io.c cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../libc/include -c -o graded_test.o graded_test.c cc -nostdlib -no-pie -L../libc -o test_io test_io.o graded_test.o -lc /usr/bin/ld: ../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make: [Makefile:17: test_io] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../libc/include -c -o test_string.o test_string.c cc -nostdlib -no-pie -L../libc -o test_string test_string.o graded_test.o -lc /usr/bin/ld: ../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make: [Makefile:17: test_string] Error 1 (ignored) cc -Wall -Wextra -fno-PIC -fno-stack-protector -fno-builtin -nostdinc -I. -I../libc/include -c -o test_memory.o test_memory.c cc -nostdlib -no-pie -L../libc -o test_memory test_memory.o graded_test.o -lc /usr/bin/ld: ../libc/libc.a: error adding symbols: archive has no index; run ranlib to add one collect2: error: ld returned 1 exit status make: [Makefile:17: test_memory] Error 1 (ignored)
This was my output when running
./run_all_tests.sh
:`./run_all_tests.sh: line 6: ./test_string: No such file or directory
./run_all_tests.sh: line 9: ./test_io: No such file or directory
No such file ./io/puts
test_puts ........................ failed ... 0
No such file ./io/open_close_create_file
test_open_close_create_file ........................ failed ... 0
No such file ./io/open_close_read_byte
test_open_close_read_byte ........................ failed ... 0
No such file ./io/ftruncate
test_ftruncate ........................ failed ... 0
No such file ./io/truncate
test_truncate ........................ failed ... 0
No such file ./io/fstat
test_fstat ........................ failed ... 0
No such file ./io/stat
test_stat ........................ failed ... 0
No such file ./process/sleep
test_sleep ........................ failed ... 0
No such file ./process/nanosleep
test_nanosleep ........................ failed ... 0
./run_all_tests.sh: line 22: ./test_memory: No such file or directory
No such file ./memory/malloc
test_malloc ........................ failed ... 0
No such file ./memory/multiple_malloc
test_multiple_malloc ........................ failed ... 0
No such file ./memory/malloc_free
test_malloc_free ........................ failed ... 0
No such file ./memory/multiple_malloc_free
test_multiple_malloc_free ........................ failed ... 0
No such file ./memory/malloc_free_sequence
test_malloc_free_sequence ........................ failed ... 0
No such file ./memory/malloc_perm_ok
test_malloc_perm_ok ........................ failed ... 0
test_malloc_perm_notok ........................ failed ... 0
No such file ./memory/mmap
test_mmap ........................ failed ... 0
No such file ./memory/mmap_munmap
test_mmap_munmap ........................ failed ... 0
No such file ./memory/mmap_perm_ok
test_mmap_perm_ok ........................ failed ... 0
test_mmap_perm_notok ........................ failed ... 0
test_mmap_perm_none ........................ failed ... 0
./run_all_tests.sh: line 37: bc: command not found
./run_all_tests.sh: line 38: bc: command not found
Grade .................................. 0.00`
The text was updated successfully, but these errors were encountered: