From 003d20bb947529dc8813f132507f258a46ae5674 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 29 Sep 2025 09:42:29 -0500 Subject: [PATCH 1/2] Remove dependence on clang --- recipe/build.sh | 4 ++-- recipe/meta.yaml | 17 +++++++---------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/recipe/build.sh b/recipe/build.sh index a03ed76..4d4a5a6 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -4,8 +4,8 @@ set -ex if [[ $target_platform == osx-* ]]; then export CPU_COUNT=1 else - export CC=$(which clang) - export CXX=$(which clang++) + export CC=$(which clang-${CLANG_EXE_VERSION}) + export CXX=$(which clang-${CLANG_EXE_VERSION}) export TCROOT=$CONDA_BUILD_SYSROOT fi export cctools_cv_tapi_support=yes diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 940a545..e3b80ff 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -3,6 +3,7 @@ {% if llvm_version is not defined %} {% set llvm_version = "21.1" %} {% endif %} +{% set clang_exe_version = "19" %} {% if cross_platform is not defined %} {% set cross_platform = "osx-64" %} @@ -23,14 +24,16 @@ source: - patches/0004-avoid-stripping-out-C-stdlib-too-zealously.patch # [osx] build: - number: 2 + number: 3 skip: True # [win] ignore_run_exports: - zlib + script_env: + - CLANG_EXE_VERSION={{ clang_exe_version }} requirements: build: - - clangxx {{ llvm_version }}.* # [linux] + - clang-{{ clang_exe_version }} # [linux] - {{ stdlib('c') }} - {{ compiler('cxx') }} - autoconf @@ -79,8 +82,6 @@ outputs: run_constrained: - ld64 {{ ld64_version }}.* - cctools {{ cctools_version }}.* - # clang might pull in the wrong cctools otherwise - - clang {{ llvm_version }}.* test: commands: - test -f $PREFIX/bin/{{ cross_macos_machine }}-ar @@ -120,7 +121,6 @@ outputs: - sed host: - llvm {{ llvm_version }}.* - - clang {{ llvm_version }}.* - tapi - libcxx # [osx] - libdispatch # [linux] @@ -130,17 +130,16 @@ outputs: - libcxx # [osx] - sigtool run_constrained: - - {{ pin_compatible("clang") }} - ld {{ ld64_version }}.* - cctools {{ cctools_version }}.* - cctools_{{ cross_platform }} {{ cctools_version }}.* test: requires: - - clang {{ llvm_version }}.* + - clang-{{ clang_exe_version }} commands: - test -f $PREFIX/bin/{{ cross_macos_machine }}-ld - echo "int main() {}" > lto.c # [osx] - - clang -c lto.c -o lto.o -flto # [osx] + - clang-{{ clang_exe_version }} -c lto.c -o lto.o -flto # [osx] - $PREFIX/bin/{{ cross_macos_machine }}-ld lto.o -o lto -lSystem -arch x86_64 # [osx] downstreams: - gfortran_osx-64 # [osx and cross_platform=="osx-64"] @@ -159,7 +158,6 @@ outputs: requirements: host: - llvm {{ llvm_version }}.* - - clang {{ llvm_version }}.* - {{ pin_subpackage("ld64_" + cross_platform, exact=True) }} run: - {{ pin_subpackage("ld64_" + cross_platform, exact=True) }} @@ -184,7 +182,6 @@ outputs: requirements: host: - llvm {{ llvm_version }}.* - - clang {{ llvm_version }}.* - {{ pin_subpackage("ld64", exact=True) }} - {{ pin_subpackage("cctools_" + cross_platform, exact=True) }} run: From d587bd759a9face6ff95d44a90406eb733ceb23d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 29 Sep 2025 11:29:41 -0500 Subject: [PATCH 2/2] fix clang++ --- recipe/build.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/recipe/build.sh b/recipe/build.sh index 4d4a5a6..64b06ce 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -3,9 +3,13 @@ set -ex if [[ $target_platform == osx-* ]]; then export CPU_COUNT=1 -else - export CC=$(which clang-${CLANG_EXE_VERSION}) - export CXX=$(which clang-${CLANG_EXE_VERSION}) +elif [[ $target_platform == linux-* ]]; then + export CC=${BUILD_PREFIX}/bin/clang-${CLANG_EXE_VERSION} + export CXX=${BUILD_PREFIX}/bin/clang++-${CLANG_EXE_VERSION} + if [[ ! -f ${CXX} ]]; then + # Remove after https://github.com/conda-forge/clangdev-feedstock/pull/387 is in + ln -sf ${CC} ${CXX} + fi export TCROOT=$CONDA_BUILD_SYSROOT fi export cctools_cv_tapi_support=yes