-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ AIE2 ] Driver update for Startup Objects #52
[ AIE2 ] Driver update for Startup Objects #52
Conversation
clang/lib/Driver/ToolChains/AIE.cpp
Outdated
@@ -37,6 +37,15 @@ void aie::Linker::ConstructJob(Compilation &C, const JobAction &JA, | |||
!Args.hasArg(options::OPT_nodefaultlibs)) { | |||
AddRunTimeLibs(ToolChain, ToolChain.getDriver(), CmdArgs, Args); | |||
} | |||
SmallString<128> InstalledDir(ToolChain.getDriver().InstalledDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires the startup files to be installed right next to the clang driver, which is not the case.
We should create the following installation dir: test/Driver/Inputs/basic_aie_tree
.
In there, create the following structure:
basic_aie_tree/
├── bin
│ └── .keep
└── lib
└── aie2-none-unknown-elf
├── crt0.o
└── crt1.o
The tests can then point -ccc-install-dir
to the bin
directory.
The clang driver knows how to navigate this installation directory, hence you can simply call
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
options::OPT_r)) {
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crt0.o")));
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crt1.o")));
}
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// RUN: %clang %s -### --target=aie2-none-unknown-elf -D__AIE_ENGINE__ -ccc-install-dir /scratch/llvm-aie/clang/test/Driver/Inputs/aie2 2>&1 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot hardcode this path, this will fail on any other system.
Replace with
-ccc-install-dir %S/Inputs/basic_aie_tree/bin
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// RUN: %clang %s -### --target=aie2-none-unknown-elf -ccc-install-dir %S/Inputs/basic_aie_tree/bin 2>&1 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// RUN: %clang %s -### --target=aie2-none-unknown-elf -ccc-install-dir %S/Inputs/basic_aie_tree/bin 2>&1 \ | |
// RUN: %clang %s -### --target=aie2-none-unknown-elf -ccc-install-dir %S/../Inputs/basic_aie_tree/bin 2>&1 \ |
-ccc-install-dir
).