From 46160885b7499a8be2984ccd31e8c702e7555bd5 Mon Sep 17 00:00:00 2001 From: wuyuanchao Date: Mon, 18 Mar 2024 02:46:52 +0000 Subject: [PATCH 01/15] [lldb] change libxml2 to openeuler-version Signed-off-by: wuyuanchao Change-Id: I737e9bdff28b1e03decc503b89600d34658c054c --- llvm-build/build.py | 48 +++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/llvm-build/build.py b/llvm-build/build.py index 290acb10931e..f9022b823fdc 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -87,6 +87,7 @@ class BuildConfig(): self.ARCHIVE_EXTENSION = '.tar.' + self.compression_format self.ARCHIVE_OPTION = '-c' + ('j' if self.compression_format == "bz2" else 'z') + self.LIBXML2_VERSION = None logging.basicConfig(level=logging.INFO) def discover_paths(self): @@ -549,23 +550,17 @@ class BuildUtils(object): return None def get_libxml2_version(self): - version_file = os.path.join(self.build_config.REPOROOT_DIR, 'third_party', 'libxml2', 'configure.ac') + version_file = os.path.join(self.build_config.REPOROOT_DIR, 'third_party', 'libxml2', 'libxml2.spec') if os.path.isfile(version_file): + pattern = r'Version:\s+(\d+\.\d+\.\d+)' with open(version_file, 'r') as file: lines = file.readlines() - MAJOR_VERSION = '' - MINOR_VERSION = '' - MICRO_VERSION = '' + VERSION = '' for line in lines: - if "m4_define([MAJOR_VERSION]" in line: - MAJOR_VERSION = re.findall(r'\d+', line)[1] - elif "m4_define([MINOR_VERSION]" in line: - MINOR_VERSION = re.findall(r'\d+', line)[1] - elif "m4_define([MICRO_VERSION]" in line: - MICRO_VERSION = re.findall(r'\d+', line)[1] - - if MAJOR_VERSION != '' and MINOR_VERSION != '' and MICRO_VERSION != '' : - return MAJOR_VERSION+'.'+MINOR_VERSION+'.'+MICRO_VERSION + if 'Version: ' in line: + VERSION = re.search(pattern, line).group(1) + if VERSION != '': + return VERSION return None return None @@ -644,9 +639,8 @@ class LlvmCore(BuildUtils): if self.build_config.build_libedit: llvm_defines['LibEdit_LIBRARIES'] = os.path.join(self.get_prebuilts_dir('libedit'), 'lib', 'libedit.0.dylib') - libxml2_version = self.get_libxml2_version() - if self.build_config.build_libxml2 and libxml2_version is not None: - llvm_defines['LIBXML2_LIBRARIES'] = os.path.join(self.get_prebuilts_dir('libxml2'), self.use_platform(), 'lib', f'libxml2.{libxml2_version}.dylib') + if self.build_config.build_libxml2: + llvm_defines['LIBXML2_LIBRARIES'] = os.path.join(self.get_prebuilts_dir('libxml2'), self.use_platform(), 'lib', f'libxml2.{self.build_config.LIBXML2_VERSION}.dylib') def llvm_compile_linux_defines(self, @@ -691,9 +685,8 @@ class LlvmCore(BuildUtils): if not build_instrumented and not no_lto and not debug_build: llvm_defines['LLVM_ENABLE_LTO'] = 'Thin' - libxml2_version = self.get_libxml2_version() - if self.build_config.build_libxml2 and libxml2_version is not None: - llvm_defines['LIBXML2_LIBRARY'] = os.path.join(self.get_prebuilts_dir('libxml2'), self.use_platform(), 'lib', f'libxml2.so.{libxml2_version}') + if self.build_config.build_libxml2: + llvm_defines['LIBXML2_LIBRARY'] = os.path.join(self.get_prebuilts_dir('libxml2'), self.use_platform(), 'lib', f'libxml2.so.{self.build_config.LIBXML2_VERSION}') def llvm_compile_llvm_defines(self, llvm_defines, llvm_root, cflags, ldflags): llvm_defines['LLVM_ENABLE_PROJECTS'] = 'clang;lld;clang-tools-extra;openmp;lldb' @@ -1804,7 +1797,7 @@ class LlvmLibs(BuildUtils): libxml2_defines = self.build_libxml2_defines() - libxml2_cmake_path = os.path.abspath(os.path.join(self.build_config.REPOROOT_DIR, 'third_party', 'libxml2')) + libxml2_cmake_path = os.path.abspath(os.path.join(self.build_config.REPOROOT_DIR, 'out', ('libxml2-' + self.build_config.LIBXML2_VERSION))) libxml2_build_path = self.merge_out_path('libxml2') libxml2_install_path = os.path.join(self.get_prebuilts_dir('libxml2'), self.use_platform()) @@ -1858,7 +1851,7 @@ class LlvmLibs(BuildUtils): libxml2_defines['CMAKE_RC_FLAGS'] = ' '.join(rcflags) libxml2_defines['XML_INCLUDEDIR'] = os.path.join(windows_sysroot, 'include') - libxml2_cmake_path = os.path.abspath(os.path.join(self.build_config.REPOROOT_DIR, 'third_party', 'libxml2')) + libxml2_cmake_path = os.path.abspath(os.path.join(self.build_config.REPOROOT_DIR, 'out', ('libxml2-' + self.build_config.LIBXML2_VERSION))) self.invoke_cmake(libxml2_cmake_path, libxml2_build_path, @@ -2436,10 +2429,19 @@ def main(): if build_config.build_libedit: llvm_libs.build_libedit(llvm_make, llvm_install) + build_config.LIBXML2_VERSION = build_utils.get_libxml2_version() + if build_config.LIBXML2_VERSION is None: + build_config.build_libxml2 = False + if build_config.build_libxml2: - build_utils.get_libxml2_version() + libxml2_untar_py = os.path.join( + build_config.REPOROOT_DIR, 'third_party', 'libxml2', 'install.py') + if not os.path.exists(build_config.REPOROOT_DIR + '/out'): + os.makedirs(build_config.REPOROOT_DIR + '/out') + subprocess.run(['python3', libxml2_untar_py, '--gen-dir', build_config.REPOROOT_DIR + '/out', + '--source-file', build_config.REPOROOT_DIR + '/third_party/libxml2']) llvm_libs.build_libxml2(llvm_make, llvm_install) - + if build_config.do_build and need_host: llvm_core.llvm_compile( build_config.build_name, -- Gitee From 99823a7253f5dc8707101864368be57a8f080695 Mon Sep 17 00:00:00 2001 From: Kholiavin Nikolai Date: Thu, 21 Mar 2024 10:17:18 +0000 Subject: [PATCH 02/15] [lldb][OHOS] Support remote HDC server Adds support for connecting to an HDC server on a remote machine. The address in the platform connection command is used as that remote machine address, meaning that device id can now be only set with HDC_UTID environment variable. The remote HDC server should be listening not on loopback to accept the lldb connection, and the HDC forwarded ports should be accessible. Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I8O7Q9 Signed-off-by: Nikolai Kholiavin --- .../Plugins/Platform/OHOS/HdcClient.cpp | 520 +++++++++++++++++- lldb/source/Plugins/Platform/OHOS/HdcClient.h | 34 +- .../Plugins/Platform/OHOS/PlatformOHOS.cpp | 31 +- .../Plugins/Platform/OHOS/PlatformOHOS.h | 3 + .../OHOS/PlatformOHOSRemoteGDBServer.cpp | 64 ++- .../OHOS/PlatformOHOSRemoteGDBServer.h | 3 + 6 files changed, 612 insertions(+), 43 deletions(-) diff --git a/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp b/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp index eef720eaf78b..679b821f2d08 100644 --- a/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp +++ b/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp @@ -8,14 +8,17 @@ #include "HdcClient.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/FileUtilities.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/PosixApi.h" +#include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/DataBuffer.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataEncoder.h" @@ -34,9 +37,13 @@ #include #include +#include #include #include +#include +#include #include +#include // On Windows, transitive dependencies pull in , which defines a // macro that clashes with a method name. @@ -121,11 +128,13 @@ Status HdcClient::CreateByDeviceID(const std::string &device_id, return error; } -HdcClient::HdcClient() {} +HdcClient::HdcClient(const std::string &connect_addr, + const std::string &device_id) + : m_connect_addr(connect_addr), m_device_id(device_id) {} -HdcClient::HdcClient(const std::string &device_id) : m_device_id(device_id) {} +HdcClient::HdcClient(HdcClient &&) = default; -HdcClient::~HdcClient() {} +HdcClient::~HdcClient() = default; void HdcClient::SetDeviceID(const std::string &device_id) { m_device_id = device_id; @@ -133,6 +142,10 @@ void HdcClient::SetDeviceID(const std::string &device_id) { const std::string &HdcClient::GetDeviceID() const { return m_device_id; } +bool HdcClient::IsServerLocal() { + return m_connect_addr == "localhost"; +} + namespace { typedef unsigned msg_len_t; struct ChannelHandShake { @@ -163,8 +176,9 @@ Status HdcClient::Connect() { return Status("invalid port specification: %s. $OHOS_HDC_SERVER_PORT must be a positive number in (0,65535]", env_port); } } - - std::string uri = "connect://localhost:" + port; + + // Support remote HDC server by providing connection address explicitly + std::string uri = "connect://" + m_connect_addr + ":" + port; m_conn->Connect(uri.c_str(), &error); ConnectionStatus status = eConnectionStatusError; if (error.Success()) { @@ -265,8 +279,8 @@ Status HdcClient::DeletePortForwarding(const uint16_t local_port, return ReadResponseStatus("Remove forward ruler success"); } -Status HdcClient::TransferFile(const char *direction, const FileSpec &src, - const FileSpec &dst) { +Status HdcClient::LocalTransferFile(const char *direction, const FileSpec &src, + const FileSpec &dst) { LLDB_MODULE_TIMER(LLDBPerformanceTagName::TAG_HDC); // OHOS_LOCAL llvm::SmallVector cwd; std::error_code ec = llvm::sys::fs::current_path(cwd); @@ -284,12 +298,459 @@ Status HdcClient::TransferFile(const char *direction, const FileSpec &src, return ReadResponseStatus("FileTransfer finish"); } +Status HdcClient::ExpectCommandMessagePrefix(uint16_t expected_command, + std::vector &message, + size_t prefix_size) { + uint16_t command; + Status error = ReadCommandMessagePrefix(command, message, prefix_size); + if (error.Fail()) + return error; + if (command != expected_command) + return Status("Unexpected HDC server command: %d, expected %d", command, + expected_command); + + return error; +} + +Status HdcClient::ExpectCommandMessage(uint16_t expected_command, + std::vector &message) { + return ExpectCommandMessagePrefix(expected_command, message, + std::numeric_limits::max()); +} + +template struct HdcIO; + +struct HdcTagIO { + enum class WireType : uint32_t { VARINT = 0, LENGTH_DELIMETED = 2 }; + + template + static llvm::Optional> ParseTag(InItT &InBegin, + InItT InEnd) { + llvm::Optional Tag = HdcIO::Parse(InBegin, InEnd); + return Tag.map([](U Val) { + return std::make_pair(static_cast(Val >> 3), + static_cast(Val & 0x7)); + }); + } + + template + static void SerializeTag(size_t Idx, WireType Type, OutItT &OutIt) { + HdcIO::Serialize( + static_cast(Type) | (static_cast(Idx) << 3), OutIt); + } +}; + +template +struct HdcIOBase { + using ValueT = T; + + static HdcTagIO::WireType GetWireType() { return TheType; } + + template + static llvm::Optional ParseTagged(size_t Idx, InItT &InBegin, + InItT InEnd) { + if (!HdcTagIO::ParseTag(InBegin, InEnd) + .map([Idx](auto P) { + return P.first == Idx && P.second == TheType; + }) + .value_or(false)) + return {}; + return DerivedT::Parse(InBegin, InEnd); + } + + template + static void SerializeTagged(size_t Idx, T Value, OutItT &OutIt) { + HdcTagIO::SerializeTag(Idx, TheType, OutIt); + DerivedT::Serialize(Value, OutIt); + } +}; + +template +struct HdcIO : HdcIOBase> { + static_assert(std::is_integral::value, "Don't know how to parse T"); + + template + static llvm::Optional Parse(InItT &InBegin, InItT InEnd) { + constexpr size_t NBytes = (sizeof(T) * 8 + 6) / 7; + T value = 0; + for (size_t c = 0; c < NBytes; ++c) { + uint8_t x; + if (InBegin == InEnd) + return {}; + x = *InBegin++; + value |= static_cast(x & 0x7Fu) << 7 * c; + if (!(x & 0x80)) + return value; + } + return {}; + } + + template static void Serialize(T value, OutItT &OutIt) { + constexpr size_t NBytes = (sizeof(T) * 8 + 6) / 7; + uint8_t b[NBytes]; + for (size_t i = 0; i < NBytes; ++i) { + b[i] = value & 0b0111'1111; + value >>= 7; + if (value) { + b[i] |= 0b1000'0000; + } else { + OutIt = std::copy_n(std::begin(b), i + 1, OutIt); + return; + } + } + } +}; + +template <> +struct HdcIO : HdcIOBase> { + template + static llvm::Optional Parse(InItT &InBegin, InItT InEnd) { + auto MaybeLen = HdcIO::Parse(InBegin, InEnd); + if (!MaybeLen) + return llvm::None; + size_t Len = *MaybeLen; + std::string Res; + Res.reserve(Len); + while (Res.size() < Len && InBegin != InEnd) + Res.push_back(*InBegin++); + if (Res.size() < Len) + return {}; + return Res; + } + + template + static void Serialize(const std::string &value, OutItT &OutIt) { + HdcIO::Serialize(value.size(), OutIt); + OutIt = std::copy_n(value.begin(), value.size(), OutIt); + } +}; + +template struct HdcTaggedIOHelper { + template + static llvm::Optional> Parse(InItT &InBegin, InItT InEnd) { + return std::tuple<>{}; + } + + template static void Serialize(OutItT &OutIt) {} +}; + +template +struct HdcTaggedIOHelper { + using ResT = llvm::Optional>; + + template static ResT Parse(InItT &InBegin, InItT InEnd) { + return HdcIO::ParseTagged(StartIdx, InBegin, InEnd) + .map([&](auto &&LHS) { + return HdcTaggedIOHelper::Parse(InBegin, InEnd) + .map([LHS = std::move(LHS)](auto &&RHS) { + return std::tuple_cat(std::make_tuple(std::move(LHS)), + std::move(RHS)); + }); + }) + .value_or(ResT(llvm::None)); + } + + template static ResT ParseOnce(InItT InBegin, InItT InEnd) { + return Parse(InBegin, InEnd); + } + + template + static void Serialize(const T &Arg, const Ts &...Args, OutItT &OutIt) { + HdcIO::SerializeTagged(StartIdx, std::move(Arg), OutIt); + HdcTaggedIOHelper::Serialize(std::move(Args)..., + OutIt); + } + + template + static void SerializeOnce(const T &Arg, const Ts &...Args, OutItT OutIt) { + return Serialize(Arg, Args..., OutIt); + } +}; + +template struct HdcTaggedIO : HdcTaggedIOHelper<1, Ts...> {}; + +template struct HdcTaggedIOTuple; + +template +struct HdcTaggedIOTuple> : HdcTaggedIO {}; + +using HdcTransferConfig = std::tuple; + +using HdcTransferPayload = std::tuple; + +using HdcFileMode = std::tuple; // fullName + +enum HdcCommand : uint16_t { + CMD_KERNEL_WAKEUP_SLAVETASK = 12, + CMD_FILE_INIT = 3000, + CMD_FILE_CHECK, + CMD_FILE_BEGIN, + CMD_FILE_DATA, + CMD_FILE_FINISH, + CMD_FILE_MODE = 3006 +}; + +static constexpr size_t HdcTransferPayloadPrefixReserve = 64; +static constexpr size_t HdcTransferPayloadMaxChunkSize = 49152; + +Status HdcClient::FileCheck(int FD, size_t &file_size) { + std::vector msg; + Status error = ExpectCommandMessage(HdcCommand::CMD_FILE_MODE, msg); + if (error.Fail()) + return error; + + auto maybe_file_mode = HdcTaggedIOTuple::ParseOnce(msg.cbegin(), msg.cend()); + if (!maybe_file_mode) + return Status("Could not parse HDC server FileMode"); + + auto &file_mode = *maybe_file_mode; + + uint32_t perms = static_cast(std::get<0>(file_mode)); + auto EC = llvm::sys::fs::setPermissions( + FD, static_cast(perms) & llvm::sys::fs::all_perms); + if (EC) + return Status(EC); + + error = SendCommandMessage(HdcCommand::CMD_FILE_MODE, {}); + if (error.Fail()) + return error; + + error = ExpectCommandMessage(HdcCommand::CMD_FILE_CHECK, msg); + if (error.Fail()) + return error; + + auto transfer_config = + HdcTaggedIOTuple::ParseOnce(msg.cbegin(), msg.cend()); + if (!transfer_config.has_value()) + return Status("Could not parse HDC server TransferConfig"); + + if (auto compress_type = std::get<7>(*transfer_config)) + return Status("Compression is not supported"); + + file_size = std::get<0>(*transfer_config); + + return SendCommandMessage(HdcCommand::CMD_FILE_BEGIN, {}); +} + +Status HdcClient::PullFileChunk(std::vector &buffer) { + buffer.clear(); + + std::vector msg; + Status error = ExpectCommandMessagePrefix(HdcCommand::CMD_FILE_DATA, msg, + HdcTransferPayloadPrefixReserve); + if (error.Fail()) + return error; + + auto transfer_payload = + HdcTaggedIOTuple::ParseOnce(msg.cbegin(), msg.cend()); + if (!transfer_payload.has_value()) + return Status("Could not parse HDC server TransferPayload"); + + if (auto compress_type = std::get<1>(*transfer_payload)) + return Status("Compression is not supported"); + + uint32_t read_bytes = std::get<3>(*transfer_payload); + buffer.resize(read_bytes, 0); + error = ReadAllBytes(buffer.data(), buffer.size()); + if (error.Fail()) + buffer.clear(); + + return error; +} + Status HdcClient::RecvFile(const FileSpec &src, const FileSpec &dst) { - return TransferFile("recv", src, dst); + if (IsServerLocal()) + return LocalTransferFile("recv", src, dst); + + const auto local_file_path = dst.GetPath(); + llvm::FileRemover local_file_remover(local_file_path); + + int dst_file_fd; + auto EC = llvm::sys::fs::openFileForWrite(local_file_path, dst_file_fd); + if (EC) + return Status("Unable to open local file %s", local_file_path.c_str()); + + std::stringstream cmd; + cmd << "file recv remote -m"; + cmd << " " << src.GetPath() << " " << dst.GetPath(); + Status error = SendMessage(cmd.str()); + if (error.Fail()) + return error; + + size_t cur_size = 0, all_size = 0; + error = FileCheck(dst_file_fd, all_size); + if (error.Fail()) + return error; + + llvm::raw_fd_ostream dst_file(dst_file_fd, true); + + std::vector buf; + while (cur_size < all_size) { + error = PullFileChunk(buf); + if (error.Fail()) + return error; + dst_file.write(buf.data(), buf.size()); + cur_size += buf.size(); + } + + error = SendCommandMessage(HdcCommand::CMD_FILE_FINISH, {}); + if (error.Fail()) + return error; + error = ReadResponseStatus("FileTransfer finish"); + if (error.Fail()) + return error; + + dst_file.close(); + if (dst_file.has_error()) + return Status("Failed to write file %s", local_file_path.c_str()); + + local_file_remover.releaseFile(); + return error; +} + +Status HdcClient::FileInit(size_t file_size, uint32_t perm, uint32_t u_id, + uint32_t g_id, const std::string &remote_path) { + std::vector msg; + Status error = ExpectCommandMessage(HdcCommand::CMD_FILE_INIT, msg); + if (error.Fail()) + return error; + + error = SendCommandMessage(HdcCommand::CMD_KERNEL_WAKEUP_SLAVETASK, {}); + if (error.Fail()) + return error; + + constexpr uint64_t IFREG_MASK = 0100000; + msg.clear(); + HdcTaggedIOTuple::SerializeOnce(perm | IFREG_MASK, // perm + u_id, // u_id + g_id, // g_id + "", // context + "", // fullName + std::back_inserter(msg)); + error = SendCommandMessage(HdcCommand::CMD_FILE_MODE, msg); + if (error.Fail()) + return error; + + error = ExpectCommandMessage(HdcCommand::CMD_FILE_MODE, msg); + if (error.Fail()) + return error; + + msg.clear(); + HdcTaggedIOTuple::SerializeOnce(file_size, // fileSize + 0, // atime + 0, // mtime + "", // options + remote_path, // path + "", // optionalName + false, // updateIfNew + 0, // compressType + false, // holdTimestamp + "", // funcName + "", // clientCwd + "", // reserve1 + "", // reserve2 + std::back_inserter(msg)); + error = SendCommandMessage(HdcCommand::CMD_FILE_CHECK, msg); + if (error.Fail()) + return error; + + return ExpectCommandMessage(HdcCommand::CMD_FILE_BEGIN, msg); +} + +Status HdcClient::PushFileChunk(std::vector &buffer, size_t chunk_size, + size_t index) { + std::fill_n(buffer.begin(), HdcTransferPayloadPrefixReserve, 0); + HdcTaggedIOTuple::SerializeOnce( + index, // index + 0, // compressType + chunk_size, // compressSize + chunk_size, // uncompressSize + buffer.begin()); + return SendCommandMessage(CMD_FILE_DATA, buffer); } Status HdcClient::SendFile(const FileSpec &src, const FileSpec &dst) { - return TransferFile("send", src, dst); + if (IsServerLocal()) + return LocalTransferFile("send", src, dst); + + const auto local_file_path = src.GetPath(); + std::ifstream src_file(local_file_path.c_str(), std::ios::in | std::ios::binary); + if (!src_file.is_open()) + return Status("Unable to open local file %s", local_file_path.c_str()); + + std::stringstream cmd; + cmd << "file send remote -m " << src.GetPath() << " " << dst.GetPath(); + Status error = SendMessage(cmd.str()); + if (error.Fail()) + return error; + + llvm::sys::fs::file_status status; + auto EC = llvm::sys::fs::status(local_file_path, status); + if (EC) + return Status(EC); + + error = FileInit(status.getSize(), status.permissions(), status.getUser(), + status.getGroup(), dst.GetPath()); + if (error.Fail()) + return error; + + std::vector buffer; + size_t sent_bytes = 0; + while (!src_file.eof()) { + buffer.resize(HdcTransferPayloadPrefixReserve + + HdcTransferPayloadMaxChunkSize); + if (src_file + .read(buffer.data() + HdcTransferPayloadPrefixReserve, + HdcTransferPayloadMaxChunkSize) + .bad()) + break; + size_t chunk_size = src_file.gcount(); + buffer.resize(HdcTransferPayloadPrefixReserve + chunk_size); + error = PushFileChunk(buffer, chunk_size, sent_bytes); + if (error.Fail()) + return error; + sent_bytes += chunk_size; + } + + if (src_file.bad()) + return Status("Failed read on %s", local_file_path.c_str()); + if (sent_bytes < status.getSize()) { + m_conn.reset(); + return Status("Failed to read all of the bytes from %s: read %zu/%zu", + local_file_path.c_str(), sent_bytes, status.getSize()); + } + + error = ExpectCommandMessage(HdcCommand::CMD_FILE_FINISH, buffer); + if (error.Fail()) + return error; + + error = SendCommandMessage(HdcCommand::CMD_FILE_FINISH, {}); + if (error.Fail()) + return error; + + return ReadResponseStatus("FileTransfer finish"); } Status HdcClient::SendMessage(llvm::StringRef packet, const bool reconnect) { @@ -314,6 +775,13 @@ Status HdcClient::SendMessage(llvm::StringRef packet, const bool reconnect) { return error; } +Status HdcClient::SendCommandMessage(uint16_t command, llvm::ArrayRef packet) { + llvm::SmallVector buf(sizeof(command) + packet.size()); + std::copy_n(reinterpret_cast(&command), sizeof(command), buf.begin()); + std::copy_n(packet.begin(), packet.size(), buf.begin() + sizeof(command)); + return SendMessage(llvm::StringRef(buf.data(), buf.size()), false); +} + Status HdcClient::ReadMessage(std::vector &message) { message.clear(); @@ -331,6 +799,40 @@ Status HdcClient::ReadMessage(std::vector &message) { return error; } +Status HdcClient::ReadCommandMessagePrefix(uint16_t &command, std::vector &message, size_t prefix_size) { + message.clear(); + + msg_len_t packet_len; + auto error = ReadAllBytes(&packet_len, sizeof(packet_len)); + if (error.Fail()) + return error; + + packet_len = htonl(packet_len); + if (packet_len < sizeof(command)) + return Status("Message too small to contain a command"); + + error = ReadAllBytes(&command, sizeof(command)); + if (error.Fail()) { + command = 0; + return error; + } + + message.resize(std::min(packet_len - sizeof(command), prefix_size), 0); + error = ReadAllBytes(&message[0], message.size()); + if (error.Fail()) { + command = 0; + message.clear(); + } + + return error; +} + +Status HdcClient::ReadCommandMessage(uint16_t &command, + std::vector &message) { + return ReadCommandMessagePrefix(command, message, + std::numeric_limits::max()); +} + Status HdcClient::ReadMessageStream(std::vector &message, milliseconds timeout) { auto start = steady_clock::now(); diff --git a/lldb/source/Plugins/Platform/OHOS/HdcClient.h b/lldb/source/Plugins/Platform/OHOS/HdcClient.h index 39b6569b447a..5e17b0d8f8ef 100644 --- a/lldb/source/Plugins/Platform/OHOS/HdcClient.h +++ b/lldb/source/Plugins/Platform/OHOS/HdcClient.h @@ -34,8 +34,10 @@ public: static Status CreateByDeviceID(const std::string &device_id, HdcClient &hdc); - HdcClient(); - explicit HdcClient(const std::string &device_id); + explicit HdcClient(const std::string &connect_addr, + const std::string &device_id = ""); + + HdcClient(HdcClient &&); ~HdcClient(); @@ -63,19 +65,38 @@ public: std::string *output); private: + bool IsServerLocal(); Status Connect(); - Status TransferFile(const char *direction, const FileSpec &src, - const FileSpec &dst); + Status LocalTransferFile(const char *direction, const FileSpec &src, + const FileSpec &dst); + + Status FileCheck(int FD, size_t &file_size); + Status PullFileChunk(std::vector &buffer); + + Status FileInit(size_t file_size, uint32_t perm, uint32_t u_id, uint32_t g_id, + const std::string &remote_path); + Status PushFileChunk(std::vector &buffer, size_t chunk_size, + size_t index); void SetDeviceID(const std::string &device_id); Status SendMessage(llvm::StringRef packet, const bool reconnect = true); - Status SendDeviceMessage(const std::string &packet); - Status ReadMessage(std::vector &message); + Status SendCommandMessage(uint16_t command, llvm::ArrayRef packet); + + Status ReadCommandMessagePrefix(uint16_t &command, std::vector &message, + size_t prefix_size); + Status ReadCommandMessage(uint16_t &command, std::vector &message); + + Status ExpectCommandMessage(uint16_t expected_command, + std::vector &message); + Status ExpectCommandMessagePrefix(uint16_t expected_command, + std::vector &message, + size_t prefix_size); + Status ReadMessageStream(std::vector &message, std::chrono::milliseconds timeout); @@ -83,6 +104,7 @@ private: Status ReadAllBytes(void *buffer, size_t size); + std::string m_connect_addr; std::string m_device_id; std::unique_ptr m_conn; }; diff --git a/lldb/source/Plugins/Platform/OHOS/PlatformOHOS.cpp b/lldb/source/Plugins/Platform/OHOS/PlatformOHOS.cpp index 5193e17edbd1..6a1bb9044646 100644 --- a/lldb/source/Plugins/Platform/OHOS/PlatformOHOS.cpp +++ b/lldb/source/Plugins/Platform/OHOS/PlatformOHOS.cpp @@ -129,8 +129,13 @@ llvm::StringRef PlatformOHOS::GetPluginName() { return GetPluginNameStatic(IsHost()); } +HdcClient PlatformOHOS::CreateHdcClient() { + return HdcClient(m_connect_addr, m_device_id); +} + Status PlatformOHOS::ConnectRemote(Args &args) { m_device_id.clear(); + m_connect_addr = "localhost"; if (IsHost()) { return Status("can't connect to the host platform '%s', always connected", @@ -146,17 +151,26 @@ Status PlatformOHOS::ConnectRemote(Args &args) { llvm::Optional uri = URI::Parse(url); if (!uri) return Status("Invalid URL: %s", url); - if (uri->hostname != "localhost") - m_device_id = static_cast(uri->hostname); + + Log *log = GetLog(LLDBLog::Platform); + if (PlatformOHOSRemoteGDBServer::IsHostnameDeviceID( + uri->hostname)) { // accepts no (empty) hostname too + m_device_id = uri->hostname.str(); + LLDB_LOG(log, "Treating hostname as device id: \"{0}\"", m_device_id); + } else { + m_connect_addr = uri->hostname.str(); + LLDB_LOG(log, "Treating hostname as remote HDC server address: \"{0}\"", + m_connect_addr); + } auto error = PlatformLinux::ConnectRemote(args); if (error.Success()) { - HdcClient adb; - error = HdcClient::CreateByDeviceID(m_device_id, adb); + HdcClient hdc(m_connect_addr); + error = HdcClient::CreateByDeviceID(m_device_id, hdc); if (error.Fail()) return error; - m_device_id = adb.GetDeviceID(); + m_device_id = hdc.GetDeviceID(); } return error; } @@ -171,7 +185,7 @@ Status PlatformOHOS::GetFile(const FileSpec &source, source_spec = GetRemoteWorkingDirectory().CopyByAppendingPathComponent( source_spec.GetCString(false)); - HdcClient hdc(m_device_id); + HdcClient hdc = CreateHdcClient(); Status error = hdc.RecvFile(source_spec, destination); return error; } @@ -188,7 +202,7 @@ Status PlatformOHOS::PutFile(const FileSpec &source, destination_spec.GetCString(false)); // TODO: Set correct uid and gid on remote file. - HdcClient hdc(m_device_id); + HdcClient hdc = CreateHdcClient(); Status error = hdc.SendFile(source, destination_spec); return error; } @@ -209,6 +223,7 @@ Status PlatformOHOS::DisconnectRemote() { Status error = PlatformLinux::DisconnectRemote(); if (error.Success()) { m_device_id.clear(); + m_connect_addr.clear(); m_sdk_version = 0; m_remote_platform_sp.reset(); } @@ -227,7 +242,7 @@ uint32_t PlatformOHOS::GetSdkVersion() { return m_sdk_version; std::string version_string; - HdcClient hdc(m_device_id); + HdcClient hdc = CreateHdcClient(); Status error = hdc.Shell("param get const.ohos.apiversion", seconds(5), &version_string); version_string = llvm::StringRef(version_string).trim().str(); diff --git a/lldb/source/Plugins/Platform/OHOS/PlatformOHOS.h b/lldb/source/Plugins/Platform/OHOS/PlatformOHOS.h index 83645ff209a5..fdbd1d42535a 100644 --- a/lldb/source/Plugins/Platform/OHOS/PlatformOHOS.h +++ b/lldb/source/Plugins/Platform/OHOS/PlatformOHOS.h @@ -66,7 +66,10 @@ protected: llvm::StringRef GetLibdlFunctionDeclarations(lldb_private::Process *process) override; + HdcClient CreateHdcClient(); + private: + std::string m_connect_addr; std::string m_device_id; uint32_t m_sdk_version; diff --git a/lldb/source/Plugins/Platform/OHOS/PlatformOHOSRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/OHOS/PlatformOHOSRemoteGDBServer.cpp index 28f996a6cdb7..0a6a7b208f40 100644 --- a/lldb/source/Plugins/Platform/OHOS/PlatformOHOSRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/OHOS/PlatformOHOSRemoteGDBServer.cpp @@ -26,13 +26,13 @@ static const lldb::pid_t g_remote_platform_pid = static uint16_t g_hdc_forward_port_offset = 0; static Status ForwardPortWithHdc( - const uint16_t local_port, const uint16_t remote_port, - llvm::StringRef remote_socket_name, + const std::string &connect_addr, const uint16_t local_port, + const uint16_t remote_port, llvm::StringRef remote_socket_name, const llvm::Optional &socket_namespace, std::string &device_id) { Log *log = GetLog(LLDBLog::Platform); - HdcClient hdc; + HdcClient hdc(connect_addr); auto error = HdcClient::CreateByDeviceID(device_id, hdc); if (error.Fail()) return error; @@ -56,19 +56,22 @@ static Status ForwardPortWithHdc( *socket_namespace); } -static Status DeleteForwardPortWithHdc(std::pair ports, +static Status DeleteForwardPortWithHdc(const std::string &connect_addr, + std::pair ports, const std::string &device_id) { Log *log = GetLog(LLDBLog::Platform); LLDB_LOGF(log, "Delete port forwarding %d -> %d, device=%s", ports.first, ports.second, device_id.c_str()); - HdcClient hdc(device_id); + HdcClient hdc(connect_addr, device_id); return hdc.DeletePortForwarding(ports); } -static Status DeleteForwardPortWithHdc(std::pair remote_socket, - const llvm::Optional &socket_namespace, - const std::string &device_id) { +static Status DeleteForwardPortWithHdc( + const std::string &connect_addr, + std::pair remote_socket, + const llvm::Optional &socket_namespace, + const std::string &device_id) { Log *log = GetLog(LLDBLog::Platform); uint16_t local_port = remote_socket.first; @@ -78,7 +81,7 @@ static Status DeleteForwardPortWithHdc(std::pair remote_s if (!socket_namespace) return Status("Invalid socket namespace"); - HdcClient hdc(device_id); + HdcClient hdc(connect_addr, device_id); return hdc.DeletePortForwarding(local_port, remote_socket_name, *socket_namespace); } @@ -102,14 +105,14 @@ static Status FindUnusedPort(uint16_t &port) { return error; } -PlatformOHOSRemoteGDBServer::PlatformOHOSRemoteGDBServer() {} +PlatformOHOSRemoteGDBServer::PlatformOHOSRemoteGDBServer() = default; PlatformOHOSRemoteGDBServer::~PlatformOHOSRemoteGDBServer() { for (const auto &it : m_port_forwards) { - DeleteForwardPortWithHdc(it.second, m_device_id); + DeleteForwardPortWithHdc(m_connect_addr, it.second, m_device_id); } for (const auto &it_socket : m_remote_socket_name) { - DeleteForwardPortWithHdc(it_socket.second, m_socket_namespace, m_device_id); + DeleteForwardPortWithHdc(m_connect_addr, it_socket.second, m_socket_namespace, m_device_id); } } @@ -135,8 +138,14 @@ bool PlatformOHOSRemoteGDBServer::KillSpawnedProcess(lldb::pid_t pid) { return m_gdb_client_up->KillSpawnedProcess(pid); } +bool PlatformOHOSRemoteGDBServer::IsHostnameDeviceID(llvm::StringRef hostname) { + return hostname != "localhost" && !hostname.contains(':') && + !hostname.contains('.'); +} + Status PlatformOHOSRemoteGDBServer::ConnectRemote(Args &args) { m_device_id.clear(); + m_connect_addr = "localhost"; if (args.GetArgumentCount() != 1) return Status( @@ -149,8 +158,16 @@ Status PlatformOHOSRemoteGDBServer::ConnectRemote(Args &args) { uri = URI::Parse(url); if (!uri) return Status("Invalid URL: %s", url); - if (uri->hostname != "localhost") - m_device_id = static_cast(uri->hostname); + + Log *log = GetLog(LLDBLog::Platform); + if (IsHostnameDeviceID(uri->hostname)) { // accepts no (empty) hostname too + m_device_id = uri->hostname.str(); + LLDB_LOG(log, "Treating hostname as device id: \"{0}\"", m_device_id); + } else { + m_connect_addr = uri->hostname.str(); + LLDB_LOG(log, "Treating hostname as remote HDC server address: \"{0}\"", + m_connect_addr); + } m_socket_namespace.reset(); if (uri->scheme == "unix-connect") @@ -168,7 +185,6 @@ Status PlatformOHOSRemoteGDBServer::ConnectRemote(Args &args) { args.ReplaceArgumentAtIndex(0, connect_url); - Log *log = GetLog(LLDBLog::Platform); LLDB_LOGF(log, "Rewritten platform connect URL: %s", connect_url.c_str()); error = PlatformRemoteGDBServer::ConnectRemote(args); if (error.Fail()) @@ -180,6 +196,7 @@ Status PlatformOHOSRemoteGDBServer::ConnectRemote(Args &args) { Status PlatformOHOSRemoteGDBServer::DisconnectRemote() { DeleteForwardPort(g_remote_platform_pid); g_hdc_forward_port_offset = 0; + m_connect_addr.clear(); return PlatformRemoteGDBServer::DisconnectRemote(); } @@ -189,7 +206,8 @@ void PlatformOHOSRemoteGDBServer::DeleteForwardPort(lldb::pid_t pid) { auto it = m_port_forwards.find(pid); auto it_socket = m_remote_socket_name.find(pid); if (it != m_port_forwards.end() && it->second.second != 0) { - const auto error = DeleteForwardPortWithHdc(it->second, m_device_id); + const auto error = + DeleteForwardPortWithHdc(m_connect_addr, it->second, m_device_id); if (error.Fail()) { LLDB_LOGF(log, "Failed to delete port forwarding (pid=%" PRIu64 ", fwd=(%d -> %d), device=%s): %s", @@ -200,7 +218,8 @@ void PlatformOHOSRemoteGDBServer::DeleteForwardPort(lldb::pid_t pid) { } if(it_socket != m_remote_socket_name.end()) { - const auto error_Socket = DeleteForwardPortWithHdc(it_socket->second, m_socket_namespace, m_device_id); + const auto error_Socket = DeleteForwardPortWithHdc( + m_connect_addr, it_socket->second, m_socket_namespace, m_device_id); if (error_Socket.Fail()) { LLDB_LOGF(log, "Failed to delete port forwarding (pid=%" PRIu64 ", fwd=(%d->%s)device=%s): %s", pid, it_socket->second.first, it_socket->second.second.c_str(), m_device_id.c_str(),error_Socket.AsCString()); @@ -226,8 +245,9 @@ Status PlatformOHOSRemoteGDBServer::MakeConnectURL( if (error.Fail()) return error; - error = ForwardPortWithHdc(local_port, remote_port, remote_socket_name, - m_socket_namespace, m_device_id); + error = + ForwardPortWithHdc(m_connect_addr, local_port, remote_port, + remote_socket_name, m_socket_namespace, m_device_id); if (error.Success()) { if (remote_port != 0){ m_port_forwards[pid] = {local_port, remote_port}; @@ -235,8 +255,10 @@ Status PlatformOHOSRemoteGDBServer::MakeConnectURL( else{ m_remote_socket_name[pid] ={local_port, remote_socket_name.str()}; } + // Connect to local_port on a potentially remote machine with running HDC + // server std::ostringstream url_str; - url_str << "connect://localhost:" << local_port; + url_str << "connect://" << m_connect_addr << ":" << local_port; connect_url = url_str.str(); break; } @@ -262,6 +284,8 @@ lldb::ProcessSP PlatformOHOSRemoteGDBServer::ConnectProcess( return nullptr; } + // If m_connect_addr is remote, this connects to a remote HDC server, assuming + // that all of the needed ports are open std::string new_connect_url; error = MakeConnectURL(s_remote_gdbserver_fake_pid--, (*uri->port) ? (*uri->port) : 0, uri->path, diff --git a/lldb/source/Plugins/Platform/OHOS/PlatformOHOSRemoteGDBServer.h b/lldb/source/Plugins/Platform/OHOS/PlatformOHOSRemoteGDBServer.h index 680ddc1e733c..cb130574d3f6 100644 --- a/lldb/source/Plugins/Platform/OHOS/PlatformOHOSRemoteGDBServer.h +++ b/lldb/source/Plugins/Platform/OHOS/PlatformOHOSRemoteGDBServer.h @@ -38,7 +38,10 @@ public: lldb_private::Target *target, lldb_private::Status &error) override; + static bool IsHostnameDeviceID(llvm::StringRef hostname); + protected: + std::string m_connect_addr; std::string m_device_id; std::map> m_port_forwards; std::map> m_remote_socket_name; -- Gitee From ca5e7179c5ef277c79c54cfbcec8a7e7e16ad45c Mon Sep 17 00:00:00 2001 From: yinchuang Date: Wed, 20 Mar 2024 10:28:53 +0800 Subject: [PATCH 03/15] [Sanitizer] Modify GetEnv to call getenv Issue:I99YTZ Signed-off-by: yinchuang --- .../lib/sanitizer_common/sanitizer_linux.cpp | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp index 630def6c0a57..2d72a21b711e 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp @@ -597,11 +597,9 @@ u64 NanoTime() { } #endif -// Like getenv, but reads env directly from /proc (on Linux) or parses the -// 'environ' array (on some others) and does not use libc. This function -// should be called first inside __asan_init. -const char *GetEnv(const char *name) { -#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_SOLARIS +// OHOS_LOCAL begin +static const char *GetEnvDirectly(const char *name) +{ if (::environ != 0) { uptr NameLen = internal_strlen(name); for (char **Env = ::environ; *Env != 0; Env++) { @@ -610,6 +608,15 @@ const char *GetEnv(const char *name) { } } return 0; // Not found. +} +// OHOS_LOCAL end + +// Like getenv, but reads env directly from /proc (on Linux) or parses the +// 'environ' array (on some others) and does not use libc. This function +// should be called first inside __asan_init. +const char *GetEnv(const char *name) { +#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_SOLARIS + return GetEnvDirectly(name); // // OHOS_LOCAL #elif SANITIZER_LINUX static char *environ; static uptr len; @@ -620,7 +627,18 @@ const char *GetEnv(const char *name) { if (!ReadFileToBuffer("/proc/self/environ", &environ, &environ_size, &len)) environ = nullptr; } - if (!environ || len == 0) return nullptr; + if (!environ || len == 0) { +// OHOS_LOCAL begin +#if SANITIZER_OHOS + // "/proc/self/environ" can't be accessed by non-root processes, + // Let's fall back to read env directly from environ. + return GetEnvDirectly(name); +#else + return nullptr; +#endif +// OHOS_LOCAL end + } + uptr namelen = internal_strlen(name); const char *p = environ; while (*p != '\0') { // will happen at the \0\0 that terminates the buffer -- Gitee From 5cb2bc8f3db912775024873586c44a96343573e2 Mon Sep 17 00:00:00 2001 From: yp9522 Date: Tue, 19 Mar 2024 12:22:02 +0800 Subject: [PATCH 04/15] [build] add libcxx version verification mechanism MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: add Check the libc++_shared. so dependency during IDE compilation to prevent compatibility issues Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I950VX Test: Add some ABI public functions to use build. py and add parameters -- enable check abi Signed-off-by: yp9522 Change-Id: I38895af51822c1e9ee882f44a82dc0689aae6a2c Signed-off-by: yp9522 --- llvm-build/README.md | 3 +- llvm-build/abi_check.py | 212 ++ llvm-build/build.py | 64 +- .../aarch64-linux-ohos/libc++_shared.abi | 2366 ++++++++++++++++ .../a7_hard_neon-vfpv4/libc++_shared.abi | 2372 +++++++++++++++++ .../arm-linux-ohos/a7_soft/libc++_shared.abi | 2372 +++++++++++++++++ .../a7_softfp_neon-vfpv4/libc++_shared.abi | 2372 +++++++++++++++++ .../arm-linux-ohos/libc++_shared.abi | 2372 +++++++++++++++++ .../a7_hard_neon-vfpv4/libc++_shared.abi | 2372 +++++++++++++++++ .../arm-liteos-ohos/a7_soft/libc++_shared.abi | 2372 +++++++++++++++++ .../a7_softfp_neon-vfpv4/libc++_shared.abi | 2372 +++++++++++++++++ .../arm-liteos-ohos/libc++_shared.abi | 2372 +++++++++++++++++ .../mipsel-linux-ohos/libc++_shared.abi | 2366 ++++++++++++++++ .../nanlegacy/libc++_shared.abi | 2366 ++++++++++++++++ .../riscv64-linux-ohos/libc++_shared.abi | 2364 ++++++++++++++++ .../x86_64-linux-ohos/libc++_shared.abi | 2365 ++++++++++++++++ 16 files changed, 31078 insertions(+), 4 deletions(-) create mode 100755 llvm-build/abi_check.py create mode 100644 llvm-build/libcxx_abidiff/aarch64-linux-ohos/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/arm-linux-ohos/a7_hard_neon-vfpv4/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/arm-linux-ohos/a7_soft/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/arm-linux-ohos/a7_softfp_neon-vfpv4/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/arm-linux-ohos/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_hard_neon-vfpv4/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_soft/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_softfp_neon-vfpv4/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/arm-liteos-ohos/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/mipsel-linux-ohos/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/mipsel-linux-ohos/nanlegacy/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/riscv64-linux-ohos/libc++_shared.abi create mode 100644 llvm-build/libcxx_abidiff/x86_64-linux-ohos/libc++_shared.abi diff --git a/llvm-build/README.md b/llvm-build/README.md index 892e6c0b2091..407b4b4c1871 100644 --- a/llvm-build/README.md +++ b/llvm-build/README.md @@ -20,7 +20,7 @@ MacOS X >= 10.15.4 ubuntu ``` -sudo apt-get install build-essential swig python3-dev libedit-dev libncurses5-dev binutils-dev gcc-multilib +sudo apt-get install build-essential swig python3-dev libedit-dev libncurses5-dev binutils-dev gcc-multilib abigail-tools ``` mac ``` @@ -91,6 +91,7 @@ build.py options: OH LLVM BOTH +--enable-check-abi # Check libc++_shared.so ABI. If the ABI was changed then interrupt a build process and report an error. ```
diff --git a/llvm-build/abi_check.py b/llvm-build/abi_check.py new file mode 100755 index 000000000000..e3d6621881d0 --- /dev/null +++ b/llvm-build/abi_check.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python3 +# Copyright (C) 2024 Huawei Device Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import subprocess +import sys +import logging + + +class AbiCheck: + + def __init__(self, args) -> None: + self.args = argparse.Namespace( + action=None, + suppressions=None, + no_show_locs=None, + headers_dir=None, + debug_info_dir=None, + load_all_types=None, + annotate=None, + abi_file=None, + elf_file=None, + debug_info_dir1=None, + debug_info_dir2=None, + headers_dir1=None, + headers_dir2=None, + show_size_offset=None, + compare_files=None + ) + source_dict = vars(args) + self.args.__dict__.update(source_dict) + logging.basicConfig(level=logging.INFO) + return + + @classmethod + def exec_command(cls, command, timeout=10): + with subprocess.Popen(command, stderr=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True, + start_new_session=True) as process: + output, errs = process.communicate(timeout=timeout) + out_str = output.decode() + errs_str = errs.decode() + if out_str != '': + logging.info(out_str) + if errs_str != '': + logging.error(errs_str) + + @classmethod + def get_show_size_offset(cls, argument): + if argument == "bytes": + return "bytes" + elif argument == "bits": + return "bits" + elif argument == "hex" or argument == "hexadecimal": + return "hex" + elif argument == "dec" or argument == "decimal": + return "dec" + else: + return "bytes" + + def run(self) -> None: + if self.args.action == "gen_abi": + self.gen_abi_file() + elif self.args.action == "compare_abi": + self.compare_abi_files() + else: + logging.info("do nothing") + + def build_gen_command(self): + all_args = ["--no-corpus-path"] + if self.args.suppressions is not None: + all_args.extend(["--suppressions", self.args.suppressions]) + if self.args.debug_info_dir is not None: + all_args.extend(["--debug-info-dir", self.args.debug_info_dir]) + if self.args.headers_dir is not None: + all_args.extend(["--headers-dir", self.args.headers_dir]) + if self.args.no_show_locs is not None and self.args.no_show_locs is not False: + all_args.extend(["--no-show-locs"]) + if self.args.load_all_types is not None and self.args.load_all_types is not False: + all_args.extend(["--load-all-types"]) + if self.args.annotate is not None and self.args.annotate is not False: + all_args.extend(["--annotate"]) + all_args.extend(["--out-file", self.args.abi_file]) + all_args.extend([self.args.elf_file]) + command = ["abidw"] + all_args + return command + + def gen_abi_file(self): + if self.args.elf_file is None: + logging.error("elf-file is None, please check your file") + return + if self.args.abi_file is None: + logging.error("abi-file path is None, please check your config") + return + command = self.build_gen_command() + self.exec_command(command) + + def build_compare_command(self): + all_args = ["--no-corpus-path", + "--deleted-fns", + "--drop-private-types", + "--changed-fns", + "--added-fns", + "--deleted-vars", + "--changed-vars", + "--added-vars", + "--harmless", + "--no-redundant"] + if self.args.suppressions is not None: + all_args.extend(["--suppressions", self.args.suppressions]) + if self.args.debug_info_dir1 is not None: + all_args.extend(["--debug-info-dir1", self.args.debug_info_dir1]) + if self.args.debug_info_dir2 is not None: + all_args.extend(["--debug-info-dir2", self.args.debug_info_dir2]) + if self.args.headers_dir1 is not None: + all_args.extend(["--headers-dir1", self.args.headers_dir1]) + if self.args.headers_dir2 is not None: + all_args.extend(["--headers-dir2", self.args.headers_dir2]) + if self.args.show_size_offset is not None: + size_offset = self.get_show_size_offset(self.args.show_size_offset) + all_args.extend([f"--show-{size_offset}"]) + all_args.extend(self.args.compare_files) + command = ["abidiff"] + all_args + return command + + def compare_abi_files(self, timeout=10): + if self.args.compare_files is None: + logging.error("elf_file is None, please check your file") + return False + command = self.build_compare_command() + cmd_string = " ".join(command) + with subprocess.Popen(command, stderr=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True, + start_new_session=True) as process: + output, errs = process.communicate(timeout=timeout) + out_str = output.decode() + if out_str is not None and out_str != "": + logging.warning("cmd_string is : %s", cmd_string) + logging.warning(out_str) + return True + else: + return False + + +def parse_abi_check_args(): + parser = argparse.ArgumentParser(description='Generate ABI files and compare ABI files') + parser.add_argument('--action', help='gen_abi or compare_abi') + parser.add_argument('--suppressions', help=' specify a suppression file') + parser.add_argument('--no-show-locs', action='store_true', default=False, help='do not show location information') + gen_abi = parser.add_argument_group("gen_abi_file") + gen_abi.add_argument( + '--elf-file', + help='elf-file to gen abi-file') + gen_abi.add_argument( + '--abi-file', + help=' write the output to file-path') + gen_abi.add_argument( + '--debug-info-dir', + help=' look for debug info under dir-path') + gen_abi.add_argument( + '--headers-dir', + help=' the path to headers of the elf file') + gen_abi.add_argument( + '--load-all-types', + action='store_true', + default=False, + help='read all types including those not reachable from exported declarations') + gen_abi.add_argument( + '--annotate', + action='store_true', + default=False, + help='annotate the ABI artifacts emitted in the output') + compare_abi = parser.add_argument_group("compare_abi") + compare_abi.add_argument( + '--compare-files', + nargs=2, + metavar='FILE', help='compare two abi files') + compare_abi.add_argument( + '--debug-info-dir1', + help=' the root for the debug info of file1') + compare_abi.add_argument( + '--debug-info-dir2', + help=' the root for the debug info of file1') + compare_abi.add_argument( + '--headers-dir1', + help=' the path to headers of file1') + compare_abi.add_argument( + '--headers-dir2', + help=' the path to headers of file2') + compare_abi.add_argument( + '--show-size-offset', + help='show size offsets in bytes/bits/hexadecimal/decimal') + return parser.parse_args() + + +def main(args): + abi_check = AbiCheck(args) + abi_check.run() + + +if __name__ == '__main__': + sys.exit(main(parse_abi_check_args())) diff --git a/llvm-build/build.py b/llvm-build/build.py index b665c2200fd2..7a8092541ea1 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -30,6 +30,7 @@ import stat from python_builder import MinGWPythonBuilder from prebuilts_clang_version import prebuilts_clang_version from get_ohos_flags import get_ohos_cflags, get_ohos_ldflags +from abi_check import AbiCheck class BuildConfig(): # Defines public methods and functions and obtains script parameters. @@ -69,7 +70,7 @@ class BuildConfig(): self.build_libs = args.build_libs self.build_libs_flags = args.build_libs_flags self.compression_format = args.compression_format - + self.enable_check_abi = args.enable_check_abi self.discover_paths() self.TARGETS = 'AArch64;ARM;BPF;Mips;RISCV;X86' @@ -251,13 +252,20 @@ class BuildConfig(): default='bz2', help='Choose compression output format (bz2 or gz)' ) - + parser.add_argument( '--build-with-debug-info', action='store_true', default=False, help='Append -g to build flags in build_libs') + parser.add_argument( + '--enable-check-abi', + nargs='?', + const=True, + default=False, + help='check libc++_shared.so abi') + def parse_args(self): parser = argparse.ArgumentParser(description='Process some integers.') @@ -1879,6 +1887,52 @@ class LlvmLibs(BuildUtils): os.makedirs(os.path.join(windows64_install, 'bin')) shutil.copyfile(os.path.join(libxml2_build_path, 'libxml2.dll'), os.path.join(windows64_install, 'bin', 'libxml2.dll')) + def run_abi_checks(self, enable_check_abi, llvm_install, configs): + diff_dict = {} + for (arch, target) in configs: + configs_list, cc, cxx, ar, llvm_config = self.libs_argument(llvm_install) + for (_, llvm_triple, _, multilib_suffix) in configs_list: + if target != llvm_triple: + continue + if multilib_suffix: + baseline_abi_file_path = self.merge_out_path(self.build_config.LLVM_BUILD_DIR, + "libcxx_abidiff", llvm_triple, multilib_suffix, "libc++_shared.abi") + elf_common_path = self.merge_out_path('lib', + f"libunwind-libcxxabi-libcxx-ndk-{str(llvm_triple)}-{multilib_suffix}", + 'lib', llvm_triple, multilib_suffix) + else: + baseline_abi_file_path = self.merge_out_path(self.build_config.LLVM_BUILD_DIR, + "libcxx_abidiff", llvm_triple, "libc++_shared.abi") + elf_common_path = self.merge_out_path('lib', + f"libunwind-libcxxabi-libcxx-ndk-{str(llvm_triple)}", 'lib', llvm_triple) + elf_file_path = self.merge_out_path(elf_common_path, "libc++_shared.so") + abi_file_path = self.merge_out_path(elf_common_path, "libc++_shared.abi") + header_dir = self.merge_out_path('lib', + f"libunwind-libcxxabi-libcxx-ndk-{str(llvm_triple)}", 'include', "c++", "v1") + res = self.run_abi_check(elf_file_path, abi_file_path, baseline_abi_file_path, header_dir) + if res: + diff_dict[abi_file_path] = baseline_abi_file_path + if len(diff_dict) > 0: + if enable_check_abi is True: + user_check = input("ABI files are different, please confirm if you want to update [Y/n] : \n") + if user_check.lower() == "y" or user_check.lower() == "yes": + for key, value in diff_dict.items(): + shutil.copy2(key, value) + self.logger().info('update abi file %s ', value) + return True + else: + raise Exception("ABI files are different, please check it") + return False + + def run_abi_check(self, elf_file_path, abi_file_path, baseline_abi_file_path, header_dir): + abi_args = argparse.Namespace() + abi_args.elf_file = elf_file_path + abi_args.abi_file = abi_file_path + abi_args.compare_files = [baseline_abi_file_path, abi_file_path] + abi_args.headers_dir = header_dir + abi_check = AbiCheck(abi_args) + abi_check.gen_abi_file() + return abi_check.compare_abi_files() class LlvmPackage(BuildUtils): @@ -2393,7 +2447,6 @@ class LlvmPackage(BuildUtils): create_tar = True if create_tar: self.package_up_resulting(package_name, host, install_host_dir) - return @@ -2480,6 +2533,11 @@ def main(): else: for (arch, target) in configs: llvm_libs.build_libs(llvm_install, target) + if build_config.enable_check_abi: + has_diff = llvm_libs.run_abi_checks(build_config.enable_check_abi, llvm_install, configs) + if has_diff: + print("Build is interrupted because of libCxx ABI changed") + return windows_python_builder = None diff --git a/llvm-build/libcxx_abidiff/aarch64-linux-ohos/libc++_shared.abi b/llvm-build/libcxx_abidiff/aarch64-linux-ohos/libc++_shared.abi new file mode 100644 index 000000000000..757c2c4e24a7 --- /dev/null +++ b/llvm-build/libcxx_abidiff/aarch64-linux-ohos/libc++_shared.abi @@ -0,0 +1,2366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_hard_neon-vfpv4/libc++_shared.abi b/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_hard_neon-vfpv4/libc++_shared.abi new file mode 100644 index 000000000000..9ab042d5bce0 --- /dev/null +++ b/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_hard_neon-vfpv4/libc++_shared.abi @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_soft/libc++_shared.abi b/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_soft/libc++_shared.abi new file mode 100644 index 000000000000..9ab042d5bce0 --- /dev/null +++ b/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_soft/libc++_shared.abi @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_softfp_neon-vfpv4/libc++_shared.abi b/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_softfp_neon-vfpv4/libc++_shared.abi new file mode 100644 index 000000000000..9ab042d5bce0 --- /dev/null +++ b/llvm-build/libcxx_abidiff/arm-linux-ohos/a7_softfp_neon-vfpv4/libc++_shared.abi @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/arm-linux-ohos/libc++_shared.abi b/llvm-build/libcxx_abidiff/arm-linux-ohos/libc++_shared.abi new file mode 100644 index 000000000000..9ab042d5bce0 --- /dev/null +++ b/llvm-build/libcxx_abidiff/arm-linux-ohos/libc++_shared.abi @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_hard_neon-vfpv4/libc++_shared.abi b/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_hard_neon-vfpv4/libc++_shared.abi new file mode 100644 index 000000000000..60a1c87eaead --- /dev/null +++ b/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_hard_neon-vfpv4/libc++_shared.abi @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_soft/libc++_shared.abi b/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_soft/libc++_shared.abi new file mode 100644 index 000000000000..60a1c87eaead --- /dev/null +++ b/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_soft/libc++_shared.abi @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_softfp_neon-vfpv4/libc++_shared.abi b/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_softfp_neon-vfpv4/libc++_shared.abi new file mode 100644 index 000000000000..60a1c87eaead --- /dev/null +++ b/llvm-build/libcxx_abidiff/arm-liteos-ohos/a7_softfp_neon-vfpv4/libc++_shared.abi @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/arm-liteos-ohos/libc++_shared.abi b/llvm-build/libcxx_abidiff/arm-liteos-ohos/libc++_shared.abi new file mode 100644 index 000000000000..60a1c87eaead --- /dev/null +++ b/llvm-build/libcxx_abidiff/arm-liteos-ohos/libc++_shared.abi @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/mipsel-linux-ohos/libc++_shared.abi b/llvm-build/libcxx_abidiff/mipsel-linux-ohos/libc++_shared.abi new file mode 100644 index 000000000000..65cda7fbf299 --- /dev/null +++ b/llvm-build/libcxx_abidiff/mipsel-linux-ohos/libc++_shared.abi @@ -0,0 +1,2366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/mipsel-linux-ohos/nanlegacy/libc++_shared.abi b/llvm-build/libcxx_abidiff/mipsel-linux-ohos/nanlegacy/libc++_shared.abi new file mode 100644 index 000000000000..65cda7fbf299 --- /dev/null +++ b/llvm-build/libcxx_abidiff/mipsel-linux-ohos/nanlegacy/libc++_shared.abi @@ -0,0 +1,2366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/riscv64-linux-ohos/libc++_shared.abi b/llvm-build/libcxx_abidiff/riscv64-linux-ohos/libc++_shared.abi new file mode 100644 index 000000000000..d8e41fef4660 --- /dev/null +++ b/llvm-build/libcxx_abidiff/riscv64-linux-ohos/libc++_shared.abi @@ -0,0 +1,2364 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llvm-build/libcxx_abidiff/x86_64-linux-ohos/libc++_shared.abi b/llvm-build/libcxx_abidiff/x86_64-linux-ohos/libc++_shared.abi new file mode 100644 index 000000000000..f14d3a5e3797 --- /dev/null +++ b/llvm-build/libcxx_abidiff/x86_64-linux-ohos/libc++_shared.abi @@ -0,0 +1,2365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- Gitee From bca6b6284463ec68cd264fde4acf5a57214e65ae Mon Sep 17 00:00:00 2001 From: zhao-baiyi Date: Tue, 2 Apr 2024 01:42:54 +0000 Subject: [PATCH 05/15] [build]LLVM compilation and installation package synchronization with OH Description: OH updated gn, but LLVM did not synchronize, resulting in LLVM compilation error Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I8PIOT Test: LLVM toolchain compilation Signed-off-by: zhao-baiyi --- llvm-build/env_prepare.sh | 53 ++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/llvm-build/env_prepare.sh b/llvm-build/env_prepare.sh index 2557ece0be32..6614f8c2fc6f 100755 --- a/llvm-build/env_prepare.sh +++ b/llvm-build/env_prepare.sh @@ -20,6 +20,10 @@ case $(uname -m) in host_cpu=x86_64 esac +linux_platform=linux-x86 +darwin_platform=darwin-x86 +download_url=https://mirrors.huaweicloud.com + # sync code directory code_dir=$(pwd) @@ -31,7 +35,7 @@ if [ ! -d "${bin_dir}" ];then mkdir -p "${bin_dir}" fi -DOWNLOADER="wget -t3 -T10 -O " +DOWNLOADER="wget -t3 -T10 -O" function download_and_archive() { archive_dir=$1 @@ -61,28 +65,24 @@ function download_and_archive() { copy_config=""" """ -CLANG_PACKAGE_VERSION="15.0.4-a36336" -CLANG_LINUX_BUILD=clang_linux-x86_64-a36336-20231130 copy_config_linux_x86_64=""" -prebuilts/cmake,https://mirrors.huaweicloud.com/harmonyos/compiler/cmake/3.16.5/${host_platform}/cmake-${host_platform}-x86-3.16.5.tar.gz -prebuilts/clang/ohos/${host_platform}-${host_cpu},https://mirrors.huaweicloud.com/openharmony/compiler/clang/${CLANG_PACKAGE_VERSION}/linux/${CLANG_LINUX_BUILD}.tar.bz2 -prebuilts/python3,https://mirrors.huaweicloud.com/harmonyos/compiler/python/3.10.2/${host_platform}/python-${host_platform}-x86-3.10.2_20230604.tar.gz -prebuilts/build-tools/${host_platform}-x86/bin,https://repo.huaweicloud.com/openharmony/compiler/gn/20240115/linux/gn-linux-x86-20240115.tar.gz -prebuilts/build-tools/${host_platform}-x86/bin,https://repo.huaweicloud.com/openharmony/compiler/ninja/1.11.0/linux/ninja-linux-x86-1.11.0.tar.gz +prebuilts/cmake,cmake-${linux_platform} +prebuilts/clang/ohos/${host_platform}-${host_cpu},linux/clang_${linux_platform} +prebuilts/python3,python-${linux_platform} +prebuilts/build-tools/${host_platform}-x86/bin,gn-${linux_platform} +prebuilts/build-tools/${host_platform}-x86/bin,ninja-${linux_platform} """ - -CLANG_DARWIN_BUILD=clang_darwin-x86_64-8e906c-20230415 copy_config_darwin_x86_64=""" -prebuilts/cmake,https://mirrors.huaweicloud.com/harmonyos/compiler/cmake/3.16.5/${host_platform}/cmake-${host_platform}-x86-3.16.5.tar.gz -prebuilts/clang/ohos/${host_platform}-${host_cpu},http://mirrors.huaweicloud.com/harmonyos/compiler/clang/15.0.4-8e906c/darwin/${CLANG_DARWIN_BUILD}.tar.bz2 -prebuilts/python3,https://mirrors.huaweicloud.com/harmonyos/compiler/python/3.10.2/${host_platform}/python-${host_platform}-x86-3.10.2_20230604.tar.gz -prebuilts/build-tools/${host_platform}-x86/bin,https://repo.huaweicloud.com/openharmony/compiler/gn/20240115/darwin/gn-darwin-x86-20240115.tar.gz -prebuilts/build-tools/${host_platform}-x86/bin,https://repo.huaweicloud.com/openharmony/compiler/ninja/1.11.0/darwin/ninja-darwin-x86-1.11.0.tar.gz +prebuilts/cmake,cmake-${darwin_platform} +prebuilts/clang/ohos/${host_platform}-${host_cpu},darwin/clang_${darwin_platform} +prebuilts/python3,python-${darwin_platform} +prebuilts/build-tools/${host_platform}-x86/bin,gn-${darwin_platform} +prebuilts/build-tools/${host_platform}-x86/bin,ninja-${darwin_platform} """ copy_config_darwin_arm64=""" -prebuilts/python3,https://mirrors.huaweicloud.com/harmonyos/compiler/python/3.10.2/${host_platform}/python-${host_platform}-x86-3.10.2_20230604.tar.gz +prebuilts/python3,python-${darwin_platform} """ if [[ "${host_platform}" == "linux" ]]; then @@ -109,11 +109,24 @@ fi for i in $(echo ${copy_config}) do - unzip_dir=$(echo $i|awk -F ',' '{print $1}') - remote_url=$(echo $i|awk -F ',' '{print $2}') - download_and_archive "${unzip_dir}" "${remote_url}" + unzip_dir=$(echo $i|awk -F ',' '{print $1}') + keyword=$(echo $i|awk -F ',' '{print $2}') + url_part=$(cat ./build/prebuilts_download_config.json | sort | uniq | grep "$keyword" | grep -oE '"/[^"]+"' | sed 's/^"//;s/"$//' |head -1) + echo $url_part + if [ -n "$url_part" ]; then + full_url="${download_url}${url_part}" + else + echo "URL not found" + fi + download_and_archive "${unzip_dir}" "${full_url}" + done +linux_filename=$(cat ./build/prebuilts_download_config.json | sort | uniq | grep "clang_linux-x86" | grep -oE '"/[^"]+"' | sed 's/^"//;s/"$//') +CLANG_LINUX_BUILD=$(basename "$linux_filename" .tar.bz2) + +darwin_filename=$(cat ./build/prebuilts_download_config.json | sort | uniq | grep "clang_darwin-x86" | grep -oE '"/[^"]+"' | sed 's/^"//;s/"$//') +CLANG_DARWIN_BUILD=$(basename "$darwin_filename" .tar.bz2) if [ -d "${code_dir}/prebuilts/clang/ohos/linux-x86_64/${CLANG_LINUX_BUILD}" ]; then SET_CLANG_VERSION='15.0.4' @@ -130,7 +143,7 @@ BASE_CLANG_DIR="${code_dir}/prebuilts/clang/ohos/${host_platform}-x86_64" CLANG_FOUND_VERSION=$(cd ${BASE_CLANG_DIR}; basename $(ls -d clang*/ | head -1) | sed s/clang-//) # check that pipe above didn't fail and that we have (any) clang version -if [ ! $? == 0 ] || [ x == x${CLANG_FOUND_VERSION} ] ; then +if [ ! $? == 0 ] || [ x == x${CLANG_FOUND_VERSION} ] ; then echo "env_prepare.sh: could not detect clang version" 2>&1 exit 1 fi -- Gitee From d9d86d8ebdced65c849189457f088d0d9c4c1388 Mon Sep 17 00:00:00 2001 From: Sukhikh Alexander Date: Tue, 2 Apr 2024 07:53:40 +0000 Subject: [PATCH 06/15] !421 Choose build targets for x86 * Add ability to choose runtimes/projects to build for host --- llvm-build/build.py | 68 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/llvm-build/build.py b/llvm-build/build.py index f8aaf6963a9b..d135ff4dfb65 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -91,6 +91,14 @@ class BuildConfig(): self.LIBXML2_VERSION = None logging.basicConfig(level=logging.INFO) + self.host_projects = args.host_build_projects + if 'clang' not in self.host_projects: + # Clang not found in the project list, + # but it is mandatory to build other projects/runtimes. + # Adding clang to project list. + self.host_projects.append('clang') + self.host_runtimes = args.host_build_runtimes + def discover_paths(self): # Location of llvm-build directory self.LLVM_BUILD_DIR = os.path.abspath(os.path.dirname(__file__)) @@ -238,7 +246,7 @@ class BuildConfig(): action='store_true', default=False, help='Automatically exit when timeout (currently effective for lldb-server)') - + parser.add_argument( '--enable-monitoring', action='store_true', @@ -289,24 +297,32 @@ class BuildConfig(): self.parse_add_argument(parser) - known_platforms = ('windows', 'libs', 'lldb-server', 'linux', 'check-api') - known_platforms_str = ', '.join(known_platforms) - class SeparatedListByCommaAction(argparse.Action): + + def __init__(self, choice_list, *args, **kwargs): + super().__init__(*args, **kwargs) + self.choice_list = choice_list + def __call__(self, parser, namespace, vals, option_string): - for val in vals.split(','): - if val in known_platforms: - continue - else: - error = '\'{}\' invalid. Choose from {}'.format(val, known_platforms) + if not vals: + setattr(namespace, self.dest, []) + return + vals = vals.split(',') + for val in vals: + if val not in self.choice_list: + error = f'"{val}" is invalid. Choose from: {self.choice_list}' raise argparse.ArgumentError(self, error) - setattr(namespace, self.dest, vals.split(',')) + setattr(namespace, self.dest, vals) + def choice_wrapper(choices): + return lambda *args, **kwargs: SeparatedListByCommaAction(choices, *args, **kwargs) + + known_platforms = ('windows', 'libs', 'lldb-server', 'linux', 'check-api') parser.add_argument( '--no-build', - action=SeparatedListByCommaAction, + action=choice_wrapper(known_platforms), default=list(), - help='Don\'t build toolchain for specified platforms. Choices: ' + known_platforms_str) + help=f"Don't build toolchain for specified platforms. Choices: {', '.join(known_platforms)}") known_libs = ['crts_first_time', 'crts_not_first_time', 'runtimes_libunwind', 'runtimes_libcxx', 'runtimes_libcxx_ndk'] known_libs_flags = ['OH', 'BOTH', 'LLVM'] @@ -321,7 +337,21 @@ class BuildConfig(): '--build-libs-flags', choices=known_libs_flags, default="LLVM", - help='which kind of flags for build_crts and build_runtimes, Choices:' + ', '.join(known_libs_flags)) + help='which kind of flags for build_crts and build_runtimes') + + llvm_projects = ('clang', 'lld', 'clang-tools-extra', 'openmp', 'lldb') + parser.add_argument( + '--host-build-projects', + action=choice_wrapper(llvm_projects), + default=llvm_projects, + help=f'Projects to build for host. Choices: {", ".join(llvm_projects)}') + + llvm_runtimes = ('libunwind', 'libcxxabi', 'libcxx', 'compiler-rt') + parser.add_argument( + '--host-build-runtimes', + action=choice_wrapper(llvm_runtimes), + default=llvm_runtimes, + help=f'Runtimes to build for host. Choices: {", ".join(llvm_runtimes)}') return parser.parse_args() @@ -697,8 +727,8 @@ class LlvmCore(BuildUtils): llvm_defines['LIBXML2_LIBRARY'] = os.path.join(self.get_prebuilts_dir('libxml2'), self.use_platform(), 'lib', f'libxml2.so.{self.build_config.LIBXML2_VERSION}') def llvm_compile_llvm_defines(self, llvm_defines, llvm_root, cflags, ldflags): - llvm_defines['LLVM_ENABLE_PROJECTS'] = 'clang;lld;clang-tools-extra;openmp;lldb' - llvm_defines['LLVM_ENABLE_RUNTIMES'] = 'libunwind;libcxxabi;libcxx;compiler-rt' + llvm_defines['LLVM_ENABLE_PROJECTS'] = ';'.join(self.build_config.host_projects) + llvm_defines['LLVM_ENABLE_RUNTIMES'] = ';'.join(self.build_config.host_runtimes) llvm_defines['LLVM_ENABLE_BINDINGS'] = 'OFF' llvm_defines['CMAKE_C_COMPILER'] = os.path.join(llvm_root, 'bin', 'clang') llvm_defines['CMAKE_CXX_COMPILER'] = os.path.join(llvm_root, 'bin', 'clang++') @@ -820,6 +850,12 @@ class LlvmCore(BuildUtils): cxx, windows_sysroot): + win_projects = list(self.build_config.host_projects) + if 'openmp' in win_projects: + # Currently we have build problems with + # windows openmp target (lack of ml.exe) + win_projects.remove('openmp') + if self.build_config.enable_assertions: windows_defines['LLVM_ENABLE_ASSERTIONS'] = 'ON' @@ -850,7 +886,7 @@ class LlvmCore(BuildUtils): windows_defines['LLVM_TOOL_OPENMP_BUILD'] = 'OFF' windows_defines['LLVM_INCLUDE_TESTS'] = 'OFF' windows_defines['LLVM_ENABLE_LIBCXX'] = 'ON' - windows_defines['LLVM_ENABLE_PROJECTS'] = 'clang;clang-tools-extra;lld;lldb' + windows_defines['LLVM_ENABLE_PROJECTS'] = ';'.join(win_projects) windows_defines['LLVM_BUILD_LLVM_DYLIB'] = 'OFF' windows_defines['CLANG_BUILD_EXAMPLES'] = 'OFF' windows_defines['CMAKE_SYSROOT'] = windows_sysroot -- Gitee From 99e3a7a64ca9016b7ef807a27e5913481c3e509a Mon Sep 17 00:00:00 2001 From: wanzixuan Date: Tue, 2 Apr 2024 02:20:24 +0000 Subject: [PATCH 07/15] [libcxxabi] Uncaught C++ exception supports faultlog Description: Add uncaught C++ exception to faultlog Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I9DI1D Test: LLVM toolchain compilation Signed-off-by: wanzixuan Change-Id: Ic3c2f8253a3982fc0c0aa1b0fb6b14a1cfcb4b79 --- libcxxabi/src/abort_message.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/libcxxabi/src/abort_message.cpp b/libcxxabi/src/abort_message.cpp index 2264168e1ef0..428b45096690 100644 --- a/libcxxabi/src/abort_message.cpp +++ b/libcxxabi/src/abort_message.cpp @@ -26,6 +26,10 @@ # define _LIBCXXABI_USE_CRASHREPORTER_CLIENT #endif +#if defined(__OHOS__) + extern "C" __attribute__((weak)) void set_fatal_message(const char *msg); +#endif + void abort_message(const char* format, ...) { // Write message to stderr. We do this before formatting into a @@ -52,7 +56,19 @@ void abort_message(const char* format, ...) va_end(list); CRSetCrashLogMessage(buffer); -#elif defined(__BIONIC__) && !defined(__OHOS__) + +#elif defined(__OHOS__) + char* buffer; + va_list list; + va_start(list, format); + vasprintf(&buffer, format, list); + va_end(list); + + if (&set_fatal_message) { + set_fatal_message(buffer); + } + +#elif defined(__BIONIC__) char* buffer; va_list list; va_start(list, format); @@ -73,7 +89,7 @@ void abort_message(const char* format, ...) // (tombstone and/or logcat) in older releases. __assert2(__FILE__, __LINE__, __func__, buffer); # endif // __ANDROID_API__ >= 21 -#endif // __BIONIC__ +#endif // __BIONIC__ || __OHOS__ abort(); } -- Gitee From 54a545a6bebb2750d44aabccc22111c30b0bbd7c Mon Sep 17 00:00:00 2001 From: liuyaning Date: Wed, 3 Apr 2024 10:34:51 +0800 Subject: [PATCH 08/15] [Build]Fix the llvm ci modify the ninja path to fix llvm ci Issue:https://gitee.com/openharmony/third_party_llvm-project/issues/I9DTX2 Test:No Signed-off-by: liuyaning --- llvm-build/build.py | 2 +- llvm-build/mingw.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm-build/build.py b/llvm-build/build.py index d135ff4dfb65..bef40a27305b 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -408,7 +408,7 @@ class BuildUtils(object): install=True, build_threads=False): - ninja_bin_path = os.path.join(self.CMAKE_BIN_DIR, 'ninja') + ninja_bin_path = os.path.join(self.build_config.REPOROOT_DIR, 'prebuilts/build-tools', self.platform_prefix(), 'bin', 'ninja') ninja_list = ['-l{}'.format(build_threads)] if build_threads else [] diff --git a/llvm-build/mingw.py b/llvm-build/mingw.py index 9d27a5e1eb6e..4436944af064 100755 --- a/llvm-build/mingw.py +++ b/llvm-build/mingw.py @@ -57,7 +57,7 @@ class LlvmMingw(): self.build_config = build_config self.CMAKE_BIN_PATH = os.path.join(self.cmake_prebuilt_bin_dir(), 'cmake') - self.NINJA_BIN_PATH = os.path.join(self.cmake_prebuilt_bin_dir(), 'ninja') + self.NINJA_BIN_PATH = os.path.join(self.build_config.repo_root('prebuilts/build-tools', 'linux-x86', 'bin'), 'ninja') self.LLVM_ROOT = self.build_config.out_root('llvm-install') self.LLVM_CONFIG = os.path.join(self.LLVM_ROOT, 'bin', 'llvm-config') -- Gitee From 6b2dc79d07f7c67684b82e46c9665f78eca0d021 Mon Sep 17 00:00:00 2001 From: DmitrievVadim Date: Wed, 3 Apr 2024 11:54:02 +0300 Subject: [PATCH 09/15] [OHOS][compiler-rt][test] Enable UBSan testing remotely on OHOS devices Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I9D4T3 Signed-off-by: DmitrievVadim --- .../test/sanitizer_common/ohos_family_commands/ohos_run.py | 4 ++-- .../test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py | 2 +- compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp | 3 ++- compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp | 6 ++++++ .../test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py | 2 +- compiler-rt/test/ubsan/lit.common.cfg.py | 2 +- compiler-rt/test/ubsan_minimal/lit.common.cfg.py | 2 +- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_run.py b/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_run.py index 675e064fa8ff..1bdd8ea33771 100755 --- a/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_run.py +++ b/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_run.py @@ -45,8 +45,8 @@ def build_env(): if san_opt: value += ':abort_on_error=0' if key in ['ASAN_ACTIVATION_OPTIONS', 'SCUDO_OPTIONS'] or san_opt or key == 'LD_LIBRARY_PATH': - if key == 'TSAN_OPTIONS': - # Map TSan suppressions file to device + if key in ['TSAN_OPTIONS', 'UBSAN_OPTIONS']: + # Map TSan or UBSan suppressions file to device value = map_list(value, ':', r'(?<=suppressions=)(.+)', lambda m: (m.group(1), True)) elif key == 'LD_LIBRARY_PATH': # Map LD_LIBRARY_PATH to device diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py b/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py index 57271b8078a4..ce7ce5ddde93 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py +++ b/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py @@ -5,5 +5,5 @@ def getRoot(config): root = getRoot(config) -if root.host_os not in ['Linux']: +if root.host_os not in ['Linux', 'OHOS']: # OHOS_LOCAL config.unsupported = True diff --git a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp index 4a94350ec162..e80552ec7434 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp +++ b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp @@ -21,7 +21,8 @@ // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%t-dir"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN // Coverage is not yet implemented in TSan. -// XFAIL: ubsan-tsan +// OHOS_LOCAL +// XFAIL: ubsan-tsan && !ohos_family // UNSUPPORTED: ubsan-standalone-static // No coverage support // UNSUPPORTED: openbsd diff --git a/compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp b/compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp index c82fed3bf3f6..23ec69459616 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp +++ b/compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp @@ -10,6 +10,12 @@ // RUN: %clangxx %s -lc -o %t %ld_flags_rpath_exe // RUN: %run %t 2>&1 | FileCheck %s +// OHOS_LOCAL begin +// For OHOS the test build commands result in a runtime error with a missing +// symbol message. +// UNSUPPORTED: ohos_family +// OHOS_LOCAL end + #include int dso_function(int); diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py b/compiler-rt/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py index 57271b8078a4..ce7ce5ddde93 100644 --- a/compiler-rt/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py +++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py @@ -5,5 +5,5 @@ def getRoot(config): root = getRoot(config) -if root.host_os not in ['Linux']: +if root.host_os not in ['Linux', 'OHOS']: # OHOS_LOCAL config.unsupported = True diff --git a/compiler-rt/test/ubsan/lit.common.cfg.py b/compiler-rt/test/ubsan/lit.common.cfg.py index 7108561a92c4..214833e240d6 100644 --- a/compiler-rt/test/ubsan/lit.common.cfg.py +++ b/compiler-rt/test/ubsan/lit.common.cfg.py @@ -68,7 +68,7 @@ config.substitutions.append( ("%gmlt ", " ".join(config.debug_info_flags) + " ") config.suffixes = ['.c', '.cpp', '.m'] # Check that the host supports UndefinedBehaviorSanitizer tests -if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows', 'NetBSD', 'SunOS', 'OpenBSD']: +if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows', 'NetBSD', 'SunOS', 'OpenBSD', 'OHOS']: # OHOS_LOCAL config.unsupported = True config.available_features.add('arch=' + config.target_arch) diff --git a/compiler-rt/test/ubsan_minimal/lit.common.cfg.py b/compiler-rt/test/ubsan_minimal/lit.common.cfg.py index 39800c968dbf..3455908413f4 100644 --- a/compiler-rt/test/ubsan_minimal/lit.common.cfg.py +++ b/compiler-rt/test/ubsan_minimal/lit.common.cfg.py @@ -30,7 +30,7 @@ config.substitutions.append( ("%clangxx ", build_invocation(clang_ubsan_cxxflags config.suffixes = ['.c', '.cpp'] # Check that the host supports UndefinedBehaviorSanitizerMinimal tests -if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD', 'Darwin', 'OpenBSD', 'SunOS']: # TODO: Windows +if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD', 'Darwin', 'OpenBSD', 'SunOS', 'OHOS']: # OHOS_LOCAL # TODO: Windows config.unsupported = True # Don't target x86_64h if the test machine can't execute x86_64h binaries. -- Gitee From 3c66676bd3e4a3ed893ec442e63780aaa75f0ea8 Mon Sep 17 00:00:00 2001 From: liujialiang Date: Mon, 8 Apr 2024 09:27:24 +0000 Subject: [PATCH 10/15] [LLDB][BUILD]Improve the compilation configuration of lldb Description: 1. "LLVM_HOST_TRIPLE" is a necessary configuration for cross-compiling for lldb-aarch64 2. lldb need to add its own config. Func 'set_lldb_defines' is added to do that. Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I9EXE1?from=project-issue Test: lldb for aarch64 can run and debug program. Signed-off-by: liujialiang Change-Id: If63655073a0e5704050d9f8e1980ea20da1dc848 --- llvm-build/build-ohos-aarch64.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/llvm-build/build-ohos-aarch64.py b/llvm-build/build-ohos-aarch64.py index 9dc42111624a..dd8fec1d54cc 100755 --- a/llvm-build/build-ohos-aarch64.py +++ b/llvm-build/build-ohos-aarch64.py @@ -18,7 +18,7 @@ import os from build import BuildConfig, BuildUtils def main(): - print('Start building LLVM toolchain for OHOS AArch64 host') + print('Start cross-compiling LLVM toolchain for OHOS AArch64 host on linux') build_config = BuildConfig() build_utils = BuildUtils(build_config) @@ -68,6 +68,7 @@ def main(): llvm_defines['CMAKE_INSTALL_PREFIX'] = llvm_install llvm_defines['CMAKE_SYSROOT'] = sysroot llvm_defines['CMAKE_LIBRARY_ARCHITECTURE'] = llvm_triple + llvm_defines['LLVM_HOST_TRIPLE'] = llvm_triple llvm_defines['LLVM_TARGETS_TO_BUILD'] = build_config.TARGETS llvm_defines['LLVM_TARGET_ARCH'] = 'AArch64' llvm_defines['LLVM_DEFAULT_TARGET_TRIPLE'] = llvm_triple @@ -80,7 +81,7 @@ def main(): llvm_defines['LLVM_BUILD_TOOLS'] = 'ON' llvm_defines['LLVM_INSTALL_UTILS'] = 'ON' llvm_defines['LLVM_ENABLE_ZLIB'] = 'OFF' - llvm_defines['LLVM_ENABLE_PROJECTS'] = 'clang;clang-tools-extra;lld;lldb;openmp' + llvm_defines['LLVM_ENABLE_PROJECTS'] = ';'.join(build_config.host_projects) # We do not build runtimes, since they will be copied from main toolchain build llvm_defines['LLVM_CONFIG_PATH'] = os.path.join(llvm_root, 'bin', 'llvm-config') llvm_defines['LLVM_TABLEGEN'] = os.path.join(llvm_root, 'bin', 'llvm-tblgen') @@ -118,6 +119,9 @@ def main(): llvm_defines['OPENMP_STANDALONE_BUILD'] = 'ON' llvm_defines['LLVM_DIR'] = os.path.join(llvm_root, 'lib', 'cmake', 'llvm') + lldb_defines = set_lldb_defines() + llvm_defines.update(lldb_defines) + if build_config.enable_assertions: llvm_defines['LLVM_ENABLE_ASSERTIONS'] = 'ON' @@ -153,6 +157,20 @@ def main(): build_utils.check_create_dir(build_config.PACKAGES_PATH) build_utils.check_call(args) +def set_lldb_defines(): + lldb_defines = {} + lldb_defines['LLDB_INCLUDE_TESTS'] = 'OFF' + lldb_defines['LLDB_ENABLE_TIMEOUT'] = 'False' + # Optional Dependencies + lldb_defines['LLDB_ENABLE_LIBEDIT'] = 'OFF' + lldb_defines['LLDB_ENABLE_CURSE'] = 'OFF' + lldb_defines['LLDB_ENABLE_LIBXML2'] = 'OFF' + lldb_defines['LLDB_ENABLE_LZMA'] = 'OFF' + lldb_defines['LLDB_ENABLE_PYTHON'] = 'OFF' + # Debug & Tuning + lldb_defines['LLDB_ENABLE_PERFORMANCE'] = 'OFF' + + return lldb_defines if __name__ == '__main__': main() -- Gitee From 758c955736684dc8aa5fa623364ef77bfd6ffdbf Mon Sep 17 00:00:00 2001 From: Lyupa Anastasia Date: Fri, 12 Apr 2024 17:20:54 +0300 Subject: [PATCH 11/15] [build] Update cmake from 3.16 to 3.28 Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I9GA68 Signed-off-by: Lyupa Anastasia --- llvm-build/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm-build/build.py b/llvm-build/build.py index bef40a27305b..92b11a801b6b 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -1033,7 +1033,7 @@ class SysrootComposer(BuildUtils): # but it didn't contain these two lines, so we still need OHOS.cmake. ohos_cmake = 'OHOS.cmake' dst_dir = self.merge_out_path( - '../prebuilts/cmake/%s/share/cmake-3.16/Modules/Platform' % self.platform_prefix()) + '../prebuilts/cmake/%s/share/cmake-3.28/Modules/Platform' % self.platform_prefix()) src_file = '%s/%s' % (self.build_config.LLVM_BUILD_DIR, ohos_cmake) if os.path.exists(os.path.join(dst_dir, ohos_cmake)): os.remove(os.path.join(dst_dir, ohos_cmake)) -- Gitee From 06eb05e3da97c57a0d3f94f4ad42eeb72fc96765 Mon Sep 17 00:00:00 2001 From: Lyupa Anastasia Date: Tue, 9 Apr 2024 12:33:31 +0300 Subject: [PATCH 12/15] [compiler-rt][OHOS] Remove print in hdc_constants Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I9FXQY Signed-off-by: Lyupa Anastasia --- .../sanitizer_common/ohos_family_commands/hdc_constants.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/compiler-rt/test/sanitizer_common/ohos_family_commands/hdc_constants.py b/compiler-rt/test/sanitizer_common/ohos_family_commands/hdc_constants.py index 5fcfb514f4b3..3ea67a67c65e 100644 --- a/compiler-rt/test/sanitizer_common/ohos_family_commands/hdc_constants.py +++ b/compiler-rt/test/sanitizer_common/ohos_family_commands/hdc_constants.py @@ -3,16 +3,13 @@ import os # TODO: move this to the cmake ? HDC = os.environ.get('HDC', 'hdc') +# Please set "HDC_SERVER_IP_PORT" and "HDC_UTID" environment variables +# to pass options for connecting to remote device if needed HDC_SERVER_IP_PORT = os.environ.get('HDC_SERVER_IP_PORT') HDC_UTID = os.environ.get('HDC_UTID') TMPDIR = os.environ.get('OHOS_REMOTE_TMP_DIR', '/data/local/tmp/Output') DYN_LINKER = os.environ.get('OHOS_REMOTE_DYN_LINKER') -# emit warning on import if some required constants are not set -if not HDC_SERVER_IP_PORT or not HDC_UTID: - print('Please set "HDC_SERVER_IP_PORT" and "HDC_UTID" environment variables ' - 'to be able to debug on remote device') - def get_hdc_cmd_prefix(): server = ['-s', HDC_SERVER_IP_PORT] if HDC_SERVER_IP_PORT else [] device = ['-t', HDC_UTID] if HDC_UTID else [] -- Gitee From 0a25beac9645c61502073fa0d7c72de95184307a Mon Sep 17 00:00:00 2001 From: A_Wei Date: Tue, 16 Apr 2024 10:36:51 +0800 Subject: [PATCH 13/15] =?UTF-8?q?[LLDB]=20Fixed=20file=20paths=20with=20sp?= =?UTF-8?q?aces=20cannot=20pull=20so=20Description:=20Add=20"=20to=20the?= =?UTF-8?q?=20path=20when=20calling=20the=20hdc=20command=20Issue=EF=BC=9A?= =?UTF-8?q?=20https://gitee.com/openharmony/third=5Fparty=5Fllvm-project/i?= =?UTF-8?q?ssues/I9GYOS=3Ffrom=3Dproject-issue=20Test:=20Files=20in=20path?= =?UTF-8?q?s=20with=20spaces=20can=20be=20obtained=20through=20hdc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: A_Wei Change-Id: 4da90238afc0f6332df140c3f9cd4b82aaf3bbde --- lldb/source/Plugins/Platform/OHOS/HdcClient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp b/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp index 679b821f2d08..bcac55f04b7d 100644 --- a/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp +++ b/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp @@ -290,7 +290,7 @@ Status HdcClient::LocalTransferFile(const char *direction, const FileSpec &src, std::stringstream cmd; cmd << "file " << direction << " -m " << " -cwd "; cmd.write(cwd.data(), cwd.size()); - cmd << " " << src.GetPath() << " " << dst.GetPath(); + cmd << " \"" << src.GetPath() << "\" \"" << dst.GetPath() << "\""; Status error = SendMessage(cmd.str()); if (error.Fail()) return error; @@ -594,7 +594,7 @@ Status HdcClient::RecvFile(const FileSpec &src, const FileSpec &dst) { std::stringstream cmd; cmd << "file recv remote -m"; - cmd << " " << src.GetPath() << " " << dst.GetPath(); + cmd << " \"" << src.GetPath() << "\" \"" << dst.GetPath() << "\""; Status error = SendMessage(cmd.str()); if (error.Fail()) return error; @@ -701,7 +701,7 @@ Status HdcClient::SendFile(const FileSpec &src, const FileSpec &dst) { return Status("Unable to open local file %s", local_file_path.c_str()); std::stringstream cmd; - cmd << "file send remote -m " << src.GetPath() << " " << dst.GetPath(); + cmd << "file send remote -m \"" << src.GetPath() << "\" \"" << dst.GetPath() << "\""; Status error = SendMessage(cmd.str()); if (error.Fail()) return error; -- Gitee From cf08ba81e3d582dedbf77aafaf202fc323abc64e Mon Sep 17 00:00:00 2001 From: guzhihao4 Date: Sun, 7 Apr 2024 07:39:14 +0000 Subject: [PATCH 14/15] [OHOS][Sanitizer] Add log end in sanitizers Description: Add log end strings in all sanitizers so that hiview can identify it and write to file. Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I9EIO3 Test: All sanitizer log write to hiview log Signed-off-by: guzhihao4 Change-Id: Iad0f02fbad792e248284f3e0ac52f356dee965b8 --- compiler-rt/lib/asan/asan_report.cpp | 1 + compiler-rt/lib/asan/asan_rtl.cpp | 1 + compiler-rt/lib/hwasan/hwasan_report.cpp | 1 + compiler-rt/lib/tsan/rtl/tsan_report.cpp | 1 + compiler-rt/lib/tsan/rtl/tsan_rtl.cpp | 1 + compiler-rt/lib/ubsan/ubsan_handlers.cpp | 1 + compiler-rt/lib/ubsan/ubsan_init.cpp | 1 + 7 files changed, 7 insertions(+) diff --git a/compiler-rt/lib/asan/asan_report.cpp b/compiler-rt/lib/asan/asan_report.cpp index 2a55d6c0978d..8ba48c51df63 100644 --- a/compiler-rt/lib/asan/asan_report.cpp +++ b/compiler-rt/lib/asan/asan_report.cpp @@ -191,6 +191,7 @@ class ScopedInErrorReport { Report("ABORTING\n"); Die(); } + Report("End Asan report\n"); // OHOS_LOCAL } void ReportError(const ErrorDescription &description) { diff --git a/compiler-rt/lib/asan/asan_rtl.cpp b/compiler-rt/lib/asan/asan_rtl.cpp index 686834063149..cbbdcf7914b0 100644 --- a/compiler-rt/lib/asan/asan_rtl.cpp +++ b/compiler-rt/lib/asan/asan_rtl.cpp @@ -63,6 +63,7 @@ static void AsanDie() { UnmapOrDie((void*)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg); } } + Report("End Asan report (AsanDie)\n"); // OHOS_LOCAL } static void CheckUnwind() { diff --git a/compiler-rt/lib/hwasan/hwasan_report.cpp b/compiler-rt/lib/hwasan/hwasan_report.cpp index 66d3d155d409..a59d5fef9791 100644 --- a/compiler-rt/lib/hwasan/hwasan_report.cpp +++ b/compiler-rt/lib/hwasan/hwasan_report.cpp @@ -56,6 +56,7 @@ class ScopedReport { if (common_flags()->print_module_map >= 2 || (fatal && common_flags()->print_module_map)) DumpProcessMap(); + Report("End Hwasan report\n"); // OHOS_LOCAL if (fatal) Die(); } diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp index 3b0bddc33a43..b5481eb8b340 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp @@ -469,6 +469,7 @@ void PrintReport(const ReportDesc *rep) { } } Printf("==================\n"); + Report("End Tsan report\n"); // OHOS_LOCAL } #endif diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp index ff3bb33eb134..5b4c7a0e4bdb 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp @@ -796,6 +796,7 @@ int Finalize(ThreadState *thr) { PrintMatchedSuppressions(); failed = OnFinalize(failed); + Report("End Tsan report (Finalize)\n"); // OHOS_LOCAL return failed ? common_flags()->exitcode : 0; } diff --git a/compiler-rt/lib/ubsan/ubsan_handlers.cpp b/compiler-rt/lib/ubsan/ubsan_handlers.cpp index e201e6bba220..faafa92423bd 100644 --- a/compiler-rt/lib/ubsan/ubsan_handlers.cpp +++ b/compiler-rt/lib/ubsan/ubsan_handlers.cpp @@ -902,6 +902,7 @@ void __ubsan::__ubsan_handle_cfi_check_fail(CFICheckFailData *Data, handleCFIBadIcall(Data, Value, Opts); else __ubsan_handle_cfi_bad_type(Data, Value, ValidVtable, Opts); + Report("End CFI report\n"); // OHOS_LOCAL } void __ubsan::__ubsan_handle_cfi_check_fail_abort(CFICheckFailData *Data, diff --git a/compiler-rt/lib/ubsan/ubsan_init.cpp b/compiler-rt/lib/ubsan/ubsan_init.cpp index 01080567331e..54ff2b450519 100644 --- a/compiler-rt/lib/ubsan/ubsan_init.cpp +++ b/compiler-rt/lib/ubsan/ubsan_init.cpp @@ -37,6 +37,7 @@ static void CommonInit() { static void UbsanDie() { if (common_flags()->print_module_map >= 1) DumpProcessMap(); + Report("End CFI report (UbsanDie)\n"); // OHOS_LOCAL } static void CommonStandaloneInit() { -- Gitee From 37a6a8287decac2540fe692bff465e1c9b48d8e7 Mon Sep 17 00:00:00 2001 From: Sukhikh Alexander Date: Tue, 23 Apr 2024 04:01:39 +0000 Subject: [PATCH 15/15] !427 Enable -fno-plt option for aarch64 * [AArch64] Implement -fno-plt for SelectionDAG/GlobalISel --- llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 17 ++++++++++++++--- llvm/lib/Target/AArch64/AArch64FastISel.cpp | 5 +++++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 9 +++++---- llvm/lib/Target/AArch64/AArch64Subtarget.cpp | 11 ++++++----- .../AArch64/GISel/AArch64CallLowering.cpp | 11 ++++++++++- .../GISel/AArch64InstructionSelector.cpp | 16 ++++++++++++---- .../AArch64/GISel/AArch64LegalizerInfo.cpp | 3 +++ llvm/test/CodeGen/AArch64/nonlazybind.ll | 2 +- 8 files changed, 56 insertions(+), 18 deletions(-) diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp index 6c36c6445c65..3c967a857f35 100644 --- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp @@ -133,9 +133,20 @@ bool CallLowering::lowerCall(MachineIRBuilder &MIRBuilder, const CallBase &CB, // Try looking through a bitcast from one function type to another. // Commonly happens with calls to objc_msgSend(). const Value *CalleeV = CB.getCalledOperand()->stripPointerCasts(); - if (const Function *F = dyn_cast(CalleeV)) - Info.Callee = MachineOperand::CreateGA(F, 0); - else + if (const Function *F = dyn_cast(CalleeV)) { + if (F->hasFnAttribute(Attribute::NonLazyBind)) { + LLT Ty = getLLTForType(*F->getType(), DL); + Register Reg = MIRBuilder.buildGlobalValue(Ty, F).getReg(0); + Info.Callee = MachineOperand::CreateReg(Reg, false); + } else { + Info.Callee = MachineOperand::CreateGA(F, 0); + } + } else if (isa(CalleeV) || isa(CalleeV)) { + // IR IFuncs and Aliases can't be forward declared (only defined), so the + // callee must be in the same TU and therefore we can direct-call it without + // worrying about it being out of range. + Info.Callee = MachineOperand::CreateGA(cast(CalleeV), 0); + } else Info.Callee = MachineOperand::CreateReg(GetCalleeReg(), false); Register ReturnHintAlignReg; diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp index 6aa0e45eac67..9b4ddd03b9a0 100644 --- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp +++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp @@ -3152,6 +3152,11 @@ bool AArch64FastISel::fastLowerCall(CallLoweringInfo &CLI) { if (CM == CodeModel::Large && !Subtarget->isTargetMachO()) return false; + // ELF -fno-plt compiled intrinsic calls do not have the nonlazybind + // attribute. Check "RtLibUseGOT" instead. + if (MF->getFunction().getParent()->getRtLibUseGOT()) + return false; + // Let SDISel handle vararg functions. if (IsVarArg) return false; diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 638bbab0f194..a98f763143fe 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -6901,13 +6901,14 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, Callee = DAG.getTargetGlobalAddress(GV, DL, PtrVT, 0, 0); } } else if (auto *S = dyn_cast(Callee)) { - if (getTargetMachine().getCodeModel() == CodeModel::Large && - Subtarget->isTargetMachO()) { - const char *Sym = S->getSymbol(); + bool UseGot = (getTargetMachine().getCodeModel() == CodeModel::Large && + Subtarget->isTargetMachO()) || + MF.getFunction().getParent()->getRtLibUseGOT(); + const char *Sym = S->getSymbol(); + if (UseGot) { Callee = DAG.getTargetExternalSymbol(Sym, PtrVT, AArch64II::MO_GOT); Callee = DAG.getNode(AArch64ISD::LOADgot, DL, PtrVT, Callee); } else { - const char *Sym = S->getSymbol(); Callee = DAG.getTargetExternalSymbol(Sym, PtrVT, 0); } } diff --git a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp index 15005304383d..4fda1ee74387 100644 --- a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp +++ b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp @@ -44,10 +44,10 @@ static cl::opt UseAddressTopByteIgnored("aarch64-use-tbi", cl::desc("Assume that top byte of " "an address is ignored"), cl::init(false), cl::Hidden); -static cl::opt - UseNonLazyBind("aarch64-enable-nonlazybind", - cl::desc("Call nonlazybind functions via direct GOT load"), - cl::init(false), cl::Hidden); +static cl::opt MachOUseNonLazyBind( + "aarch64-macho-enable-nonlazybind", + cl::desc("Call nonlazybind functions via direct GOT load for Mach-O"), + cl::Hidden); static cl::opt UseAA("aarch64-use-aa", cl::init(true), cl::desc("Enable the use of AA during codegen.")); @@ -354,7 +354,8 @@ unsigned AArch64Subtarget::classifyGlobalFunctionReference( // NonLazyBind goes via GOT unless we know it's available locally. auto *F = dyn_cast(GV); - if (UseNonLazyBind && F && F->hasFnAttribute(Attribute::NonLazyBind) && + if ((!isTargetMachO() || MachOUseNonLazyBind) && F && + F->hasFnAttribute(Attribute::NonLazyBind) && !TM.shouldAssumeDSOLocal(*GV->getParent(), GV)) return AArch64II::MO_GOT; diff --git a/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp b/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp index 62bf5f439fe6..5c3a2ee63d56 100644 --- a/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp @@ -1183,8 +1183,17 @@ bool AArch64CallLowering::lowerCall(MachineIRBuilder &MIRBuilder, !Subtarget.noBTIAtReturnTwice() && MF.getInfo()->branchTargetEnforcement()) Opc = AArch64::BLR_BTI; - else + else { + // For an intrinsic call (e.g. memset), use GOT if "RtLibUseGOT" (-fno-plt) + // is set. + if (Info.Callee.isSymbol() && F.getParent()->getRtLibUseGOT()) { + auto MIB = MIRBuilder.buildInstr(TargetOpcode::G_GLOBAL_VALUE); + DstOp(getLLTForType(*F.getType(), DL)).addDefToMIB(MRI, MIB); + MIB.addExternalSymbol(Info.Callee.getSymbolName(), AArch64II::MO_GOT); + Info.Callee = MachineOperand::CreateReg(MIB.getReg(0), false); + } Opc = getCallOpcode(MF, Info.Callee.isReg(), false); + } auto MIB = MIRBuilder.buildInstrNoInsert(Opc); unsigned CalleeOpNo = 0; diff --git a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp index eb8d0552173d..6d29504c7ce3 100644 --- a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp @@ -2733,11 +2733,19 @@ bool AArch64InstructionSelector::select(MachineInstr &I) { } case TargetOpcode::G_GLOBAL_VALUE: { - auto GV = I.getOperand(1).getGlobal(); - if (GV->isThreadLocal()) - return selectTLSGlobalValue(I, MRI); + const GlobalValue *GV = nullptr; + unsigned OpFlags; + if (I.getOperand(1).isSymbol()) { + OpFlags = I.getOperand(1).getTargetFlags(); + // Currently only used by "RtLibUseGOT". + assert(OpFlags == AArch64II::MO_GOT); + } else { + GV = I.getOperand(1).getGlobal(); + if (GV->isThreadLocal()) + return selectTLSGlobalValue(I, MRI); + OpFlags = STI.ClassifyGlobalReference(GV, TM); + } - unsigned OpFlags = STI.ClassifyGlobalReference(GV, TM); if (OpFlags & AArch64II::MO_GOT) { I.setDesc(TII.get(AArch64::LOADgot)); I.getOperand(1).setTargetFlags(OpFlags); diff --git a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp index 380d3621e745..fb1a6790cce5 100644 --- a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp @@ -939,6 +939,9 @@ bool AArch64LegalizerInfo::legalizeSmallCMGlobalValue( // By splitting this here, we can optimize accesses in the small code model by // folding in the G_ADD_LOW into the load/store offset. auto &GlobalOp = MI.getOperand(1); + // Don't modify an intrinsic call. + if (GlobalOp.isSymbol()) + return true; const auto* GV = GlobalOp.getGlobal(); if (GV->isThreadLocal()) return true; // Don't want to modify TLS vars. diff --git a/llvm/test/CodeGen/AArch64/nonlazybind.ll b/llvm/test/CodeGen/AArch64/nonlazybind.ll index 7f5701495ef9..cf8f01cd7f3b 100644 --- a/llvm/test/CodeGen/AArch64/nonlazybind.ll +++ b/llvm/test/CodeGen/AArch64/nonlazybind.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=aarch64-apple-ios %s -o - -aarch64-enable-nonlazybind | FileCheck %s +; RUN: llc -mtriple=aarch64-apple-ios %s -o - -aarch64-macho-enable-nonlazybind | FileCheck %s ; RUN: llc -mtriple=aarch64-apple-ios %s -o - | FileCheck %s --check-prefix=CHECK-NORMAL define void @local() nonlazybind { -- Gitee