Skip to content

Commit

Permalink
Rollup merge of #133811 - mustartt:change-default-codemodel, r=jieyouxu
Browse files Browse the repository at this point in the history
[AIX] change AIX default codemodel=large

On AIX, for most libraries, we run out of Table of Contents (TOC) offsets very quickly due to the default 16-bit offset limit. We want the large code model should be used as the default to provide more TOC entries so the end user does not have to specify `-Ccode-model=large` for all their packages. This is even more of an issue with ThinLTO as the ThinLTO globals can very quickly use all available TOC entry.

In addition, on AIX, code with different code-model across different compilation units will not cause undefined behavior, so this is safe to do.
  • Loading branch information
matthiaskrgr authored Dec 3, 2024
2 parents 12519a6 + 89b70b9 commit 9a97214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/base/aix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::spec::{Cc, CodeModel, LinkOutputKind, LinkerFlavor, TargetOptions, cr
pub(crate) fn opts() -> TargetOptions {
TargetOptions {
abi: "vec-extabi".into(),
code_model: Some(CodeModel::Small),
code_model: Some(CodeModel::Large),
cpu: "pwr7".into(),
os: "aix".into(),
vendor: "ibm".into(),
Expand Down

0 comments on commit 9a97214

Please sign in to comment.