Skip to content

Commit b5d07b4

Browse files
support aarch64
1 parent 755b5d0 commit b5d07b4

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4389,7 +4389,7 @@ defm partition_static_data_sections: BoolFOption<"partition-static-data-sections
43894389
CodeGenOpts<"PartitionStaticDataSections">, DefaultFalse,
43904390
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
43914391
NegFlag<SetFalse, [], [ClangOption], "Disable">,
4392-
BothFlags<[], [ClangOption], " partition static data sections using profile information (x86 ELF)">>;
4392+
BothFlags<[], [ClangOption], " partition static data sections using profile information (x86 and aarch64 ELF)">>;
43934393

43944394
defm strict_return : BoolFOption<"strict-return",
43954395
CodeGenOpts<"StrictReturn">, DefaultTrue,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6407,7 +6407,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
64076407
if (!A->getOption().matches(
64086408
options::OPT_fno_partition_static_data_sections)) {
64096409
// This codegen pass is only available on x86 and AArch64 ELF targets.
6410-
if (Triple.isX86() && Triple.isOSBinFormatELF())
6410+
if ((Triple.isX86() || Triple.isAArch64()) && Triple.isOSBinFormatELF())
64116411
A->render(Args, CmdArgs);
64126412
else
64136413
D.Diag(diag::err_drv_unsupported_opt_for_target)

clang/test/Driver/fpartition-static-data-sections.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %clang -### --target=x86_64 -fpartition-static-data-sections %s 2>&1 | FileCheck %s --check-prefixes=OPT
2-
// RUN: not %clang -### --target=aarch64 -fpartition-static-data-sections %s 2>&1 | FileCheck %s --check-prefixes=ERR
2+
// RUN: %clang -### --target=aarch64 -fpartition-static-data-sections %s 2>&1 | FileCheck %s --check-prefixes=OPT
3+
4+
// RUN: not %clang -### --target=arm -fpartition-static-data-sections %s 2>&1 | FileCheck %s --check-prefixes=ERR
35

46
// RUN: %clang -### --target=x86_64 -fpartition-static-data-sections -fno-partition-static-data-sections %s 2>&1 | FileCheck %s --implicit-check-not="-fpartition-static-data-sections"
57

clang/test/Driver/test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %clang -### --target=x86_64 -fpartition-static-data-sections %s 2>&1 | FileCheck %s --check-prefixes=OPT
2-
// RUN: not %clang -### --target=aarch64 -fpartition-static-data-sections %s 2>&1 | FileCheck %s --check-prefixes=ERR
2+
// RUN: %clang -### --target=aarch64 -fpartition-static-data-sections %s 2>&1 | FileCheck %s --check-prefixes=OPT
3+
4+
// RUN: not %clang -### --target=arm -fpartition-static-data-sections %s 2>&1 | FileCheck %s --check-prefixes=ERR
35

46
// RUN: %clang -### --target=x86_64 -fpartition-static-data-sections -fno-partition-static-data-sections %s 2>&1 | FileCheck %s --implicit-check-not="-fpartition-static-data-sections"
57

0 commit comments

Comments
 (0)