From 446396da4c23344fa6f8c044c9f30574197f0ca8 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 16 Aug 2021 00:25:41 +0200 Subject: [PATCH] Remove soft float accidentally turned on. --- resources/testproject/project.toml | 1 - src/compiler/target.c | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/testproject/project.toml b/resources/testproject/project.toml index a5707da23..f557f4ebb 100644 --- a/resources/testproject/project.toml +++ b/resources/testproject/project.toml @@ -8,4 +8,3 @@ warnings = ["no-unused"] sources = ["./**"] # libraries to use libs = [] -soft-float = true diff --git a/src/compiler/target.c b/src/compiler/target.c index 19254b42a..ec6116d74 100644 --- a/src/compiler/target.c +++ b/src/compiler/target.c @@ -389,7 +389,7 @@ static inline void target_setup_x64_abi(BuildTarget *target) if (target->feature.no_avx) platform_target.x64.avx_level = AVX_NONE; if (target->feature.no_mmx) platform_target.x64.no_mmx = true; if (target->feature.no_sse) platform_target.x64.no_sse = true; - if (target->feature.soft_float) platform_target.x64.soft_float = true; + if (target->feature.soft_float == SOFT_FLOAT_YES) platform_target.x64.soft_float = true; if (platform_target.environment_type == ENV_TYPE_GNU) { platform_target.x64.is_mingw64 = platform_target.x64.is_win64; @@ -1122,8 +1122,11 @@ void *llvm_target_machine_create(void) if (platform_target.x64.soft_float) scratch_buffer_append("+soft-float,"); if (platform_target.x64.no_mmx) scratch_buffer_append("-mmx,"); } + char *features = scratch_buffer_to_string(); + size_t len = strlen(features); + if (len > 0) features[len - 1] = 0; void *result = LLVMCreateTargetMachine(target, platform_target.target_triple, - platform_target.cpu ?: "", strdup(scratch_buffer_to_string()), + platform_target.cpu ?: "", features, (LLVMCodeGenOptLevel)platform_target.llvm_opt_level, reloc_mode, LLVMCodeModelDefault); if (!result) error_exit("Failed to create target machine."); @@ -1314,7 +1317,6 @@ void target_setup(BuildTarget *target) break; case ARCH_TYPE_X86_64: target_setup_x64_abi(target); - platform_target.x64.avx_level = 0; /* TODO */ if (platform_target.os == OS_TYPE_WIN32) { platform_target.abi = ABI_WIN64;