2015-10-02 23:10:33 +08:00
|
|
|
// REQUIRES: system-darwin
|
|
|
|
|
darwin: Unconditionally pass -lto_library, remove -Wliblto warning.
https://reviews.llvm.org/D25932 made it so that clang always checks if
libLTO.dylib is present on disk, even if -flto is not being used. The
motivation for that change was that if a dependency happens to contain bitcode,
ld64 will try to load libLTO without -flto explicitly being enabled. However,
the change had the undesirable side effect of warning if libLTO.dylib doesn't
exist even if it isn't needed.
Change things so that -lto_library is always passes, independent of if it
exists or not. ld64 only looks at this flag if it uses LTO. If the dylib
exists, all is well. If it doesn't, and LTO is not being used, all is well too.
If ld64 does end up using LTO and the dylib does not exist, ld64 will print
something like
ld: could not process llvm bitcode object file, because foo/libLTO.dylib could not be loaded file 'test.o' for architecture x86_64
https://reviews.llvm.org/D26984
llvm-svn: 287685
2016-11-23 03:38:07 +08:00
|
|
|
// Check that ld gets "-lto_library".
|
2015-10-02 23:10:33 +08:00
|
|
|
|
2016-08-31 04:36:50 +08:00
|
|
|
// RUN: mkdir -p %T/bin
|
|
|
|
// RUN: mkdir -p %T/lib
|
|
|
|
// RUN: touch %T/lib/libLTO.dylib
|
2015-10-02 23:10:33 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
|
2016-10-27 07:23:08 +08:00
|
|
|
// RUN: -ccc-install-dir %T/bin -mlinker-version=133 2> %t.log
|
2016-08-31 04:36:50 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log
|
2015-10-02 23:10:33 +08:00
|
|
|
//
|
|
|
|
// LINK_LTOLIB_PATH: {{ld(.exe)?"}}
|
|
|
|
// LINK_LTOLIB_PATH: "-lto_library"
|
|
|
|
|
darwin: Unconditionally pass -lto_library, remove -Wliblto warning.
https://reviews.llvm.org/D25932 made it so that clang always checks if
libLTO.dylib is present on disk, even if -flto is not being used. The
motivation for that change was that if a dependency happens to contain bitcode,
ld64 will try to load libLTO without -flto explicitly being enabled. However,
the change had the undesirable side effect of warning if libLTO.dylib doesn't
exist even if it isn't needed.
Change things so that -lto_library is always passes, independent of if it
exists or not. ld64 only looks at this flag if it uses LTO. If the dylib
exists, all is well. If it doesn't, and LTO is not being used, all is well too.
If ld64 does end up using LTO and the dylib does not exist, ld64 will print
something like
ld: could not process llvm bitcode object file, because foo/libLTO.dylib could not be loaded file 'test.o' for architecture x86_64
https://reviews.llvm.org/D26984
llvm-svn: 287685
2016-11-23 03:38:07 +08:00
|
|
|
// Also pass -lto_library even if the file doesn't exist; if it's needed at
|
|
|
|
// link time, ld will complain instead.
|
2015-10-02 23:10:33 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
|
2016-10-27 07:23:08 +08:00
|
|
|
// RUN: -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log
|
darwin: Unconditionally pass -lto_library, remove -Wliblto warning.
https://reviews.llvm.org/D25932 made it so that clang always checks if
libLTO.dylib is present on disk, even if -flto is not being used. The
motivation for that change was that if a dependency happens to contain bitcode,
ld64 will try to load libLTO without -flto explicitly being enabled. However,
the change had the undesirable side effect of warning if libLTO.dylib doesn't
exist even if it isn't needed.
Change things so that -lto_library is always passes, independent of if it
exists or not. ld64 only looks at this flag if it uses LTO. If the dylib
exists, all is well. If it doesn't, and LTO is not being used, all is well too.
If ld64 does end up using LTO and the dylib does not exist, ld64 will print
something like
ld: could not process llvm bitcode object file, because foo/libLTO.dylib could not be loaded file 'test.o' for architecture x86_64
https://reviews.llvm.org/D26984
llvm-svn: 287685
2016-11-23 03:38:07 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log
|