Skip to content

Commit

Permalink
Merge pull request #195 from regro-cf-autotick-bot/19.1.0_h683e73
Browse files Browse the repository at this point in the history
libcxx v19.1.0
  • Loading branch information
isuruf authored Sep 19, 2024
2 parents 66e861f + 6f3df2b commit d5ad9ec
Show file tree
Hide file tree
Showing 15 changed files with 291 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-osx.yml

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

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
c_compiler:
- gcc
c_compiler_version:
- '13'
- '14'
c_stdlib:
- sysroot
c_stdlib_version:
Expand All @@ -15,7 +15,7 @@ channel_targets:
cxx_compiler:
- gxx
cxx_compiler_version:
- '13'
- '14'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
hardening:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
c_compiler:
- gcc
c_compiler_version:
- '13'
- '14'
c_stdlib:
- sysroot
c_stdlib_version:
Expand All @@ -15,7 +15,7 @@ channel_targets:
cxx_compiler:
- gxx
cxx_compiler_version:
- '13'
- '14'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
hardening:
Expand Down
5 changes: 4 additions & 1 deletion build-locally.py

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

7 changes: 4 additions & 3 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
azure:
settings_osx:
pool:
vmImage: macos-14
bot:
abi_migration_branches:
- 16.x
Expand All @@ -10,7 +14,4 @@ channel_priority: flexible
github:
branch_name: main
tooling_branch_name: main
provider:
linux_aarch64: default
linux_ppc64le: default
test: native_and_emulated
1 change: 1 addition & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cmake -G Ninja \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXX_ENABLE_TIME_ZONE_DATABASE=ON \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
-DLIBCXX_INCLUDE_DOCS=OFF \
-DLIBCXX_INCLUDE_TESTS=OFF \
Expand Down
24 changes: 18 additions & 6 deletions recipe/compile_test.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
set -xe

LINK_FLAGS="-Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -Wl,-v -v"
FLAGS="-Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -Wl,-v -v"

# target platform is empty here now
if [[ "$target_platform" == osx* ]]; then
llvm-nm $PREFIX/lib/libc++.1.dylib
# to be able to use libc++'s tzdb code
FLAGS="${FLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
else
LINK_FLAGS="${LINK_FLAGS} -lc++abi"
FLAGS="${FLAGS} -lc++abi"
fi

FILES=test_sources/*.c
for f in $FILES
do
clang -O2 -g $f $LINK_FLAGS
clang -O2 -g $f $FLAGS
./a.out
done

FILES=test_sources/*.cpp
for f in $FILES
do
clang++ -stdlib=libc++ -O2 -g $f $LINK_FLAGS
clang++ -stdlib=libc++ -O2 -g $f $FLAGS
./a.out
done

FILES=test_sources/cpp11/*.cpp
for f in $FILES
do
clang++ -stdlib=libc++ -std=c++11 -O2 -g $f $LINK_FLAGS
clang++ -stdlib=libc++ -std=c++11 -O2 -g $f $FLAGS
./a.out
done

FILES=test_sources/cpp14/*.cpp
for f in $FILES
do
clang++ -stdlib=libc++ -std=c++14 -O2 -g $f $LINK_FLAGS
clang++ -stdlib=libc++ -std=c++14 -O2 -g $f $FLAGS
./a.out
done

# tzdb integration (experimental as of v19)
cd test_sources/tzdb
clang++ -stdlib=libc++ -fexperimental-library -std=c++20 -O2 -g tzdb.cpp -o tzdb $FLAGS
./tzdb

# also test tzdb without any environment activation
unset PREFIX
unset CONDA_PREFIX
./tzdb
10 changes: 5 additions & 5 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ cxx_compiler: # [osx]
# libcxx only supports the last released GCC version, see
# https://libcxx.llvm.org/index.html#platform-and-compiler-support
c_compiler_version: # [unix]
- 13 # [linux]
- 14 # [linux]
- "*" # [osx]
cxx_compiler_version: # [unix]
- 13 # [linux]
- 14 # [linux]
- "*" # [osx]

# we want different hashes between osx-64 & osx-arm
Expand All @@ -35,23 +35,23 @@ c_stdlib_version: # [linux]
# avoided in production (which we enforce with a run-export). For more details see
# https://libcxx.llvm.org/Hardening.html
hardening:
- none # [osx]
- none
- debug
- none # [osx]

# in some scenarios, libraries will load a cached _system_ libc++, and if we have an
# ABI-mismatch with that system lib, segfaults ensue (see libcxx-testing-feedstock);
# because the ABI changed with macOS 12, we build a version each for before & after
sys_abi: # [osx]
- pre-12 # [osx]
- post-12 # [osx]
- post-12 # [osx]
- pre-12 # [osx]

# publish the pre-12 ABI & hardened builds to a separate label
channel_targets:
- conda-forge libcxx_macos_lt_12 # [osx]
- conda-forge main
- conda-forge libcxx_debug
- conda-forge libcxx_macos_lt_12 # [osx]

zip_keys:
-
Expand Down
27 changes: 19 additions & 8 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "18.1.8" %}
{% set version = "19.1.0" %}

{% if sys_abi is undefined %}
{% set sys_abi = "dummy" %}
Expand All @@ -11,7 +11,7 @@ package:

source:
- url: https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-{{ version.replace(".rc", "-rc") }}.tar.gz
sha256: 09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856
sha256: 0a08341036ca99a106786f50f9c5cb3fbe458b3b74cab6089fd368d0edb2edfe
patches:
# See https://discourse.llvm.org/t/shipping-custom-libc-on-macos/58606
- patches/0001-Fix-ABI-compatibility-with-system.patch # [sys_abi == "pre-12"]
Expand All @@ -20,9 +20,11 @@ source:
- patches/0003-disable-_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPT.patch
# work around https://github.com/llvm/llvm-project/issues/90332
- patches/0004-Work-around-stray-nostdlib-flags-causing-errors-with.patch
# allow chrono implementation to work on osx
- patches/0005-patch-__libcpp_tzdb_directory-to-allow-use-on-osx.patch

build:
number: 7
number: 0
skip: true # [win]
skip: true # [ppc64le or aarch64]

Expand All @@ -38,9 +40,6 @@ requirements:
- {{ compiler('c') }}
- {{ stdlib('c') }}
- python >3 # [not osx]
host:
# - clangdev {{ version }} # [not osx]
- llvmdev {{ version }} # [not osx]

outputs:
- name: libcxx-devel
Expand All @@ -52,11 +51,15 @@ outputs:
- libcxx =*=debug* # [hardening == "debug"]
files:
- include/c++ # [unix]
# for C++20 modules, which are installed into $PREFIX/share/libc++
- share/libc++/* # [unix]
- Library/include/c++ # [win]
requirements:
host:
- {{ pin_subpackage("libcxx", exact=True) }}
run:
# re-enable this once chrono implementation is in shared library
# - tzdata
- {{ pin_subpackage("libcxx", max_pin=None) }}
run_constrained:
- __osx <12 # [osx and (sys_abi == "pre-12")]
Expand Down Expand Up @@ -87,12 +90,20 @@ outputs:
# i.e. everywhere there's a string "availability(macos,...,introduced=<ver>)" for osx version >10.13;
# '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 our link or are for <=10.13 (lowest occurring in that file is 10.9)
- if [ 0 -eq $(cat ${PREFIX}/include/c++/v1/__availability | grep "availability(macos" | grep -vE "(conda-forge|10.9|10.1[0-3])" | wc -l) ]; then exit 0; else exit 1; fi # [osx]
- if [ 0 -ne $(cat ${PREFIX}/include/c++/v1/__configuration/availability.h | grep "availability(macos" | grep -vE "(conda-forge|10.9|10.1[0-3])" | wc -l) ]; then 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]
- test -f $PREFIX/lib/libc++abi.so # [linux]

# for full chrono support, libcxx needs leap-seconds.list, which
# isn't shipped in ubuntu-22.04 nor macos-14 images (ubuntu-24.04
# should have it, but isn't available in azure pipelines yet).
- ls -lL /usr/share/zoneinfo
# This check is intended to start failing once an image starts shipping
# that file, so we can re-enable the leapsecond portion of the tzdb-tests
- if [ 0 -ne $(ls -lL /usr/share/zoneinfo | grep leap-seconds.list | wc -l) ]; then exit 1; fi

# Following 2 projects had issues with libc++, so check them
# before releasing just to be sure.
downstreams: # [osx]
Expand All @@ -104,7 +115,6 @@ outputs:
- libcxx-testing 0.18 # [osx]
- libcxx-testing 0.17 # [osx]
- libcxx-testing 0.16 # [osx]
- libcxx-testing 0.15 # [osx]
{% endif %}

- name: libcxx
Expand All @@ -124,6 +134,7 @@ outputs:
- lib/libc++.dylib # [osx]
- lib/libc++.*.dylib # [osx]
- Library/bin/c++*.dll # [win]
# static libs for cross-compilation, due to lack of host-exports
- lib/libc++.a # [unix]
- lib/libc++experimental.* # [unix]
- Library/lib/c++*.lib # [win]
Expand Down
14 changes: 7 additions & 7 deletions recipe/patches/0001-Fix-ABI-compatibility-with-system.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From b461291f007bc7457a5a7f7219cd0943b8e7ba3d Mon Sep 17 00:00:00 2001
From bf8c76c5be4a6923267959f629650d375ffe1fb5 Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Tue, 13 Jul 2021 01:57:06 -0500
Subject: [PATCH 1/4] Fix ABI compatibility with system
Subject: [PATCH 1/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 73b24dbf595a..6a69d6fa2855 100644
index 4efdc63c0966..812d1a386096 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -176,10 +176,6 @@ locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {
@@ -174,10 +174,6 @@ locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {
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 73b24dbf595a..6a69d6fa2855 100644
install(&make<numpunct<char> >(1u));
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(&make<numpunct<wchar_t> >(1u));
@@ -218,6 +214,10 @@ locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {
@@ -216,6 +212,10 @@ locale::__imp::__imp(size_t refs) : facet(refs), facets_(N), name_("C") {
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(&make<std::messages<wchar_t> >(1u));
#endif
Expand All @@ -33,7 +33,7 @@ index 73b24dbf595a..6a69d6fa2855 100644
}

locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N), name_(name) {
@@ -244,10 +244,6 @@ locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N),
@@ -242,10 +242,6 @@ locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N),
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 73b24dbf595a..6a69d6fa2855 100644
install(new numpunct_byname<char>(name_));
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(new numpunct_byname<wchar_t>(name_));
@@ -270,6 +266,10 @@ locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N),
@@ -268,6 +264,10 @@ locale::__imp::__imp(const string& name, size_t refs) : facet(refs), facets_(N),
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(new messages_byname<wchar_t>(name_));
#endif
Expand Down
Loading

0 comments on commit d5ad9ec

Please sign in to comment.