llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-lldb Author: David Mentler (mentlerd) <details> <summary>Changes</summary> This PR fixes warnings that occur out-of-the-box when building lldb with Xcode 27 in standalone mode. The exact warning messages are in commit descriptions. --- Full diff: https://github.com/llvm/llvm-project/pull/213438.diff 4 Files Affected: - (modified) lldb/cmake/modules/LLDBFramework.cmake (+2) - (modified) lldb/source/Host/posix/FilePosix.cpp (+1-1) - (modified) lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp (+39-34) - (modified) llvm/cmake/modules/AddLLVM.cmake (+8-2) ``````````diff diff --git a/lldb/cmake/modules/LLDBFramework.cmake b/lldb/cmake/modules/LLDBFramework.cmake index 23d9d49d0cefc..88a1c2b968e40 100644 --- a/lldb/cmake/modules/LLDBFramework.cmake +++ b/lldb/cmake/modules/LLDBFramework.cmake @@ -19,6 +19,8 @@ if(NOT APPLE_EMBEDDED) MACOSX_FRAMEWORK_BUNDLE_VERSION ${LLDB_VERSION} MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${LLDB_VERSION} MACOSX_FRAMEWORK_INFO_PLIST ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist.in + + XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.apple.LLDB.framework ) else() set_target_properties(liblldb PROPERTIES diff --git a/lldb/source/Host/posix/FilePosix.cpp b/lldb/source/Host/posix/FilePosix.cpp index 27ef905fb6eb8..a09f042d8a3d6 100644 --- a/lldb/source/Host/posix/FilePosix.cpp +++ b/lldb/source/Host/posix/FilePosix.cpp @@ -235,4 +235,4 @@ Status NativeFilePosix::Write(const void *buf, size_t &num_bytes, return error; } -char NativeFilePosix::ID = 0; \ No newline at end of file +char NativeFilePosix::ID = 0; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index ce75ebfce7d8d..e89c79171f3a0 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -49,12 +49,17 @@ bool CommunicationKDP::SendRequestPacket( return SendRequestPacketNoLock(request_packet); } +static constexpr uint8_t Combine(CommunicationKDP::PacketType packet_type, + CommunicationKDP::CommandType command_type) { + return uint8_t(command_type) | uint8_t(packet_type); +} + void CommunicationKDP::MakeRequestPacketHeader(CommandType request_type, PacketStreamType &request_packet, uint16_t request_length) { request_packet.Clear(); - request_packet.PutHex8(request_type | - ePacketTypeRequest); // Set the request type + request_packet.PutHex8( + Combine(ePacketTypeRequest, request_type)); // Set the request type request_packet.PutHex8(m_request_sequence_id++); // Sequence number request_packet.PutHex16( request_length); // Length of the packet including this header @@ -252,8 +257,8 @@ bool CommunicationKDP::CheckForPacket(const uint8_t *src, size_t src_len, lldb::offset_t offset = 0; uint8_t reply_command = packet.GetU8(&offset); switch (reply_command) { - case ePacketTypeRequest | KDP_EXCEPTION: - case ePacketTypeRequest | KDP_TERMINATION: + case Combine(ePacketTypeRequest, KDP_EXCEPTION): + case Combine(ePacketTypeRequest, KDP_TERMINATION): // We got an exception request, so be sure to send an ACK { PacketStreamType request_ack_packet(Stream::eBinary, m_byte_order); @@ -268,36 +273,36 @@ bool CommunicationKDP::CheckForPacket(const uint8_t *src, size_t src_len, } // Fall through to case below to get packet contents [[fallthrough]]; - case ePacketTypeReply | KDP_CONNECT: - case ePacketTypeReply | KDP_DISCONNECT: - case ePacketTypeReply | KDP_HOSTINFO: - case ePacketTypeReply | KDP_VERSION: - case ePacketTypeReply | KDP_MAXBYTES: - case ePacketTypeReply | KDP_READMEM: - case ePacketTypeReply | KDP_WRITEMEM: - case ePacketTypeReply | KDP_READREGS: - case ePacketTypeReply | KDP_WRITEREGS: - case ePacketTypeReply | KDP_LOAD: - case ePacketTypeReply | KDP_IMAGEPATH: - case ePacketTypeReply | KDP_SUSPEND: - case ePacketTypeReply | KDP_RESUMECPUS: - case ePacketTypeReply | KDP_BREAKPOINT_SET: - case ePacketTypeReply | KDP_BREAKPOINT_REMOVE: - case ePacketTypeReply | KDP_REGIONS: - case ePacketTypeReply | KDP_REATTACH: - case ePacketTypeReply | KDP_HOSTREBOOT: - case ePacketTypeReply | KDP_READMEM64: - case ePacketTypeReply | KDP_WRITEMEM64: - case ePacketTypeReply | KDP_BREAKPOINT_SET64: - case ePacketTypeReply | KDP_BREAKPOINT_REMOVE64: - case ePacketTypeReply | KDP_KERNELVERSION: - case ePacketTypeReply | KDP_READPHYSMEM64: - case ePacketTypeReply | KDP_WRITEPHYSMEM64: - case ePacketTypeReply | KDP_READIOPORT: - case ePacketTypeReply | KDP_WRITEIOPORT: - case ePacketTypeReply | KDP_READMSR64: - case ePacketTypeReply | KDP_WRITEMSR64: - case ePacketTypeReply | KDP_DUMPINFO: { + case Combine(ePacketTypeReply, KDP_CONNECT): + case Combine(ePacketTypeReply, KDP_DISCONNECT): + case Combine(ePacketTypeReply, KDP_HOSTINFO): + case Combine(ePacketTypeReply, KDP_VERSION): + case Combine(ePacketTypeReply, KDP_MAXBYTES): + case Combine(ePacketTypeReply, KDP_READMEM): + case Combine(ePacketTypeReply, KDP_WRITEMEM): + case Combine(ePacketTypeReply, KDP_READREGS): + case Combine(ePacketTypeReply, KDP_WRITEREGS): + case Combine(ePacketTypeReply, KDP_LOAD): + case Combine(ePacketTypeReply, KDP_IMAGEPATH): + case Combine(ePacketTypeReply, KDP_SUSPEND): + case Combine(ePacketTypeReply, KDP_RESUMECPUS): + case Combine(ePacketTypeReply, KDP_BREAKPOINT_SET): + case Combine(ePacketTypeReply, KDP_BREAKPOINT_REMOVE): + case Combine(ePacketTypeReply, KDP_REGIONS): + case Combine(ePacketTypeReply, KDP_REATTACH): + case Combine(ePacketTypeReply, KDP_HOSTREBOOT): + case Combine(ePacketTypeReply, KDP_READMEM64): + case Combine(ePacketTypeReply, KDP_WRITEMEM64): + case Combine(ePacketTypeReply, KDP_BREAKPOINT_SET64): + case Combine(ePacketTypeReply, KDP_BREAKPOINT_REMOVE64): + case Combine(ePacketTypeReply, KDP_KERNELVERSION): + case Combine(ePacketTypeReply, KDP_READPHYSMEM64): + case Combine(ePacketTypeReply, KDP_WRITEPHYSMEM64): + case Combine(ePacketTypeReply, KDP_READIOPORT): + case Combine(ePacketTypeReply, KDP_WRITEIOPORT): + case Combine(ePacketTypeReply, KDP_READMSR64): + case Combine(ePacketTypeReply, KDP_WRITEMSR64): + case Combine(ePacketTypeReply, KDP_DUMPINFO): { offset = 2; const uint16_t length = packet.GetU16(&offset); if (length <= bytes_available) { diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index a267166eb6c2d..370a2dcfa424f 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -1232,8 +1232,14 @@ macro(add_llvm_executable name) NOT LLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES AND NOT ARG_EXPORT_SYMBOLS) if(LLVM_LINKER_SUPPORTS_NO_EXPORTED_SYMBOLS) - set_property(TARGET ${name} APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-no_exported_symbols") + if (XCODE) + # warning: The OTHER_LDFLAGS build setting is not allowed to contain -no_exported_symbols, + # use the dedicated LD_EXPORT_SYMBOLS build setting instead. + set_target_properties(${name} PROPERTIES LD_EXPORT_SYMBOLS NO) + else() + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-no_exported_symbols") + endif() else() message(FATAL_ERROR "LLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES cannot be disabled when linker does not support \"-no_exported_symbols\"") `````````` </details> https://github.com/llvm/llvm-project/pull/213438 _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
