Compiler

RSS for tag

Discuss the various compiler and toolchain technologies used in development.

Posts under Compiler tag

91 Posts
Sort by:
Post not yet marked as solved
0 Replies
236 Views
I'm having issues with compiling and linking. Randomly, either the compiler or the linker fails with error reports similar to this: Process: ld [39849] Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld Identifier: ld Version: ??? Code Type: X86-64 (Native) Parent Process: clang [39847] Responsible: Xcode [11293] User ID: 501 Date/Time: 2022-03-08 20:49:34.2264 -0700 OS Version: macOS 12.2.1 (21D62) Report Version: 12 Anonymous UUID: 65A32827-D6E1-71EE-C648-BD8683BC8BB0 Time Awake Since Boot: 10000 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00007d9738aab060 Exception Codes: 0x0000000000000001, 0x00007d9738aab060 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [39849] VM Region Info: 0x7d9738aab060 is not in any region. Bytes after previous region: 138083053240417 Bytes before following region: 2198373486496 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL mapped file 1414c1000-141543000 [ 520K] r--/r-- SM=COW ...t_id=b04ff949 ---> GAP OF 0x7f95d09bd000 BYTES MALLOC_LARGE 7f9711f00000-7f9717f00000 [ 96.0M] rw-/rwx SM=PRV ... Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libLTO.dylib 0x112bcbf54 (anonymous namespace)::SCCPSolver::markUsersAsChanged(llvm::Value*) + 20 1 libLTO.dylib 0x112bc7d7e (anonymous namespace)::SCCPSolver::Solve() + 94 2 libLTO.dylib 0x112bc5eed llvm::runIPSCCP(llvm::Module&, llvm::DataLayout const&, std::__1::function<llvm::TargetLibraryInfo const& (llvm::Function&)>, llvm::function_ref<llvm::AnalysisResultsForFn (llvm::Function&)>) + 2749 3 libLTO.dylib 0x112ae1136 (anonymous namespace)::IPSCCPLegacyPass::runOnModule(llvm::Module&) + 86 4 libLTO.dylib 0x11246ab95 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 709 5 libLTO.dylib 0x1126f91f1 llvm::LTOCodeGenerator::optimize(bool, bool, bool, bool) + 945 6 libLTO.dylib 0x111ee7993 lto_codegen_optimize + 51 7 ld 0x10b5eac31 lto::Parser::codegen(lto::OptimizeOptions const&, ld::Internal&, LLVMOpaqueLTOCodeGenerator*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 301 8 ld 0x10b5eb71c lto::Parser::optimizeLTO(std::__1::vector<lto::File*, std::__1::allocator<lto::File*> >, std::__1::vector<ld::Atom const*, std::__1::allocator<ld::Atom const*> > const&, ld::Internal&, lto::OptimizeOptions const&, ld::File::AtomHandler&, std::__1::vector<ld::Atom const*, std::__1::allocator<ld::Atom const*> >&, std::__1::vector<char const*, std::__1::allocator<char const*> >&) + 536 9 ld 0x10b5eddfe lto::Parser::optimize(std::__1::vector<ld::Atom const*, std::__1::allocator<ld::Atom const*> > const&, ld::Internal&, lto::OptimizeOptions const&, ld::File::AtomHandler&, std::__1::vector<ld::Atom const*, std::__1::allocator<ld::Atom const*> >&, std::__1::vector<char const*, std::__1::allocator<char const*> >&) + 1134 10 ld 0x10b5ee8bf lto::optimize(std::__1::vector<ld::Atom const*, std::__1::allocator<ld::Atom const*> > const&, ld::Internal&, lto::OptimizeOptions const&, ld::File::AtomHandler&, std::__1::vector<ld::Atom const*, std::__1::allocator<ld::Atom const*> >&, std::__1::vector<char const*, std::__1::allocator<char const*> >&) + 69 11 ld 0x10b611318 ld::tool::Resolver::linkTimeOptimize() + 666 12 ld 0x10b611bb4 ld::tool::Resolver::resolve() + 166 13 ld 0x10b598abd main + 307 14 dyld 0x111e2f4fe start + 462 I'm thinking this is either a problem with the RAM or my computer is overheating. Thoughts?
Posted
by
Post not yet marked as solved
1 Replies
400 Views
How can playground or any app exec an swift code or show an update live of view that we are make? I want to know this because i want to build app that help you to build views without coding..so i want the same Features that used on swift playground and xcode that exec swift code and show update live of view.
Posted
by
Post not yet marked as solved
0 Replies
259 Views
TimeoutError: Timed out waiting for connection to DTServiceHub after 15.0 seconds. I'm getting this error when trying to preview SwiftUI views. And I'm getting it for a brand new app with nothing else going on. I've tried the usual troubleshooting like Clean Build Folder. Also having trouble getting the app to build on my Apple Watch. I'm wondering if this is a serious bug with Xcode 13.2.1 (13C100)
Posted
by
Post not yet marked as solved
0 Replies
262 Views
I am creating an app that uses firebase on Xcode. I installed the 64 bit version I read others recommended on the new M1 Macs and every time I open up my computer again, I get 15 errors of 'Redefinition of Firebase' in all files like the modulemap, object.h, dispatch.h, CFNetwork.h, AXFoundation.h as well as 'Could not build module 'CoreFoundation' I am not sure what to do since I am new to the swift language and Xcode. I have not been using the workspace rather the project and it worked the first time I installed it. I also tried uninstalling and redoing the pod install, but to no avail. I would like my code to work as I am just trying to make a way for others to sign in so I can build the rest of the app. Thanks!
Posted
by
Post not yet marked as solved
0 Replies
473 Views
objdump seems to always print an error message, example: malcolm@Malcolms-Air keeperfx % objdump --version Apple LLVM version 13.0.0 (clang-1300.0.29.30)  Optimized build.  Default target: arm64-apple-darwin21.3.0  Host CPU: vortex  Registered Targets:   aarch64  - AArch64 (little endian)   aarch64_32 - AArch64 (little endian ILP32)   aarch64_be - AArch64 (big endian)   arm    - ARM   arm64   - ARM64 (little endian)   arm64_32  - ARM64 (little endian ILP32)   armeb   - ARM (big endian)   thumb   - Thumb   thumbeb  - Thumb (big endian)   x86    - 32-bit X86: Pentium-Pro and above   x86-64   - 64-bit X86: EM64T and AMD64 malcolm@Malcolms-Air keeperfx % clang --version Apple clang version 13.0.0 (clang-1300.0.29.30) Target: arm64-apple-darwin21.3.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin malcolm@Malcolms-Air keeperfx % clang -c src/actionpt.c In file included from src/actionpt.c:19: In file included from src/actionpt.h:22: src/bflib_basics.h:153:15: warning: '__stdcall' calling convention is not supported for this target [-Wignored-attributes] typedef void (__stdcall *TbNetworkCallbackFunc)(struct TbNetworkCallbackData *, void *);        ^ 1 warning generated. malcolm@Malcolms-Air keeperfx % objdump -f actionpt.o  actionpt.o: file format mach-o arm64 /Library/Developer/CommandLineTools/usr/bin/objdump: error: 'actionpt.o': Invalid/Unsupported object file format The warning message should have no impact on objdumps ability to produce a result. I have been looking for objcopy as I need to rename some functions in a precompiled library. I installed the gnu binutils version (brew install binutils) .. this generates a file that the gnu binutils thinks is perfect. The Apple objdump throws up error messages.
Posted
by
Post not yet marked as solved
0 Replies
214 Views
Just updated to Monterey and when building openexr the following error occurred: ld: cannot link directly with dylib/framework, your binary is not an allowed client of /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.tbd for architecture x86_64 My mac is a Intel CPU model. Anyone knows what's going on?
Posted
by
Post not yet marked as solved
1 Replies
181 Views
I'm a university student and this is my first time coding anything. I was doing pretty good but now, for some reason, my xcode will only run the first .c file i made within the project, even if i have a different one selected. My screen is shown in this screenshot to make it make more sense. https://imgur.com/a/yjNi9QA The "Hello world" code is in the first "main.c" file on the left, but whenever i try to run q1d or q2a, it only runs Hello World, not the actual files. Please help!!!!
Posted
by
Post not yet marked as solved
1 Replies
224 Views
Hey, Ive been trying to run this app from GitHub. It successfully compiled but once it started launching the program only bounced in the dock and didn’t show anything. Here’s what Xcode says Please help me fixing it. I really want to run this app. Many thanks for your help in advance
Posted
by
Post marked as solved
2 Replies
259 Views
Hey, I'm not bad with computers but not a developer at all. I really want to use the app from this GitHub page. The problem is that the creator hasn't published a release yet so I have to compile it myself. When I hit build in Xcode it immediately shows a number of errors. How can I fix them and get it to build? Please excuse me very much for asking such a noob question but please help me guys. You would make somebody very happy. Thanks very much for your help in advance!
Posted
by
Post marked as solved
1 Replies
320 Views
When compiling my project for a physical device, Xcode does not reuse the build cache but instead recompiles every file. When compiling for a simulator target instead, Xcode properly uses the build cache, and incremental builds are lightning fast. Is there a configuration I can check to enable incremental builds for physical devices, too?
Posted
by
Post not yet marked as solved
2 Replies
518 Views
I am using Xcode 13.1 and get the following Apple Mach-O Linker Error when building in Release mode only (project can be successfully built in Debug mode) : ld: reference to symbol (which has not been assigned an address) __ZNSt3__113__vector_baseINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEED2Ev in '__ZNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEED1Ev' from &lt;my-path-placeholder&gt;tmp.a(Tmp.o) for architecture arm64 This error only happens on newer versions of Xcode (13 and up). Any ideas?
Posted
by
Post not yet marked as solved
1 Replies
340 Views
The project can run on simulator well but it can't run on the iOS devices. I got the error: "error: Build input file cannot be found: '/Users/tantan/Library/Developer/Xcode/DerivedData/Videe-bpukzfmjaxewiuaiolulcqllukjg/Build/Products/Debug-iphoneos/[AppName].app/AppName' (in target 'AppName' from project 'Videe')" Are there any solutions for that? Thanks.
Posted
by
Post not yet marked as solved
0 Replies
484 Views
I'm getting the error: ** "Warning: Error creating LLDB target at path '/Users/tantan/Library/Developer/Xcode/DerivedData/Videe-bpukzfmjaxewiuaiolulcqllukjg/Build/Products/Debug-iphonesimulator/[AppName].app'- using an empty LLDB target which can cause slow memory reads from remote devices."** Is there anyone who can explain to me what the reason is and how can fix it? Thanks,
Posted
by
Post not yet marked as solved
1 Replies
222 Views
According to Increasing Performance by Reducing Dynamic Dispatch, addding 'final' keyword increase runtime performance by reducing dynamic dispatch. I'm wondering if adding 'final' keyword will also improve compile time. read such opinions in some articels, but not clear to me. I tested it, and it seems to me 'final' not affect compile time.
Posted
by
Post not yet marked as solved
4 Replies
1.4k Views
HI! I've compiled a command line utility written in plain C on macOS Monterey on macBook m1 pro. The compilation command is just following: clang -std=gnu11 -Wall -o my_run_ht run_ht.c ht.c It compiles fine but when I try running it, it is aborted with the following message: dyld[8385]: dyld cache '/System/Library/dyld/dyld_shared_cache_arm64e' not loaded: syscall to map cache into shared region failed dyld[8385]: Library not loaded: /usr/lib/libSystem.B.dylib Referenced from: /Users/sasha/Src/my/ht/run_ht Reason: tried: '/usr/lib/libSystem.B.dylib' (no such file), '/usr/local/lib/libSystem.B.dylib' (no such file) What is more strange that I can compile and run other command line utilities. So I'm quite puzzled and have no idea what is the reason for that and how to fix it. Could anybody please help me with this? Thanks in advance.
Posted
by
Post not yet marked as solved
4 Replies
3.3k Views
Hello, When trying to open a project written in approximately August in xcode 13.2.1 version, I get the error 'module compiled with swift 5.3.2 cannot be imported by the swift 5.5.2 compiler'. As you can see in the attachment, I get 127 errors when I run it with the 5.3.2 toolchain. How can I upgrade an existing project to version 5.5.2? Thank you in advance for your help
Posted
by
Post marked as solved
1 Replies
528 Views
Hi all, my project is running fine on simulator and real device, but when I try to archive it for distribution the following error code appears. Build input file cannot be found: '/Users/mauro/Library/Developer/Xcode/DerivedData/FlexoCalculator_mobile-acfisshphqrnvoennhvdkcvtplhc/Build/Intermediates.noindex/ArchiveIntermediates/FlexoCalculator_mobile/InstallationBuildProductsLocation/Applications/FlexoCalculator_mobile.app/FlexoCalculator_mobile' I already cleaned build folder and derived data but issue is still there. I have no idea on where this error comes from and how to clean it. Any help is appreciated. Xcode 13.2.1 - Swift 4 - Project for iOS 10 This project was well compiled and distributed for years. Now, after upgrade to Monterey/Xcode 13, I'm not able to compile it anymore. This error is not visible on logs, but is present on left panel only:
Posted
by
Post marked as solved
1 Replies
397 Views
Consider a C++ method that retrieve struct of native typed arguments like enum class, sub-structs, std::string, int, etc... I'd like to create a swift API that return the same struct but in swift variables for example : class ErrorMessage { public: int status; std::string message; }; class serverResponse { public: ErrorMessage error; std::string str_value; std::uint16_t int_val; std::time_t last_seen; EnumVal status; }; serverResponse getServerResponse(); So I'd like to convert it to the swift equivalent struct with native members open class serverResponseSwift : NSObject { open class var error: ErrorMessage { get } open var str_value: String { get } open var int_val: UInt16 { get } open var status: EnumVal { get } }; I know that direct conversion is not yet possible so I need to use objective-C++ code as a mediator. So I've used a bridging header to include the converting method in objective-C++ which will look like this : @interface Converter - (serverResponseSwift) getServerStatusSwift; @end and the equivalent .mm file will implement the conversion function, but can I use the swift Class in objective-c in order to fill it up according to the CPP serverResponse ? @implementation Converter - (serverResponseSwift) getServerStatusSwift { serverResponse x = getServerResponse(); /// How do I create serverResponseSwift out of serverResponse } Thanks !
Posted
by
Post not yet marked as solved
0 Replies
458 Views
Project is based on python3.8 and 3.9, containing some C and C++ source How can I do parallel computing on CPU and GPU of M1max In deed, I buy Mac m1max for the strong GPU to do quantitative finance, for which the speed is extremely important. Unfortunately, cuda is not compatible with Mac. Show me how to do it, thx. Are Accelerate(for CPU) and Metal(for GPU) can speed up any source by building like this: Step 1: download source from github Step 2: create a file named "site.cfg"in this souce file, and add content: [accelerate] libraries=Metal, Acelerate, vecLib Step 3: Terminal: NPY_LAPACK_Order=accelerate python3 setup.py build Step 4: pip3 install . or python3 setup.py install ? (I am not sure which method to apply) 2、how is the compatibility of such method? I need speed up numpy, pandas and even a open souce project, such as https://github.com/microsoft/qlib 3、just show me the code 4、when compiling C++, C source, a lot of errors were reported, which gcc and g++ to choose? the default gcc installed by brew is 4.2.1, which cannot work. and I even tried to download gcc from the offical website of ARM, still cannot work. give me a hint. thx so much urgent
Posted
by