diff --git a/CMakeLists.txt b/CMakeLists.txt index a09b683..9062e7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,7 +96,7 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-flto") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_CFLAGS_HARDWARE} ${TARGET_CFLAGS_EXTRA} -Wall -fdata-sections -ffunction-sections") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_CFLAGS_HARDWARE} ${TARGET_CXXFLAGS_EXTRA} -Wall -fdata-sections -ffunction-sections") set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_C_FLAGS} -x assembler-with-cpp") -set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -lc -lm -lnosys -nostartfiles ${TARGET_LDFLAGS_EXTRA}") +set(CMAKE_EXE_LINKER_FLAGS "-specs=nano.specs -specs=nosys.specs -Wl,--gc-sections -nostartfiles -nostdlib ${TARGET_LDFLAGS_EXTRA}") # Include sub directories here @@ -104,7 +104,12 @@ set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -lc -lm -lnosys -nostartfiles ${TA add_compile_definitions(${TARGET_C_DEFINES}) include_directories(${TARGET_C_INCLUDES}) link_directories(${TARGET_LIB_DIRECTORIES}) -link_libraries(${TARGET_LIBS}) +link_libraries( + ${TARGET_LIBS} + "c" + "m" + "nosys" +) # Main targets are added here diff --git a/src/syscalls.c b/src/syscalls.c index 977632e..21a0fdc 100644 --- a/src/syscalls.c +++ b/src/syscalls.c @@ -4,4 +4,16 @@ int _fstat(int file, struct stat *st) { st->st_mode = S_IFCHR; return 0; -} \ No newline at end of file +} + +int _close(int file) { + return -1; +} + +int _isatty(int file) { + return -1; +} + +off_t _lseek(int file, off_t pos, int whence) { + return -1; +}