@@ -2375,13 +2375,31 @@ for host in "${ALL_HOSTS[@]}"; do
2375
2375
echo " copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR} ."
2376
2376
2377
2377
for OS in ios watchos tvos; do
2378
+ # Copy over the device .a
2378
2379
LIB_NAME=" libclang_rt.$OS .a"
2379
2380
HOST_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$LIB_NAME "
2380
2381
if [[ -f " ${HOST_LIB_PATH} " ]]; then
2381
2382
call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${LIB_NAME} "
2382
2383
elif [[ " ${VERBOSE_BUILD} " ]]; then
2383
2384
echo " no file exists at ${HOST_LIB_PATH} "
2384
2385
fi
2386
+ # Copy over the simulator .a
2387
+ SIM_LIB_NAME=" libclang_rt.${OS} sim.a"
2388
+ HOST_SIM_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$SIM_LIB_NAME "
2389
+ if [[ -f " ${HOST_SIM_LIB_PATH} " ]]; then
2390
+ call cp " ${HOST_SIM_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${SIM_LIB_NAME} "
2391
+ elif [[ " ${HOST_LIB_PATH} " ]]; then
2392
+ # The simulator .a might not exist if the host
2393
+ # Xcode is old. In that case, copy over the
2394
+ # device library to the simulator location to allow
2395
+ # clang to find it. The device library has the simulator
2396
+ # slices in Xcode that doesn't have the simulator .a, so
2397
+ # the link is still valid.
2398
+ echo " copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME} "
2399
+ call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${SIM_LIB_NAME} "
2400
+ elif [[ " ${VERBOSE_BUILD} " ]]; then
2401
+ echo " no file exists at ${HOST_SIM_LIB_PATH} "
2402
+ fi
2385
2403
done
2386
2404
done
2387
2405
fi
0 commit comments