Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
added back sse stuff for building the libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
larryk85 committed Feb 5, 2019
1 parent 0061fbb commit bf25aae
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions libraries/libc++/CMakeLists.txt
Expand Up @@ -35,6 +35,8 @@ target_include_directories(native_c++
target_link_libraries(c++ c) target_link_libraries(c++ c)
target_link_libraries(native_c++ native_c) target_link_libraries(native_c++ native_c)


target_compile_options(native_c++ PUBLIC -allow-sse)

add_custom_command( TARGET c++ POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:c++> ${BASE_BINARY_DIR}/lib ) add_custom_command( TARGET c++ POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:c++> ${BASE_BINARY_DIR}/lib )


add_custom_command( TARGET native_c++ POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:native_c++> ${BASE_BINARY_DIR}/lib ) add_custom_command( TARGET native_c++ POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:native_c++> ${BASE_BINARY_DIR}/lib )
Expand Down
2 changes: 1 addition & 1 deletion libraries/libc/CMakeLists.txt
Expand Up @@ -16,7 +16,7 @@ file(GLOB THREAD_SOURCES "musl/src/thread/*.c") #only for __lock __unlock


set(INTERNAL_SOURCES musl/src/internal/floatscan.c musl/src/internal/intscan.c musl/src/internal/shgetc.c musl/src/internal/libc.c) set(INTERNAL_SOURCES musl/src/internal/floatscan.c musl/src/internal/intscan.c musl/src/internal/shgetc.c musl/src/internal/libc.c)


set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-everything") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-everything -allow-sse")


file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/musl/include/*.h" file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/musl/include/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/musl/src/internal/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/musl/src/internal/*.h"
Expand Down
3 changes: 2 additions & 1 deletion libraries/native/CMakeLists.txt
Expand Up @@ -6,7 +6,8 @@ else()
set(CRT_ASM macho_crt.s) set(CRT_ASM macho_crt.s)
endif() endif()


set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-everything") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-everything -allow-sse")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-everything -allow-sse")


file(GLOB HEADERS "*.hpp" file(GLOB HEADERS "*.hpp"
"*.h") "*.h")
Expand Down
3 changes: 2 additions & 1 deletion libraries/rt/CMakeLists.txt
@@ -1,6 +1,7 @@
# Defines builtins library # Defines builtins library
set(C_DEFINES, "-D__wasm__ -DQUAD_PRECISION") set(C_DEFINES, "-D__wasm__ -DQUAD_PRECISION")
set( CMAKE_C_FLAGS " -Wall ${CMAKE_C_FLAGS} ${C_DEFINES}" ) set( CMAKE_C_FLAGS " -Wall ${CMAKE_C_FLAGS} ${C_DEFINES} -allow-sse" )
set( CMAKE_CXX_FLAGS " -Wall ${CMAKE_CXX_FLAGS} ${C_DEFINES} -allow-sse" )
set ( builtins_sources set ( builtins_sources
compiler_builtins.cpp compiler_builtins.cpp
fixtfti.c fixtfti.c
Expand Down
15 changes: 11 additions & 4 deletions tools/include/compiler_options.hpp.in
Expand Up @@ -97,6 +97,11 @@ static cl::opt<bool> fuse_main_opt(
"fuse-main", "fuse-main",
cl::desc("Use main as entry"), cl::desc("Use main as entry"),
cl::cat(LD_CAT)); cl::cat(LD_CAT));
static cl::opt<bool> allow_sse_opt(
"allow-sse",
cl::desc("Should not be used, except for build libc"),
cl::Hidden,
cl::cat(LD_CAT));
/// End of ld options /// End of ld options


#ifndef ONLY_LD #ifndef ONLY_LD
Expand Down Expand Up @@ -345,18 +350,20 @@ static void GetCompDefaults(std::vector<std::string>& copts) {
copts.emplace_back("--target=x86_64-unknown-darwin-macho"); copts.emplace_back("--target=x86_64-unknown-darwin-macho");
copts.emplace_back("-mmacosx-version-min=10.13"); copts.emplace_back("-mmacosx-version-min=10.13");
copts.emplace_back("-fno-stack-protector"); copts.emplace_back("-fno-stack-protector");
copts.emplace_back("-mno-sse");
copts.emplace_back("-m64"); copts.emplace_back("-m64");
#else #else
copts.emplace_back("--target=x86_64-unknown-linux-gnu"); copts.emplace_back("--target=x86_64-unknown-linux-gnu");
copts.emplace_back("-mtune=generic");
copts.emplace_back("-m64"); copts.emplace_back("-m64");
#endif #endif
if (!allow_sse_opt) {
copts.emplace_back("-mno-sse");
copts.emplace_back("-mno-sse2");
copts.emplace_back("-mno-mmx");
copts.emplace_back("-mno-3dnow");
}
if (!fasm_opt) { if (!fasm_opt) {
copts.emplace_back("-msoft-float");
copts.emplace_back("-DEOSIO_NATIVE"); copts.emplace_back("-DEOSIO_NATIVE");
copts.emplace_back("-DLP64"); copts.emplace_back("-DLP64");
copts.emplace_back("-nostdlib");
} }
} }


Expand Down

0 comments on commit bf25aae

Please sign in to comment.