diff options
author | Fabian Groffen <grobian@gentoo.org> | 2017-12-29 15:36:17 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2017-12-29 15:36:26 +0100 |
commit | 861716fce0066319fce54243dab1aa805e04aeff (patch) | |
tree | a29ccb9efbc23f63bba17f38eadb0edf6eaea57d /sys-libs/tapi/files | |
parent | www-client/google-chrome: remove myself from metadata.xml (diff) | |
download | gentoo-861716fce0066319fce54243dab1aa805e04aeff.tar.gz gentoo-861716fce0066319fce54243dab1aa805e04aeff.tar.bz2 gentoo-861716fce0066319fce54243dab1aa805e04aeff.zip |
sys-libs/tapi: version bump to support recent ld64 by Michael Weiser
I made some small changes to use a tarball because repoman does not
permit a live-ebuild (one that uses git-r3) to be in the tree unmasked.
Closes: https://bugs.gentoo.org/642292
Package-Manager: Portage-2.3.13, Repoman-2.3.3
Diffstat (limited to 'sys-libs/tapi/files')
-rw-r--r-- | sys-libs/tapi/files/objcmetadata-800.0.42.1-standalone.patch | 130 | ||||
-rw-r--r-- | sys-libs/tapi/files/tapi-2.0.0-standalone.patch | 141 |
2 files changed, 271 insertions, 0 deletions
diff --git a/sys-libs/tapi/files/objcmetadata-800.0.42.1-standalone.patch b/sys-libs/tapi/files/objcmetadata-800.0.42.1-standalone.patch new file mode 100644 index 000000000000..71ca24f1beb2 --- /dev/null +++ b/sys-libs/tapi/files/objcmetadata-800.0.42.1-standalone.patch @@ -0,0 +1,130 @@ +Provide standalone cmake project file that allows compilation outside the LLVM +source tree and installs the headers as well. + +Tune other CMakeLists for out-of-tree build. + +Provide missing isDynamic() method for Objective C properties. (Best-guess +implementation based on +https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html +and llvm-objdump -m -objc-meta-data output). Does not seem to be used anywhere +anyways - but the control flow of the code is somewhat encrypted. + +Adjust to some minor API differencies between Apple clang 8.0.0 and upstream +LLVM 5.0.1. + +--- objcmetadata-800.0.42.1/CMakeLists.txt.orig 2017-12-25 22:23:41.000000000 +0100 ++++ objcmetadata-800.0.42.1/CMakeLists.txt 2017-12-25 20:54:39.000000000 +0100 +@@ -0,0 +1,25 @@ ++cmake_minimum_required(VERSION 3.4.3) ++project(ObjCMetadata) ++ ++find_package(LLVM REQUIRED CONFIG) ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) ++include(AddLLVM) ++ ++include_directories(${LLVM_INCLUDE_DIRS}) ++link_directories(${LLVM_LIBRARY_DIRS}) ++add_definitions(${LLVM_DEFINITIONS}) ++set(LLVM_COMMON_LIBS Object Support Analysis Core) ++ ++include_directories(BEFORE ++ ${CMAKE_CURRENT_BINARY_DIR}/include ++ ${CMAKE_CURRENT_SOURCE_DIR}/include ++ ) ++ ++install(FILES ++ include/llvm/${PROJECT_NAME}/ObjCBitcode.h ++ include/llvm/${PROJECT_NAME}/ObjCMachOBinary.h ++ include/llvm/${PROJECT_NAME}/ObjCMetadata.h ++ DESTINATION include/llvm/${PROJECT_NAME} ++ ) ++ ++add_subdirectory(lib/${PROJECT_NAME}) +--- objcmetadata-800.0.42.1/include/llvm/ObjCMetadata/ObjCMetadata.h.orig 2017-12-25 20:09:28.000000000 +0100 ++++ objcmetadata-800.0.42.1/include/llvm/ObjCMetadata/ObjCMetadata.h 2017-12-25 20:10:11.000000000 +0100 +@@ -110,6 +110,7 @@ + // Return empty string if doesn't exists. + Expected<std::string> getGetter() const; + Expected<std::string> getSetter() const; ++ Expected<bool> isDynamic() const; + }; + + class ObjCMethod : public ObjCInfoBase { +--- objcmetadata-800.0.42.1/lib/ObjCMetadata/ObjCMetadata.cpp.orig 2017-12-25 20:09:11.000000000 +0100 ++++ objcmetadata-800.0.42.1/lib/ObjCMetadata/ObjCMetadata.cpp 2017-12-25 20:13:33.000000000 +0100 +@@ -164,6 +164,20 @@ + return setter; + } + ++Expected<bool> ObjCProperty::isDynamic() const { ++ auto Attr = getAttribute(); ++ if (!Attr) ++ return Attr.takeError(); ++ // Find setter attribute. ++ SmallVector<StringRef, 4> Attrs; ++ Attr->split(Attrs, ','); ++ for (auto a : Attrs) { ++ if (a == "D") ++ return true; ++ } ++ return false; ++} ++ + Expected<StringRef> ObjCMethod::getName() const { + return MetadataReader->getMethodName(*this); + } +--- objcmetadata-800.0.42.1/lib/ObjCMetadata/CMakeLists.txt.orig 2017-12-25 17:29:01.000000000 +0100 ++++ objcmetadata-800.0.42.1/lib/ObjCMetadata/CMakeLists.txt 2017-12-25 20:59:31.000000000 +0100 +@@ -1,3 +1,10 @@ ++set(LLVM_LINK_COMPONENTS ++ Object ++ Support ++ Analysis ++ Core ++) ++ + add_llvm_library(LLVMObjCMetadata + ObjCBitcode.cpp + ObjCMetadata.cpp +@@ -5,7 +12,4 @@ + + ADDITIONAL_HEADER_DIRS + ${LLVM_MAIN_INCLUDE_DIR}/llvm/ObjCMetadata +- +- DEPENDS +- intrinsics_gen + ) +--- objcmetadata-800.0.42.1/lib/ObjCMetadata/ObjCBitcode.cpp.orig 2017-12-25 17:14:29.000000000 +0100 ++++ objcmetadata-800.0.42.1/lib/ObjCMetadata/ObjCBitcode.cpp 2017-12-25 17:17:51.000000000 +0100 +@@ -20,7 +20,7 @@ + #include "llvm/IR/GlobalAlias.h" + #include "llvm/IR/GlobalVariable.h" + #include "llvm/IR/Operator.h" +-#include "llvm/Support/Error.h" ++#include "llvm/Object/Error.h" + + #include "macho-obj.h" + +@@ -75,7 +75,7 @@ + Operator::getOpcode(V) == Instruction::AddrSpaceCast) { + V = cast<Operator>(V)->getOperand(0); + } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) { +- if (GA->mayBeOverridden()) ++ if (GA->isInterposable()) + return V; + V = GA->getAliasee(); + } else if (PtrToIntOperator *PTI = dyn_cast<PtrToIntOperator>(V)) { +--- objcmetadata-800.0.42.1/lib/ObjCMetadata/ObjCMachOBinary.cpp.orig 2017-12-25 17:24:23.000000000 +0100 ++++ objcmetadata-800.0.42.1/lib/ObjCMetadata/ObjCMachOBinary.cpp 2017-12-25 17:27:15.000000000 +0100 +@@ -1262,9 +1262,9 @@ + const char *SymbolName = nullptr; + if (reloc_found && isExtern) { + offset = Symbol.getValue(); +- ErrorOr<StringRef> NameOrError = Symbol.getName(); ++ Expected<StringRef> NameOrError = Symbol.getName(); + if (!NameOrError) { +- return errorOrToExpected(std::move(NameOrError)); ++ return NameOrError; + } + StringRef Name = *NameOrError; + if (!Name.empty()) { diff --git a/sys-libs/tapi/files/tapi-2.0.0-standalone.patch b/sys-libs/tapi/files/tapi-2.0.0-standalone.patch new file mode 100644 index 000000000000..77bc56331dfb --- /dev/null +++ b/sys-libs/tapi/files/tapi-2.0.0-standalone.patch @@ -0,0 +1,141 @@ +Tune CMakeLists for out-of-tree build. + +Adjust for API discrepancies between Apple clang-8.0.0 and upstream LLVM 5.0.1. + +Allow all clients to link against the library, not just ld. Main reason: Our ld +is called ld64 when we link it. + +--- tapi-2.0.0/tools/tapi/CMakeLists.txt.orig 2017-12-25 22:36:06.620886714 +0100 ++++ tapi-2.0.0/tools/tapi/CMakeLists.txt 2017-12-25 22:41:43.867893060 +0100 +@@ -6,6 +6,12 @@ + + target_link_libraries(tapi + tapiDriver ++ clangAST ++ clangFrontend ++ LLVMOption ++ LLVMDemangle ++ LLVMSupport ++ LLVMCore + ) + + if (TAPI_BUILD_LIBIOSSDK) +--- tapi-2.0.0/tools/libtapi/CMakeLists.txt.orig 2017-12-25 22:26:06.816905789 +0100 ++++ tapi-2.0.0/tools/libtapi/CMakeLists.txt 2017-12-25 22:31:22.914862289 +0100 +@@ -1,4 +1,7 @@ + set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/libtapi.exports) ++set(LLVM_LINK_COMPONENTS ++ Support ++ ) + + add_tapi_library(libtapi + SHARED +@@ -19,5 +22,5 @@ + + set_property(TARGET libtapi APPEND_STRING + PROPERTY +- LINK_FLAGS " -current_version ${TAPI_FULL_VERSION} -compatibility_version 1 -allowable_client ld" ++ LINK_FLAGS " -current_version ${TAPI_FULL_VERSION} -compatibility_version 1" + ) +--- tapi-2.0.0/tools/tapi-run/CMakeLists.txt.orig 2017-12-26 15:12:39.605057352 +0100 ++++ tapi-2.0.0/tools/tapi-run/CMakeLists.txt 2017-12-26 15:15:53.304983942 +0100 +@@ -5,6 +5,8 @@ + target_link_libraries(tapi-run + tapiCore + libtapi ++ LLVMSupport ++ LLVMCore + ) + + set_property(TARGET tapi-run APPEND_STRING +--- tapi-2.0.0/CMakeLists.txt.orig 2017-12-24 15:27:56.000000000 +0100 ++++ tapi-2.0.0/CMakeLists.txt 2017-12-26 15:50:01.199506782 +0100 +@@ -4,6 +4,24 @@ + message(FATAL_ERROR "Unsupported configuration.") + endif() + ++project(tapi) ++set(PACKAGE_VENDOR Apple CACHE STRING "") ++add_definitions(-DTAPI_BUG_REPORT_URL="https://bugs.gentoo.org/") ++ ++find_package(LLVM REQUIRED CONFIG) ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) ++include(AddLLVM) ++ ++add_definitions(${LLVM_DEFINITIONS}) ++include_directories(${LLVM_INCLUDE_DIRS} ${OBJCMETADATA_INCLUDE_DIRS}) ++link_directories(${LLVM_LIBRARY_DIRS} ${OBJCMETADATA_LIBRARY_DIRS}) ++ ++# make tblgen happy ++include(TableGen) ++foreach(IPATH ${LLVM_INCLUDE_DIRS}) ++ list(APPEND LLVM_TABLEGEN_FLAGS -I ${IPATH}) ++endforeach(IPATH) ++ + set(TAPI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + set(TAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + +--- tapi-2.0.0/lib/Core/MachODylibReader.cpp.orig 2017-12-24 15:27:56.000000000 +0100 ++++ tapi-2.0.0/lib/Core/MachODylibReader.cpp 2017-12-25 22:15:53.075478606 +0100 +@@ -254,8 +254,7 @@ + auto arch = getArchType(H.cputype, H.cpusubtype); + assert(arch != Architecture::unknown && "unknown architecture slice"); + +- Error error = Error::success(); +- for (const auto &symbol : object->exports(error)) { ++ for (const auto &symbol : object->exports()) { + StringRef name; + XPIKind kind; + std::tie(name, kind) = parseSymbol(symbol.name()); +@@ -272,7 +271,7 @@ + file->addSymbol(kind, name, arch, flags); + } + +- return error; ++ return Error::success(); + } + + static Error readUndefinedSymbols(MachOObjectFile *object, +@@ -309,10 +308,7 @@ + auto H = object->getHeader(); + auto arch = getArchType(H.cputype, H.cpusubtype); + +- auto error = Error::success(); +- MachOMetadata metadata(object, error); +- if (error) +- return std::move(error); ++ MachOMetadata metadata(object); + + /// + /// Classes +--- tapi-2.0.0/lib/Driver/Snapshot.cpp.orig 2017-12-24 15:27:56.000000000 +0100 ++++ tapi-2.0.0/lib/Driver/Snapshot.cpp 2017-12-26 15:49:09.864184826 +0100 +@@ -14,7 +14,7 @@ + #include "tapi/Defines.h" + #include "clang/Frontend/FrontendOptions.h" + #include "llvm/ADT/ArrayRef.h" +-#include "llvm/Config/config.h" ++#include "llvm/Config/llvm-config.h" + #include "llvm/Support/FileSystem.h" + #include "llvm/Support/raw_ostream.h" + #include "llvm/Support/xxhash.h" +@@ -356,7 +356,7 @@ + } + + if (isCrash) { +- outs() << "PLEASE submit a bug report to " BUG_REPORT_URL ++ outs() << "PLEASE submit a bug report to " TAPI_BUG_REPORT_URL + " and include the " + "crash backtrace and snapshot.\n\n" + "********************************************************\n\n" +--- tapi-2.0.0/lib/Driver/Options.cpp.orig 2017-12-25 22:17:40.506874748 +0100 ++++ tapi-2.0.0/lib/Driver/Options.cpp 2017-12-25 22:18:04.181989766 +0100 +@@ -1023,7 +1023,7 @@ + table->PrintHelp( + outs(), + (programName + " " + getNameFromTAPICommand(command)).str().c_str(), +- toolName, /*FlagsToInclude=*/getIncludeOptionFlagMasks(command), ++ toolName, /*FlagsToInclude=*///getIncludeOptionFlagMasks(command), + /*FlagsToExclude=*/0, /*ShowAllAliases=*/false); + } + |