Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// REQUIRES: stdlib=apple-libc++ | // REQUIRES: stdlib=apple-libc++ | ||||
// This file checks various properties of the installation of libc++ when built as | // This file checks various properties of the installation of libc++ when built as | ||||
// a system library on Apple platforms. | // a system library on Apple platforms. | ||||
// | |||||
// TODO: We should install to `<prefix>/usr` in CMake and check that path instead. | |||||
// Make sure we install the libc++ headers in the right location. | // Make sure we install the libc++ headers in the right location. | ||||
// | // | ||||
// RUN: stat "%{install}/include/c++/v1/__config" | // RUN: stat "%{include}/__config" | ||||
// Make sure we install libc++.1.dylib in the right location. | // Make sure we install libc++.1.dylib in the right location. | ||||
// | // | ||||
// RUN: stat "%{install}/lib/libc++.1.dylib" | // RUN: stat "%{lib}/libc++.1.dylib" | ||||
// Make sure we install a symlink from libc++.dylib to libc++.1.dylib. | // Make sure we install a symlink from libc++.dylib to libc++.1.dylib. | ||||
// | // | ||||
// RUN: stat "%{install}/lib/libc++.dylib" | // RUN: stat "%{lib}/libc++.dylib" | ||||
// RUN: readlink "%{install}/lib/libc++.dylib" | grep "libc++.1.dylib" | // RUN: readlink "%{lib}/libc++.dylib" | grep "libc++.1.dylib" | ||||
// Make sure the install_name is /usr/lib. | // Make sure the install_name is /usr/lib. | ||||
// | // | ||||
// In particular, make sure we don't use any @rpath in the load commands. When building as | // In particular, make sure we don't use any @rpath in the load commands. When building as | ||||
// a system library, it is important to hardcode the installation paths in the dylib, because | // a system library, it is important to hardcode the installation paths in the dylib, because | ||||
// various tools like dyld and ld64 will treat us specially if they recognize us as being a | // various tools like dyld and ld64 will treat us specially if they recognize us as being a | ||||
// system library. | // system library. | ||||
// | // | ||||
// TODO: We currently don't do that correctly in the CMake build. | // TODO: We currently don't do that correctly in the CMake build. | ||||
// | // | ||||
// XRUNX: otool -L "%{install}/lib/libc++.1.dylib" | grep '/usr/lib/libc++.1.dylib' | // XRUNX: otool -L "%{lib}/libc++.1.dylib" | grep '/usr/lib/libc++.1.dylib' | ||||
// XRUNX: ! otool -l "%{install}/lib/libc++.1.dylib" | grep -E "LC_RPATH|@loader_path|@rpath" | // XRUNX: ! otool -l "%{lib}/libc++.1.dylib" | grep -E "LC_RPATH|@loader_path|@rpath" | ||||
// Make sure the compatibility_version of libc++ is 1.0.0. | // Make sure the compatibility_version of libc++ is 1.0.0. | ||||
// Failure to respect this can result in applications not being able to find libc++ | // Failure to respect this can result in applications not being able to find libc++ | ||||
// when they are loaded by dyld, if the compatibility version was bumped. | // when they are loaded by dyld, if the compatibility version was bumped. | ||||
// | // | ||||
// RUN: otool -L "%{install}/lib/libc++.1.dylib" | grep "libc++.1.dylib" | grep "compatibility version 1.0.0" | // RUN: otool -L "%{lib}/libc++.1.dylib" | grep "libc++.1.dylib" | grep "compatibility version 1.0.0" |