[clang] [llvm] Enable fexec-charset option (PR #138895)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 6 21:06:25 PST 2026
================
@@ -7612,12 +7565,20 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
<< value;
}
- // -fexec_charset=UTF-8 is default. Reject others
- if (Arg *execCharset = Args.getLastArg(options::OPT_fexec_charset_EQ)) {
- StringRef value = execCharset->getValue();
- if (!value.equals_insensitive("utf-8"))
- D.Diag(diag::err_drv_invalid_value) << execCharset->getAsString(Args)
- << value;
+ if (Arg *ExecEncoding = Args.getLastArg(options::OPT_fexec_charset_EQ)) {
+ StringRef Value = ExecEncoding->getValue();
+ if (llvm::TextEncodingConverter::isEncodingSupported(Value)) {
+ CmdArgs.push_back("-fexec-charset");
+ CmdArgs.push_back(Args.MakeArgString(Value));
+ } else {
+ D.Diag(diag::err_drv_unsupported_encoding_for_target)
----------------
s-barannikov wrote:
Maybe just '%0' is not a supported encoding"? Mentioning target is confusing because it usually refers to the compilation target (e.g. PowerPC).
https://github.com/llvm/llvm-project/pull/138895
More information about the llvm-commits
mailing list