[tags:compiler,llvm]

137 results found

Post not yet marked as solved
19 Replies
but I am getting the same error how do I rectify that? thanks! Start by using the Xcode g++ (which is actually clang), not the homebrew g++. I'm not sure what the best way to do that is; I do have a lot of homebrew packages installed but not any compilers. If you want to have both homebrew and xcode compilers installed it may be sufficient to adjust your PATH - or it may not. I bet this is a Homebrew FAQ. Or, if you want to get the homebrew compiler working, try asking the homebrew people at e.g. https://github.com/Homebrew/discussions/discussions Curious to know if @fanick is using the Homebrew g++, deliberately or not?
Post not yet marked as solved
19 Replies
Same Issue: C++ program is not running because of Xcode 14 #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); vector arr = {1, 2, 3, 4}; for(int i : arr) cout<<< ; cout< m; m[1] = 1; for(auto it: m) cout<<< <<
Post not yet marked as solved
19 Replies
@endecotp I ran the same command and I got this - % g++ --verbose --std=c++17 Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/12.1.0/bin/../libexec/gcc/aarch64-apple-darwin21/12/lto-wrapper Target: aarch64-apple-darwin21 Configured with: ../configure --prefix=/opt/homebrew/opt/gcc --libdir=/opt/homebrew/opt/gcc/lib/gcc/current --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-12 --with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr --with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl --with-zstd=/opt/homebrew/opt/zstd --with-pkgversion='Homebrew GCC 12.1.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --with-system-zlib --build=aarch64-apple-darwin21 --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.1.0 (Homebrew GCC 12.1.0)
Post not yet marked as solved
6 Replies
Did you escalate this with your tools vendor? Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
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
540 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 marked as solved
6 Replies
5.8k Views
My question set is fairly broad, but I can't seem to find any answers anywhere. As a fairly low-level developer, the vast majority of my work is done with Sublime Text, terminal-based compilers, IDEs like Coq's (coq.inria.fr), and code that has to be compiled by terminal. These projects are at the very fabric of what I do, and I fear that Rosetta 2 will be inadequate until LLVM and other systems are updated to run natively on Apple Silicon. Honestly, I can't really afford complex virtualization systems like Parallels or VMWare (not that they help much) and I'd rather not give up MacOS for my Ubuntu desktop. I was raised on MacOS and I can't imagine losing features like scenes or seamless integration with the rest of my electronics. I want to keep my initial post fairly simple and broad, but if anyone has any questions on what I need supported, feel free to ask. I am sure I'm not alone here.
Posted
by
Post not yet marked as solved
3 Replies
471 Views
The setlocale C/C++ function writes the global variable errno to 0. In Linux it doesn't have this behavior and the documentation doesn't says anything about setting errno (as I understand, no function should set errno to 0 The following code allows to reproduce it #include #include using namespace std; int main() { ifstream myStream; myStream.open(NONEXISTENT.txt, ios::in); cout << errno << endl; setlocale(LC_ALL, en_US.UTF-8); cout << errno << endl; } // Output: // 2 // 0 I don't think is a compiler issue as the error also happens with gcc but rather a libc issue.
Posted
by
Post not yet marked as solved
3 Replies
As a general rule, errno is only valid immediately after a call that’s documented to set it. If you call into library code that says nothing about errno, you can’t assume that it preserves its value. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
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
0 Replies
173 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
3 Replies
C supports two syntaxes for includes: To include your own header, use quotes. For example, #include MyTypes.h. To include system headers, use angle brackets. For example, #include . Xcode’s C compiler, Clang, has separate search paths for these: For the first, use the Header Search Paths build setting. For the second, use System Header Search Paths. I believe you’re crossing the streams here, hence your problems. Finally, there’s an option to support crossing the streams, namely Always Search User Paths, but it’s been deprecated and I recommend that you avoid it. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Post not yet marked as solved
3 Replies
If you call into library code that says nothing about errno, you can’t assume that it preserves its value. But POSIX says that no function sets it to zero: https://pubs.opengroup.org/onlinepubs/9699919799/functions/errno.html No function in this volume of POSIX.1-2017 shall set errno to 0 Does macOS claim to comply with (this version of) POSIX?
Post not yet marked as solved
4 Replies
Sorry you are experiencing this issue. It can be very frustrating! You can watch the build log in Xcode as it builds to see where the time is going. Sometimes it is not in the Swift compiler. If it is in the Swift compiler, depending on which release you are running, setting -disable-fine-grained-dependencies in the other Swift flags can help. But when you adopt a new release, you want to try removing it. You can also try setting -driver-show-incremental and possibly -driver-show-job-lifecycle (also in Other Swift Flags). These flags will cause the compiler to print out extra information to tell you which source files are being compiled, and way. Remember to remove them after you have gathered the information, because the extra output can confuse Xcode. The extra output will show up in the build log if you expand the step for compiling Swift files. If the small change you are making does not affect other files, you should see only a few source files recompiled. If a lot of files are recompiled, ensure you don
Post not yet marked as solved
5 Replies
Thanks for the reply. How else can one apply obfuscation at the compilation time?