[llvm] [clang] [AIX][TLS] Disallow the use of -maix-small-local-exec-tls and -fno-data-sections (PR #79252)
Amy Kwan via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 26 07:17:46 PST 2024
================
@@ -124,10 +124,23 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef TuneCPU,
// Determine endianness.
IsLittleEndian = TM.isLittleEndian();
- if (HasAIXSmallLocalExecTLS && (!TargetTriple.isOSAIX() || !IsPPC64))
- report_fatal_error(
- "The aix-small-local-exec-tls attribute is only supported on AIX in "
- "64-bit mode.\n", false);
+ if (HasAIXSmallLocalExecTLS) {
+ if (!TargetTriple.isOSAIX() || !IsPPC64)
+ report_fatal_error(
+ "The aix-small-local-exec-tls attribute is only supported on AIX in "
+ "64-bit mode.\n",
+ false);
+ // The aix-small-local-exec-tls attribute should only be used with
+ // -data-sections, as having data sections turned off with this option
+ // is not ideal for performance. Moreover, the small-local-exec-tls region
+ // is a limited resource, and should not be used for variables that may
+ // be replaced.
+ if (!TM.getDataSections())
+ report_fatal_error(
+ "The aix-small-local-exec-tls attribute can only be specified with "
+ "-data-sections.\n",
----------------
amy-kwan wrote:
I kept the llvm portion as `-data-sections` since the option for llc is `-data-sections` rather than `-fdata-sections` (which is the option for clang).
https://github.com/llvm/llvm-project/pull/79252
More information about the cfe-commits
mailing list