Skip to content

Commit

Permalink
[Driver][LLD] Turn off use of default page alignment.
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarMaheshwari99 committed Dec 12, 2024
1 parent ef131e8 commit e026793
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/lib/Driver/ToolChains/AIE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ void aie::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const ToolChain &ToolChain = getToolChain();
std::string Linker = ToolChain.GetProgramPath(getShortName());
ArgStringList CmdArgs;
// We should not use the default page alignment.
CmdArgs.push_back(Args.MakeArgString("--nmagic"));
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
// CmdArgs.push_back("-shared");
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Driver/aie2/aie2-toolchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,15 @@
// RUN: %clang %s -### --target=aie2-none-unknown-elf -ccc-install-dir %S/../Inputs/basic_aie_tree/bin 2>&1 \
// RUN: | FileCheck -check-prefix=C-INCLUDES %s
// C-INCLUDES: "-internal-externc-isystem" "{{.*}}include{{/|\\\\}}aie2-none-unknown-elf"

// Verify we are not using default page alignment.
// RUN: %clang %s -### --target=aie2-none-unknown-elf -ccc-install-dir %S/../Inputs/basic_aie_tree/bin 2>&1 \
// RUN: | FileCheck -check-prefix=NMAGIC %s
// NMAGIC: "{{[^"]*}}ld.lld{{[^"]*}}"
// NMAGIC-SAME: "--nmagic"

// Verify we can override "not using" the default page alignment.
// RUN: %clang %s -### --target=aie2-none-unknown-elf -Wl,--no-nmagic -ccc-install-dir %S/../Inputs/basic_aie_tree/bin 2>&1 \
// RUN: | FileCheck -check-prefix=NONMAGIC %s
// NONMAGIC: "{{[^"]*}}ld.lld{{[^"]*}}"
// NONMAGIC-SAME: "--nmagic{{.*}}--no-nmagic"

0 comments on commit e026793

Please sign in to comment.