Skip to content

Commit aa4c536

Browse files
FIX: Exclude PCM files from prefix detection on all platforms
Native linux-aarch64 builds crash with SIGSEGV in CreateInterpreter at test time because: 1. runtime_cxxmodules defaults to ON for native builds (it was only set to OFF inside the cross-compilation block in build_root.sh) 2. PCM files (lib/*.pcm) are LLVM bitcode that Cling loads at startup 3. prefix_detection.ignore only excluded lib/*.pcm for non-aarch64, so on aarch64 rattler-build detected and relocated prefix strings inside the PCM files, corrupting their bitcode structure 4. Cling segfaults when loading the corrupted PCMs The fix makes lib/*.pcm unconditionally excluded from prefix detection, matching the existing behavior on linux-64 where native builds with runtime_cxxmodules=ON already work. Also reverts the CLING_CXX_PATH change from the previous commit, as hypothesis 1 (build-time paths) was ruled out by testing.
1 parent 248e455 commit aa4c536

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

recipe/build_root.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -332,18 +332,8 @@ else
332332
fi
333333
CMAKE_PLATFORM_FLAGS+=("-Droottest=OFF")
334334

335-
# For native builds, use the compiler in $PREFIX (the host prefix) rather than
336-
# $BUILD_PREFIX. Conda's binary relocation only acts on $PREFIX paths, so
337-
# $BUILD_PREFIX paths baked into libCling.so would point to a nonexistent build
338-
# directory at runtime, causing Cling's interpreter initialization to segfault.
339-
# The compiler exists in $PREFIX because it is listed in the host requirements.
340-
if [[ "${target_platform}" == "${build_platform}" && "${target_platform}" == linux* ]]; then
341-
CLING_CXX="${PREFIX}/bin/$(basename $(which $CXX))"
342-
else
343-
CLING_CXX="$(which $CXX)"
344-
fi
345-
CMAKE_PLATFORM_FLAGS+=("-DCLING_CXX_PATH=${CLING_CXX}")
346-
CMAKE_PLATFORM_FLAGS+=("-DCLING_CXX_RLTV=$(basename ${CLING_CXX})")
335+
CMAKE_PLATFORM_FLAGS+=("-DCLING_CXX_PATH=$(which $CXX)")
336+
CMAKE_PLATFORM_FLAGS+=("-DCLING_CXX_RLTV=$(basename $(which $CXX))")
347337

348338
# Now we can actually run CMake
349339
cmake $CMAKE_ARGS "${CMAKE_PLATFORM_FLAGS[@]}" ${SRC_DIR}/root-source

recipe/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ outputs:
6969
overdepending_behavior: ignore
7070
prefix_detection:
7171
ignore:
72+
- lib/*.pcm
7273
- if: aarch64
7374
then: etc/allDict.cxx.pch
74-
else: lib/*.pcm
7575
files:
7676
include:
7777
- "**"

0 commit comments

Comments
 (0)