embeddedartistry / libc

libc targeted for embedded systems usage. Reduced set of functionality (due to embedded nature). Chosen for portability and quick bringup.
MIT License
504 stars 67 forks source link

Create M1 Build Variant #162

Closed phillipjohnston closed 9 months ago

phillipjohnston commented 2 years ago

I have received emails from M1 users, and I realize now that I need to get a 64-bit MacOS Darwin variant working and tested. One thing to investigate that is noted is wchar_t type mismatches. Catch2 tests (through printf) also not working - likely need a dependency update (and I need to check against the new version we will switch to)

phillipjohnston commented 2 years ago

printf test compilation errors reported via user:

Compiling C++ object printf_tests.p/subprojects_printf_test_test_suite.cpp.o FAILED: printf_tests.p/subprojects_printf_test_test_suite.cpp.o c++ -Iprintf_tests.p -I. -I.. -Isubprojects/printf/test -I../subprojects/printf/test -I../arch/aarch64/include -I../arch/aarch64/include/_types -fcolor-diagnostics -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -O0 -g -MD -MQ printf_tests.p/subprojects_printf_test_test_suite.cpp.o -MF printf_tests.p/subprojects_printf_test_test_suite.cpp.o.d -o printf_tests.p/subprojects_printf_test_test_suite.cpp.o -c ../subprojects/printf/test/test_suite.cpp In file included from ../subprojects/printf/test/test_suite.cpp:31: ../subprojects/printf/test/catch.hpp:6317:13: error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not? CATCH_BREAK_INTO_DEBUGGER(); ^ ../subprojects/printf/test/catch.hpp:6035:79: note: expanded from macro 'CATCH_BREAK_INTO_DEBUGGER' #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }() ^ ../subprojects/printf/test/catch.hpp:6014:34: note: expanded from macro 'CATCH_TRAP' #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */ ^ :1:2: note: instantiated into assembly here int $3 ^ 1 error generated. ninja: build stopped: subcommand failed. “`
phillipjohnston commented 2 years ago

Unused argument (I mean, I don't even enable this)

clang: warning: argument unused during compilation: '-fstack-clash-protection' 
phillipjohnston commented 2 years ago

Sample wchar_t related type mismatches, it seems all related functions generate warnings due to prototype mismatches.

[152/166] Building C object src/CMakeFiles/c.dir/wchar/iswspace.c.o In file included from /Users/bs/cmake/libc-skeleton/src/wchar/iswspace.c:1: /Users/bs/cmake/libc-skeleton/include/wchar.h:23:10: warning: incompatible redeclaration of library function 'wcschr' [-Wincompatible-library-redeclaration] wchar_t* wcschr(const wchar_t*, wchar_t); ^ /Users/bs/cmake/libc-skeleton/include/wchar.h:23:10: note: 'wcschr' is a builtin with type 'int *(const int *, int)' /Users/bs/cmake/libc-skeleton/include/wchar.h:37:5: warning: incompatible redeclaration of library function 'wcscmp' [-Wincompatible-library-redeclaration] int wcscmp(const wchar_t*, const wchar_t*); ^ /Users/bs/cmake/libc-skeleton/include/wchar.h:37:5: note: 'wcscmp' is a builtin with type 'int (const int *, const int *)'