mirror of
https://github.com/intel/llvm.git
synced 2026-02-06 23:31:50 +08:00
This reverts commit 7832769d32.
This was reverted prior due to a test failure on the windows builder. I
think this was because we didn't specify the triple and assumed windows.
The other tests use the full triple specifying linux, so we follow suite
here.
---
We are using PLTs for cortex-m33 which only supports thumb. More
specifically, this is for a very restricted use case. There's no MMU so
there's no sharing of virtual addresses between two processes, but this
is fine. The MCU is used for running [chre
nanoapps](https://android.googlesource.com/platform/system/chre/+/HEAD/doc/nanoapp_overview.md)
for android. Each nanoapp is a shared library (but effectively acts as
an executable containing a test suite) that is loaded and run on the MCU
one binary at a time and there's only one process running at a time, so
we ensure that the same text segment cannot be shared by two different
running executables. GNU LD supports thumb PLTs but we want to migrate
to a clang toolchain and use LLD, so thumb PLTs are needed.
This commit is contained in:
@@ -194,6 +194,18 @@ static void updateSupportedARMFeatures(const ARMAttributeParser &attributes) {
|
||||
if (arch >= ARMBuildAttrs::CPUArch::v8_M_Base &&
|
||||
profile == ARMBuildAttrs::MicroControllerProfile)
|
||||
config->armCMSESupport = true;
|
||||
|
||||
// The thumb PLT entries require Thumb2 which can be used on multiple archs.
|
||||
// For now, let's limit it to ones where ARM isn't available and we know have
|
||||
// Thumb2.
|
||||
std::optional<unsigned> armISA =
|
||||
attributes.getAttributeValue(ARMBuildAttrs::ARM_ISA_use);
|
||||
std::optional<unsigned> thumb =
|
||||
attributes.getAttributeValue(ARMBuildAttrs::THUMB_ISA_use);
|
||||
bool noArmISA = !armISA || *armISA == ARMBuildAttrs::Not_Allowed;
|
||||
bool hasThumb2 = thumb && *thumb >= ARMBuildAttrs::AllowThumb32;
|
||||
if (noArmISA && hasThumb2)
|
||||
config->armThumbPLTs = true;
|
||||
}
|
||||
|
||||
InputFile::InputFile(Kind k, MemoryBufferRef m)
|
||||
|
||||
Reference in New Issue
Block a user