userspace: Allow building without SSE
I had added changes that had broken compilation without sse support
This commit is contained in:
@@ -43,4 +43,9 @@ foreach(project ${USERSPACE_PROGRAMS})
|
||||
target_link_options(${project} PRIVATE -nolibc)
|
||||
# Default compile options
|
||||
target_compile_options(${project} PRIVATE -g -O2)
|
||||
|
||||
target_compile_definitions(${project} PRIVATE __enable_sse=${BANAN_ENABLE_SSE})
|
||||
if (NOT BANAN_ENABLE_SSE)
|
||||
target_compile_options(${project} PRIVATE -mno-sse -mno-sse2)
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
@@ -499,6 +499,7 @@ BAN::Optional<int> execute_builtin(BAN::Vector<BAN::String>& args, int fd_in, in
|
||||
TEST("ffffffffffffffff", 16);
|
||||
TEST("10000000000000000", 16);
|
||||
#undef TEST
|
||||
#if __enable_sse
|
||||
#define TEST(num) do { errno = 0; printf("strtod(\"" num "\", nullptr) = %e ", strtod(num, nullptr)); puts(errno ? strerrorname_np(errno) : ""); } while (false)
|
||||
TEST("0");
|
||||
TEST(".1");
|
||||
@@ -531,6 +532,7 @@ BAN::Optional<int> execute_builtin(BAN::Vector<BAN::String>& args, int fd_in, in
|
||||
TEST("-inf");
|
||||
TEST("nan");
|
||||
#undef TEST
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user