LLDB Linking Error

Hi,

Whenever I add the no-assertions flag to my Swift compiler build I get the following linking error for LLDB when building a toolchain:

Ld /Users/eaplatanios/Development/GitHub/swift-source-temp/swift/swift-nightly-install/Library/Developer/Toolchains/swift-tensorflow-LOCAL-2019-07-16-a.xctoolchain/usr/bin/lldb normal x86_64
    cd /Users/eaplatanios/Development/GitHub/swift-source-temp/lldb
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos10.13 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/Users/eaplatanios/Development/GitHub/swift-source-temp/build/buildbot_osx/lldb-macosx-x86_64/CustomSwift-Release -F/Users/eaplatanios/Development/GitHub/swift-source-temp/build/buildbot_osx/lldb-macosx-x86_64/CustomSwift-Release -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/PrivateFrameworks -filelist /Users/eaplatanios/Development/GitHub/swift-source-temp/build/buildbot_osx/lldb-macosx-x86_64/lldb.build/CustomSwift-Release/lldb-tool.build/Objects-normal/x86_64/lldb.LinkFileList -Xlinker -object_path_lto -Xlinker /Users/eaplatanios/Development/GitHub/swift-source-temp/build/buildbot_osx/lldb-macosx-x86_64/lldb.build/CustomSwift-Release/lldb-tool.build/Objects-normal/x86_64/lldb_lto.o -Xlinker -final_output -Xlinker /Library/Developer/Toolchains/swift-tensorflow-LOCAL-2019-07-16-a.xctoolchain/usr/bin/lldb -stdlib=libc++ -lcompression -lcompression -L/Users/eaplatanios/Development/GitHub/swift-source-temp/build/buildbot_osx/swift-macosx-x86_64/lib/swift/macosx -Wl,-rpath,@executable_path/../lib/swift/macosx -Wl,-rpath,@loader_path/../../../../../../usr/lib/swift/macosx -ltensorflow -sectcreate __TEXT __info_plist /Users/eaplatanios/Development/GitHub/swift-source-temp/lldb/tools/driver/lldb-Info.plist -Wl,-rpath,@loader_path -Wl,-rpath,@loader_path/../../System/Library/PrivateFrameworks -L/Users/eaplatanios/Development/GitHub/swift-source-temp/build/buildbot_osx/llvm-macosx-x86_64/lib -lLLVMOption -lLLVMSupport -lLLVMDemangle -ltermcap -framework LLDB -lz -Xlinker -dependency_info -Xlinker /Users/eaplatanios/Development/GitHub/swift-source-temp/build/buildbot_osx/lldb-macosx-x86_64/lldb.build/CustomSwift-Release/lldb-tool.build/Objects-normal/x86_64/lldb_dependency_info.dat -o /Users/eaplatanios/Development/GitHub/swift-source-temp/swift/swift-nightly-install/Library/Developer/Toolchains/swift-tensorflow-LOCAL-2019-07-16-a.xctoolchain/usr/bin/lldb
Undefined symbols for architecture x86_64:
  "typeinfo for llvm::format_object_base", referenced from:
      typeinfo for llvm::format_object<int, void const*, unsigned long long, int> in Driver.o
      typeinfo for llvm::format_object<int, int> in Driver.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** INSTALL FAILED **


The following build commands failed:
	Ld /Users/eaplatanios/Development/GitHub/swift-source-temp/swift/swift-nightly-install/Library/Developer/Toolchains/swift-tensorflow-LOCAL-2019-07-16-a.xctoolchain/usr/bin/lldb normal x86_64
(1 failure)
./utils/build-script: fatal error: command terminated with a non-zero exit status 65, aborting
./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

I am compiling from the tensorflow branch and all I am changing from a build that works if line 2117 of build-presets.ini from mixin-preset=mixin_lightweight_assertions to no-assertions. Why does no-assertions cause errors when linking LLDB?

Thanks,
Anthony

EDIT: This can be reproduced shown in this commit.

I wonder if this error is reproducible from master branch instead of tensorflow branch?
That would reveal if it's a tensorflow-specific issue and would help others debug. I believe you can simply copy the build-script invocation, but drop the --enable-tensorflow flag.