Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcxx v15.0.4 #104

5 changes: 1 addition & 4 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ dummy_var:
macos_machine:
- x86_64-apple-darwin13.4.0
openturns:
- '1.18'
pin_run_as_build:
openturns:
max_pin: x.x
- '1.19'
target_platform:
- osx-64
5 changes: 1 addition & 4 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ dummy_var:
macos_machine:
- arm64-apple-darwin20.0.0
openturns:
- '1.18'
pin_run_as_build:
openturns:
max_pin: x.x
- '1.19'
target_platform:
- osx-arm64
2 changes: 1 addition & 1 deletion .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 20 additions & 72 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,88 +6,36 @@ if [[ "$target_platform" == osx-* ]]; then
export CFLAGS="$CFLAGS -isysroot $CONDA_BUILD_SYSROOT"
export CXXFLAGS="$CXXFLAGS -isysroot $CONDA_BUILD_SYSROOT"
export LDFLAGS="$LDFLAGS -isysroot $CONDA_BUILD_SYSROOT"

export CMAKE_EXTRA_ARGS="-DCMAKE_OSX_SYSROOT=$CONDA_BUILD_SYSROOT -DLIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS=ON"
fi

export CFLAGS="$CFLAGS -I$LLVM_PREFIX/include -I$BUILD_PREFIX/include"
export LDFLAGS="$LDFLAGS -L$LLVM_PREFIX/lib -Wl,-rpath,$LLVM_PREFIX/lib -L$BUILD_PREFIX/lib -Wl,-rpath,$BUILD_PREFIX/lib"
export PATH="$LLVM_PREFIX/bin:$PATH"

if [[ "$target_platform" != osx-* ]]; then
# build libcxx first
mkdir build
cd build

cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
../libcxx

make -j${CPU_COUNT} VERBOSE=1
make install
cd ..

# now build libcxxabi
cd libcxxabi
mkdir build && cd build

cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXXABI_LIBCXX_PATH=$SRC_DIR/libcxx \
-DLIBCXXABI_LIBCXX_INCLUDES=$PREFIX/include/c++/v1 \
-DLLVM_INCLUDE_TESTS=OFF \
..

make -j${CPU_COUNT} VERBOSE=1
make install
cd ../..
mkdir build

# now rebuild libcxx with libcxxabi
mkdir build2
cd build2
cmake -G Ninja \
-B build \
-S runtimes \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
-DLIBCXX_INCLUDE_DOCS=OFF \
-DLIBCXX_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
$CMAKE_ARGS \
$CMAKE_EXTRA_ARGS

cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXX_INSTALL_HEADERS=ON \
-DLIBCXX_CXX_ABI=libcxxabi \
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=$SRC_DIR/libcxxabi/include \
-DLIBCXX_CXX_ABI_LIBRARY_PATH=$PREFIX/lib \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
../libcxx
# Build
ninja -C build cxx cxxabi unwind

make -j${CPU_COUNT} VERBOSE=1
make install

cd ..
else
mkdir build
cd build

# on osx we point libc++ to the system libc++abi
cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXX_CXX_ABI=libcxxabi \
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${CONDA_BUILD_SYSROOT}/usr/include \
-DLIBCXX_CXX_ABI_LIBRARY_PATH=${CONDA_BUILD_SYSROOT}/usr/lib \
-DCMAKE_OSX_SYSROOT=$CONDA_BUILD_SYSROOT \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=ON \
-DLIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS=ON \
../libcxx

make -j${CPU_COUNT} VERBOSE=1
make install
# Install
ninja -C build install-cxx install-cxxabi install-unwind

if [[ "$target_platform" == osx-* ]]; then
# on osx we point libc++ to the system libc++abi
$INSTALL_NAME_TOOL -change "@rpath/libc++abi.1.dylib" "/usr/lib/libc++abi.dylib" $PREFIX/lib/libc++.1.0.dylib

cd ..
fi
13 changes: 7 additions & 6 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{% set version = "14.0.6" %}
{% set version = "15.0.4" %}

package:
name: libcxx_and_libcxxabi
version: {{ version }}

source:
- url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz
sha256: 8b3cfd7bc695bd6cea0f37f53f0981f34f87496e79e2529874fd03a2f9dd3a8a
sha256: a3112dca9bdea4095361829910b74fb6b9da8ae6e3500db67c43c540ad6072da
patches:
- patches/0001-libcxxabi-10.9-compatibility.patch # [osx and x86_64]
- patches/0002-Support-legacy-standalone-builds.patch
# See https://lists.llvm.org/pipermail/libcxx-dev/2021-July/001172.html
- patches/0003-Fix-ABI-compatibility-with-system.patch
- patches/0004-custom-error-message-for-old-sdk.patch
- patches/0005-disable-timespec-due-to-old-glibc.patch

build:
number: 0
Expand All @@ -26,7 +27,7 @@ build:
requirements:
build:
- cmake
- make # [unix]
- ninja
- {{ compiler('cxx') }}
- python >3 # [not osx]
host:
Expand Down Expand Up @@ -70,10 +71,10 @@ outputs:
- bash compile_test.sh # [unix]
- compile_test.bat # [win]
# make sure we inserted link to our docs wherever it is necessary;
# i.e. everywhere there's a string "availability(macosx,...,introduced=<ver>)" for osx version >10.9
# 'grep -v' inverts the match but returns non-zero exit code no lines are returned; so we use 'wc -l';
# i.e. everywhere there's a string "availability(macos,...,introduced=<ver>)" for osx version >10.9;
# 'grep -v' inverts the match but returns non-zero exit code if no lines are returned; so we use 'wc -l';
# we want to have zero lines that don't either: contain the link or are for 10.9
- if [ 0 -eq $(cat ${PREFIX}/include/c++/v1/__availability | grep "availability(macosx" | grep -vE "(conda-forge|10.9)" | wc -l) ]; then exit 0; else exit 1; fi # [osx]
- if [ 0 -eq $(cat ${PREFIX}/include/c++/v1/__availability | grep "availability(macos" | grep -vE "(conda-forge|10.9)" | wc -l) ]; then exit 0; else exit 1; fi # [osx]
# !!!!!!!!!!!! README !!!!!!!!!!!!!!!!!!
# we do not ship libcxxabi on OSX - this breaks exception passing
- if [ -f $PREFIX/lib/libc++abi.dylib ]; then exit 1; fi # [osx]
Expand Down
8 changes: 4 additions & 4 deletions recipe/patches/0001-libcxxabi-10.9-compatibility.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From f92a414a9219f79c3359bf296ca5cf14ec88dc34 Mon Sep 17 00:00:00 2001
From d5004a2bf64156684a7a2a113b2a2d9fa4bd153e Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Sat, 8 Aug 2020 15:52:31 +0000
Subject: [PATCH 1/4] libcxxabi 10.9 compatibility
Subject: [PATCH 1/5] libcxxabi 10.9 compatibility

---
libcxx/src/support/runtime/exception_libcxxabi.ipp | 4 ----
1 file changed, 4 deletions(-)

diff --git a/libcxx/src/support/runtime/exception_libcxxabi.ipp b/libcxx/src/support/runtime/exception_libcxxabi.ipp
index ee15e437e602..8933a9b747a6 100644
index ee15e437e6..8933a9b747 100644
--- a/libcxx/src/support/runtime/exception_libcxxabi.ipp
+++ b/libcxx/src/support/runtime/exception_libcxxabi.ipp
@@ -17,11 +17,7 @@ bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
Expand All @@ -24,5 +24,5 @@ index ee15e437e602..8933a9b747a6 100644

} // namespace std
--
2.37.0.windows.1
2.38.1.windows.1

10 changes: 5 additions & 5 deletions recipe/patches/0002-Support-legacy-standalone-builds.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From e02e436ece48dab41f2f1337c25e0ca309b4697e Mon Sep 17 00:00:00 2001
From d29448d3a9f777674c2aea03ebbdba6bb245e97e Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Tue, 18 May 2021 19:51:28 -0500
Subject: [PATCH 2/4] Support legacy standalone builds
Subject: [PATCH 2/5] Support legacy standalone builds

---
libcxx/src/CMakeLists.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 12dcdf954405..d2c33141c77b 100644
index 9abf548abb..3f155af09e 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -265,6 +265,23 @@ if (LIBCXX_ENABLE_SHARED)
@@ -236,6 +236,23 @@ if (LIBCXX_ENABLE_SHARED)
"-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/weak.exp")

target_link_libraries(cxx_shared PRIVATE $<TARGET_NAME_IF_EXISTS:cxxabi-reexports>)
Expand All @@ -36,5 +36,5 @@ index 12dcdf954405..d2c33141c77b 100644

# Generate a linker script in place of a libc++.so symlink.
--
2.37.0.windows.1
2.38.1.windows.1

16 changes: 8 additions & 8 deletions recipe/patches/0003-Fix-ABI-compatibility-with-system.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From e378e3f253ca8255927aa767feb1eb2a1901414d Mon Sep 17 00:00:00 2001
From e30718656c41bd624ddd9895fb9f6e64ed4c2ab5 Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Tue, 13 Jul 2021 01:57:06 -0500
Subject: [PATCH 3/4] Fix ABI compatibility with system
Subject: [PATCH 3/5] Fix ABI compatibility with system

---
libcxx/src/locale.cpp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 2234784769dd..d69e8c43a467 100644
index 6b454274e1..5e601e133a 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -198,10 +198,6 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -194,10 +194,6 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
install(&make<codecvt<char16_t, char, mbstate_t> >(1u));
install(&make<codecvt<char32_t, char, mbstate_t> >(1u));
_LIBCPP_SUPPRESS_DEPRECATED_POP
Expand All @@ -22,7 +22,7 @@ index 2234784769dd..d69e8c43a467 100644
install(&make<numpunct<char> >(1u));
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(&make<numpunct<wchar_t> >(1u));
@@ -240,6 +236,10 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -236,6 +232,10 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(&make<_VSTD::messages<wchar_t> >(1u));
#endif
Expand All @@ -33,7 +33,7 @@ index 2234784769dd..d69e8c43a467 100644
}

locale::__imp::__imp(const string& name, size_t refs)
@@ -271,10 +271,6 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
@@ -267,10 +267,6 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
install(new codecvt_byname<char16_t, char, mbstate_t>(name_));
install(new codecvt_byname<char32_t, char, mbstate_t>(name_));
_LIBCPP_SUPPRESS_DEPRECATED_POP
Expand All @@ -44,7 +44,7 @@ index 2234784769dd..d69e8c43a467 100644
install(new numpunct_byname<char>(name_));
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(new numpunct_byname<wchar_t>(name_));
@@ -297,6 +293,10 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
@@ -293,6 +289,10 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(new messages_byname<wchar_t>(name_));
#endif
Expand All @@ -56,5 +56,5 @@ index 2234784769dd..d69e8c43a467 100644
}
catch (...)
--
2.37.0.windows.1
2.38.1.windows.1

Loading