From: jca Date: Fri, 16 Dec 2022 12:06:23 +0000 (+0000) Subject: Downgrade riscv64-specific LTO error to a warning X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=21998d4690adc3ff45ab3a5d54ead3976b1c962e;p=openbsd Downgrade riscv64-specific LTO error to a warning Error happens when mixing some PIC and non-PIC code in an LTO build/link ld: error: linking module flags 'SmallDataLimit': IDs have conflicting values in '.o' and 'ld-temp.o' and affects a few ports now. Issue reported upstream where the proposed fix uses llvm::Module::Min, which we don't have and would require a backport. For now, work around this issue by downgrading to a warning, which should have the intended effect in most cases (use the value of the first module, which is smaller than the defaults value used by ld-temp.o). ok kettenis@ --- diff --git a/gnu/llvm/clang/lib/CodeGen/CodeGenModule.cpp b/gnu/llvm/clang/lib/CodeGen/CodeGenModule.cpp index 49a1396b58e..22a7edcf675 100644 --- a/gnu/llvm/clang/lib/CodeGen/CodeGenModule.cpp +++ b/gnu/llvm/clang/lib/CodeGen/CodeGenModule.cpp @@ -846,7 +846,7 @@ void CodeGenModule::EmitBackendOptionsMetadata( break; case llvm::Triple::riscv32: case llvm::Triple::riscv64: - getModule().addModuleFlag(llvm::Module::Error, "SmallDataLimit", + getModule().addModuleFlag(llvm::Module::Warning, "SmallDataLimit", CodeGenOpts.SmallDataLimit); break; }