@@ -2352,13 +2352,31 @@ for host in "${ALL_HOSTS[@]}"; do
2352
2352
echo " copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR} ."
2353
2353
2354
2354
for OS in ios watchos tvos; do
2355
+ # Copy over the device .a
2355
2356
LIB_NAME=" libclang_rt.$OS .a"
2356
2357
HOST_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$LIB_NAME "
2357
2358
if [[ -f " ${HOST_LIB_PATH} " ]]; then
2358
2359
call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${LIB_NAME} "
2359
2360
elif [[ " ${VERBOSE_BUILD} " ]]; then
2360
2361
echo " no file exists at ${HOST_LIB_PATH} "
2361
2362
fi
2363
+ # Copy over the simulator .a
2364
+ SIM_LIB_NAME=" libclang_rt.${OS} sim.a"
2365
+ HOST_SIM_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$SIM_LIB_NAME "
2366
+ if [[ -f " ${HOST_SIM_LIB_PATH} " ]]; then
2367
+ call cp " ${HOST_SIM_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${SIM_LIB_NAME} "
2368
+ elif [[ " ${HOST_LIB_PATH} " ]]; then
2369
+ # The simulator .a might not exist if the host
2370
+ # Xcode is old. In that case, copy over the
2371
+ # device library to the simulator location to allow
2372
+ # clang to find it. The device library has the simulator
2373
+ # slices in Xcode that doesn't have the simulator .a, so
2374
+ # the link is still valid.
2375
+ echo " copying over faux-sim library ${HOST_LIB_PATH} to ${SIM_LIB_NAME} "
2376
+ call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${SIM_LIB_NAME} "
2377
+ elif [[ " ${VERBOSE_BUILD} " ]]; then
2378
+ echo " no file exists at ${HOST_SIM_LIB_PATH} "
2379
+ fi
2362
2380
done
2363
2381
done
2364
2382
fi
0 commit comments