[tags:compiler,llvm]

137 results found

Post not yet marked as solved
0 Replies
122 Views
Hi all, I'm attempting to generate an XCFramework that must maintain ABI stability. The framework is created from an SPM using the attached script generate-FK.sh. I does not work. Removing the flag BUILD_LIBRARY_FOR_DISTRIBUTION=YES and adding the flag -allow-internal-distribution to xcodebuild -create-xcframework everything is fine. Despite this resolves the problem, it results in the generated module not being ABI stable. However, when attempting the script approach, it generates the XCFramework but when used it raises an error in arm64-apple-ios-private.swiftinterface with no such file or module as soon as it encounters an import statement for ModuleX reading it. The package structure is attached as Package.swift and te obtained result XCFramework structure is as follows: MyLibrary.xcframework ├── Info.plist ├── ios-arm64 │ └── MyLibrary.framework │ ├── Headers │ │ ├── ModuleH-Swift.h │ │ ├── ModuleH.modulemap │ │ ├── ModuleC-Swift.h │ │ ├── ModuleC.modulemap │ │ ├── ModuleA-Swift.h │ │ ├── ModuleA.modulem
Posted
by
Post not yet marked as solved
1 Replies
My general advice on this front is to repeat your steps outside of your third-party IDE. That tells you whether the problem is with your IDE or with your command-line tools setup. I talk about this extensively in Investigating Third-Party IDE Integration Problems. If you run through the example from the Run a Simple Test section of that post, what do you see? IMPORTANT This uses clang, not gcc. I did that because, depending on your setup, gcc might be an alias for clang or the actual GCC C compiler. I can’t provide much help with the latter. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Post not yet marked as solved
0 Replies
118 Views
Hi all, I'm attempting to generate an XCFramework that must maintain ABI stability. The framework is created from an SPM using the attached script generate-FK.sh. I does not work. Removing the flag BUILD_LIBRARY_FOR_DISTRIBUTION=YES and adding the flag -allow-internal-distribution to xcodebuild -create-xcframework everything is fine. Despite this resolves the problem, it results in the generated module not being ABI stable. However, when attempting the script approach, it generates the XCFramework but when used it raises an error in arm64-apple-ios-private.swiftinterface with no such file or module as soon as it encounters an import statement for ModuleX reading it. The package structure is attached as Package.swift and te obtained result XCFramework structure is as follows: MyLibrary.xcframework ├── Info.plist ├── ios-arm64 │ └── MyLibrary.framework │ ├── Headers │ │ ├── ModuleH-Swift.h │ │ ├── ModuleH.modulemap │ │ ├── ModuleC-Swift.h │ │ ├── ModuleC.modulemap │ │ ├── ModuleA-Swift.h │ │ ├── ModuleA.modulem
Posted
by
Post not yet marked as solved
4 Replies
First, do read the notes on the cppreference page for isspace: https://en.cppreference.com/w/cpp/string/byte/isspace Like all other functions from , the behavior of std::isspace is undefined if the argument's value is neither representable as unsigned char nor equal to EOF. To use these functions safely with plain chars (or signed chars), the argument should first be converted to unsigned char Similarly, they should not be directly used with standard algorithms when the iterator's value type is char or signed char. Instead, convert the value to unsigned char first As to why it doesn't work, consider this: int foospace(int c) { return c == ' '; } int foospace(char c) { return c == ' '; } void foo() { const std::string text = Hello Cruel World!; auto is_empty = std::all_of(text.begin(), text.end(), foospace); } That fails, but remove either one of the overloads and it works. std::isspace in is supposed to take an int. I don't know where the other overload is coming from, nor what its argument type is. It's unfo
Post not yet marked as solved
4 Replies
Interesting! Thanks for your insights. I could fix the compiler error that starts popping up with Xcode 15.3 by switching to a lambda, i.e. auto isEmpty = text.empty() || std::all_of(text.begin(), text.end(), [](const auto& c) { return std::isspace(c); }); though I can't see any reason why the original code should stop compiling under the latest compiler version... Cheers, Jay
Post not yet marked as solved
4 Replies
Consider this: #include #include #include #include int main(int argc, const char * argv[]) { const std::string text = Hello Cruel World!; auto isEmptyNG = std::all_of(text.begin(), text.end(), std::isspace); // ^ No matching function for call to 'all_of' int (*myIsSpace)(int ch) = std::isspace; auto isEmptyOK = std::all_of(text.begin(), text.end(), myIsSpace); return 0; } Compiling with Xcode 15.3, the isEmptyNG example fails as you’ve described. OTOH the isEmptyOK works. AFAICT that’s because it ‘nails down’ the type of the predicate passed to all_of. The interesting thing is that commenting out the include of fixes the problem. At that point we’ve run off the end of my C++ Fu. It seems that something in is adding an overload on std::isspace that causes problems for the all_of template resolution, but I don’t have any great suggestions for how to proceed from there. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Post not yet marked as solved
4 Replies
FWIW the required includes - algorithm, string, ctype - are all #included, and as mentioned this compiles fine in all previous Xcode versions…
Post not yet marked as solved
4 Replies
428 Views
After upgrading to Xcode 15.3 (15E204a) trivial C++ code of mine no longer compiles: const string text = textComponent->GetText(); auto isEmpty = text.empty() || std::all_of(text.begin(), text.end(), std::isspace); now yields compiler error No matching function for call to 'all_of' while working as expected on Version 15.2 (15C500b) and older. Is there a regression in the latest Xcode update C++ support..? Thanks, Jay
Posted
by
Post not yet marked as solved
3 Replies
I was trying to archive iOS App. Using Xcode 15, But archiving is failing with following error 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): 08:42:27 0 swift-frontend 0x0000000102fadabc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 08:42:27 1 swift-frontend 0x0000000105c13cb0 llvm::sys::RunSignalHandlers() + 112 08:42:27 2 swift-frontend 0x000000010597d054 SignalHandler(int) + 352 08:42:27 3 libsystem_platform.dylib 0x000000018b142a24 _sigtramp + 56 08:42:27 4 swift-frontend 0x000000010238a26c swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::ProtocolConformanceRef) + 264 08:42:27 5 swift-frontend 0x000000010238a26c swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::ProtocolConformanceRef) + 264 08:42:27 6 swift-frontend 0x0000000102390020 swift::irgen::emitGenericRequirementFromSubstitut
Post not yet marked as solved
3 Replies
I was trying to archive iOS App. Using Xcode 15, But archiving is failing with following error 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): 08:42:27 0 swift-frontend 0x0000000102fadabc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 08:42:27 1 swift-frontend 0x0000000105c13cb0 llvm::sys::RunSignalHandlers() + 112 08:42:27 2 swift-frontend 0x000000010597d054 SignalHandler(int) + 352 08:42:27 3 libsystem_platform.dylib 0x000000018b142a24 _sigtramp + 56 08:42:27 4 swift-frontend 0x000000010238a26c swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::ProtocolConformanceRef) + 264 08:42:27 5 swift-frontend 0x000000010238a26c swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::ProtocolConformanceRef) + 264 08:42:27 6 swift-frontend 0x0000000102390020 swift::irgen::emitGenericRequirementFromSubstitut
Post not yet marked as solved
3 Replies
Which program is crashing? Xcode itself? Or one of the tools that it sublaunches? Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Post not yet marked as solved
3 Replies
487 Views
I'm encountering an **error Segmentation fault: 11 ** during the archiving process. If the issue is happing with the my code. Then how can I diagnosing the problem. or figure out pin point in code base? I changed the compiler optimization level. It works for me when I use the Osize compiler optimization level. Previously, it was set to Ospeed. Want to know about the impact of the Osize compiler optimization level on the app.
Posted
by
Post not yet marked as solved
2 Replies
My goal is to have standalone assembly programs. However, when structs or data items are returned from OS calls, I want to be able to map those accurately (and painlessly) as well. What are the tricks you refer to? Writing a C program to write out equates for field offsets would technically work, but it's pretty ugly and a PITA to maintain, as it's really just magic numbers at that point. I saw in the last version of Xcode (the version that was associated with El Capitan) I could choose NASM instead of the MAC OS assembler. Should I be using NASM instead? I haven't looked to see if that's still an option in 15.2. I've perused the build options but didn't see it yet. (I'm on Ventura now). My research into the lack off support for structs/unions in the Mac OS assembler harkens of a big road block sign that says DO NOT ENTER, as without support for structures, it's really not a viable development option. I've written in assembler since 1984, but not on this platform. As a side question... I'd be up for upgrading
Post not yet marked as solved
2 Replies
What’s with all the assembly questions today? (-: Perhaps there is a utility to convert a C struct to an assembly struct that I haven't seen? Not that I’m aware of. It kinda depends on your goal. If you want to use these structures entirely within your assembly language code, there are various tricks you can apply. However, if you want your struct to exactly match the layout of a C struct, things get a bit complex: If you’re building for the local machine, you can write a C program that outputs the assembly definitions for the various member offsets. If you’re cross compiling… hmmm… I’m not sure what you’d do in that case. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com