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

53 Posts
Sort by:
Post not yet marked as solved
3 Replies
197 Views
I'm trying to update all my projects to C++20. The C++ only projects work fine. All the Objective-C++ files, though, suddenly stop compiling. Is this supposed to work. I can't imagine [NSString stringWithUTF8String:foo] should be failing. Setting the project back to C++17 works. I do have -fmodules and -fcxx-modules for clang modules in some projects. Do those all need to be removed for C++20 modules?
Posted
by Alecazam.
Last updated
.
Post not yet marked as solved
2 Replies
1.5k Views
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.
Posted
by LAGApollo.
Last updated
.
Post not yet marked as solved
0 Replies
91 Views
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
Posted
by mayur.etm.
Last updated
.
Post not yet marked as solved
1 Replies
733 Views
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, ***.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.
Posted Last updated
.
Post not yet marked as solved
1 Replies
244 Views
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]
Posted
by davpea.
Last updated
.
Post not yet marked as solved
1 Replies
337 Views
Hi, OS: macOS 12.4 CPU: Apple M1 I cannot import the new TensorFlow 2.9.0 on Apple M1. I got an error: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /Users/martin/Documents/Projects/Solar-Transformer/Testing.ipynb Cell 3' in <cell line: 1>() ----> 1 from tensorflow.keras.layers import Add, Dense, Dropout, Layer, LayerNormalization, MultiHeadAttention, Normalization 2 from tensorflow.keras.models import Model 3 from tensorflow.keras.initializers import TruncatedNormal File ~/miniforge3/lib/python3.9/site-packages/tensorflow/__init__.py:37, in <module> 34 import sys as _sys 35 import typing as _typing ---> 37 from tensorflow.python.tools import module_util as _module_util 38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader 40 # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import. File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/__init__.py:42, in <module> 37 from tensorflow.python.eager import context 39 # pylint: enable=wildcard-import 40 41 # Bring in subpackages. ---> 42 from tensorflow.python import data 43 from tensorflow.python import distribute 44 # from tensorflow.python import keras File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/data/__init__.py:21, in <module> 15 """`tf.data.Dataset` API for input pipelines. 16 17 See [Importing Data](https://tensorflow.org/guide/data) for an overview. 18 """ 20 # pylint: disable=unused-import ---> 21 from tensorflow.python.data import experimental 22 from tensorflow.python.data.ops.dataset_ops import AUTOTUNE 23 from tensorflow.python.data.ops.dataset_ops import Dataset File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/data/util/structure.py:22, in <module> 19 import six 20 import wrapt ---> 22 from tensorflow.python.data.util import nest 23 from tensorflow.python.framework import composite_tensor 24 from tensorflow.python.framework import ops File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/data/util/nest.py:36, in <module> 16 """## Functions for working with arbitrarily nested sequences of elements. 17 18 NOTE(mrry): This fork of the `tensorflow.python.util.nest` module (...) 31 arrays. 32 """ 34 import six as _six ---> 36 from tensorflow.python.framework import sparse_tensor as _sparse_tensor 37 from tensorflow.python.util import _pywrap_utils 38 from tensorflow.python.util import nest File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/framework/sparse_tensor.py:24, in <module> 22 from tensorflow.python import tf2 23 from tensorflow.python.framework import composite_tensor ---> 24 from tensorflow.python.framework import constant_op 25 from tensorflow.python.framework import dtypes 26 from tensorflow.python.framework import ops File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/framework/constant_op.py:25, in <module> 23 from tensorflow.core.framework import types_pb2 24 from tensorflow.python.eager import context ---> 25 from tensorflow.python.eager import execute 26 from tensorflow.python.framework import dtypes 27 from tensorflow.python.framework import op_callbacks File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/eager/execute.py:23, in <module> 21 from tensorflow.python import pywrap_tfe 22 from tensorflow.python.eager import core ---> 23 from tensorflow.python.framework import dtypes 24 from tensorflow.python.framework import ops 25 from tensorflow.python.framework import tensor_shape File ~/miniforge3/lib/python3.9/site-packages/tensorflow/python/framework/dtypes.py:29, in <module> 26 from tensorflow.python.lib.core import _pywrap_bfloat16 27 from tensorflow.python.util.tf_export import tf_export ---> 29 _np_bfloat16 = _pywrap_bfloat16.TF_bfloat16_type() 32 @tf_export("dtypes.DType", "DType") 33 class DType(_dtypes.DType): 34 """Represents the type of the elements in a `Tensor`. 35 36 `DType`'s are used to specify the output data type for operations which (...) 46 See `tf.dtypes` for a complete list of `DType`'s defined. 47 """ Example code: from tensorflow.keras.layers import Add, Dense, Dropout, Layer, LayerNormalization, MultiHeadAttention, Normalization from tensorflow.keras.models import Model from tensorflow.keras.initializers import TruncatedNormal from tensorflow.keras.utils import timeseries_dataset_from_array import tensorflow as tf import tensorflow_probability as tfp import numpy as np
Posted Last updated
.
Post not yet marked as solved
3 Replies
2.5k Views
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?)
Posted
by DrWho.
Last updated
.
Post not yet marked as solved
1 Replies
620 Views
I use clang 12 to build some cpp project that needs semaphore.acquire() function. System version: MacOs Big Sur 12.0 However, Compiler shows that some function is unavailable. Detail messages: /concurrencpp/source/executors/worker_thread_executor.cpp:42:21: error: 'acquire' is unavailable [build] m_semaphore.acquire(); [build] ^ [build] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/semaphore:202:10: note: 'acquire' has been explicitly marked unavailable here [build] void acquire() [build] ^ [build] /Users/mirocos/master/study/concurrencpp/source/executors/worker_thread_executor.cpp:106:21: error: 'release' is unavailable [build] m_semaphore.release(); [build] ^ [build] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/semaphore:197:10: note: 'release' has been explicitly marked unavailable here [build] void release(ptrdiff_t __update = 1) [build] ^ [build] /Users/mirocos/master/study/concurrencpp/source/executors/worker_thread_executor.cpp:121:21: error: 'release' is unavailable [build] m_semaphore.release(); [build] ^ [build] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/semaphore:197:10: note: 'release' has been explicitly marked unavailable here [build] void release(ptrdiff_t __update = 1) [build] ^ [build] /Users/mirocos/master/study/concurrencpp/source/executors/worker_thread_executor.cpp:160:17: error: 'release' is unavailable [build] m_semaphore.release(); [build] ^ [build] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/semaphore:197:10: note: 'release' has been explicitly marked unavailable here [build] void release(ptrdiff_t __update = 1) [build] ^ [build] /Users/mirocos/master/study/concurrencpp/source/executors/thread_pool_executor.cpp:218:26: error: 'try_acquire_until' is unavailable [build] if (!m_semaphore.try_acquire_until(deadline)) { [build] ^ [build] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/semaphore:219:10: note: 'try_acquire_until' has been explicitly marked unavailable here [build] bool try_acquire_until(chrono::time_point<Clock, Duration> const& __abs_time) [build] ^ [build] /Users/mirocos/master/study/concurrencpp/source/executors/thread_pool_executor.cpp:218:26: error: 'try_acquire_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000>>>' is unavailable [build] if (!m_semaphore.try_acquire_until(deadline)) { [build] ^ [build] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/semaphore:219:10: note: 'try_acquire_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000>>>' has been explicitly marked unavailable here [build] bool try_acquire_until(chrono::time_point<Clock, Duration> const& __abs_time) [build] ^ [build] /Users/mirocos/master/study/concurrencpp/source/executors/thread_pool_executor.cpp:322:25: error: 'release' is unavailable [build] m_semaphore.release(); [build] ^ [build] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/semaphore:197:10: note: 'release' has been explicitly marked unavailable here [build] void release(ptrdiff_t __update = 1) [build] ^ [build] /Users/mirocos/master/study/concurrencpp/source/executors/thread_pool_executor.cpp:420:17: error: 'release' is unavailable [build] m_semaphore.release(); [build] ^ [build] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/semaphore:197:10: note: 'release' has been explicitly marked unavailable here [build] void release(ptrdiff_t __update = 1) [build] ^ [build] 4 errors generated. can anyone could help me with it?
Posted
by mirocos.
Last updated
.
Post not yet marked as solved
9 Replies
25k Views
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
Posted
by KalMudov.
Last updated
.
Post marked as solved
1 Replies
228 Views
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?
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
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')
Posted Last updated
.
Post not yet marked as solved
0 Replies
185 Views
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?
Posted
by dbsoft.
Last updated
.
Post not yet marked as solved
1 Replies
332 Views
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
Posted Last updated
.
Post not yet marked as solved
2 Replies
527 Views
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.
Posted
by DSec.
Last updated
.
Post not yet marked as solved
1 Replies
554 Views
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?
Posted
by dbug18.
Last updated
.
Post not yet marked as solved
1 Replies
698 Views
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?
Posted
by tracyk.
Last updated
.
Post not yet marked as solved
2 Replies
4k Views
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!
Posted Last updated
.
Post not yet marked as solved
0 Replies
273 Views
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.
Posted
by rubu.
Last updated
.
Post not yet marked as solved
2 Replies
754 Views
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++?
Posted Last updated
.