Skip to content

Commit

Permalink
devel/py-llvmlite: un-break at least on Linux, update to 0.41.1 with …
Browse files Browse the repository at this point in the history
…static LLVM

This now builds a patched LLVM that is statically linked, with llvmlite patches,
as upstream wants and supports as only variant.

This has not been tested widely, but has been uncondtionally BROKEN before.


v0.41.1 (Oct 17, 2023)¶

This is a maintenance release that includes a workaround in the test suite for ORCJit issues on the aarch64 platform. Also, this is the last release to support the Windows 32-bit platform (win32).

Pull-Requests:

    PR #996: fix typos found by codespell (esc)

    PR #997: Fix issue #880 by ensuring all sources are compiled under FreeBSD. (ke6jjj)

    PR #998: adding sphinx_rtd_theme to RTD build to fix build (esc)

    PR #1001: Fix / workaround for OrcJIT blocking issues (gmarkall)

Authors:

    esc

    ke6jjj

    gmarkall

v0.41.0 (Sept 20, 2023)¶

Pull-Requests:

    PR #871: Refactor native library loading (folded sklam)

    PR #896: drop upper limit on Python for conda recipe (esc)

    PR #904: Create GitHub Action for llvmlite release (apmasell)

    PR #934: Expose TargetLibraryInfo pass (sklam)

    PR #935: Disable zlib for LLVM on Windows (apmasell)

    PR #936: Enable querying constants and value kinds (tbennun)

    PR #939: Bump llvmdev build number to include the nozlib change for windows (sklam)

    PR #940: Update CHANGE_LOG for 0.40.0 final. (stuartarchibald)

    PR #942: Add ORCJITv2 support (apmasell)

    PR #951: Add a type hint for IntType.width (apmasell)

    PR #952: Fix CI failing due to unsupported target triple on non-x86 platforms. (sklam)

    PR #958: fixup LLVM versions in version compat table (esc)

    PR #959: Remove support for LLVM < 14 (apmasell)

    PR #960: add various bullets to release checklists and sync (esc)

    PR #963: Allow adding comments to generated IR (apmasell)

    PR #966: build: support building on GNU/Hurd (pinotree)

    PR #967: Expose library name in OrcJIT tracker (apmasell)

    PR #968: Update LLVM manual build instructions (apmasell)

    PR #969: update changelog on main for v0.40.1 (esc)

    PR #983: adding RTD conf file V2 as per request (esc)

    PR #985: Update release checklist post 0.41.0rc1 (esc)

    PR #988: Fix FreeBsd build (sklam)

Authors:

    apmasell

    esc

    folded

    pinotree

    sklam

    stuartarchibald

    tbennun

v0.40.1 (June 21, 2023)¶

Pull-Requests:

    PR #945: Fix #944. Add .argtypes to prevent errors in pypy. (Siu Kwan Lam)

    PR #947: Update SVML patch for LLVM 14 (Andre Masella)

    PR #949: Handle PowerPC synonyms (Andre Masella)

    PR #950: Fix incorrect byval and other attributes on LLVM 14 (Andre Masella)

Authors:

    Andre Masella

    Siu Kwan Lam

v0.40.0 (May 1, 2023)¶

This release predominantly upgrades to LLVM 14 and Python 3.11. Bindings to a large number of passes are added. The minimum supported Python version is now Python 3.8.

Note: A bug was discovered in LLVM’s RuntimeDyldELF on the Aarch64 platform that can cause segfaults when cross module symbols are linked. It is necessary for JIT users to build LLVM with the patch added in PR#926.

Pull-Requests:

    PR #827: Add more LLVM pass bindings (apmasell)

    PR #830: Add LLVM 14 support (apmasell)

    PR #860: the git tag for the RC needs an rc1 suffix (esc)

    PR #869: bump max Python version to 3.11 (esc sklam)

    PR #876: Remove llvmlite.llvmpy after deprecation (apmasell)

    PR #883: Adds support for calling functions with ‘tail’, ‘notail’, or ‘musttail’ markers. (bslatkin)

    PR #886: Simplify setup.py Python version guard (mbargull)

    PR #892: Bump minimum supported Python version to 3.8 (jamesobutler)

    PR #893: Upgrade to ubuntu-20.04 for azure pipeline CI (jamesobutler)

    PR #899: Run Minconda install with bash (gmarkall)

    PR #903: Fix flake8 config and style for flake8 6 (gmarkall)

    PR #905: Add YouCompleteMe configuration file and ignore vim swap files (gmarkall)

    PR #906: Replace importlib-resources legacy API use (sklam)

    PR #910: Aarch64 split build for LLVM14 (sklam)

    PR #921: Setup AzureCI to use py311 and llvm14 (sklam)

    PR #922: Fix AzureCI not using llvm14 on windows (sklam)

    PR #926: llvmdev recipe: Add patch that clears GOTOffsetMap (apmasell gmarkall sklam)

    PR #930: Update changelog for 0.40.0rc1 (sklam stuartarchibald)

    PR #931: Remove maximum Python version limit (sklam apmasell)

    PR #932: Fix wheel builds (sklam)

    PR #935: Disable zlib for LLVM on Windows (apmasell)

    PR #939: Bump llvmdev build number to include the nozlib change for windows (sklam)

    PR #940: Update CHANGE_LOG for 0.40.0 final. (stuartarchibald)

Authors:

    apmasell

    bslatkin

    esc

    gmarkall

    jamesobutler

    mbargull

    sklam

    stuartarchibald

v0.39.1 (September 1, 2022)¶

This is a maintenance release to fix build issues on MacOS.

Pull-Requests:

    PR #752: Skip test if libm is not found (Siu Kwan Lam)

    PR #865: Move Azure to use macos-11 (stuartarchibald)

    PR #874: Add zlib as a dependency for aarch64 (esc)

    PR #878: Update changelog (Andre Masella)

v0.39.0 (July 25, 2022)¶

This release predominantly adds new features and improves functionality.

    It’s now possible to directly set LLVM metadata on global variables.

    Functions and global variables now support the specification of a section in which they should be placed.

    The attribute source_file had been added to the ModuleRef class, it returns the module’s original file name.

    The FFI library binding to LLVM is now loaded with importlib to increase compatibility with other projects and improve start-up times.

    Linux builds now use the parallel option to make to speed up building the FFI library.

    Preliminary work to expose LLVM’s optimization-remarks interface has been undertaken. The bindings are exposed and tested, but not yet documented for general use (additional work is needed).

Deprecations:

    The llvmlite.llvmpy module has been deprecated as the functionality it provides is available through the llvmlite.ir module. See the deprecation guide in the user documentation for details and recommendations regarding replacement.

Pull-Requests:

    PR #328: Build C files separately on Linux and support parallel make (Michał Górny)

    PR #754: manylinux2014 aarch64 wheels with system compilers (esc)

    PR #760: add support for attaching metadata to global variables (Graham Markall John Törnblom)

    PR #786: Update Windows and OSX CI images. (stuartarchibald)

    PR #801: Update ffi.py (franzhaas)

    PR #803: llvm::Module::GetSourceFileName (J. Aaron Pendergrass)

    PR #806: Bump to v0.39.0dev (esc)

    PR #807: Exclude ExecutionEngine tests on linux 32 (esc)

    PR #809: Update CHANGE_LOG for 0.38.0 (stuartarchibald)

    PR #813: Add m1 support to conda build scripts (esc Stan Seibert)

    PR #815: update local references (esc)

    PR #816: remove configuration landscape service as it is no longer used (esc)

    PR #817: remove uppper limit on Python requires (esc)

    PR #819: adding rc and final release checklist templates (esc)

    PR #823: Add section to globals (Andreas Wrisley)

    PR #824: add GitHub URL for PyPi (Andrii Oriekhov)

    PR #825: Add flag handling to more instructions. (stuartarchibald Andre Masella)

    PR #826: Deprecated llvmlite.llvmpy (Andre Masella)

    PR #831: Format C++ code (Andre Masella)

    PR #832: DOC: Fix the syntax for the llvmlite discourse topic link. (stuartarchibald)

    PR #835: Add pre-commit hooks for clang-format (Andre Masella)

    PR #837: Add support for optimization remarks in pass managers (Siu Kwan Lam Andre Masella)

    PR #846: Cherry-Pick: #842 –> main :Changelog for 0.38.1 (esc)

    PR #851: adding the llvm_11_consecutive_registers.patch (esc)

    PR #857: Delegate passmanager remarks methods (Andre Masella)

    PR #858: Update CHANGE_LOG for 0.39.0 (esc Graham Markall stuartarchibald)

    PR #863: Update changelog for 0.39.0 release (Siu Kwan Lam)

    PR #864: Update release date for 0.39.0 release. (stuartarchibald)

    PR #867: Update CHANGE_LOG 0.39.0 final. (stuartarchibald)

Authors:

    Andrii Oriekhov

    Andreas Wrisley

    Andre Masella

    esc

    franzhaas

    Graham Markall

    J. Aaron Pendergrass

    John Törnblom

    Michał Górny

    Stan Seibert

    Siu Kwan Lam

    stuartarchibald
  • Loading branch information
thor committed Jan 24, 2024
1 parent 1167f7d commit def1123
Show file tree
Hide file tree
Showing 9 changed files with 2,372 additions and 81 deletions.
84 changes: 76 additions & 8 deletions devel/py-llvmlite/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.24 2022/08/15 19:14:43 wiz Exp $
# $NetBSD: Makefile,v 1.25 2024/01/24 15:25:12 thor Exp $

DISTNAME= llvmlite-0.38.1
DISTNAME= llvmlite-0.41.1
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES= devel python
MASTER_SITES= ${MASTER_SITE_PYPI:=l/llvmlite/}
Expand All @@ -10,20 +10,89 @@ HOMEPAGE= https://llvmlite.readthedocs.io/
COMMENT= Lightweight LLVM Python binding for writing JIT compilers
LICENSE= 2-clause-bsd

USE_LANGUAGES= c++14
# Statically linking in a purpose-built LLVM as upstream urges to do.
# They support only a certain version of LLVM per release, and that
# with patches.
LLVM_VERSION= 14.0.6
DISTFILES= ${DEFAULT_DISTFILES}
DISTFILES+= llvm-${LLVM_VERSION}.src.tar.xz
DISTFILES+= lld-${LLVM_VERSION}.src.tar.xz
DISTFILES+= libunwind-${LLVM_VERSION}.src.tar.xz

# https://github.com/numba/llvmlite/pull/802
BROKEN= "No support for llvm 14 yet."
LLVM_SITE= https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/
SITES.llvm-${LLVM_VERSION}.src.tar.xz= ${LLVM_SITE}
SITES.lld-${LLVM_VERSION}.src.tar.xz= ${LLVM_SITE}
SITES.libunwind-${LLVM_VERSION}.src.tar.xz= ${LLVM_SITE}

# officially supports llvm 11 as of 0.37.0
MAKE_ENV+= LLVMLITE_SKIP_LLVM_VERSION_CHECK=1
USE_LANGUAGES= c c++
USE_CXX_FEATURES= c++14
# Just for LLVM build.
USE_TOOLS= cmake

# See
# https://github.com/numba/llvmlite/blob/main/conda-recipes/llvmdev/build.sh
# for the procedure. This is what
# https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html
# points to. Need to match up this to the correct llvmlite release, as
# they do not include this in the tarball. Python people think building
# stuff from source is hard and keep it so:-/
# I kept some upstream comments inline.

LLVM_CMAKE_ARGS= -DCMAKE_INSTALL_PREFIX=${WRKDIR}/llvm-inst
LLVM_CMAKE_ARGS+= -DCMAKE_BUILD_TYPE:STRING=Release
LLVM_CMAKE_ARGS+= -DLLVM_ENABLE_PROJECTS:STRING=lld
# We explicitly want static linking.
LLVM_CMAKE_ARGS+= -DBUILD_SHARED_LIBS:BOOL=OFF
LLVM_CMAKE_ARGS+= -DLLVM_ENABLE_ASSERTIONS:BOOL=ON
LLVM_CMAKE_ARGS+= -DLINK_POLLY_INTO_TOOLS:BOOL=ON
# Don't really require libxml2. Turn it off explicitly to avoid accidentally linking to system libs
LLVM_CMAKE_ARGS+= -DLLVM_ENABLE_LIBXML2:BOOL=OFF
# Urgh, llvm *really* wants to link to ncurses / terminfo and we *really* do not want it to.
LLVM_CMAKE_ARGS+= -DHAVE_TERMINFO_CURSES=OFF
LLVM_CMAKE_ARGS+= -DLLVM_ENABLE_TERMINFO=OFF
# Sometimes these are reported as unused. Whatever.
LLVM_CMAKE_ARGS+= -DHAVE_TERMINFO_NCURSES=OFF
LLVM_CMAKE_ARGS+= -DHAVE_TERMINFO_NCURSESW=OFF
LLVM_CMAKE_ARGS+= -DHAVE_TERMINFO_TERMINFO=OFF
LLVM_CMAKE_ARGS+= -DHAVE_TERMINFO_TINFO=OFF
LLVM_CMAKE_ARGS+= -DHAVE_TERMIOS_H=OFF
LLVM_CMAKE_ARGS+= -DCLANG_ENABLE_LIBXML=OFF
LLVM_CMAKE_ARGS+= -DLIBOMP_INSTALL_ALIASES=OFF
LLVM_CMAKE_ARGS+= -DLLVM_ENABLE_RTTI=OFF
# Not sure if this should be adapted for pkgsrc.
LLVM_CMAKE_ARGS+= -DLLVM_TARGETS_TO_BUILD=all
LLVM_CMAKE_ARGS+= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly
# for llvm-lit
LLVM_CMAKE_ARGS+= -DLLVM_INCLUDE_UTILS=ON
# doesn't build without the rest of LLVM project
LLVM_CMAKE_ARGS+= -DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF
LLVM_CMAKE_ARGS+= -DLLVM_INCLUDE_DOCS=OFF
LLVM_CMAKE_ARGS+= -DLLVM_INCLUDE_EXAMPLES=OFF


MAKE_ENV+= LLVM_CONFIG=${WRKDIR}/llvm-inst/bin/llvm-config
# unable to pass LLVM bit-code files to linker
MAKE_ENV.NetBSD+= CXX_FLTO_FLAGS=
MAKE_ENV.NetBSD+= LD_FLTO_FLAGS=

# From 3.8 on is fine.
PYTHON_VERSIONS_INCOMPATIBLE= 27

# The llvm build detects lots of stuff outside the build sandbox ...
# a python it likes, git ... just hoping that this does not matter
# much for the static lib being used by llvmlite.

pre-configure:
cd ${WRKDIR}/llvm-${LLVM_VERSION}.src && \
for f in ${FILESDIR}/llvm*.patch; do patch -Np2 < $$f; done
${LN} -s llvm-${LLVM_VERSION}.src ${WRKDIR}/llvm
${LN} -s lld-${LLVM_VERSION}.src ${WRKDIR}/lld
${LN} -s libunwind-${LLVM_VERSION}.src ${WRKDIR}/libunwind
cd ${WRKDIR} && mkdir build && cd build && \
cmake -G'Unix Makefiles' ${LLVM_CMAKE_ARGS} ../llvm && \
${MAKE} -j${MAKE_JOBS} && \
${MAKE} -j${MAKE_JOBS} check-llvm-unit && \
${MAKE} install
${SED} -e 's/ -stdlib=libc++//' ${WRKSRC}/ffi/Makefile.freebsd > ${WRKSRC}/ffi/Makefile.netbsd

.include "../../mk/bsd.prefs.mk"
Expand All @@ -34,6 +103,5 @@ post-install:
${DESTDIR}${PREFIX}/${PYSITELIB}/llvmlite/binding/libllvmlite.dylib
.endif

.include "../../lang/llvm/buildlink3.mk"
.include "../../lang/python/egg.mk"
.include "../../mk/bsd.pkg.mk"
17 changes: 4 additions & 13 deletions devel/py-llvmlite/PLIST
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.6 2022/01/12 21:13:50 wiz Exp $
@comment $NetBSD: PLIST,v 1.7 2024/01/24 15:25:12 thor Exp $
${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
Expand Down Expand Up @@ -46,6 +46,9 @@ ${PYSITELIB}/llvmlite/binding/object_file.pyo
${PYSITELIB}/llvmlite/binding/options.py
${PYSITELIB}/llvmlite/binding/options.pyc
${PYSITELIB}/llvmlite/binding/options.pyo
${PYSITELIB}/llvmlite/binding/orcjit.py
${PYSITELIB}/llvmlite/binding/orcjit.pyc
${PYSITELIB}/llvmlite/binding/orcjit.pyo
${PYSITELIB}/llvmlite/binding/passmanagers.py
${PYSITELIB}/llvmlite/binding/passmanagers.pyc
${PYSITELIB}/llvmlite/binding/passmanagers.pyo
Expand Down Expand Up @@ -85,15 +88,6 @@ ${PYSITELIB}/llvmlite/ir/types.pyo
${PYSITELIB}/llvmlite/ir/values.py
${PYSITELIB}/llvmlite/ir/values.pyc
${PYSITELIB}/llvmlite/ir/values.pyo
${PYSITELIB}/llvmlite/llvmpy/__init__.py
${PYSITELIB}/llvmlite/llvmpy/__init__.pyc
${PYSITELIB}/llvmlite/llvmpy/__init__.pyo
${PYSITELIB}/llvmlite/llvmpy/core.py
${PYSITELIB}/llvmlite/llvmpy/core.pyc
${PYSITELIB}/llvmlite/llvmpy/core.pyo
${PYSITELIB}/llvmlite/llvmpy/passes.py
${PYSITELIB}/llvmlite/llvmpy/passes.pyc
${PYSITELIB}/llvmlite/llvmpy/passes.pyo
${PYSITELIB}/llvmlite/tests/__init__.py
${PYSITELIB}/llvmlite/tests/__init__.pyc
${PYSITELIB}/llvmlite/tests/__init__.pyo
Expand All @@ -112,9 +106,6 @@ ${PYSITELIB}/llvmlite/tests/test_binding.pyo
${PYSITELIB}/llvmlite/tests/test_ir.py
${PYSITELIB}/llvmlite/tests/test_ir.pyc
${PYSITELIB}/llvmlite/tests/test_ir.pyo
${PYSITELIB}/llvmlite/tests/test_llvmpy.py
${PYSITELIB}/llvmlite/tests/test_llvmpy.pyc
${PYSITELIB}/llvmlite/tests/test_llvmpy.pyo
${PYSITELIB}/llvmlite/tests/test_refprune.py
${PYSITELIB}/llvmlite/tests/test_refprune.pyc
${PYSITELIB}/llvmlite/tests/test_refprune.pyo
Expand Down
20 changes: 13 additions & 7 deletions devel/py-llvmlite/distinfo
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
$NetBSD: distinfo,v 1.21 2022/05/22 12:16:59 adam Exp $
$NetBSD: distinfo,v 1.22 2024/01/24 15:25:12 thor Exp $

BLAKE2s (llvmlite-0.38.1.tar.gz) = ebc28cc09fccd56c5e0c02398c61a564945c279f3951e6769743538f5153b06b
SHA512 (llvmlite-0.38.1.tar.gz) = a872a8535173426feaf8af01824a22e0a439a99e67801d8e78397137aebec82ebd53aeb16d797da86f9570f90c3362d00c2180e4d3b6c564d0d490c37b2c4ed6
Size (llvmlite-0.38.1.tar.gz) = 129131 bytes
SHA1 (patch-ffi_Makefile.freebsd) = 39a533f17952c73ef7cbfe910bc58166a106448c
SHA1 (patch-ffi_Makefile.linux) = 64fe000e738b61f0ece5c3b6cb86a1d548955c70
BLAKE2s (libunwind-14.0.6.src.tar.xz) = 21da632762db6524a46c1f721908b233265afe83728c1de5dd7757c662db0d99
SHA512 (libunwind-14.0.6.src.tar.xz) = c8f3804c47ac33273238899e5682f9cb52465dcceff0e0ecf9925469620c6c9a62cc2c708a35a0e156b666e1198df52c5fff1da9d5ee3194605dfd62c296b058
Size (libunwind-14.0.6.src.tar.xz) = 108680 bytes
BLAKE2s (lld-14.0.6.src.tar.xz) = 2fc265b616bbdbaeecc8385fda204dbc28b1d871d98f4b3b3cd5183c4d6eefc8
SHA512 (lld-14.0.6.src.tar.xz) = fad97b441f9642b73edd240af2c026259de0951d5ace42779e9e0fcf5e417252a1d744e2fc51e754a45016621ba0c70088177f88695af1c6ce290dd26873b094
Size (lld-14.0.6.src.tar.xz) = 1366180 bytes
BLAKE2s (llvm-14.0.6.src.tar.xz) = 2d44946453add45426569fd4187654f83881341c5c0109e4ffacc60e8f73af60
SHA512 (llvm-14.0.6.src.tar.xz) = 6461bdde27aac17fa44c3e99a85ec47ffb181d0d4e5c3ef1c4286a59583e3b0c51af3c8081a300f45b99524340773a3011380059e3b3a571c3b0a8733e96fc1d
Size (llvm-14.0.6.src.tar.xz) = 49660136 bytes
BLAKE2s (llvmlite-0.41.1.tar.gz) = 2da761d269e0be534391778303456a1f71033e65c8e51a6719c70dab07e1ae48
SHA512 (llvmlite-0.41.1.tar.gz) = f344c49dae8494fc3e7c1b30a516f046d718d7d1aab69bab8d9f636dce3136d3970de40f0c6fd5dc48cd7292699f0afdf1e41264820d4d421ee2d1e14e321e71
Size (llvmlite-0.41.1.tar.gz) = 146564 bytes
SHA1 (patch-ffi_build.py) = 9a992dd33f624055d5c8bea3986c4243c87b4ccf
SHA1 (patch-ffi_targets.cpp) = 99f888839916fa42848f9dad2f28468b70cf668f
31 changes: 31 additions & 0 deletions devel/py-llvmlite/files/llvm14-clear-gotoffsetmap.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 322c79fff224389b4df9f24ac22965867007c2fa Mon Sep 17 00:00:00 2001
From: Graham Markall <[email protected]>
Date: Mon, 13 Mar 2023 21:35:11 +0000
Subject: [PATCH] RuntimeDyldELF: Clear the GOTOffsetMap when finalizing the
load

This needs resetting so that stale entries are not left behind when the
GOT section and index are reset.

See llvm/llvm#61402: RuntimeDyldELF doesn't clear GOTOffsetMap in
finalizeLoad(), leading to invalid GOT relocations on AArch64 -
https://github.com/llvm/llvm-project/issues/61402.
---
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/llvm-14.0.6.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm-14.0.6.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index f92618afdff6..eb3c27a9406a 100644
--- a/llvm-14.0.6.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/llvm-14.0.6.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -2345,6 +2345,7 @@ Error RuntimeDyldELF::finalizeLoad(const ObjectFile &Obj,
}
}

+ GOTOffsetMap.clear();
GOTSectionID = 0;
CurrentGOTIndex = 0;

--
2.34.1

54 changes: 54 additions & 0 deletions devel/py-llvmlite/files/llvm14-remove-use-of-clonefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
diff -ur a/llvm-14.0.6.src/lib/Support/Unix/Path.inc b/llvm-14.0.6.src/lib/Support/Unix/Path.inc
--- a/llvm-14.0.6.src/lib/Support/Unix/Path.inc 2022-03-14 05:44:55.000000000 -0400
+++ b/llvm-14.0.6.src/lib/Support/Unix/Path.inc 2022-09-19 11:30:59.000000000 -0400
@@ -1462,6 +1462,7 @@
std::error_code copy_file(const Twine &From, const Twine &To) {
std::string FromS = From.str();
std::string ToS = To.str();
+ /*
#if __has_builtin(__builtin_available)
if (__builtin_available(macos 10.12, *)) {
// Optimistically try to use clonefile() and handle errors, rather than
@@ -1490,6 +1491,7 @@
// cheaper.
}
#endif
+ */
if (!copyfile(FromS.c_str(), ToS.c_str(), /*State=*/NULL, COPYFILE_DATA))
return std::error_code();
return std::error_code(errno, std::generic_category());
diff -ur a/llvm-14.0.6.src/unittests/Support/Path.cpp b/llvm-14.0.6.src/unittests/Support/Path.cpp
--- a/llvm-14.0.6.src/unittests/Support/Path.cpp 2022-03-14 05:44:55.000000000 -0400
+++ b/llvm-14.0.6.src/unittests/Support/Path.cpp 2022-09-19 11:33:07.000000000 -0400
@@ -2267,15 +2267,15 @@

EXPECT_EQ(fs::setPermissions(TempPath, fs::set_uid_on_exe), NoError);
EXPECT_TRUE(CheckPermissions(fs::set_uid_on_exe));
-
+#if !defined(__APPLE__)
EXPECT_EQ(fs::setPermissions(TempPath, fs::set_gid_on_exe), NoError);
EXPECT_TRUE(CheckPermissions(fs::set_gid_on_exe));
-
+#endif
// Modern BSDs require root to set the sticky bit on files.
// AIX and Solaris without root will mask off (i.e., lose) the sticky bit
// on files.
#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \
- !defined(_AIX) && !(defined(__sun__) && defined(__svr4__))
+ !defined(_AIX) && !(defined(__sun__) && defined(__svr4__)) && !defined(__APPLE__)
EXPECT_EQ(fs::setPermissions(TempPath, fs::sticky_bit), NoError);
EXPECT_TRUE(CheckPermissions(fs::sticky_bit));

@@ -2297,10 +2297,12 @@
EXPECT_TRUE(CheckPermissions(fs::all_perms));
#endif // !FreeBSD && !NetBSD && !OpenBSD && !AIX

+#if !defined(__APPLE__)
EXPECT_EQ(fs::setPermissions(TempPath, fs::all_perms & ~fs::sticky_bit),
NoError);
EXPECT_TRUE(CheckPermissions(fs::all_perms & ~fs::sticky_bit));
#endif
+#endif
}

#ifdef _WIN32
Loading

0 comments on commit def1123

Please sign in to comment.