cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
64 lines
2.1 KiB
C++
64 lines
2.1 KiB
C++
//===- ArmSMEStub.cpp - ArmSME ABI routine stubs --------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/Support/Compiler.h"
|
|
#include <cstdint>
|
|
#include <iostream>
|
|
|
|
#if (defined(_WIN32) || defined(__CYGWIN__))
|
|
#ifndef MLIR_ARMSMEABISTUBS_EXPORTED
|
|
#ifdef mlir_arm_sme_abi_stubs_EXPORTS
|
|
// We are building this library
|
|
#define MLIR_ARMSMEABISTUBS_EXPORTED __declspec(dllexport)
|
|
#else
|
|
// We are using this library
|
|
#define MLIR_ARMSMEABISTUBS_EXPORTED __declspec(dllimport)
|
|
#endif // mlir_arm_sme_abi_stubs_EXPORTS
|
|
#endif // MLIR_ARMSMEABISTUBS_EXPORTED
|
|
#else
|
|
#define MLIR_ARMSMEABISTUBS_EXPORTED \
|
|
__attribute__((visibility("default"))) LLVM_ATTRIBUTE_WEAK
|
|
#endif // (defined(_WIN32) || defined(__CYGWIN__))
|
|
|
|
// The actual implementation of these routines is in:
|
|
// compiler-rt/lib/builtins/aarch64/sme-abi.S. These stubs allow the current
|
|
// ArmSME tests to run without depending on compiler-rt. This works as we don't
|
|
// rely on nested ZA-enabled calls at the moment. The use of these stubs can be
|
|
// overridden by setting the ARM_SME_ABI_ROUTINES_SHLIB CMake cache variable to
|
|
// a path to an alternate implementation.
|
|
|
|
extern "C" {
|
|
|
|
bool MLIR_ARMSMEABISTUBS_EXPORTED __aarch64_sme_accessible() {
|
|
// The ArmSME tests are run within an emulator so we assume SME is available.
|
|
return true;
|
|
}
|
|
|
|
struct sme_state {
|
|
int64_t x0;
|
|
int64_t x1;
|
|
};
|
|
|
|
sme_state MLIR_ARMSMEABISTUBS_EXPORTED __arm_sme_state() {
|
|
std::cerr << "[warning] __arm_sme_state() stubbed!\n";
|
|
return sme_state{};
|
|
}
|
|
|
|
void MLIR_ARMSMEABISTUBS_EXPORTED __arm_tpidr2_restore() {
|
|
std::cerr << "[warning] __arm_tpidr2_restore() stubbed!\n";
|
|
}
|
|
|
|
void MLIR_ARMSMEABISTUBS_EXPORTED __arm_tpidr2_save() {
|
|
std::cerr << "[warning] __arm_tpidr2_save() stubbed!\n";
|
|
}
|
|
|
|
void MLIR_ARMSMEABISTUBS_EXPORTED __arm_za_disable() {
|
|
std::cerr << "[warning] __arm_za_disable() stubbed!\n";
|
|
}
|
|
}
|