The LLVM compiler is the next-generation compiler introduced in Xcode 3.2 for Snow Leopard based on the open source LLVM.org project.

Posts under LLVM tag

172 Posts

Post

Replies

Boosts

Views

Activity

Xcode 14 beta 6 Indexing | Processing files forever - hangs So does Compiles.
This appears to be a common issue with little to zero known resolutions over the years.... Appears to happen with previous versions of Xcode. Does Apple or the community have a fix? I've checked out the sources in a new location from my github - Same/similar issue. I've started a completely new project from scratch and then dragged my source into it... same/similar issue. I've killed the swift-frontend process & closed reopened Xcode. I've cleaned the build folder / delete DerivedData & restarted the computer... same/similar issue. Any ideas?
1
1
2.1k
Aug ’22
Important bug for C++ object dynamic delete in XCode Compiler
I have a sample code to test c++ virtual deconstructor like below: #include <iostream> class CA { public:   virtual ~CA() {     std::cout<< "~CA" << std::endl;   } }; class CB :public CA {    public:   virtual ~CB() {     std::cout<< "~CB" << std::endl;   } }; int main(int argc, const char * argv[]) {       CA *pb = new CB[3];   delete []pb;       return 0; } in xcode this code print out result is : ~CA ~CA ~CA but in other compilers like visual studio C++ and gcc the print out result is: ~CB ~CA ~CB ~CA ~CB ~CA I think this is a dynamic delete array object with virtual deconstructor bug in xcode compiler 。 because the print result is not conform to C++ form。
1
0
996
Aug ’22
Crash in `outlined init with copy of` when run in Release Mode
Hey there, When I run the following 50 lines of code in release mode, or turn Optimization on in Build-Settings Swift Compiler - Code Generation I will get the following crash. Anyone any idea why that happens? (Xcode 13.4.1, happens on Device as well as simulator on iOS 15.5 and 15.6) Example Project: https://github.com/Bersaelor/ResourceCrashMinimalDemo #0 0x000000010265dd58 in assignWithCopy for Resource () #1 0x000000010265d73c in outlined init with copy of Resource<VoidPayload, String> () #2 0x000000010265d5dc in specialized Resource<>.init(url:method:query:authToken:headers:) [inlined] at /Users/konradfeiler/Source/ResourceCrashMinimalDemo/ResourceCrashMinimalDemo/ContentView.swift:51 #3 0x000000010265d584 in specialized ContentView.crash() at /Users/konradfeiler/Source/ResourceCrashMinimalDemo/ResourceCrashMinimalDemo/ContentView.swift:18 Code needed: import SwiftUI struct ContentView: View {     var body: some View {         Button(action: { crash() }, label: { Text("Create Resouce") })     }     /// crashes in `outlined init with copy of Resource<VoidPayload, String>`     func crash() {         let testURL = URL(string: "https://www.google.com")!         let r = Resource<VoidPayload, String>(url: testURL, method: .get, authToken: nil)         print("r: \(r)")     } } struct VoidPayload {} enum HTTPMethod<Payload> {     case get     case post(Payload)     case patch(Payload) } struct Resource<Payload, Response> {     let url: URL     let method: HTTPMethod<Payload>     let query: [(String, String)]     let authToken: String?     let parse: (Data) throws -> Response } extension Resource where Response: Decodable {     init(         url: URL,         method: HTTPMethod<Payload>,         query: [(String, String)] = [],         authToken: String?,         headers: [String: String] = [:]     ) {         self.url = url         self.method = method         self.query = query         self.authToken = authToken         self.parse = {             return try JSONDecoder().decode(Response.self, from: $0)         }     } }
2
2
3.8k
Aug ’22
How to use relative path for compiling
Hi there, We are currently facing a problem around compilation and `swiftc` command.When building, xcode gives the list of files to compile to swiftc in absolute path :CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target: Module) cd /Users/user/Documents/workspace/company/project export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name Module -Onone -whole-module-optimization -enforce-exclusivity=none -DDEBUG -Onone -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -target x86_64-apple-ios9.3-simulator -g -module-cache-path /Users/user/Documents/workspace/company/project/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -profile-coverage-mapping -profile-generate -enable-testing -index-store-path /Users/user/Documents/workspace/company/project/DerivedData/project/Index/DataStore -swift-version 4.2 -I /Users/user/Documents/workspace/company/project/DerivedData/project/Build/Products/development-iphonesimulator -F /Users/user/Documents/workspace/company/project/DerivedData/project/Build/Products/development-iphonesimulator -F /Users/user/Documents/workspace/company/project/Carthage/Build/iOS /Users/user/Documents/workspace/company/project/Module/File.swift /Users/user/Documents/workspace/company/project/Module/File2.swift /Users/user/Documents/workspace/company/project/Module/File3.swiftWe found the `working-directory` parameter to the swiftc command and wonder how to make xcode use it, in order to reduce the command line length ?We are currently reaching the mac os buffer limit for command line, that is 2Mb.
2
0
2.7k
Jul ’22
Ipatool falled with an exception: #<maspec:Nonerotxitexception
We are creating a framework to distribute to other application, our framework contains multiple third party library with pods. We are able to successfully generate the framework. But we are getting error when that framework is used and generating Ad hoc build. Below is the pod file for the framework project pod 'Alamofire', '> 4.9.0' pod 'RealmSwift', '> 3.19.0' pod 'ObjectMapper', '> 3.5.1' pod 'ObjectMapper+Realm', '> 0.6' pod 'ZIPFoundation', '> 0.9.9' #(0.9.9) pod 'NMSSH', '> 2.3.1' post_install do |installer| installer.pods_project.targets.each do |target|       if ['ObjectMapper','ObjectMapper+Realm','Alamofire'].include? target.name    target.build_configurations.each do |config|     config.build_settings['SWIFT_VERSION'] = '4.2'    end   end target.build_configurations.each do |config|    # set valid architecture #   config.build_settings['VALID_ARCHS'] = 'arm64 armv7 armv7s i386 x86_64'    # build active architecture only (Debug build all) #   config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"    config.build_settings['ENABLE_BITCODE'] = 'YES'    if config.name == 'Release' || config.name == 'Pro'      config.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'     else # Debug       config.build_settings['BITCODE_GENERATION_MODE'] = 'marker'    end    cflags = config.build_settings['OTHER_CFLAGS'] || ['$(inherited)']    if config.name == 'Release' || config.name == 'Pro'      cflags << '-fembed-bitcode'    else # Debug      cflags << '-fembed-bitcode-marker'    end    config.build_settings['OTHER_CFLAGS'] = cflags   end  end end
0
0
551
Jun ’22
What are the steps to load crashlog using LLDB
I'm studying iOS crash analysis. Now, I need to import crashlog files into LLDB. As WWDC18 Session 414 said, I now have a copy of myApp, dSYM, xxx.crash. Run the following command in a folder that I created:$ lldb(lldb) command script import lldb.macosx.crashlog(lldb) crashlog /xxxx.crashHowever, the stack trace file is not available and there is only a lot of error like:error: unable to locate any executables from the crash logDid I use it wrong? What is the correct stepts?Thanks in advance. For any question please just let me know.
1
0
2.2k
Jun ’22
C++20 Full Support Road Map?
Hi I'm using C++17 in XCode 13 and looking at the release notes it shows that C++20 is only partially supported - does anyone know when C++20 will be fully supported in XCode ? [C++23 is out next year and would be useful to see some statement from Apple about their plans to support this]
1
0
802
Jun ’22
XCode 10 - "new" file not found
Hello,Just upgraded XCode to version 10. I tried to compile my project which use both Objective-C and C++ files.One of the cpp files includes a header file (.h) which has the following line:#include &lt;new&gt;Compiler gives this error: 'new' file not foundWhy is that? I didn't have this problem with XCode 9.Thanks,Kal
10
0
29k
May ’22
dieharder compilation failure on Apple Silicon: 'ld: symbol(s) not found for architecture arm64'
Attempting to compile dieharder from source on an M1 Max MacBookPro18,2 (macOS 12 + Xcode 13.3.1 + command line tools) and running into an error: ... /bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/local/include -L/opt/local/lib -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm -lgsl -lgslcblas libtool: link: gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/local/include -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o -L/opt/local/lib ../libdieharder/.libs/libdieharder.a -lm -lgsl -lgslcblas Undefined symbols for architecture arm64: "_insert", referenced from: _dab_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) _main_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) "_insertBit", referenced from: _dab_filltree2 in libdieharder.a(libdieharder_la-dab_filltree2.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ... I got to this failure with a MacPorts installed gsl and by executing the following: $ mkdir dieharder; cd dieharder $ wget --no-check-certificate https://webhome.phy.duke.edu/~rgb/General/dieharder/dieharder-3.31.1.tgz $ tar xf dieharder-3.31.1.tgz $ cd dieharder-3.31.1 $ sudo port install gsl $ ./configure LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include CFLAGS=-I/opt/local/include --disable-shared ... $ make ... I reproduced the failure with Homebrew: $ brew install gsl $ make distclean $ ./configure LDFLAGS=-L/opt/homebrew/lib CPPFLAGS=-I/opt/homebrew/include CFLAGS=-I/opt/homebrew/include --disable-shared ... $ make ... /bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/homebrew/include -L/opt/homebrew/lib -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm -lgsl -lgslcblas libtool: link: gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/homebrew/include -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o -L/opt/homebrew/lib ../libdieharder/.libs/libdieharder.a -lm -lgsl -lgslcblas Undefined symbols for architecture arm64: "_insert", referenced from: _dab_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) _main_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) "_insertBit", referenced from: _dab_filltree2 in libdieharder.a(libdieharder_la-dab_filltree2.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [dieharder] Error 1 make: *** [dieharder.time] Error 2 Anyone know what might be going on here and how to properly configure this to complete compilation on and for Apple Silicon systems?
1
0
1.1k
Apr ’22
Xcode 13.3 - LLVM Error when building app
Just upgraded from Xcode 12 to Xcode 13.3 (latest) and now suddenly am getting a LLVM Error when archiving my app. See error message below. Google tells me that many users seem to have this issue, some related to unused dependencies or not enough memory, neither of which is the case for me. Appreciate if one of the experts here can advise, pretty new to Xcode and not sure how to best proceed. Thank you LLVM ERROR: out of memory Allocation failed Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace. Stack dump: 0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/AG-Opus.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.bc -embed-bitcode -target arm64-apple-ios12.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name AG_Opus -o /Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/Appname.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.o 1. Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8) 2. Compiling with the current language version 3. Running pass 'Function Pass Manager' on module '/Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/Appname.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.bc'. 4. Running pass 'ObjC ARC contraction' on function '@UI_USER_INTERFACE_IDIOM' Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0  swift-frontend           0x000000010eb13de7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39 1  swift-frontend           0x000000010eb12e38 llvm::sys::RunSignalHandlers() + 248 2  swift-frontend           0x000000010eb14440 SignalHandler(int) + 288 3  libsystem_platform.dylib 0x00007ff804caedfd _sigtramp + 29 4  libsystem_malloc.dylib   0x00007ff804accabb _malloc_zone_malloc + 125 5  libsystem_c.dylib        0x00007ff804be4d24 abort + 123 6  swift-frontend           0x000000010ea60cda llvm::report_bad_alloc_error(char const*, bool) + 106 7  swift-frontend           0x000000010ea60cf2 out_of_memory_new_handler() + 18 8  libc++abi.dylib          0x00007ff804c5696b operator new(unsigned long) + 43 9  swift-frontend           0x000000010e821efd llvm::Function::BuildLazyArguments() const + 77 10 swift-frontend           0x000000010c60ae87 llvm::objcarc::BundledRetainClaimRVs::insertRVCallWithColors(llvm::Instruction*, llvm::CallBase*, llvm::DenseMap<llvm::BasicBlock*, llvm::TinyPtrVector<llvm::BasicBlock*>, llvm::DenseMapInfo<llvm::BasicBlock*>, llvm::detail::DenseMapPair<llvm::BasicBlock*, llvm::TinyPtrVector<llvm::BasicBlock*> > > const&) + 151 11 swift-frontend           0x000000010c61df88 (anonymous namespace)::ObjCARCContract::run(llvm::Function&, llvm::AAResults*, llvm::DominatorTree*) + 1384 12 swift-frontend           0x000000010e859380 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1488 13 swift-frontend           0x000000010e860073 llvm::FPPassManager::runOnModule(llvm::Module&) + 67 14 swift-frontend           0x000000010e859b39 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1161 15 swift-frontend           0x0000000109d776df swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*) + 3791 16 swift-frontend           0x0000000109d788cc swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, swift::UnifiedStatsReporter*) + 2812 17 swift-frontend           0x0000000109d81aa5 swift::performLLVM(swift::IRGenOptions const&, swift::ASTContext&, llvm::Module*, llvm::StringRef) + 213 18 swift-frontend           0x000000010983c795 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 16565 19 swift-frontend           0x00000001097fb5d4 swift::mainEntry(int, char const**) + 1108 20 dyld                     0x000000011ceb751e start + 462 error: Abort trap: 6 (in target 'Appname' from project 'Projectname')
1
0
4.3k
Apr ’22
How do I enable/disable individual optimizations in Apple's Clang?
I work on a very large project based on Mozilla Firefox, I am getting a crash at -O2 and -O3. It is stable at -O0 and -O1, so I did some research and found a number of optimizations that supposedly get enabled at -O2. The information I found tells me that I should use -mllvm and the optimization flag that gets passed to the LLVM "opt" command in the normal LLVM toolchain. However Apple's command line tools do not have the "opt" command and -mllvm does not seem to accept the "opt" flags. What is the Apple way of seeing what optimizations are enabled in -O2 and how do I enable or disable them individually?
2
0
1.1k
Apr ’22
libc++ list.h broken error Xcode 13.3 macOS Monterey 12.3.1
Hi, I am using, inside my Xcode project, the snacc library (https://github.com/nevali/snacc) which uses the libc++ which comes with Xcode. I'm using Xcode 13.3 (13E113) on macOS Monterey 12.3.1. The compilation with the Xcode command-line tool fails with these errors: In file included from /Users/idplug-middleware/Work/idplug-ios-generic-api/idplug-classic/external_sdks/snacc/src/inc/asn-buf.h:12: /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:11: error: use of undeclared identifier '_A' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)           ^ /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:14: error: use of undeclared identifier 'lloc' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)              ^ /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:34: error: unknown type name '__link_pointer' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)                                  ^ /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:54: error: unknown type name '__link_pointer' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)                                                      ^ /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:74: error: unknown type name '__link_pointer' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l) Is there anything wrong with the libc++ library that comes with Xcode 13.3 ? Or am I doing something wrong ? I have never had this issue before with older versions of Xcode or macOS. Thank you. Christophe
1
0
1.2k
Apr ’22
During debug output (po) of an iOS app Swift/ObjC, bridging headers cannot be found (Version 13.2.1 (13C100)
The bridging header works fine for compilation, and with previous version of xcode there were no problems running and debugging the app. But after switching to 13.2.1, poing a variable leads first to error: expression failed to parse, unknown error, and then to an error hinting at not being able to find header files. Example: (lldb) po recipientType error: expression failed to parse, unknown error (lldb) po recipientType warning: Swift error in scratch context: error: /Users/dirk/projects/pEp/src_iOS/pep4ios/pEpForiOS/pEpForiOS-Bridging-Header.h:14:9: error: 'AccountSettings.h' file not found #import "AccountSettings.h"         ^ error: failed to import bridging header '/Users/dirk/projects/pEp/src_iOS/pep4ios/pEpForiOS/pEpForiOS-Bridging-Header.h' . Shared Swift state for pEp has developed fatal errors and is being discarded. REPL definitions and persistent names/types will be lost. error: expression failed to parse, unknown error I have experimented with using <> for the import, instead of "", and also setting the framework header path, but no luck so far.
2
0
2.2k
Mar ’22
LLVM Profile Error: Failed to write file : Filename not set
Hello everyone, I'm running some tests and after upgrading my Xcode from 12.5 to 13.2.1, I can't run them anymore. It shows me "Testing..." and after waiting 10 minutes it fails and this output is presented in the console: LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set I'm using an iPhone 11 Simulator (version 13.2) running iOS 15.2 Any ideas?
1
0
1.8k
Mar ’22
Umbrella header imported into generated swift header
I have a framework with both Swift and Objective-C code. For some reason, the compiler decided that it was necessary to import the framework's umbrella header in its generated Swift.h file. This is causing duplicate definition errors and preventing me from compiling.Example:Framework called "MyFramework"Swift code generates "MyFramework-Swift.h"Contents of MyFramework-Swift.h includes this line:#import &lt;MyFramework/MyFramework.h&gt;This causes the errors and prevents me from building. Changing random lines of Swift code seems to make it NOT put this line in the Swift.h file, but this is not a working solution for me as I need the line of Swift code in question. It was not causing this error before.Any hints on how to prevent the compiler from putting its own umbrella header into the generated Swift.h file?
1
0
3.4k
Mar ’22
Using private Objective-C files from Swift within the same framework
We currently have a legacy Objective-C framework that we'd like to introduce some Swift components into. However, I can't figure out how to access the Private- and Project-scoped Objective-C files from our Swift files.We already use an umbrella header and a modulemap file to declare the public headers that should be included in the library's module, and we want to keep these as the only publicly exposed files. However, our new Swift files (within the same framework) need to also access private headers that we don't want to expose.I've already tried defining a private modulemap file that lists the private headers I want to use, and then specified it with the MODULEMAP_PRIVATE_FILE build setting, but I dont think this does what we want. It appears to introduce a new MyLibrary.Private module which is publicly visible to external targets (such as the unit test target) but is still not available to the Swift files within the framework.Any suggestions of how this can be accomplished, or experience doing this in other projects would be greatly appreicated.Thanks!
2
0
6.1k
Mar ’22
tapi-1100.0.11 from https://opensource.apple.com/source/tapi/ does not build with the llvm version mentioned in Readme.md
I was attempting to build tapi-1100.0.11 since it is required by ld64 (building which was my initial goal), but it fails due to different issues. I followed the Readme.md guidelines and used https://github.com/apple/llvm-project/tree/apple/stable/20190104, but there seem to be several issues: LinkerInterfaceFile.cpp uses MachO::PLATFORM_DRIVERKIT in two switch statements, but this enumeration value is not present in the given tag in llvm-project (https://github.com/apple/llvm-project/blob/729748d085a90bd2a4af36efbfb2dc33b4704de3/llvm/include/llvm/BinaryFormat/MachO.h#L485), and seems to be only added with commit https://github.com/apple/llvm-project/commit/eef41efe0098814ba8445633c7bc6756d4228f8a Even if I #if 0 out these statements everything fails with linking error regarding missing library -ltapiAPIVerifier, I see that a lot of the cmake files add tapi-api-verifier as a linker input, but I don't see any library targets being added anywhere, so how to resolve this? Is there a different tapi version that is working with a different llvm version, which I can build without such hassle? I tried reverting ld64 to older tags, but all seem to require tapi. Using newer apple/stable/xxxx tags seem to be incompatible with the tapi source, since they require that projects use add_llvm_install_targets which tapi does not do.
0
0
1.2k
Feb ’22
C++20 Support.
When does support of the language will be rescheduled from the clang-llvm to the Xcode? For example 13.0.0 llvm has implementation of the of the core language instead of the Xcode 13.2beta... Also interesting when does Xcode editor begin understand that 'requires', 'concept' is new keywords in the C++?
2
0
2k
Feb ’22
Xcode 14 beta 6 Indexing | Processing files forever - hangs So does Compiles.
This appears to be a common issue with little to zero known resolutions over the years.... Appears to happen with previous versions of Xcode. Does Apple or the community have a fix? I've checked out the sources in a new location from my github - Same/similar issue. I've started a completely new project from scratch and then dragged my source into it... same/similar issue. I've killed the swift-frontend process & closed reopened Xcode. I've cleaned the build folder / delete DerivedData & restarted the computer... same/similar issue. Any ideas?
Replies
1
Boosts
1
Views
2.1k
Activity
Aug ’22
Important bug for C++ object dynamic delete in XCode Compiler
I have a sample code to test c++ virtual deconstructor like below: #include <iostream> class CA { public:   virtual ~CA() {     std::cout<< "~CA" << std::endl;   } }; class CB :public CA {    public:   virtual ~CB() {     std::cout<< "~CB" << std::endl;   } }; int main(int argc, const char * argv[]) {       CA *pb = new CB[3];   delete []pb;       return 0; } in xcode this code print out result is : ~CA ~CA ~CA but in other compilers like visual studio C++ and gcc the print out result is: ~CB ~CA ~CB ~CA ~CB ~CA I think this is a dynamic delete array object with virtual deconstructor bug in xcode compiler 。 because the print result is not conform to C++ form。
Replies
1
Boosts
0
Views
996
Activity
Aug ’22
Crash in `outlined init with copy of` when run in Release Mode
Hey there, When I run the following 50 lines of code in release mode, or turn Optimization on in Build-Settings Swift Compiler - Code Generation I will get the following crash. Anyone any idea why that happens? (Xcode 13.4.1, happens on Device as well as simulator on iOS 15.5 and 15.6) Example Project: https://github.com/Bersaelor/ResourceCrashMinimalDemo #0 0x000000010265dd58 in assignWithCopy for Resource () #1 0x000000010265d73c in outlined init with copy of Resource<VoidPayload, String> () #2 0x000000010265d5dc in specialized Resource<>.init(url:method:query:authToken:headers:) [inlined] at /Users/konradfeiler/Source/ResourceCrashMinimalDemo/ResourceCrashMinimalDemo/ContentView.swift:51 #3 0x000000010265d584 in specialized ContentView.crash() at /Users/konradfeiler/Source/ResourceCrashMinimalDemo/ResourceCrashMinimalDemo/ContentView.swift:18 Code needed: import SwiftUI struct ContentView: View {     var body: some View {         Button(action: { crash() }, label: { Text("Create Resouce") })     }     /// crashes in `outlined init with copy of Resource<VoidPayload, String>`     func crash() {         let testURL = URL(string: "https://www.google.com")!         let r = Resource<VoidPayload, String>(url: testURL, method: .get, authToken: nil)         print("r: \(r)")     } } struct VoidPayload {} enum HTTPMethod<Payload> {     case get     case post(Payload)     case patch(Payload) } struct Resource<Payload, Response> {     let url: URL     let method: HTTPMethod<Payload>     let query: [(String, String)]     let authToken: String?     let parse: (Data) throws -> Response } extension Resource where Response: Decodable {     init(         url: URL,         method: HTTPMethod<Payload>,         query: [(String, String)] = [],         authToken: String?,         headers: [String: String] = [:]     ) {         self.url = url         self.method = method         self.query = query         self.authToken = authToken         self.parse = {             return try JSONDecoder().decode(Response.self, from: $0)         }     } }
Replies
2
Boosts
2
Views
3.8k
Activity
Aug ’22
How to use relative path for compiling
Hi there, We are currently facing a problem around compilation and `swiftc` command.When building, xcode gives the list of files to compile to swiftc in absolute path :CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target: Module) cd /Users/user/Documents/workspace/company/project export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name Module -Onone -whole-module-optimization -enforce-exclusivity=none -DDEBUG -Onone -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -target x86_64-apple-ios9.3-simulator -g -module-cache-path /Users/user/Documents/workspace/company/project/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -profile-coverage-mapping -profile-generate -enable-testing -index-store-path /Users/user/Documents/workspace/company/project/DerivedData/project/Index/DataStore -swift-version 4.2 -I /Users/user/Documents/workspace/company/project/DerivedData/project/Build/Products/development-iphonesimulator -F /Users/user/Documents/workspace/company/project/DerivedData/project/Build/Products/development-iphonesimulator -F /Users/user/Documents/workspace/company/project/Carthage/Build/iOS /Users/user/Documents/workspace/company/project/Module/File.swift /Users/user/Documents/workspace/company/project/Module/File2.swift /Users/user/Documents/workspace/company/project/Module/File3.swiftWe found the `working-directory` parameter to the swiftc command and wonder how to make xcode use it, in order to reduce the command line length ?We are currently reaching the mac os buffer limit for command line, that is 2Mb.
Replies
2
Boosts
0
Views
2.7k
Activity
Jul ’22
Ipatool falled with an exception: #<maspec:Nonerotxitexception
We are creating a framework to distribute to other application, our framework contains multiple third party library with pods. We are able to successfully generate the framework. But we are getting error when that framework is used and generating Ad hoc build. Below is the pod file for the framework project pod 'Alamofire', '> 4.9.0' pod 'RealmSwift', '> 3.19.0' pod 'ObjectMapper', '> 3.5.1' pod 'ObjectMapper+Realm', '> 0.6' pod 'ZIPFoundation', '> 0.9.9' #(0.9.9) pod 'NMSSH', '> 2.3.1' post_install do |installer| installer.pods_project.targets.each do |target|       if ['ObjectMapper','ObjectMapper+Realm','Alamofire'].include? target.name    target.build_configurations.each do |config|     config.build_settings['SWIFT_VERSION'] = '4.2'    end   end target.build_configurations.each do |config|    # set valid architecture #   config.build_settings['VALID_ARCHS'] = 'arm64 armv7 armv7s i386 x86_64'    # build active architecture only (Debug build all) #   config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"    config.build_settings['ENABLE_BITCODE'] = 'YES'    if config.name == 'Release' || config.name == 'Pro'      config.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'     else # Debug       config.build_settings['BITCODE_GENERATION_MODE'] = 'marker'    end    cflags = config.build_settings['OTHER_CFLAGS'] || ['$(inherited)']    if config.name == 'Release' || config.name == 'Pro'      cflags << '-fembed-bitcode'    else # Debug      cflags << '-fembed-bitcode-marker'    end    config.build_settings['OTHER_CFLAGS'] = cflags   end  end end
Replies
0
Boosts
0
Views
551
Activity
Jun ’22
What are the steps to load crashlog using LLDB
I'm studying iOS crash analysis. Now, I need to import crashlog files into LLDB. As WWDC18 Session 414 said, I now have a copy of myApp, dSYM, xxx.crash. Run the following command in a folder that I created:$ lldb(lldb) command script import lldb.macosx.crashlog(lldb) crashlog /xxxx.crashHowever, the stack trace file is not available and there is only a lot of error like:error: unable to locate any executables from the crash logDid I use it wrong? What is the correct stepts?Thanks in advance. For any question please just let me know.
Replies
1
Boosts
0
Views
2.2k
Activity
Jun ’22
C++20 Full Support Road Map?
Hi I'm using C++17 in XCode 13 and looking at the release notes it shows that C++20 is only partially supported - does anyone know when C++20 will be fully supported in XCode ? [C++23 is out next year and would be useful to see some statement from Apple about their plans to support this]
Replies
1
Boosts
0
Views
802
Activity
Jun ’22
Pragma ignore missing protocol definition
Dear Apple,Is there a clang diagnostic ignore for the warning "Cannot find protocol definition for &lt;...&gt;"?While I cannot make the definition available in the header, every file importing this header will also import the definition. In which case, the code will run correctly (right?)
Replies
4
Boosts
0
Views
4.3k
Activity
May ’22
XCode 10 - "new" file not found
Hello,Just upgraded XCode to version 10. I tried to compile my project which use both Objective-C and C++ files.One of the cpp files includes a header file (.h) which has the following line:#include &lt;new&gt;Compiler gives this error: 'new' file not foundWhy is that? I didn't have this problem with XCode 9.Thanks,Kal
Replies
10
Boosts
0
Views
29k
Activity
May ’22
dieharder compilation failure on Apple Silicon: 'ld: symbol(s) not found for architecture arm64'
Attempting to compile dieharder from source on an M1 Max MacBookPro18,2 (macOS 12 + Xcode 13.3.1 + command line tools) and running into an error: ... /bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/local/include -L/opt/local/lib -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm -lgsl -lgslcblas libtool: link: gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/local/include -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o -L/opt/local/lib ../libdieharder/.libs/libdieharder.a -lm -lgsl -lgslcblas Undefined symbols for architecture arm64: "_insert", referenced from: _dab_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) _main_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) "_insertBit", referenced from: _dab_filltree2 in libdieharder.a(libdieharder_la-dab_filltree2.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ... I got to this failure with a MacPorts installed gsl and by executing the following: $ mkdir dieharder; cd dieharder $ wget --no-check-certificate https://webhome.phy.duke.edu/~rgb/General/dieharder/dieharder-3.31.1.tgz $ tar xf dieharder-3.31.1.tgz $ cd dieharder-3.31.1 $ sudo port install gsl $ ./configure LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include CFLAGS=-I/opt/local/include --disable-shared ... $ make ... I reproduced the failure with Homebrew: $ brew install gsl $ make distclean $ ./configure LDFLAGS=-L/opt/homebrew/lib CPPFLAGS=-I/opt/homebrew/include CFLAGS=-I/opt/homebrew/include --disable-shared ... $ make ... /bin/sh ../libtool --tag=CC --mode=link gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/homebrew/include -L/opt/homebrew/lib -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o ../libdieharder/libdieharder.la -lgsl -lgslcblas -lm -lgsl -lgslcblas libtool: link: gcc -std=c99 -Wall -pedantic -I/usr/local/include -I/opt/homebrew/include -o dieharder dieharder-add_ui_rngs.o dieharder-add_ui_tests.o dieharder-choose_rng.o dieharder-dieharder.o dieharder-dieharder_exit.o dieharder-help.o dieharder-list_rngs.o dieharder-list_tests.o dieharder-output.o dieharder-output_rnds.o dieharder-parsecl.o dieharder-rdieharder.o dieharder-run_all_tests.o dieharder-run_test.o dieharder-set_globals.o dieharder-testbits.o dieharder-time_rng.o dieharder-user_template.o -L/opt/homebrew/lib ../libdieharder/.libs/libdieharder.a -lm -lgsl -lgslcblas Undefined symbols for architecture arm64: "_insert", referenced from: _dab_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) _main_filltree in libdieharder.a(libdieharder_la-dab_filltree.o) "_insertBit", referenced from: _dab_filltree2 in libdieharder.a(libdieharder_la-dab_filltree2.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [dieharder] Error 1 make: *** [dieharder.time] Error 2 Anyone know what might be going on here and how to properly configure this to complete compilation on and for Apple Silicon systems?
Replies
1
Boosts
0
Views
1.1k
Activity
Apr ’22
Xcode 13.3 - LLVM Error when building app
Just upgraded from Xcode 12 to Xcode 13.3 (latest) and now suddenly am getting a LLVM Error when archiving my app. See error message below. Google tells me that many users seem to have this issue, some related to unused dependencies or not enough memory, neither of which is the case for me. Appreciate if one of the experts here can advise, pretty new to Xcode and not sure how to best proceed. Thank you LLVM ERROR: out of memory Allocation failed Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace. Stack dump: 0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/AG-Opus.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.bc -embed-bitcode -target arm64-apple-ios12.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name AG_Opus -o /Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/Appname.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.o 1. Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8) 2. Compiling with the current language version 3. Running pass 'Function Pass Manager' on module '/Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/Appname.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.bc'. 4. Running pass 'ObjC ARC contraction' on function '@UI_USER_INTERFACE_IDIOM' Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0  swift-frontend           0x000000010eb13de7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39 1  swift-frontend           0x000000010eb12e38 llvm::sys::RunSignalHandlers() + 248 2  swift-frontend           0x000000010eb14440 SignalHandler(int) + 288 3  libsystem_platform.dylib 0x00007ff804caedfd _sigtramp + 29 4  libsystem_malloc.dylib   0x00007ff804accabb _malloc_zone_malloc + 125 5  libsystem_c.dylib        0x00007ff804be4d24 abort + 123 6  swift-frontend           0x000000010ea60cda llvm::report_bad_alloc_error(char const*, bool) + 106 7  swift-frontend           0x000000010ea60cf2 out_of_memory_new_handler() + 18 8  libc++abi.dylib          0x00007ff804c5696b operator new(unsigned long) + 43 9  swift-frontend           0x000000010e821efd llvm::Function::BuildLazyArguments() const + 77 10 swift-frontend           0x000000010c60ae87 llvm::objcarc::BundledRetainClaimRVs::insertRVCallWithColors(llvm::Instruction*, llvm::CallBase*, llvm::DenseMap<llvm::BasicBlock*, llvm::TinyPtrVector<llvm::BasicBlock*>, llvm::DenseMapInfo<llvm::BasicBlock*>, llvm::detail::DenseMapPair<llvm::BasicBlock*, llvm::TinyPtrVector<llvm::BasicBlock*> > > const&) + 151 11 swift-frontend           0x000000010c61df88 (anonymous namespace)::ObjCARCContract::run(llvm::Function&, llvm::AAResults*, llvm::DominatorTree*) + 1384 12 swift-frontend           0x000000010e859380 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1488 13 swift-frontend           0x000000010e860073 llvm::FPPassManager::runOnModule(llvm::Module&) + 67 14 swift-frontend           0x000000010e859b39 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1161 15 swift-frontend           0x0000000109d776df swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*) + 3791 16 swift-frontend           0x0000000109d788cc swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, swift::UnifiedStatsReporter*) + 2812 17 swift-frontend           0x0000000109d81aa5 swift::performLLVM(swift::IRGenOptions const&, swift::ASTContext&, llvm::Module*, llvm::StringRef) + 213 18 swift-frontend           0x000000010983c795 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 16565 19 swift-frontend           0x00000001097fb5d4 swift::mainEntry(int, char const**) + 1108 20 dyld                     0x000000011ceb751e start + 462 error: Abort trap: 6 (in target 'Appname' from project 'Projectname')
Replies
1
Boosts
0
Views
4.3k
Activity
Apr ’22
How do I enable/disable individual optimizations in Apple's Clang?
I work on a very large project based on Mozilla Firefox, I am getting a crash at -O2 and -O3. It is stable at -O0 and -O1, so I did some research and found a number of optimizations that supposedly get enabled at -O2. The information I found tells me that I should use -mllvm and the optimization flag that gets passed to the LLVM "opt" command in the normal LLVM toolchain. However Apple's command line tools do not have the "opt" command and -mllvm does not seem to accept the "opt" flags. What is the Apple way of seeing what optimizations are enabled in -O2 and how do I enable or disable them individually?
Replies
2
Boosts
0
Views
1.1k
Activity
Apr ’22
libc++ list.h broken error Xcode 13.3 macOS Monterey 12.3.1
Hi, I am using, inside my Xcode project, the snacc library (https://github.com/nevali/snacc) which uses the libc++ which comes with Xcode. I'm using Xcode 13.3 (13E113) on macOS Monterey 12.3.1. The compilation with the Xcode command-line tool fails with these errors: In file included from /Users/idplug-middleware/Work/idplug-ios-generic-api/idplug-classic/external_sdks/snacc/src/inc/asn-buf.h:12: /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:11: error: use of undeclared identifier '_A' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)           ^ /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:14: error: use of undeclared identifier 'lloc' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)              ^ /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:34: error: unknown type name '__link_pointer' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)                                  ^ /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:54: error: unknown type name '__link_pointer' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)                                                      ^ /Applications/Xcode13.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk/usr/include/c++/v1/list:1164:74: error: unknown type name '__link_pointer' list<_Tp, _A*lloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l) Is there anything wrong with the libc++ library that comes with Xcode 13.3 ? Or am I doing something wrong ? I have never had this issue before with older versions of Xcode or macOS. Thank you. Christophe
Replies
1
Boosts
0
Views
1.2k
Activity
Apr ’22
During debug output (po) of an iOS app Swift/ObjC, bridging headers cannot be found (Version 13.2.1 (13C100)
The bridging header works fine for compilation, and with previous version of xcode there were no problems running and debugging the app. But after switching to 13.2.1, poing a variable leads first to error: expression failed to parse, unknown error, and then to an error hinting at not being able to find header files. Example: (lldb) po recipientType error: expression failed to parse, unknown error (lldb) po recipientType warning: Swift error in scratch context: error: /Users/dirk/projects/pEp/src_iOS/pep4ios/pEpForiOS/pEpForiOS-Bridging-Header.h:14:9: error: 'AccountSettings.h' file not found #import "AccountSettings.h"         ^ error: failed to import bridging header '/Users/dirk/projects/pEp/src_iOS/pep4ios/pEpForiOS/pEpForiOS-Bridging-Header.h' . Shared Swift state for pEp has developed fatal errors and is being discarded. REPL definitions and persistent names/types will be lost. error: expression failed to parse, unknown error I have experimented with using <> for the import, instead of "", and also setting the framework header path, but no luck so far.
Replies
2
Boosts
0
Views
2.2k
Activity
Mar ’22
LLVM Profile Error: Failed to write file : Filename not set
Hello everyone, I'm running some tests and after upgrading my Xcode from 12.5 to 13.2.1, I can't run them anymore. It shows me "Testing..." and after waiting 10 minutes it fails and this output is presented in the console: LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Note: Profile data not written to file: already written. LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set LLVM Profile Error: Failed to write file : Filename not set I'm using an iPhone 11 Simulator (version 13.2) running iOS 15.2 Any ideas?
Replies
1
Boosts
0
Views
1.8k
Activity
Mar ’22
Umbrella header imported into generated swift header
I have a framework with both Swift and Objective-C code. For some reason, the compiler decided that it was necessary to import the framework's umbrella header in its generated Swift.h file. This is causing duplicate definition errors and preventing me from compiling.Example:Framework called "MyFramework"Swift code generates "MyFramework-Swift.h"Contents of MyFramework-Swift.h includes this line:#import &lt;MyFramework/MyFramework.h&gt;This causes the errors and prevents me from building. Changing random lines of Swift code seems to make it NOT put this line in the Swift.h file, but this is not a working solution for me as I need the line of Swift code in question. It was not causing this error before.Any hints on how to prevent the compiler from putting its own umbrella header into the generated Swift.h file?
Replies
1
Boosts
0
Views
3.4k
Activity
Mar ’22
Using private Objective-C files from Swift within the same framework
We currently have a legacy Objective-C framework that we'd like to introduce some Swift components into. However, I can't figure out how to access the Private- and Project-scoped Objective-C files from our Swift files.We already use an umbrella header and a modulemap file to declare the public headers that should be included in the library's module, and we want to keep these as the only publicly exposed files. However, our new Swift files (within the same framework) need to also access private headers that we don't want to expose.I've already tried defining a private modulemap file that lists the private headers I want to use, and then specified it with the MODULEMAP_PRIVATE_FILE build setting, but I dont think this does what we want. It appears to introduce a new MyLibrary.Private module which is publicly visible to external targets (such as the unit test target) but is still not available to the Swift files within the framework.Any suggestions of how this can be accomplished, or experience doing this in other projects would be greatly appreicated.Thanks!
Replies
2
Boosts
0
Views
6.1k
Activity
Mar ’22
How do I specify using custom dsymutil?
I am working with a big project event is take 40 minutes to generate dSYM file. Is there any way I can replace the dsymutil with custom version.
Replies
0
Boosts
0
Views
754
Activity
Mar ’22
tapi-1100.0.11 from https://opensource.apple.com/source/tapi/ does not build with the llvm version mentioned in Readme.md
I was attempting to build tapi-1100.0.11 since it is required by ld64 (building which was my initial goal), but it fails due to different issues. I followed the Readme.md guidelines and used https://github.com/apple/llvm-project/tree/apple/stable/20190104, but there seem to be several issues: LinkerInterfaceFile.cpp uses MachO::PLATFORM_DRIVERKIT in two switch statements, but this enumeration value is not present in the given tag in llvm-project (https://github.com/apple/llvm-project/blob/729748d085a90bd2a4af36efbfb2dc33b4704de3/llvm/include/llvm/BinaryFormat/MachO.h#L485), and seems to be only added with commit https://github.com/apple/llvm-project/commit/eef41efe0098814ba8445633c7bc6756d4228f8a Even if I #if 0 out these statements everything fails with linking error regarding missing library -ltapiAPIVerifier, I see that a lot of the cmake files add tapi-api-verifier as a linker input, but I don't see any library targets being added anywhere, so how to resolve this? Is there a different tapi version that is working with a different llvm version, which I can build without such hassle? I tried reverting ld64 to older tags, but all seem to require tapi. Using newer apple/stable/xxxx tags seem to be incompatible with the tapi source, since they require that projects use add_llvm_install_targets which tapi does not do.
Replies
0
Boosts
0
Views
1.2k
Activity
Feb ’22
C++20 Support.
When does support of the language will be rescheduled from the clang-llvm to the Xcode? For example 13.0.0 llvm has implementation of the of the core language instead of the Xcode 13.2beta... Also interesting when does Xcode editor begin understand that 'requires', 'concept' is new keywords in the C++?
Replies
2
Boosts
0
Views
2k
Activity
Feb ’22