Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ cxx_compiler_version:
- '14'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
hardening:
- none
target_platform:
- linux-64
zip_keys:
- - c_stdlib_version
- cdt_name
- - hardening
- channel_targets
8 changes: 8 additions & 0 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ cxx_compiler_version:
- '*'
dummy_var:
- '0'
hardening:
- none
macos_machine:
- x86_64-apple-darwin13.4.0
sys_abi:
- post-12
target_platform:
- osx-64
zip_keys:
- - hardening
- channel_targets
- sys_abi
8 changes: 8 additions & 0 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ cxx_compiler_version:
- '*'
dummy_var:
- '1'
hardening:
- none
macos_machine:
- arm64-apple-darwin20.0.0
sys_abi:
- post-12
target_platform:
- osx-arm64
zip_keys:
- - hardening
- channel_targets
- sys_abi
3 changes: 1 addition & 2 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ cmake -G Ninja \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
-DLIBCXX_INCLUDE_DOCS=OFF \
-DLIBCXX_INCLUDE_TESTS=OFF \
-DLIBCXX_HARDENING_MODE="none" \
-DLIBCXX_HARDENING_MODE="${hardening}" \
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DCOMPILER_RT_USE_LLVM_UNWINDER=OFF \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
$CMAKE_ARGS \
$CMAKE_EXTRA_ARGS
Expand Down
42 changes: 36 additions & 6 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ c_compiler: # [osx]
cxx_compiler: # [osx]
- clang_bootstrap # [osx]

channel_targets:
- conda-forge llvm_rc

channel_sources:
- conda-forge/label/llvm_rc,conda-forge

# libcxx only supports the last released GCC version, see
# https://libcxx.llvm.org/index.html#platform-and-compiler-support
c_compiler_version: # [unix]
Expand All @@ -32,3 +26,39 @@ c_stdlib_version: # [linux]
- "2.17" # [linux]
# w.r.t. to the ABI of the system libcxx, this would need to be 12.0 on macos
# but as we only publish one build to main, maintain global lower bounds

# hardening modes can be useful to detect misuse or undefined behaviour, especially
# as all modes maintain the same ABI; while the fast mode has essentially no runtime
# impact, it uses a default assertion handler that just crashes (see #162) and is
# therefore not a good choice for production builds. We provide fully hardened
# "debug" builds in a separate channel, which can be used for testing, but must be
# avoided in production (which we enforce with a run-export). For more details see
# https://libcxx.llvm.org/Hardening.html
hardening:
- 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]
- post-12 # [osx]
# - post-12 # [osx]
# - pre-12 # [osx]

channel_sources:
- conda-forge/label/llvm_rc,conda-forge

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

zip_keys:
-
- hardening
- channel_targets
- sys_abi # [osx]
36 changes: 28 additions & 8 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% set version = "19.1.0.rc1" %}
{% set version = "19.1.0.rc2" %}

{% if sys_abi is undefined %}
{% set sys_abi = "dummy" %}
{% set hardening = "dummy" %}
{% endif %}

package:
Expand All @@ -10,10 +11,10 @@ package:

source:
- url: https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-{{ version.replace(".rc", "-rc") }}.tar.gz
sha256: cd3b42caf8e78c497712a661303672c1a6279eb1a5ff8735488087319ab95214
sha256: 5332e77a658136c778fc32ec2a3687de4d63e0ff48010be205c4e7af6e76f1f1
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"]
- patches/0001-Fix-ABI-compatibility-with-system.patch # [sys_abi == "pre-12"]
- patches/0002-custom-error-message-for-old-sdk.patch
# disable feature that requires up-to-date libcxxabi, which we don't ship
- patches/0003-disable-_LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPT.patch
Expand All @@ -23,30 +24,39 @@ source:
- patches/0005-patch-__libcpp_tzdb_directory-to-allow-use-on-osx.patch

build:
number: 3
number: 0
skip: true # [win]
skip: true # [ppc64le or aarch64]
ignore_run_exports:
- libstdcxx-ng
missing_dso_whitelist:
- /usr/lib/libc++abi.dylib

# use selectors here so smithy breaks up CI jobs
# [sys_abi]
# [hardening]

requirements:
build:
- cmake
- ninja
- {{ compiler('cxx') }}
- {{ stdlib('c') }}
# use sys_abi as selector, so smithy breaks up CI jobs
- {{ stdlib('c') }} # [osx and (sys_abi == "pre-12")]
- {{ stdlib('c') }} # [osx and (sys_abi == "post-12")]
- python >3 # [not osx]
host:
- clangdev {{ version }} # [not osx]
- llvmdev {{ version }} # [not osx]

outputs:
- name: libcxx
build:
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [hardening == "none"]
string: debug_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [hardening == "debug"]
run_exports: # [hardening == "debug"]
# packages built with hardened lib must not be installable without extra label
- libcxx =*=debug* # [hardening == "debug"]
ignore_run_exports: # [linux]
- libstdcxx-ng # [linux]
files:
- include/c++ # [unix]
- lib/libc++.* # [unix]
Expand All @@ -62,12 +72,17 @@ outputs:
- {{ compiler('cxx') }}
- {{ stdlib('c') }}
host:
- {{ pin_subpackage("libcxxabi", exact=True) }} # [linux]
run:
- tzdata
# re-enable this once chrono implementation is in shared library
# - tzdata
- {{ pin_subpackage("libcxxabi", exact=True) }} # [linux]
run_constrained:
- __osx <12 # [osx and (sys_abi == "pre-12")]
- sysroot_{{ target_platform }} >={{ c_stdlib_version }} # [linux]

# package for old sys_abi is not installable on macOS-12 image anymore
{% if sys_abi != "pre-12" %}
test:
requires:
- clang # [osx]
Expand Down Expand Up @@ -118,16 +133,21 @@ outputs:
- libcxx-testing 0.18 # [osx]
- libcxx-testing 0.17 # [osx]
- libcxx-testing 0.16 # [osx]
{% endif %}

- name: libcxxabi
build:
skip: true # [not linux]
# even though libcxxabi shouldn't be affected, distinguish builds
string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [hardening == "none"]
string: debug_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [hardening == "debug"]
files:
- lib/libc++abi.*
requirements:
build:
# for run-exports
- {{ stdlib('c') }}
- {{ compiler('c') }}
test:
commands:
- test -f $PREFIX/lib/libc++abi.so # [linux]
Expand Down
1 change: 0 additions & 1 deletion recipe/test_sources/hello_world.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <iostream>
#include <functional>

int main() {
std::cout << "Hello World from C++!" << std::endl;
Expand Down