Skip to content

Commit

Permalink
[llvm][objdump] Remove support for printing the embedded Bitcode sect…
Browse files Browse the repository at this point in the history
…ion in MachO files. (#68457)

It's no longer possible to submit bitcode apps to the Apple App Store.
The tools
used to create xar archived bitcode sections inside MachO files have
been
discontinued. Additionally, the xar APIs have been deprecated since
macOS 12,
so this change removes unnecessary code from objdump and all
dependencies on
libxar.

This fixes rdar://116600767
  • Loading branch information
ributzka authored Oct 9, 2023
1 parent bc34a83 commit eb60143
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 463 deletions.
11 changes: 0 additions & 11 deletions llvm/cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,6 @@ else()
set(LLVM_ENABLE_TERMINFO 0)
endif()

check_library_exists(xar xar_open "" LLVM_HAVE_LIBXAR)
if(LLVM_HAVE_LIBXAR)
message(STATUS "The xar file format has been deprecated: LLVM_HAVE_LIBXAR might be removed in the future.")
# The xar file format has been deprecated since macOS 12.0.
if (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 12)
set(LLVM_HAVE_LIBXAR 0)
else()
set(XAR_LIB xar)
endif()
endif()

# function checks
check_symbol_exists(arc4random "stdlib.h" HAVE_DECL_ARC4RANDOM)
find_package(Backtrace)
Expand Down
2 changes: 0 additions & 2 deletions llvm/cmake/modules/LLVMConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ set(LLVM_ENABLE_SHARED_LIBS @BUILD_SHARED_LIBS@)
set(LLVM_DEFAULT_EXTERNAL_LIT "@LLVM_CONFIG_DEFAULT_EXTERNAL_LIT@")
set(LLVM_LIT_ARGS "@LLVM_LIT_ARGS@")

set(LLVM_HAVE_LIBXAR "@LLVM_HAVE_LIBXAR@")

if(NOT TARGET LLVMSupport)
@LLVM_CONFIG_INCLUDE_EXPORTS@
@llvm_config_include_buildtree_only_exports@
Expand Down
3 changes: 0 additions & 3 deletions llvm/include/llvm/Config/llvm-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@
/* Define to 1 if you have the <sysexits.h> header file. */
#cmakedefine HAVE_SYSEXITS_H ${HAVE_SYSEXITS_H}

/* Define if the xar_open() function is supported on this platform. */
#cmakedefine LLVM_HAVE_LIBXAR ${LLVM_HAVE_LIBXAR}

/* Define if building libLLVM shared library */
#cmakedefine LLVM_BUILD_LLVM_DYLIB

Expand Down
1 change: 0 additions & 1 deletion llvm/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
llvm_canonicalize_cmake_booleans(
BUILD_SHARED_LIBS
LLVM_HAVE_LIBXAR
HAVE_OCAMLOPT
LLVM_ENABLE_DIA_SDK
LLVM_ENABLE_FFI
Expand Down
3 changes: 0 additions & 3 deletions llvm/test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,6 @@ def have_ld64_plugin_support():
) and not re.match(r"^arm64(e)?-apple-(macos|darwin)", config.target_triple):
config.available_features.add("debug_frame")

if config.have_libxar:
config.available_features.add("xar")

if config.enable_threads:
config.available_features.add("thread_support")

Expand Down
1 change: 0 additions & 1 deletion llvm/test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ config.llvm_use_intel_jitevents = @LLVM_USE_INTEL_JITEVENTS@
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.have_zlib = @LLVM_ENABLE_ZLIB@
config.have_zstd = @LLVM_ENABLE_ZSTD@
config.have_libxar = @LLVM_HAVE_LIBXAR@
config.have_libxml2 = @LLVM_ENABLE_LIBXML2@
config.have_curl = @LLVM_ENABLE_CURL@
config.have_httplib = @LLVM_ENABLE_HTTPLIB@
Expand Down
5 changes: 0 additions & 5 deletions llvm/tools/llvm-driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ set_target_properties(llvm-driver PROPERTIES OUTPUT_NAME llvm)
target_link_libraries(llvm-driver PUBLIC ${LLVM_DRIVER_OBJLIBS})
target_link_libraries(llvm-driver PUBLIC LLVMDebuginfod)

if(LLVM_HAVE_LIBXAR)
# used by llvm-objdump
target_link_libraries(llvm-driver PUBLIC ${XAR_LIB})
endif()

if(APPLE)
# dsymutil uses some CoreFoundation stuff on Darwin...
target_link_libraries(llvm-driver PRIVATE "-framework CoreFoundation")
Expand Down
4 changes: 0 additions & 4 deletions llvm/tools/llvm-objdump/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ if(NOT LLVM_TOOL_LLVM_DRIVER_BUILD)
target_link_libraries(llvm-objdump PRIVATE LLVMDebuginfod)
endif()

if(LLVM_HAVE_LIBXAR AND NOT LLVM_TOOL_LLVM_DRIVER_BUILD)
target_link_libraries(llvm-objdump PRIVATE ${XAR_LIB})
endif()

add_llvm_tool_symlink(llvm-otool llvm-objdump)

if(LLVM_INSTALL_BINUTILS_SYMLINKS)
Expand Down
Loading

0 comments on commit eb60143

Please sign in to comment.