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 '<REDACTED>.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@
break;
case llvm::Triple::riscv32:
case llvm::Triple::riscv64:
- getModule().addModuleFlag(llvm::Module::Error, "SmallDataLimit",
+ getModule().addModuleFlag(llvm::Module::Warning, "SmallDataLimit",
CodeGenOpts.SmallDataLimit);
break;
}