From b2c921ff8500cbf9a6632b50db88d408ffcb225d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 15 Feb 2021 11:06:23 -0800 Subject: [PATCH] [CMake] Delete LLVM_RUNTIME_BUILD_ID_LINK_TARGETS Announcement: https://lists.llvm.org/pipermail/llvm-dev/2021-February/148446.html Differential Revision: https://reviews.llvm.org/D96360 --- runtimes/CMakeLists.txt | 12 ------------ runtimes/llvm-strip-link.in | 27 --------------------------- 2 files changed, 39 deletions(-) delete mode 100755 runtimes/llvm-strip-link.in diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index 243d6ceb220..1681cd959e0 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -187,14 +187,6 @@ foreach(entry ${runtimes}) list(APPEND runtime_names ${projName}) endforeach() -if(LLVM_RUNTIME_BUILD_ID_LINK_TARGETS) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/llvm-strip-link.in - ${CMAKE_CURRENT_BINARY_DIR}/llvm-strip-link - @ONLY - ) -endif() - function(runtime_default_target) cmake_parse_arguments(ARG "" "" "DEPENDS;PREFIXES" ${ARGN}) @@ -329,10 +321,6 @@ function(runtime_register_target name target) list(APPEND ${name}_extra_args -DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES_PASSTHROUGH}) endif() - if(target IN_LIST LLVM_RUNTIME_BUILD_ID_LINK_TARGETS) - list(APPEND EXTRA_ARGS STRIP_TOOL ${CMAKE_CURRENT_BINARY_DIR}/llvm-strip-link) - endif() - llvm_ExternalProject_Add(runtimes-${name} ${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes DEPENDS ${${name}_deps} diff --git a/runtimes/llvm-strip-link.in b/runtimes/llvm-strip-link.in deleted file mode 100755 index a7b8c567faf..00000000000 --- a/runtimes/llvm-strip-link.in +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import sys -import subprocess - - -ELF_MAGIC = '\x7fELF' - -with open(sys.argv[1], "rb") as f: - buf = f.read(len(ELF_MAGIC)) - if buf != ELF_MAGIC: - sys.exit(0) - -llvm_objcopy = os.path.join('@LLVM_RUNTIME_OUTPUT_INTDIR@', 'llvm-objcopy') -install_dir = os.path.join(os.getenv('DESTDIR', ''), '@CMAKE_INSTALL_PREFIX@') -link_dir = os.path.join(install_dir, 'lib', 'debug', '.build-id') - -sys.exit(subprocess.call([ - llvm_objcopy, - '--strip-all', - '--build-id-link-dir=' + link_dir, - '--build-id-link-input=.debug', - '--build-id-link-output=', - sys.argv[1], -]))