Compiler

RSS for tag

Discuss the various compiler and toolchain technologies used in development.

Posts under Compiler tag

116 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Undefined symbols for architecture arm64 when building a driver
Hi, I have an issue with linker as well. I am building a IBM MQ driver using Erlang driver. It is building ok in Linux x64/Arm64 but doesn't build in macOS Arm64. Can you help please. e072513@VL-K4YR0QX62K c_src % gcc -I /opt/homebrew/Cellar/erlang@26/26.2.5/lib/erlang/usr/include -I /opt/mqm/inc -shared -fPIC -L /opt/mqm/lib64 -L /opt/homebrew/Cellar/erlang@26/26.2.5/lib/erlang/lib/erl_interface-5.5.1/lib -lei -lmqic_r -lpthread mq_series_drv.c -o mq_series_drv.so -v Apple clang version 16.0.0 (clang-1600.0.26.3) Target: arm64-apple-darwin23.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple arm64-apple-macosx14.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -dumpdir mq_series_drv.so- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name mq_series_drv.c -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.0 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +v8.5a -target-feature +aes -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +lse -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sha2 -target-feature +sha3 -target-feature +neon -target-feature +zcm -target-feature +zcz -target-feature +fullfp16 -target-abi darwinpcs -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/e072513/ips-tch-switch/_checkouts/mq_series/c_src -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/16 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I /opt/homebrew/Cellar/erlang@26/26.2.5/lib/erlang/usr/include -I /opt/mqm/inc -I/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/16/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdebug-compilation-dir=/Users/e072513/ips-tch-switch/_checkouts/mq_series/c_src -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -fcolor-diagnostics -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /var/folders/zw/xt5wvkzj43v_p458qgx16bxw0000gn/T/mq_series_drv-d90068.o -x c mq_series_drv.c clang -cc1 version 16.0.0 (clang-1600.0.26.3) default target arm64-apple-darwin23.6.0 ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include" ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks" #include "..." search starts here: #include <...> search starts here: /opt/homebrew/Cellar/erlang@26/26.2.5/lib/erlang/usr/include /opt/mqm/inc /Library/Developer/CommandLineTools/usr/lib/clang/16/include /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include /Library/Developer/CommandLineTools/usr/include /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) End of search list. "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -no_deduplicate -dynamic -dylib -arch arm64 -platform_version macos 14.0.0 15.0 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o mq_series_drv.so -L/opt/mqm/lib64 -L/opt/homebrew/Cellar/erlang@26/26.2.5/lib/erlang/lib/erl_interface-5.5.1/lib -L/usr/local/lib -lei -lmqic_r -lpthread /var/folders/zw/xt5wvkzj43v_p458qgx16bxw0000gn/T/mq_series_drv-d90068.o -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a Undefined symbols for architecture arm64: "_driver_alloc", referenced from: _mq_drv_start in mq_series_drv-d90068.o _do_connect in mq_series_drv-d90068.o _do_put in mq_series_drv-d90068.o _do_get in mq_series_drv-d90068.o "_driver_async", referenced from: _do_connect in mq_series_drv-d90068.o _do_put in mq_series_drv-d90068.o _do_get in mq_series_drv-d90068.o "_driver_free", referenced from: _mq_drv_stop in mq_series_drv-d90068.o _ready_async in mq_series_drv-d90068.o _do_free in mq_series_drv-d90068.o "_driver_output", referenced from: _ready_async in mq_series_drv-d90068.o _error_bad_arg in mq_series_drv-d90068.o _return_error in mq_series_drv-d90068.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
0
0
21
4h
FCP Workflow extension does not build with clang unknown argument -e_ProExtensionMain in Xcode 16
With Xcode 16 I cant make the Final Cut Extension Workflow work. I am quite sure I was able to add the Workflow Extension target a couple of months ago in Xcode 15 and did successfully build it, but in Xcode 16 it wont build and it fails with this error: clang: error: unknown argument: '-e_ProExtensionMain' I have installed multiple times Workflow Extensions SDK 1.0.2 and even disabled Library validation like its described in the release notes but I dont think thats the problem here. Seems like clang doesn't have the arguments for it, I guess the SDK should add these but seems like something got messed up - the template shows up fine in Xcode. I reinstalled Xcode and command line tools but that didnt help. Checking clang it really doesnt have the argument. But where does the SDK add this? Xcode seems to be using internal clang and /usr/bin/clang doesn't have it either. Any tips what could be the problem here? I was not really able to locate the SDK to remove it before trying to install again - any ideas? Steps to reproduce Create new project Add FCP workflow extension target Build -> it fails Same behaviour with 16.1 Beta. I am running Sonoma 14.7. Thanks in advance for any ideas!
3
0
119
4d
Incremental build changes in Xcode 16?
Hi there! Was there a change in Xcode regarding incremental builds / updating an active Simulator with a new build? We use xcodebuild to manage our internal build framework and out of the sudden, incremental builds are not launched anymore and the Simulator is stuck waiting for the new build to be launched. This was not happening for the last 10+ years. If there is an xcodebuild flag and/or guide of this new behavior, it would help a lot. Thanks everyone!
0
0
95
6d
Xcode 16 Error AppShortcut phrases may have at most one parameter
I suppose this is a bug in compiler. Xcode 16.0 (16A242d) - AppStore release version When building a project from Xcode 15 in Xcode 16, an error occurs: appintentsmetadataprocessor[12633:13677489] error: At least one halting error produced during export. No AppIntents metadata have been exported and this target is not usable with AppIntents until errors are resolved. AppShortcut phrases may have at most one parameter, but found phrase, "Set Dark Mode ${darkMode} for Widget ${widget}" with more than one parameter: darkMode, widget Apparently this is an Xcode bug because I have a production app with this AppShortcut and it works fine in Apple Shortcuts. Everything is made according to the official WWDC video about AppShortcuts https://developer.apple.com/videos/play/wwdc2022/10170
0
1
139
1w
How to fix "Could not launch: xxxx Executable does not exist" error"
Hi i am currently using XCode 15 to build a Swift command line application. But when I try to build & debug my project, it throws an error saying that it could not launch the executable. It does build but as the error suggests, the Build dir does not have a executable in it. I have messed around with DerivedData & Build location settings for quite a bit with no luck. Currently both of them are at default settings as I cleared XCode caches from ~/Library/Caches & created a new project. I tried compiling the basic Hello World but that seems to "build" but with no executable. I have attached the report for the Could not launch error Error report Am i missing something with respect to build location / configuration? Thanks for any assistance.
2
0
2.5k
3w
Why is my #available ignored by the compiler? (Xcode 15.4)
Hi, I have a workspace with a couple of modules, and now I'm making a Swift package. It's great. However, i have this SwiftUI View extension you can see at the end of this post. My Swift package needs to have the target set to IOS16, so i have added #available where I need, like I've done in the past. When i had this extension in my Widget extension target, it worked fine. However, i am now trying to move that into my new Swift package, with the Swift package declaration you can also find below. When moved, i get an error from the compiler: Type 'ContainerBackgroundPlacement' has no member 'widget' It seems that my #available is ignored? I'm at a loss as to why this happens, so if anyone has any ideas i'm all ears. Otherwise guess i'll have to move it back to the Widget extension target :( My extension code: extension View { func widgetBackground(_ color: Color) -> some View { if #available(iOSApplicationExtension 17.0, *), #available(iOS 17.0, *) { return containerBackground(color, for: .widget) } else { return background(color) } } .....more stuff } Swift Package (i renamed and cropped some stuff for simplicity): import PackageDescription let package = Package( name: "MyPackage", platforms: [ .iOS(.v16) ], products: [ .library( name: "MyPackage", targets: ["MyPackage"] ) ], targets: [ .target( name: "MyPackage" ), .testTarget( name: "MyPackageTests", dependencies: ["MyPackage"] ) ] )
0
0
165
3w
modulemap for a framework that uses another framework's interface in its interface
I have an app that uses FrameworkA and FrameworkB. FrameworkA is simple, i.e., no dependencies. FrameworkB includes FrameworkA, which is normal. But it also uses pieces of FrameworkA's public interface in its own public interface. Yes, I find that a bit odd... (I didn't make those frameworks... just trying to sort out things...) Now I am trying to enable Xcode's module verifier for FrameworkB and the problem begins... FrameworkB can no longer have #import &lt;FrameworkA/FramworkASomethingSomething.h&gt; in its public headers. The modulemap file for FrameworkB currently looks like framework module FrameworkB { umbrella header "FrameworkB.h" export * module * { export * } } Is it possible still use FrameworkA's public interface in FrameworkB's public interface? And if yes, how is that sorted out in the modulemap? So far I have tried framework module FrameworkB { umbrella header "FrameworkB.h" export * module * { export * } link framework "FrameworkA" module FrameworkA [system] { umbrella header "FrameworkA.h" export * } } But it gives the error Umbrella header 'FrameworkA.h' not found Thanks!
0
0
173
3w
xcode not showing output
Hi I was using Xcode for c++ (for competitive programming purposes, not sure if this is the standard choice but using it anyway) I included a &lt;bits/stdc++.h&gt; to the include file for XCode.app and they didn't show any error. But then when I ran my code, it showed "Build Succeeded" although no output was visible.
1
0
180
3w
Compile error while compiling with MacOSX.SDK
When I was compiling with MacOSX.SDK, these error occurred /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h:796:20: error: unknown type name 'uuid_string_t'; did you mean 'io_string_t'? char reserved[JIB_RESERVED_SIZE]; ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h:787:61: note: expanded from macro 'JIB_RESERVED_SIZE' #define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/device/device_types.h:89:33: note: 'io_string_t' declared here typedef char io_string_t[512]; I searched on the Internet and found the similar problem, it seems that there is something wrong with uuid.h. Actually, I do have this head file in my project directory. Anybody encountered with the same problem ? How to solve this problem?
2
0
251
Aug ’24
Could not build module 'UIKit' - XCode 16 Beta 3
I have an old project that combines Objective-C with Swift and it is compiling just fine in XCode 15 but is not compiling on XCode 16 Beta 3. There are multiple errors such as: "could not build module 'UIKit'" "could not build module 'CoreMedia'" "could not build module 'CoreLocation'" Among the errors there is this one about failing to emit precompiled header in the Bridging header file of the project. I've tried re-installing XCode 16 Beta 3, re-installing the simulator, restarting the computer and I've also created a sample project that also combines swift and Ojb-c and that one compiles just fine. Any clues? Thanks!
10
3
1.1k
1w
Xcode Beta 3 compile error
Hello All: I dusted off some old code to bring up to date with the latest and greatest Xcode (16B3) and ran into this weird compile error. Doesn't appear to be actually in my code. The code is in Objective-C (I did say it was old). In file included from /Volumes/Hard Disk 2/Codewarrior Projects/iCollect For Mac and iPad/iCollect2/Classes/NSImage+Additions.mm:9: In file included from /Volumes/Hard Disk 2/Codewarrior Projects/iCollect For Mac and iPad/iCollect2/Classes/NSImage+Additions.h:10: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Quartz.framework/Headers/Quartz.h:9: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Quartz.framework/Headers/PDFKit.h:6: In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFKit.h:21: /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/PDFKit.framework/Headers/PDFDocument.h:26:53: error: expected identifier or '{' 26 | typedef NS_ENUM(NSUInteger, PDFSelectionGranularity); | ^ 1 error generated. Any ideas? I understand that Xcode is in beta now and if this is outside of the forum's scope, no problem. If a radar needs to be opened, I'll do that too if required. Thanks in advance for your time. All Best John
4
2
486
Aug ’24
What does ".island" suffix in symbol name mean?
During my analysis of the binary size changes after compiling Swift source code, I discovered symbols with the ".island" suffix. I couldn't find meaningful information about this suffix through my search, so I decided to reach out for assistance. While comparing the changes in binary size after modifying specific code, I noticed a significant increase (from 33MB to 520MB). Upon analyzing the symbols of the enlarged binary using the nm command, I found the following pattern: t _$s12{SomeSymbol}WOb t _$s12{SomeSymbol}WOb.island t _$s12{SomeSymbol}WOb.island2 t _$s12{SomeSymbol}WOb.island3 When I output the symbols of the binary using nm, I noticed many symbols with the same name but different ".island", ".island2", ".island3" suffixes. Disassembling the binary showed that functions with these suffixes simply delegate calls sequentially: x.island3 -> x.island2 -> x.island1 -> x. It appears that these symbols serve as delegates for function calls, but I would like to understand why such duplicated functions with these suffixes are generated. Could someone help me to provide some insights on this matter?
1
0
368
Jul ’24
Xcode build crashes on: No such module '_SwiftData_SwiftUI'
Building with below imports returns an error. What could I do to mitigate this? I did clean the build cache and delete the derived data folder. import SwiftData import SwiftUI The error: Command SwiftCompile failed with a nonzero exit code /Users/thomas/Documents/Projects/SwiftUI/workouts/Workouts/Workouts/Views/Workout/WorkoutView.swift:9:8 No such module '_SwiftData_SwiftUI' This feedback has also been submitted under: FB14182548
2
2
675
Jul ’24
change the way build c++ code
when building my project with Xcode16 Beta, I came across several compile errors in c++ code, which used to be ok when building with Xcode15. It's not easy to fix them because some of them came from third part libraries. Is there a way to configure Xcode to build c++ code conforming to the Xcode 15 manner? (I know I can get back to Xcode15 temporarily, but I worry these issue can not be fixed even in the official release version)
3
1
486
Jul ’24
Can't link metal-cpp to C++ framework in Swift Mac app
I have a very simple Mac app with just a MTKView in it which shows a single color. I want to move the rendering code to C++. For this I created a C++ framework target which interoperates with the Swift code - main project target. I am trying to link metal-cpp library to the C++ framework target using these instructions. Approach described in this article works with simple C++ Mac console apps. But in my mixed Swift/C++ project Xcode cannot find Foundation/Foundation.hpp (and probably other headers) to include into the C++ header. I inserted metal-cpp folder into my project and added it to C++ target's header search paths, as written in the instructions.
3
0
435
Jul ’24